From 8ede0bdb63305d3353efd97e9af6210afb05734e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 17 Aug 2008 19:13:17 -0400 Subject: x86, um: initial part of asm-um move Signed-off-by: Al Viro Signed-off-by: H. Peter Anvin --- arch/um/include/asm/a.out-core.h | 27 +++ arch/um/include/asm/a.out.h | 11 + arch/um/include/asm/alternative-asm.h | 6 + arch/um/include/asm/alternative.h | 6 + arch/um/include/asm/apic.h | 4 + arch/um/include/asm/archparam-i386.h | 26 +++ arch/um/include/asm/archparam-ppc.h | 8 + arch/um/include/asm/archparam-x86_64.h | 26 +++ arch/um/include/asm/asm.h | 6 + arch/um/include/asm/atomic.h | 11 + arch/um/include/asm/auxvec.h | 4 + arch/um/include/asm/bitops.h | 10 + arch/um/include/asm/boot.h | 6 + arch/um/include/asm/bug.h | 6 + arch/um/include/asm/bugs.h | 6 + arch/um/include/asm/byteorder.h | 6 + arch/um/include/asm/cache.h | 17 ++ arch/um/include/asm/cacheflush.h | 6 + arch/um/include/asm/calling.h | 9 + arch/um/include/asm/checksum.h | 6 + arch/um/include/asm/cmpxchg.h | 6 + arch/um/include/asm/cobalt.h | 6 + arch/um/include/asm/common.lds.S | 130 +++++++++++ arch/um/include/asm/cpufeature.h | 6 + arch/um/include/asm/cputime.h | 6 + arch/um/include/asm/current.h | 13 ++ arch/um/include/asm/delay.h | 20 ++ arch/um/include/asm/desc.h | 16 ++ arch/um/include/asm/device.h | 7 + arch/um/include/asm/div64.h | 6 + arch/um/include/asm/dma-mapping.h | 128 +++++++++++ arch/um/include/asm/dma.h | 10 + arch/um/include/asm/dwarf2.h | 11 + arch/um/include/asm/elf-i386.h | 163 ++++++++++++++ arch/um/include/asm/elf-ppc.h | 53 +++++ arch/um/include/asm/elf-x86_64.h | 119 ++++++++++ arch/um/include/asm/emergency-restart.h | 6 + arch/um/include/asm/errno.h | 6 + arch/um/include/asm/fcntl.h | 6 + arch/um/include/asm/fixmap.h | 98 +++++++++ arch/um/include/asm/floppy.h | 6 + arch/um/include/asm/frame.h | 6 + arch/um/include/asm/futex.h | 6 + arch/um/include/asm/hardirq.h | 25 +++ arch/um/include/asm/highmem.h | 12 ++ arch/um/include/asm/host_ldt-i386.h | 34 +++ arch/um/include/asm/host_ldt-x86_64.h | 38 ++++ arch/um/include/asm/hw_irq.h | 7 + arch/um/include/asm/ide.h | 6 + arch/um/include/asm/io.h | 57 +++++ arch/um/include/asm/ioctl.h | 6 + arch/um/include/asm/ioctls.h | 6 + arch/um/include/asm/ipcbuf.h | 6 + arch/um/include/asm/irq.h | 23 ++ arch/um/include/asm/irq_regs.h | 1 + arch/um/include/asm/irq_vectors.h | 20 ++ arch/um/include/asm/irqflags.h | 6 + arch/um/include/asm/kdebug.h | 1 + arch/um/include/asm/kmap_types.h | 29 +++ arch/um/include/asm/ldt.h | 37 ++++ arch/um/include/asm/linkage.h | 6 + arch/um/include/asm/local.h | 6 + arch/um/include/asm/locks.h | 6 + arch/um/include/asm/mca_dma.h | 6 + arch/um/include/asm/mman.h | 6 + arch/um/include/asm/mmu.h | 22 ++ arch/um/include/asm/mmu_context.h | 54 +++++ arch/um/include/asm/module-generic.h | 6 + arch/um/include/asm/module-i386.h | 13 ++ arch/um/include/asm/module-x86_64.h | 30 +++ arch/um/include/asm/msgbuf.h | 6 + arch/um/include/asm/mtrr.h | 6 + arch/um/include/asm/mutex.h | 9 + arch/um/include/asm/nops.h | 6 + arch/um/include/asm/page.h | 122 +++++++++++ arch/um/include/asm/page_offset.h | 1 + arch/um/include/asm/param.h | 20 ++ arch/um/include/asm/paravirt.h | 6 + arch/um/include/asm/pci.h | 7 + arch/um/include/asm/pda.h | 31 +++ arch/um/include/asm/percpu.h | 6 + arch/um/include/asm/pgalloc.h | 72 +++++++ arch/um/include/asm/pgtable-2level.h | 53 +++++ arch/um/include/asm/pgtable-3level.h | 146 +++++++++++++ arch/um/include/asm/pgtable.h | 358 +++++++++++++++++++++++++++++++ arch/um/include/asm/poll.h | 6 + arch/um/include/asm/posix_types.h | 6 + arch/um/include/asm/prctl.h | 6 + arch/um/include/asm/processor-generic.h | 136 ++++++++++++ arch/um/include/asm/processor-i386.h | 78 +++++++ arch/um/include/asm/processor-ppc.h | 15 ++ arch/um/include/asm/processor-x86_64.h | 56 +++++ arch/um/include/asm/ptrace-generic.h | 55 +++++ arch/um/include/asm/ptrace-i386.h | 60 ++++++ arch/um/include/asm/ptrace-x86_64.h | 81 +++++++ arch/um/include/asm/required-features.h | 9 + arch/um/include/asm/resource.h | 6 + arch/um/include/asm/rwlock.h | 6 + arch/um/include/asm/rwsem.h | 6 + arch/um/include/asm/scatterlist.h | 6 + arch/um/include/asm/sections.h | 7 + arch/um/include/asm/segment.h | 10 + arch/um/include/asm/sembuf.h | 6 + arch/um/include/asm/serial.h | 6 + arch/um/include/asm/setup.h | 10 + arch/um/include/asm/shmbuf.h | 6 + arch/um/include/asm/shmparam.h | 6 + arch/um/include/asm/sigcontext-generic.h | 6 + arch/um/include/asm/sigcontext-i386.h | 6 + arch/um/include/asm/sigcontext-ppc.h | 10 + arch/um/include/asm/sigcontext-x86_64.h | 22 ++ arch/um/include/asm/siginfo.h | 6 + arch/um/include/asm/signal.h | 29 +++ arch/um/include/asm/smp.h | 33 +++ arch/um/include/asm/socket.h | 6 + arch/um/include/asm/sockios.h | 6 + arch/um/include/asm/spinlock.h | 6 + arch/um/include/asm/spinlock_types.h | 6 + arch/um/include/asm/stat.h | 6 + arch/um/include/asm/statfs.h | 6 + arch/um/include/asm/string.h | 7 + arch/um/include/asm/suspend.h | 4 + arch/um/include/asm/system-generic.h | 47 ++++ arch/um/include/asm/system-i386.h | 6 + arch/um/include/asm/system-ppc.h | 12 ++ arch/um/include/asm/system-x86_64.h | 23 ++ arch/um/include/asm/termbits.h | 6 + arch/um/include/asm/termios.h | 6 + arch/um/include/asm/thread_info.h | 83 +++++++ arch/um/include/asm/timex.h | 13 ++ arch/um/include/asm/tlb.h | 127 +++++++++++ arch/um/include/asm/tlbflush.h | 31 +++ arch/um/include/asm/topology.h | 6 + arch/um/include/asm/types.h | 6 + arch/um/include/asm/uaccess.h | 99 +++++++++ arch/um/include/asm/ucontext.h | 6 + arch/um/include/asm/unaligned.h | 6 + arch/um/include/asm/unistd.h | 41 ++++ arch/um/include/asm/user.h | 6 + arch/um/include/asm/vga.h | 6 + arch/um/include/asm/vm-flags-i386.h | 14 ++ arch/um/include/asm/vm-flags-x86_64.h | 33 +++ arch/um/include/asm/vm86.h | 6 + arch/um/include/asm/xor.h | 6 + 144 files changed, 3690 insertions(+) create mode 100644 arch/um/include/asm/a.out-core.h create mode 100644 arch/um/include/asm/a.out.h create mode 100644 arch/um/include/asm/alternative-asm.h create mode 100644 arch/um/include/asm/alternative.h create mode 100644 arch/um/include/asm/apic.h create mode 100644 arch/um/include/asm/archparam-i386.h create mode 100644 arch/um/include/asm/archparam-ppc.h create mode 100644 arch/um/include/asm/archparam-x86_64.h create mode 100644 arch/um/include/asm/asm.h create mode 100644 arch/um/include/asm/atomic.h create mode 100644 arch/um/include/asm/auxvec.h create mode 100644 arch/um/include/asm/bitops.h create mode 100644 arch/um/include/asm/boot.h create mode 100644 arch/um/include/asm/bug.h create mode 100644 arch/um/include/asm/bugs.h create mode 100644 arch/um/include/asm/byteorder.h create mode 100644 arch/um/include/asm/cache.h create mode 100644 arch/um/include/asm/cacheflush.h create mode 100644 arch/um/include/asm/calling.h create mode 100644 arch/um/include/asm/checksum.h create mode 100644 arch/um/include/asm/cmpxchg.h create mode 100644 arch/um/include/asm/cobalt.h create mode 100644 arch/um/include/asm/common.lds.S create mode 100644 arch/um/include/asm/cpufeature.h create mode 100644 arch/um/include/asm/cputime.h create mode 100644 arch/um/include/asm/current.h create mode 100644 arch/um/include/asm/delay.h create mode 100644 arch/um/include/asm/desc.h create mode 100644 arch/um/include/asm/device.h create mode 100644 arch/um/include/asm/div64.h create mode 100644 arch/um/include/asm/dma-mapping.h create mode 100644 arch/um/include/asm/dma.h create mode 100644 arch/um/include/asm/dwarf2.h create mode 100644 arch/um/include/asm/elf-i386.h create mode 100644 arch/um/include/asm/elf-ppc.h create mode 100644 arch/um/include/asm/elf-x86_64.h create mode 100644 arch/um/include/asm/emergency-restart.h create mode 100644 arch/um/include/asm/errno.h create mode 100644 arch/um/include/asm/fcntl.h create mode 100644 arch/um/include/asm/fixmap.h create mode 100644 arch/um/include/asm/floppy.h create mode 100644 arch/um/include/asm/frame.h create mode 100644 arch/um/include/asm/futex.h create mode 100644 arch/um/include/asm/hardirq.h create mode 100644 arch/um/include/asm/highmem.h create mode 100644 arch/um/include/asm/host_ldt-i386.h create mode 100644 arch/um/include/asm/host_ldt-x86_64.h create mode 100644 arch/um/include/asm/hw_irq.h create mode 100644 arch/um/include/asm/ide.h create mode 100644 arch/um/include/asm/io.h create mode 100644 arch/um/include/asm/ioctl.h create mode 100644 arch/um/include/asm/ioctls.h create mode 100644 arch/um/include/asm/ipcbuf.h create mode 100644 arch/um/include/asm/irq.h create mode 100644 arch/um/include/asm/irq_regs.h create mode 100644 arch/um/include/asm/irq_vectors.h create mode 100644 arch/um/include/asm/irqflags.h create mode 100644 arch/um/include/asm/kdebug.h create mode 100644 arch/um/include/asm/kmap_types.h create mode 100644 arch/um/include/asm/ldt.h create mode 100644 arch/um/include/asm/linkage.h create mode 100644 arch/um/include/asm/local.h create mode 100644 arch/um/include/asm/locks.h create mode 100644 arch/um/include/asm/mca_dma.h create mode 100644 arch/um/include/asm/mman.h create mode 100644 arch/um/include/asm/mmu.h create mode 100644 arch/um/include/asm/mmu_context.h create mode 100644 arch/um/include/asm/module-generic.h create mode 100644 arch/um/include/asm/module-i386.h create mode 100644 arch/um/include/asm/module-x86_64.h create mode 100644 arch/um/include/asm/msgbuf.h create mode 100644 arch/um/include/asm/mtrr.h create mode 100644 arch/um/include/asm/mutex.h create mode 100644 arch/um/include/asm/nops.h create mode 100644 arch/um/include/asm/page.h create mode 100644 arch/um/include/asm/page_offset.h create mode 100644 arch/um/include/asm/param.h create mode 100644 arch/um/include/asm/paravirt.h create mode 100644 arch/um/include/asm/pci.h create mode 100644 arch/um/include/asm/pda.h create mode 100644 arch/um/include/asm/percpu.h create mode 100644 arch/um/include/asm/pgalloc.h create mode 100644 arch/um/include/asm/pgtable-2level.h create mode 100644 arch/um/include/asm/pgtable-3level.h create mode 100644 arch/um/include/asm/pgtable.h create mode 100644 arch/um/include/asm/poll.h create mode 100644 arch/um/include/asm/posix_types.h create mode 100644 arch/um/include/asm/prctl.h create mode 100644 arch/um/include/asm/processor-generic.h create mode 100644 arch/um/include/asm/processor-i386.h create mode 100644 arch/um/include/asm/processor-ppc.h create mode 100644 arch/um/include/asm/processor-x86_64.h create mode 100644 arch/um/include/asm/ptrace-generic.h create mode 100644 arch/um/include/asm/ptrace-i386.h create mode 100644 arch/um/include/asm/ptrace-x86_64.h create mode 100644 arch/um/include/asm/required-features.h create mode 100644 arch/um/include/asm/resource.h create mode 100644 arch/um/include/asm/rwlock.h create mode 100644 arch/um/include/asm/rwsem.h create mode 100644 arch/um/include/asm/scatterlist.h create mode 100644 arch/um/include/asm/sections.h create mode 100644 arch/um/include/asm/segment.h create mode 100644 arch/um/include/asm/sembuf.h create mode 100644 arch/um/include/asm/serial.h create mode 100644 arch/um/include/asm/setup.h create mode 100644 arch/um/include/asm/shmbuf.h create mode 100644 arch/um/include/asm/shmparam.h create mode 100644 arch/um/include/asm/sigcontext-generic.h create mode 100644 arch/um/include/asm/sigcontext-i386.h create mode 100644 arch/um/include/asm/sigcontext-ppc.h create mode 100644 arch/um/include/asm/sigcontext-x86_64.h create mode 100644 arch/um/include/asm/siginfo.h create mode 100644 arch/um/include/asm/signal.h create mode 100644 arch/um/include/asm/smp.h create mode 100644 arch/um/include/asm/socket.h create mode 100644 arch/um/include/asm/sockios.h create mode 100644 arch/um/include/asm/spinlock.h create mode 100644 arch/um/include/asm/spinlock_types.h create mode 100644 arch/um/include/asm/stat.h create mode 100644 arch/um/include/asm/statfs.h create mode 100644 arch/um/include/asm/string.h create mode 100644 arch/um/include/asm/suspend.h create mode 100644 arch/um/include/asm/system-generic.h create mode 100644 arch/um/include/asm/system-i386.h create mode 100644 arch/um/include/asm/system-ppc.h create mode 100644 arch/um/include/asm/system-x86_64.h create mode 100644 arch/um/include/asm/termbits.h create mode 100644 arch/um/include/asm/termios.h create mode 100644 arch/um/include/asm/thread_info.h create mode 100644 arch/um/include/asm/timex.h create mode 100644 arch/um/include/asm/tlb.h create mode 100644 arch/um/include/asm/tlbflush.h create mode 100644 arch/um/include/asm/topology.h create mode 100644 arch/um/include/asm/types.h create mode 100644 arch/um/include/asm/uaccess.h create mode 100644 arch/um/include/asm/ucontext.h create mode 100644 arch/um/include/asm/unaligned.h create mode 100644 arch/um/include/asm/unistd.h create mode 100644 arch/um/include/asm/user.h create mode 100644 arch/um/include/asm/vga.h create mode 100644 arch/um/include/asm/vm-flags-i386.h create mode 100644 arch/um/include/asm/vm-flags-x86_64.h create mode 100644 arch/um/include/asm/vm86.h create mode 100644 arch/um/include/asm/xor.h (limited to 'arch/um/include/asm') diff --git a/arch/um/include/asm/a.out-core.h b/arch/um/include/asm/a.out-core.h new file mode 100644 index 00000000000..995643b1830 --- /dev/null +++ b/arch/um/include/asm/a.out-core.h @@ -0,0 +1,27 @@ +/* a.out coredump register dumper + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ + +#ifndef __UM_A_OUT_CORE_H +#define __UM_A_OUT_CORE_H + +#ifdef __KERNEL__ + +#include + +/* + * fill in the user structure for an a.out core dump + */ +static inline void aout_dump_thread(struct pt_regs *regs, struct user *u) +{ +} + +#endif /* __KERNEL__ */ +#endif /* __UM_A_OUT_CORE_H */ diff --git a/arch/um/include/asm/a.out.h b/arch/um/include/asm/a.out.h new file mode 100644 index 00000000000..754181ee868 --- /dev/null +++ b/arch/um/include/asm/a.out.h @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * Licensed under the GPL + */ + +#ifndef __UM_A_OUT_H +#define __UM_A_OUT_H + +#include "asm/arch/a.out.h" + +#endif diff --git a/arch/um/include/asm/alternative-asm.h b/arch/um/include/asm/alternative-asm.h new file mode 100644 index 00000000000..9aa9fa2402a --- /dev/null +++ b/arch/um/include/asm/alternative-asm.h @@ -0,0 +1,6 @@ +#ifndef __UM_ALTERNATIVE_ASM_I +#define __UM_ALTERNATIVE_ASM_I + +#include "asm/arch/alternative-asm.h" + +#endif diff --git a/arch/um/include/asm/alternative.h b/arch/um/include/asm/alternative.h new file mode 100644 index 00000000000..b6434396bd4 --- /dev/null +++ b/arch/um/include/asm/alternative.h @@ -0,0 +1,6 @@ +#ifndef __UM_ALTERNATIVE_H +#define __UM_ALTERNATIVE_H + +#include "asm/arch/alternative.h" + +#endif diff --git a/arch/um/include/asm/apic.h b/arch/um/include/asm/apic.h new file mode 100644 index 00000000000..876dee84ab1 --- /dev/null +++ b/arch/um/include/asm/apic.h @@ -0,0 +1,4 @@ +#ifndef __UM_APIC_H +#define __UM_APIC_H + +#endif diff --git a/arch/um/include/asm/archparam-i386.h b/arch/um/include/asm/archparam-i386.h new file mode 100644 index 00000000000..49e89b8d7e5 --- /dev/null +++ b/arch/um/include/asm/archparam-i386.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) + * Licensed under the GPL + */ + +#ifndef __UM_ARCHPARAM_I386_H +#define __UM_ARCHPARAM_I386_H + +/********* Nothing for asm-um/hardirq.h **********/ + +/********* Nothing for asm-um/hw_irq.h **********/ + +/********* Nothing for asm-um/string.h **********/ + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/arch/um/include/asm/archparam-ppc.h b/arch/um/include/asm/archparam-ppc.h new file mode 100644 index 00000000000..4269d8a37b4 --- /dev/null +++ b/arch/um/include/asm/archparam-ppc.h @@ -0,0 +1,8 @@ +#ifndef __UM_ARCHPARAM_PPC_H +#define __UM_ARCHPARAM_PPC_H + +/********* Bits for asm-um/string.h **********/ + +#define __HAVE_ARCH_STRRCHR + +#endif diff --git a/arch/um/include/asm/archparam-x86_64.h b/arch/um/include/asm/archparam-x86_64.h new file mode 100644 index 00000000000..270ed9586b6 --- /dev/null +++ b/arch/um/include/asm/archparam-x86_64.h @@ -0,0 +1,26 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_ARCHPARAM_X86_64_H +#define __UM_ARCHPARAM_X86_64_H + + +/* No user-accessible fixmap addresses, i.e. vsyscall */ +#define FIXADDR_USER_START 0 +#define FIXADDR_USER_END 0 + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/arch/um/include/asm/asm.h b/arch/um/include/asm/asm.h new file mode 100644 index 00000000000..af1269a1e9e --- /dev/null +++ b/arch/um/include/asm/asm.h @@ -0,0 +1,6 @@ +#ifndef __UM_ASM_H +#define __UM_ASM_H + +#include "asm/arch/asm.h" + +#endif diff --git a/arch/um/include/asm/atomic.h b/arch/um/include/asm/atomic.h new file mode 100644 index 00000000000..b683f1034d1 --- /dev/null +++ b/arch/um/include/asm/atomic.h @@ -0,0 +1,11 @@ +#ifndef __UM_ATOMIC_H +#define __UM_ATOMIC_H + +/* The i386 atomic.h calls printk, but doesn't include kernel.h, so we + * include it here. + */ +#include "linux/kernel.h" + +#include "asm/arch/atomic.h" + +#endif diff --git a/arch/um/include/asm/auxvec.h b/arch/um/include/asm/auxvec.h new file mode 100644 index 00000000000..1e5e1c2fc9b --- /dev/null +++ b/arch/um/include/asm/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __UM_AUXVEC_H +#define __UM_AUXVEC_H + +#endif diff --git a/arch/um/include/asm/bitops.h b/arch/um/include/asm/bitops.h new file mode 100644 index 00000000000..e4d38d437b9 --- /dev/null +++ b/arch/um/include/asm/bitops.h @@ -0,0 +1,10 @@ +#ifndef __UM_BITOPS_H +#define __UM_BITOPS_H + +#ifndef _LINUX_BITOPS_H +#error only can be included directly +#endif + +#include "asm/arch/bitops.h" + +#endif diff --git a/arch/um/include/asm/boot.h b/arch/um/include/asm/boot.h new file mode 100644 index 00000000000..09548c3e784 --- /dev/null +++ b/arch/um/include/asm/boot.h @@ -0,0 +1,6 @@ +#ifndef __UM_BOOT_H +#define __UM_BOOT_H + +#include "asm/arch/boot.h" + +#endif diff --git a/arch/um/include/asm/bug.h b/arch/um/include/asm/bug.h new file mode 100644 index 00000000000..9e33b864c35 --- /dev/null +++ b/arch/um/include/asm/bug.h @@ -0,0 +1,6 @@ +#ifndef __UM_BUG_H +#define __UM_BUG_H + +#include + +#endif diff --git a/arch/um/include/asm/bugs.h b/arch/um/include/asm/bugs.h new file mode 100644 index 00000000000..6a72e240d5f --- /dev/null +++ b/arch/um/include/asm/bugs.h @@ -0,0 +1,6 @@ +#ifndef __UM_BUGS_H +#define __UM_BUGS_H + +void check_bugs(void); + +#endif diff --git a/arch/um/include/asm/byteorder.h b/arch/um/include/asm/byteorder.h new file mode 100644 index 00000000000..eee0a834f44 --- /dev/null +++ b/arch/um/include/asm/byteorder.h @@ -0,0 +1,6 @@ +#ifndef __UM_BYTEORDER_H +#define __UM_BYTEORDER_H + +#include "asm/arch/byteorder.h" + +#endif diff --git a/arch/um/include/asm/cache.h b/arch/um/include/asm/cache.h new file mode 100644 index 00000000000..19e1bdd6741 --- /dev/null +++ b/arch/um/include/asm/cache.h @@ -0,0 +1,17 @@ +#ifndef __UM_CACHE_H +#define __UM_CACHE_H + + +#if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT) +# define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) +#elif defined(CONFIG_UML_X86) /* 64-bit */ +# define L1_CACHE_SHIFT 6 /* Should be 7 on Intel */ +#else +/* XXX: this was taken from x86, now it's completely random. Luckily only + * affects SMP padding. */ +# define L1_CACHE_SHIFT 5 +#endif + +#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) + +#endif diff --git a/arch/um/include/asm/cacheflush.h b/arch/um/include/asm/cacheflush.h new file mode 100644 index 00000000000..12e9d4b74c8 --- /dev/null +++ b/arch/um/include/asm/cacheflush.h @@ -0,0 +1,6 @@ +#ifndef __UM_CACHEFLUSH_H +#define __UM_CACHEFLUSH_H + +#include "asm/arch/cacheflush.h" + +#endif diff --git a/arch/um/include/asm/calling.h b/arch/um/include/asm/calling.h new file mode 100644 index 00000000000..0b2384cc99f --- /dev/null +++ b/arch/um/include/asm/calling.h @@ -0,0 +1,9 @@ +# Copyright 2003 - 2004 Pathscale, Inc +# Released under the GPL + +#ifndef __UM_CALLING_H /* XXX x86_64 */ +#define __UM_CALLING_H + +#include "asm/arch/calling.h" + +#endif diff --git a/arch/um/include/asm/checksum.h b/arch/um/include/asm/checksum.h new file mode 100644 index 00000000000..5b501361e36 --- /dev/null +++ b/arch/um/include/asm/checksum.h @@ -0,0 +1,6 @@ +#ifndef __UM_CHECKSUM_H +#define __UM_CHECKSUM_H + +#include "sysdep/checksum.h" + +#endif diff --git a/arch/um/include/asm/cmpxchg.h b/arch/um/include/asm/cmpxchg.h new file mode 100644 index 00000000000..529376a9988 --- /dev/null +++ b/arch/um/include/asm/cmpxchg.h @@ -0,0 +1,6 @@ +#ifndef __UM_CMPXCHG_H +#define __UM_CMPXCHG_H + +#include "asm/arch/cmpxchg.h" + +#endif diff --git a/arch/um/include/asm/cobalt.h b/arch/um/include/asm/cobalt.h new file mode 100644 index 00000000000..f813a684be9 --- /dev/null +++ b/arch/um/include/asm/cobalt.h @@ -0,0 +1,6 @@ +#ifndef __UM_COBALT_H +#define __UM_COBALT_H + +#include "asm/arch/cobalt.h" + +#endif diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S new file mode 100644 index 00000000000..cb0248616d4 --- /dev/null +++ b/arch/um/include/asm/common.lds.S @@ -0,0 +1,130 @@ +#include + + .fini : { *(.fini) } =0x9090 + _etext = .; + PROVIDE (etext = .); + + . = ALIGN(4096); + _sdata = .; + PROVIDE (sdata = .); + + RODATA + + .unprotected : { *(.unprotected) } + . = ALIGN(4096); + PROVIDE (_unprotected_end = .); + + . = ALIGN(4096); + .note : { *(.note.*) } + __ex_table : { + __start___ex_table = .; + *(__ex_table) + __stop___ex_table = .; + } + + BUG_TABLE + + .uml.setup.init : { + __uml_setup_start = .; + *(.uml.setup.init) + __uml_setup_end = .; + } + + .uml.help.init : { + __uml_help_start = .; + *(.uml.help.init) + __uml_help_end = .; + } + + .uml.postsetup.init : { + __uml_postsetup_start = .; + *(.uml.postsetup.init) + __uml_postsetup_end = .; + } + + .init.setup : { + __setup_start = .; + *(.init.setup) + __setup_end = .; + } + + . = ALIGN(32); + .data.percpu : { + __per_cpu_start = . ; + *(.data.percpu) + __per_cpu_end = . ; + } + + .initcall.init : { + __initcall_start = .; + INITCALLS + __initcall_end = .; + } + + .con_initcall.init : { + __con_initcall_start = .; + *(.con_initcall.init) + __con_initcall_end = .; + } + + .uml.initcall.init : { + __uml_initcall_start = .; + *(.uml.initcall.init) + __uml_initcall_end = .; + } + __init_end = .; + + SECURITY_INIT + + .exitcall : { + __exitcall_begin = .; + *(.exitcall.exit) + __exitcall_end = .; + } + + .uml.exitcall : { + __uml_exitcall_begin = .; + *(.uml.exitcall.exit) + __uml_exitcall_end = .; + } + + . = ALIGN(4); + .altinstructions : { + __alt_instructions = .; + *(.altinstructions) + __alt_instructions_end = .; + } + .altinstr_replacement : { *(.altinstr_replacement) } + /* .exit.text is discard at runtime, not link time, to deal with references + from .altinstructions and .eh_frame */ + .exit.text : { *(.exit.text) } + .exit.data : { *(.exit.data) } + + .preinit_array : { + __preinit_array_start = .; + *(.preinit_array) + __preinit_array_end = .; + } + .init_array : { + __init_array_start = .; + *(.init_array) + __init_array_end = .; + } + .fini_array : { + __fini_array_start = .; + *(.fini_array) + __fini_array_end = .; + } + + . = ALIGN(4096); + .init.ramfs : { + __initramfs_start = .; + *(.init.ramfs) + __initramfs_end = .; + } + + /* Sections to be discarded */ + /DISCARD/ : { + *(.exitcall.exit) + } + diff --git a/arch/um/include/asm/cpufeature.h b/arch/um/include/asm/cpufeature.h new file mode 100644 index 00000000000..fb7bd42a4d9 --- /dev/null +++ b/arch/um/include/asm/cpufeature.h @@ -0,0 +1,6 @@ +#ifndef __UM_CPUFEATURE_H +#define __UM_CPUFEATURE_H + +#include "asm/arch/cpufeature.h" + +#endif diff --git a/arch/um/include/asm/cputime.h b/arch/um/include/asm/cputime.h new file mode 100644 index 00000000000..c84acbadfa2 --- /dev/null +++ b/arch/um/include/asm/cputime.h @@ -0,0 +1,6 @@ +#ifndef __UM_CPUTIME_H +#define __UM_CPUTIME_H + +#include + +#endif /* __UM_CPUTIME_H */ diff --git a/arch/um/include/asm/current.h b/arch/um/include/asm/current.h new file mode 100644 index 00000000000..c2191d9aa03 --- /dev/null +++ b/arch/um/include/asm/current.h @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * Licensed under the GPL + */ + +#ifndef __UM_CURRENT_H +#define __UM_CURRENT_H + +#include "linux/thread_info.h" + +#define current (current_thread_info()->task) + +#endif diff --git a/arch/um/include/asm/delay.h b/arch/um/include/asm/delay.h new file mode 100644 index 00000000000..c71e32b6741 --- /dev/null +++ b/arch/um/include/asm/delay.h @@ -0,0 +1,20 @@ +#ifndef __UM_DELAY_H +#define __UM_DELAY_H + +#define MILLION 1000000 + +/* Undefined on purpose */ +extern void __bad_udelay(void); + +extern void __udelay(unsigned long usecs); +extern void __delay(unsigned long loops); + +#define udelay(n) ((__builtin_constant_p(n) && (n) > 20000) ? \ + __bad_udelay() : __udelay(n)) + +/* It appears that ndelay is not used at all for UML, and has never been + * implemented. */ +extern void __unimplemented_ndelay(void); +#define ndelay(n) __unimplemented_ndelay() + +#endif diff --git a/arch/um/include/asm/desc.h b/arch/um/include/asm/desc.h new file mode 100644 index 00000000000..4ec34a51b62 --- /dev/null +++ b/arch/um/include/asm/desc.h @@ -0,0 +1,16 @@ +#ifndef __UM_DESC_H +#define __UM_DESC_H + +/* Taken from asm-i386/desc.h, it's the only thing we need. The rest wouldn't + * compile, and has never been used. */ +#define LDT_empty(info) (\ + (info)->base_addr == 0 && \ + (info)->limit == 0 && \ + (info)->contents == 0 && \ + (info)->read_exec_only == 1 && \ + (info)->seg_32bit == 0 && \ + (info)->limit_in_pages == 0 && \ + (info)->seg_not_present == 1 && \ + (info)->useable == 0 ) + +#endif diff --git a/arch/um/include/asm/device.h b/arch/um/include/asm/device.h new file mode 100644 index 00000000000..d8f9872b0e2 --- /dev/null +++ b/arch/um/include/asm/device.h @@ -0,0 +1,7 @@ +/* + * Arch specific extensions to struct device + * + * This file is released under the GPLv2 + */ +#include + diff --git a/arch/um/include/asm/div64.h b/arch/um/include/asm/div64.h new file mode 100644 index 00000000000..1e17f7409ca --- /dev/null +++ b/arch/um/include/asm/div64.h @@ -0,0 +1,6 @@ +#ifndef _UM_DIV64_H +#define _UM_DIV64_H + +#include "asm/arch/div64.h" + +#endif diff --git a/arch/um/include/asm/dma-mapping.h b/arch/um/include/asm/dma-mapping.h new file mode 100644 index 00000000000..90fc708b320 --- /dev/null +++ b/arch/um/include/asm/dma-mapping.h @@ -0,0 +1,128 @@ +#ifndef _ASM_DMA_MAPPING_H +#define _ASM_DMA_MAPPING_H + +#include + +static inline int +dma_supported(struct device *dev, u64 mask) +{ + BUG(); + return(0); +} + +static inline int +dma_set_mask(struct device *dev, u64 dma_mask) +{ + BUG(); + return(0); +} + +static inline void * +dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, + gfp_t flag) +{ + BUG(); + return((void *) 0); +} + +static inline void +dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, + dma_addr_t dma_handle) +{ + BUG(); +} + +static inline dma_addr_t +dma_map_single(struct device *dev, void *cpu_addr, size_t size, + enum dma_data_direction direction) +{ + BUG(); + return(0); +} + +static inline void +dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline dma_addr_t +dma_map_page(struct device *dev, struct page *page, + unsigned long offset, size_t size, + enum dma_data_direction direction) +{ + BUG(); + return(0); +} + +static inline void +dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline int +dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, + enum dma_data_direction direction) +{ + BUG(); + return(0); +} + +static inline void +dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline void +dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline void +dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, + enum dma_data_direction direction) +{ + BUG(); +} + +#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) +#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) +#define dma_is_consistent(d, h) (1) + +static inline int +dma_get_cache_alignment(void) +{ + BUG(); + return(0); +} + +static inline void +dma_sync_single_range(struct device *dev, dma_addr_t dma_handle, + unsigned long offset, size_t size, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline void +dma_cache_sync(struct device *dev, void *vaddr, size_t size, + enum dma_data_direction direction) +{ + BUG(); +} + +static inline int +dma_mapping_error(struct device *dev, dma_addr_t dma_handle) +{ + BUG(); + return 0; +} + +#endif diff --git a/arch/um/include/asm/dma.h b/arch/um/include/asm/dma.h new file mode 100644 index 00000000000..9f6139a8a52 --- /dev/null +++ b/arch/um/include/asm/dma.h @@ -0,0 +1,10 @@ +#ifndef __UM_DMA_H +#define __UM_DMA_H + +#include "asm/io.h" + +extern unsigned long uml_physmem; + +#define MAX_DMA_ADDRESS (uml_physmem) + +#endif diff --git a/arch/um/include/asm/dwarf2.h b/arch/um/include/asm/dwarf2.h new file mode 100644 index 00000000000..d1a02e76293 --- /dev/null +++ b/arch/um/include/asm/dwarf2.h @@ -0,0 +1,11 @@ +/* Copyright 2003 - 2004 Pathscale, Inc + * Released under the GPL + */ + +/* Needed on x86_64 by thunk.S */ +#ifndef __UM_DWARF2_H +#define __UM_DWARF2_H + +#include "asm/arch/dwarf2.h" + +#endif diff --git a/arch/um/include/asm/elf-i386.h b/arch/um/include/asm/elf-i386.h new file mode 100644 index 00000000000..d0da9d7c537 --- /dev/null +++ b/arch/um/include/asm/elf-i386.h @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * Licensed under the GPL + */ +#ifndef __UM_ELF_I386_H +#define __UM_ELF_I386_H + +#include +#include "skas.h" + +#define R_386_NONE 0 +#define R_386_32 1 +#define R_386_PC32 2 +#define R_386_GOT32 3 +#define R_386_PLT32 4 +#define R_386_COPY 5 +#define R_386_GLOB_DAT 6 +#define R_386_JMP_SLOT 7 +#define R_386_RELATIVE 8 +#define R_386_GOTOFF 9 +#define R_386_GOTPC 10 +#define R_386_NUM 11 + +typedef unsigned long elf_greg_t; + +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +typedef struct user_i387_struct elf_fpregset_t; + +/* + * This is used to ensure we don't load something for the wrong architecture. + */ +#define elf_check_arch(x) \ + (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486)) + +#define ELF_CLASS ELFCLASS32 +#define ELF_DATA ELFDATA2LSB +#define ELF_ARCH EM_386 + +#define ELF_PLAT_INIT(regs, load_addr) do { \ + PT_REGS_EBX(regs) = 0; \ + PT_REGS_ECX(regs) = 0; \ + PT_REGS_EDX(regs) = 0; \ + PT_REGS_ESI(regs) = 0; \ + PT_REGS_EDI(regs) = 0; \ + PT_REGS_EBP(regs) = 0; \ + PT_REGS_EAX(regs) = 0; \ +} while (0) + +#define USE_ELF_CORE_DUMP +#define ELF_EXEC_PAGESIZE 4096 + +#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) + +/* Shamelessly stolen from include/asm-i386/elf.h */ + +#define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ + pr_reg[0] = PT_REGS_EBX(regs); \ + pr_reg[1] = PT_REGS_ECX(regs); \ + pr_reg[2] = PT_REGS_EDX(regs); \ + pr_reg[3] = PT_REGS_ESI(regs); \ + pr_reg[4] = PT_REGS_EDI(regs); \ + pr_reg[5] = PT_REGS_EBP(regs); \ + pr_reg[6] = PT_REGS_EAX(regs); \ + pr_reg[7] = PT_REGS_DS(regs); \ + pr_reg[8] = PT_REGS_ES(regs); \ + /* fake once used fs and gs selectors? */ \ + pr_reg[9] = PT_REGS_DS(regs); \ + pr_reg[10] = PT_REGS_DS(regs); \ + pr_reg[11] = PT_REGS_SYSCALL_NR(regs); \ + pr_reg[12] = PT_REGS_IP(regs); \ + pr_reg[13] = PT_REGS_CS(regs); \ + pr_reg[14] = PT_REGS_EFLAGS(regs); \ + pr_reg[15] = PT_REGS_SP(regs); \ + pr_reg[16] = PT_REGS_SS(regs); \ +} while (0); + +extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu); + +#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) + +extern long elf_aux_hwcap; +#define ELF_HWCAP (elf_aux_hwcap) + +extern char * elf_aux_platform; +#define ELF_PLATFORM (elf_aux_platform) + +#define SET_PERSONALITY(ex) do { } while (0) + +extern unsigned long vsyscall_ehdr; +extern unsigned long vsyscall_end; +extern unsigned long __kernel_vsyscall; + +#define VSYSCALL_BASE vsyscall_ehdr +#define VSYSCALL_END vsyscall_end + +/* + * This is the range that is readable by user mode, and things + * acting like user mode such as get_user_pages. + */ +#define FIXADDR_USER_START VSYSCALL_BASE +#define FIXADDR_USER_END VSYSCALL_END + +/* + * Architecture-neutral AT_ values in 0-17, leave some room + * for more of them, start the x86-specific ones at 32. + */ +#define AT_SYSINFO 32 +#define AT_SYSINFO_EHDR 33 + +#define ARCH_DLINFO \ +do { \ + if ( vsyscall_ehdr ) { \ + NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \ + NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \ + } \ +} while (0) + +/* + * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out + * extra segments containing the vsyscall DSO contents. Dumping its + * contents makes post-mortem fully interpretable later without matching up + * the same kernel and hardware config to see what PC values meant. + * Dumping its extra ELF program headers includes all the other information + * a debugger needs to easily find how the vsyscall DSO was being used. + */ +#define ELF_CORE_EXTRA_PHDRS \ + (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 ) + +#define ELF_CORE_WRITE_EXTRA_PHDRS \ +if ( vsyscall_ehdr ) { \ + const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \ + const struct elf_phdr *const phdrp = \ + (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \ + int i; \ + Elf32_Off ofs = 0; \ + for (i = 0; i < ehdrp->e_phnum; ++i) { \ + struct elf_phdr phdr = phdrp[i]; \ + if (phdr.p_type == PT_LOAD) { \ + ofs = phdr.p_offset = offset; \ + offset += phdr.p_filesz; \ + } \ + else \ + phdr.p_offset += ofs; \ + phdr.p_paddr = 0; /* match other core phdrs */ \ + DUMP_WRITE(&phdr, sizeof(phdr)); \ + } \ +} +#define ELF_CORE_WRITE_EXTRA_DATA \ +if ( vsyscall_ehdr ) { \ + const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \ + const struct elf_phdr *const phdrp = \ + (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \ + int i; \ + for (i = 0; i < ehdrp->e_phnum; ++i) { \ + if (phdrp[i].p_type == PT_LOAD) \ + DUMP_WRITE((void *) phdrp[i].p_vaddr, \ + phdrp[i].p_filesz); \ + } \ +} + +#endif diff --git a/arch/um/include/asm/elf-ppc.h b/arch/um/include/asm/elf-ppc.h new file mode 100644 index 00000000000..af9463cd8ce --- /dev/null +++ b/arch/um/include/asm/elf-ppc.h @@ -0,0 +1,53 @@ +#ifndef __UM_ELF_PPC_H +#define __UM_ELF_PPC_H + + +extern long elf_aux_hwcap; +#define ELF_HWCAP (elf_aux_hwcap) + +#define SET_PERSONALITY(ex) do ; while(0) + +#define ELF_EXEC_PAGESIZE 4096 + +#define elf_check_arch(x) (1) + +#ifdef CONFIG_64BIT +#define ELF_CLASS ELFCLASS64 +#else +#define ELF_CLASS ELFCLASS32 +#endif + +#define USE_ELF_CORE_DUMP + +#define R_386_NONE 0 +#define R_386_32 1 +#define R_386_PC32 2 +#define R_386_GOT32 3 +#define R_386_PLT32 4 +#define R_386_COPY 5 +#define R_386_GLOB_DAT 6 +#define R_386_JMP_SLOT 7 +#define R_386_RELATIVE 8 +#define R_386_GOTOFF 9 +#define R_386_GOTPC 10 +#define R_386_NUM 11 + +#define ELF_PLATFORM (0) + +#define ELF_ET_DYN_BASE (0x08000000) + +/* the following stolen from asm-ppc/elf.h */ +#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ +#define ELF_NFPREG 33 /* includes fpscr */ +/* General registers */ +typedef unsigned long elf_greg_t; +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +/* Floating point registers */ +typedef double elf_fpreg_t; +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + +#define ELF_DATA ELFDATA2MSB +#define ELF_ARCH EM_PPC + +#endif diff --git a/arch/um/include/asm/elf-x86_64.h b/arch/um/include/asm/elf-x86_64.h new file mode 100644 index 00000000000..6e8a9195e95 --- /dev/null +++ b/arch/um/include/asm/elf-x86_64.h @@ -0,0 +1,119 @@ +/* + * Copyright 2003 PathScale, Inc. + * Copyright (C) 2003 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * + * Licensed under the GPL + */ +#ifndef __UM_ELF_X86_64_H +#define __UM_ELF_X86_64_H + +#include +#include "skas.h" + +/* x86-64 relocation types, taken from asm-x86_64/elf.h */ +#define R_X86_64_NONE 0 /* No reloc */ +#define R_X86_64_64 1 /* Direct 64 bit */ +#define R_X86_64_PC32 2 /* PC relative 32 bit signed */ +#define R_X86_64_GOT32 3 /* 32 bit GOT entry */ +#define R_X86_64_PLT32 4 /* 32 bit PLT address */ +#define R_X86_64_COPY 5 /* Copy symbol at runtime */ +#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ +#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ +#define R_X86_64_RELATIVE 8 /* Adjust by program base */ +#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative + offset to GOT */ +#define R_X86_64_32 10 /* Direct 32 bit zero extended */ +#define R_X86_64_32S 11 /* Direct 32 bit sign extended */ +#define R_X86_64_16 12 /* Direct 16 bit zero extended */ +#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ +#define R_X86_64_8 14 /* Direct 8 bit sign extended */ +#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ + +#define R_X86_64_NUM 16 + +typedef unsigned long elf_greg_t; + +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +typedef struct user_i387_struct elf_fpregset_t; + +/* + * This is used to ensure we don't load something for the wrong architecture. + */ +#define elf_check_arch(x) \ + ((x)->e_machine == EM_X86_64) + +#define ELF_CLASS ELFCLASS64 +#define ELF_DATA ELFDATA2LSB +#define ELF_ARCH EM_X86_64 + +#define ELF_PLAT_INIT(regs, load_addr) do { \ + PT_REGS_RBX(regs) = 0; \ + PT_REGS_RCX(regs) = 0; \ + PT_REGS_RDX(regs) = 0; \ + PT_REGS_RSI(regs) = 0; \ + PT_REGS_RDI(regs) = 0; \ + PT_REGS_RBP(regs) = 0; \ + PT_REGS_RAX(regs) = 0; \ + PT_REGS_R8(regs) = 0; \ + PT_REGS_R9(regs) = 0; \ + PT_REGS_R10(regs) = 0; \ + PT_REGS_R11(regs) = 0; \ + PT_REGS_R12(regs) = 0; \ + PT_REGS_R13(regs) = 0; \ + PT_REGS_R14(regs) = 0; \ + PT_REGS_R15(regs) = 0; \ +} while (0) + +#define ELF_CORE_COPY_REGS(pr_reg, regs) \ + (pr_reg)[0] = (regs)->regs.gp[0]; \ + (pr_reg)[1] = (regs)->regs.gp[1]; \ + (pr_reg)[2] = (regs)->regs.gp[2]; \ + (pr_reg)[3] = (regs)->regs.gp[3]; \ + (pr_reg)[4] = (regs)->regs.gp[4]; \ + (pr_reg)[5] = (regs)->regs.gp[5]; \ + (pr_reg)[6] = (regs)->regs.gp[6]; \ + (pr_reg)[7] = (regs)->regs.gp[7]; \ + (pr_reg)[8] = (regs)->regs.gp[8]; \ + (pr_reg)[9] = (regs)->regs.gp[9]; \ + (pr_reg)[10] = (regs)->regs.gp[10]; \ + (pr_reg)[11] = (regs)->regs.gp[11]; \ + (pr_reg)[12] = (regs)->regs.gp[12]; \ + (pr_reg)[13] = (regs)->regs.gp[13]; \ + (pr_reg)[14] = (regs)->regs.gp[14]; \ + (pr_reg)[15] = (regs)->regs.gp[15]; \ + (pr_reg)[16] = (regs)->regs.gp[16]; \ + (pr_reg)[17] = (regs)->regs.gp[17]; \ + (pr_reg)[18] = (regs)->regs.gp[18]; \ + (pr_reg)[19] = (regs)->regs.gp[19]; \ + (pr_reg)[20] = (regs)->regs.gp[20]; \ + (pr_reg)[21] = current->thread.arch.fs; \ + (pr_reg)[22] = 0; \ + (pr_reg)[23] = 0; \ + (pr_reg)[24] = 0; \ + (pr_reg)[25] = 0; \ + (pr_reg)[26] = 0; + +extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu); + +#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) + +#ifdef TIF_IA32 /* XXX */ +#error XXX, indeed + clear_thread_flag(TIF_IA32); +#endif + +#define USE_ELF_CORE_DUMP +#define ELF_EXEC_PAGESIZE 4096 + +#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) + +extern long elf_aux_hwcap; +#define ELF_HWCAP (elf_aux_hwcap) + +#define ELF_PLATFORM "x86_64" + +#define SET_PERSONALITY(ex) do ; while(0) + +#endif diff --git a/arch/um/include/asm/emergency-restart.h b/arch/um/include/asm/emergency-restart.h new file mode 100644 index 00000000000..108d8c48e42 --- /dev/null +++ b/arch/um/include/asm/emergency-restart.h @@ -0,0 +1,6 @@ +#ifndef _ASM_EMERGENCY_RESTART_H +#define _ASM_EMERGENCY_RESTART_H + +#include + +#endif /* _ASM_EMERGENCY_RESTART_H */ diff --git a/arch/um/include/asm/errno.h b/arch/um/include/asm/errno.h new file mode 100644 index 00000000000..b7a9e37fd8d --- /dev/null +++ b/arch/um/include/asm/errno.h @@ -0,0 +1,6 @@ +#ifndef __UM_ERRNO_H +#define __UM_ERRNO_H + +#include "asm/arch/errno.h" + +#endif diff --git a/arch/um/include/asm/fcntl.h b/arch/um/include/asm/fcntl.h new file mode 100644 index 00000000000..812a65446d9 --- /dev/null +++ b/arch/um/include/asm/fcntl.h @@ -0,0 +1,6 @@ +#ifndef __UM_FCNTL_H +#define __UM_FCNTL_H + +#include "asm/arch/fcntl.h" + +#endif diff --git a/arch/um/include/asm/fixmap.h b/arch/um/include/asm/fixmap.h new file mode 100644 index 00000000000..9d2be52b865 --- /dev/null +++ b/arch/um/include/asm/fixmap.h @@ -0,0 +1,98 @@ +#ifndef __UM_FIXMAP_H +#define __UM_FIXMAP_H + +#include +#include +#include +#include +#include + +/* + * Here we define all the compile-time 'special' virtual + * addresses. The point is to have a constant address at + * compile time, but to set the physical address only + * in the boot process. We allocate these special addresses + * from the end of virtual memory (0xfffff000) backwards. + * Also this lets us do fail-safe vmalloc(), we + * can guarantee that these special addresses and + * vmalloc()-ed addresses never overlap. + * + * these 'compile-time allocated' memory buffers are + * fixed-size 4k pages. (or larger if used with an increment + * highger than 1) use fixmap_set(idx,phys) to associate + * physical memory with fixmap indices. + * + * TLB entries of such buffers will not be flushed across + * task switches. + */ + +/* + * on UP currently we will have no trace of the fixmap mechanizm, + * no page table allocations, etc. This might change in the + * future, say framebuffers for the console driver(s) could be + * fix-mapped? + */ +enum fixed_addresses { +#ifdef CONFIG_HIGHMEM + FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ + FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, +#endif + __end_of_fixed_addresses +}; + +extern void __set_fixmap (enum fixed_addresses idx, + unsigned long phys, pgprot_t flags); + +#define set_fixmap(idx, phys) \ + __set_fixmap(idx, phys, PAGE_KERNEL) +/* + * Some hardware wants to get fixmapped without caching. + */ +#define set_fixmap_nocache(idx, phys) \ + __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE) +/* + * used by vmalloc.c. + * + * Leave one empty page between vmalloc'ed areas and + * the start of the fixmap, and leave one page empty + * at the top of mem.. + */ + +#define FIXADDR_TOP (TASK_SIZE - 2 * PAGE_SIZE) +#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) +#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) + +#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) +#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) + +extern void __this_fixmap_does_not_exist(void); + +/* + * 'index to address' translation. If anyone tries to use the idx + * directly without tranlation, we catch the bug with a NULL-deference + * kernel oops. Illegal ranges of incoming indices are caught too. + */ +static inline unsigned long fix_to_virt(const unsigned int idx) +{ + /* + * this branch gets completely eliminated after inlining, + * except when someone tries to use fixaddr indices in an + * illegal way. (such as mixing up address types or using + * out-of-range indices). + * + * If it doesn't get removed, the linker will complain + * loudly with a reasonably clear error message.. + */ + if (idx >= __end_of_fixed_addresses) + __this_fixmap_does_not_exist(); + + return __fix_to_virt(idx); +} + +static inline unsigned long virt_to_fix(const unsigned long vaddr) +{ + BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); + return __virt_to_fix(vaddr); +} + +#endif diff --git a/arch/um/include/asm/floppy.h b/arch/um/include/asm/floppy.h new file mode 100644 index 00000000000..453e7415fb6 --- /dev/null +++ b/arch/um/include/asm/floppy.h @@ -0,0 +1,6 @@ +#ifndef __UM_FLOPPY_H +#define __UM_FLOPPY_H + +#include "asm/arch/floppy.h" + +#endif diff --git a/arch/um/include/asm/frame.h b/arch/um/include/asm/frame.h new file mode 100644 index 00000000000..8a8c1cb415b --- /dev/null +++ b/arch/um/include/asm/frame.h @@ -0,0 +1,6 @@ +#ifndef __UM_FRAME_I +#define __UM_FRAME_I + +#include "asm/arch/frame.h" + +#endif diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h new file mode 100644 index 00000000000..6a332a9f099 --- /dev/null +++ b/arch/um/include/asm/futex.h @@ -0,0 +1,6 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#include + +#endif diff --git a/arch/um/include/asm/hardirq.h b/arch/um/include/asm/hardirq.h new file mode 100644 index 00000000000..313ebb8a256 --- /dev/null +++ b/arch/um/include/asm/hardirq.h @@ -0,0 +1,25 @@ +/* (c) 2004 cw@f00f.org, GPLv2 blah blah */ + +#ifndef __ASM_UM_HARDIRQ_H +#define __ASM_UM_HARDIRQ_H + +#include +#include + +/* NOTE: When SMP works again we might want to make this + * ____cacheline_aligned or maybe use per_cpu state? --cw */ +typedef struct { + unsigned int __softirq_pending; +} irq_cpustat_t; + +#include + +/* As this would be very strange for UML to get we BUG() after the + * printk. */ +static inline void ack_bad_irq(unsigned int irq) +{ + printk(KERN_ERR "unexpected IRQ %02x\n", irq); + BUG(); +} + +#endif /* __ASM_UM_HARDIRQ_H */ diff --git a/arch/um/include/asm/highmem.h b/arch/um/include/asm/highmem.h new file mode 100644 index 00000000000..36974cb8abc --- /dev/null +++ b/arch/um/include/asm/highmem.h @@ -0,0 +1,12 @@ +#ifndef __UM_HIGHMEM_H +#define __UM_HIGHMEM_H + +#include "asm/page.h" +#include "asm/fixmap.h" +#include "asm/arch/highmem.h" + +#undef PKMAP_BASE + +#define PKMAP_BASE ((FIXADDR_START - LAST_PKMAP * PAGE_SIZE) & PMD_MASK) + +#endif diff --git a/arch/um/include/asm/host_ldt-i386.h b/arch/um/include/asm/host_ldt-i386.h new file mode 100644 index 00000000000..b27cb0a9dd3 --- /dev/null +++ b/arch/um/include/asm/host_ldt-i386.h @@ -0,0 +1,34 @@ +#ifndef __ASM_HOST_LDT_I386_H +#define __ASM_HOST_LDT_I386_H + +#include "asm/arch/ldt.h" + +/* + * macros stolen from include/asm-i386/desc.h + */ +#define LDT_entry_a(info) \ + ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) + +#define LDT_entry_b(info) \ + (((info)->base_addr & 0xff000000) | \ + (((info)->base_addr & 0x00ff0000) >> 16) | \ + ((info)->limit & 0xf0000) | \ + (((info)->read_exec_only ^ 1) << 9) | \ + ((info)->contents << 10) | \ + (((info)->seg_not_present ^ 1) << 15) | \ + ((info)->seg_32bit << 22) | \ + ((info)->limit_in_pages << 23) | \ + ((info)->useable << 20) | \ + 0x7000) + +#define LDT_empty(info) (\ + (info)->base_addr == 0 && \ + (info)->limit == 0 && \ + (info)->contents == 0 && \ + (info)->read_exec_only == 1 && \ + (info)->seg_32bit == 0 && \ + (info)->limit_in_pages == 0 && \ + (info)->seg_not_present == 1 && \ + (info)->useable == 0 ) + +#endif diff --git a/arch/um/include/asm/host_ldt-x86_64.h b/arch/um/include/asm/host_ldt-x86_64.h new file mode 100644 index 00000000000..74a63f7d9a9 --- /dev/null +++ b/arch/um/include/asm/host_ldt-x86_64.h @@ -0,0 +1,38 @@ +#ifndef __ASM_HOST_LDT_X86_64_H +#define __ASM_HOST_LDT_X86_64_H + +#include "asm/arch/ldt.h" + +/* + * macros stolen from include/asm-x86_64/desc.h + */ +#define LDT_entry_a(info) \ + ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) + +/* Don't allow setting of the lm bit. It is useless anyways because + * 64bit system calls require __USER_CS. */ +#define LDT_entry_b(info) \ + (((info)->base_addr & 0xff000000) | \ + (((info)->base_addr & 0x00ff0000) >> 16) | \ + ((info)->limit & 0xf0000) | \ + (((info)->read_exec_only ^ 1) << 9) | \ + ((info)->contents << 10) | \ + (((info)->seg_not_present ^ 1) << 15) | \ + ((info)->seg_32bit << 22) | \ + ((info)->limit_in_pages << 23) | \ + ((info)->useable << 20) | \ + /* ((info)->lm << 21) | */ \ + 0x7000) + +#define LDT_empty(info) (\ + (info)->base_addr == 0 && \ + (info)->limit == 0 && \ + (info)->contents == 0 && \ + (info)->read_exec_only == 1 && \ + (info)->seg_32bit == 0 && \ + (info)->limit_in_pages == 0 && \ + (info)->seg_not_present == 1 && \ + (info)->useable == 0 && \ + (info)->lm == 0) + +#endif diff --git a/arch/um/include/asm/hw_irq.h b/arch/um/include/asm/hw_irq.h new file mode 100644 index 00000000000..1cf84cf5f21 --- /dev/null +++ b/arch/um/include/asm/hw_irq.h @@ -0,0 +1,7 @@ +#ifndef _ASM_UM_HW_IRQ_H +#define _ASM_UM_HW_IRQ_H + +#include "asm/irq.h" +#include "asm/archparam.h" + +#endif diff --git a/arch/um/include/asm/ide.h b/arch/um/include/asm/ide.h new file mode 100644 index 00000000000..3d1ccebcfba --- /dev/null +++ b/arch/um/include/asm/ide.h @@ -0,0 +1,6 @@ +#ifndef __UM_IDE_H +#define __UM_IDE_H + +#include "asm/arch/ide.h" + +#endif diff --git a/arch/um/include/asm/io.h b/arch/um/include/asm/io.h new file mode 100644 index 00000000000..44e8b8c772a --- /dev/null +++ b/arch/um/include/asm/io.h @@ -0,0 +1,57 @@ +#ifndef __UM_IO_H +#define __UM_IO_H + +#include "asm/page.h" + +#define IO_SPACE_LIMIT 0xdeadbeef /* Sure hope nothing uses this */ + +static inline int inb(unsigned long i) { return(0); } +static inline void outb(char c, unsigned long i) { } + +/* + * Change virtual addresses to physical addresses and vv. + * These are pretty trivial + */ +static inline unsigned long virt_to_phys(volatile void * address) +{ + return __pa((void *) address); +} + +static inline void * phys_to_virt(unsigned long address) +{ + return __va(address); +} + +/* + * Convert a physical pointer to a virtual kernel pointer for /dev/mem + * access + */ +#define xlate_dev_mem_ptr(p) __va(p) + +/* + * Convert a virtual cached pointer to an uncached pointer + */ +#define xlate_dev_kmem_ptr(p) p + +static inline void writeb(unsigned char b, volatile void __iomem *addr) +{ + *(volatile unsigned char __force *) addr = b; +} +static inline void writew(unsigned short b, volatile void __iomem *addr) +{ + *(volatile unsigned short __force *) addr = b; +} +static inline void writel(unsigned int b, volatile void __iomem *addr) +{ + *(volatile unsigned int __force *) addr = b; +} +static inline void writeq(unsigned int b, volatile void __iomem *addr) +{ + *(volatile unsigned long long __force *) addr = b; +} +#define __raw_writeb writeb +#define __raw_writew writew +#define __raw_writel writel +#define __raw_writeq writeq + +#endif diff --git a/arch/um/include/asm/ioctl.h b/arch/um/include/asm/ioctl.h new file mode 100644 index 00000000000..cc22157346d --- /dev/null +++ b/arch/um/include/asm/ioctl.h @@ -0,0 +1,6 @@ +#ifndef __UM_IOCTL_H +#define __UM_IOCTL_H + +#include "asm/arch/ioctl.h" + +#endif diff --git a/arch/um/include/asm/ioctls.h b/arch/um/include/asm/ioctls.h new file mode 100644 index 00000000000..9a1a017de6a --- /dev/null +++ b/arch/um/include/asm/ioctls.h @@ -0,0 +1,6 @@ +#ifndef __UM_IOCTLS_H +#define __UM_IOCTLS_H + +#include "asm/arch/ioctls.h" + +#endif diff --git a/arch/um/include/asm/ipcbuf.h b/arch/um/include/asm/ipcbuf.h new file mode 100644 index 00000000000..bb2ad31dc43 --- /dev/null +++ b/arch/um/include/asm/ipcbuf.h @@ -0,0 +1,6 @@ +#ifndef __UM_IPCBUF_H +#define __UM_IPCBUF_H + +#include "asm/arch/ipcbuf.h" + +#endif diff --git a/arch/um/include/asm/irq.h b/arch/um/include/asm/irq.h new file mode 100644 index 00000000000..4a2037f8204 --- /dev/null +++ b/arch/um/include/asm/irq.h @@ -0,0 +1,23 @@ +#ifndef __UM_IRQ_H +#define __UM_IRQ_H + +#define TIMER_IRQ 0 +#define UMN_IRQ 1 +#define CONSOLE_IRQ 2 +#define CONSOLE_WRITE_IRQ 3 +#define UBD_IRQ 4 +#define UM_ETH_IRQ 5 +#define SSL_IRQ 6 +#define SSL_WRITE_IRQ 7 +#define ACCEPT_IRQ 8 +#define MCONSOLE_IRQ 9 +#define WINCH_IRQ 10 +#define SIGIO_WRITE_IRQ 11 +#define TELNETD_IRQ 12 +#define XTERM_IRQ 13 +#define RANDOM_IRQ 14 + +#define LAST_IRQ RANDOM_IRQ +#define NR_IRQS (LAST_IRQ + 1) + +#endif diff --git a/arch/um/include/asm/irq_regs.h b/arch/um/include/asm/irq_regs.h new file mode 100644 index 00000000000..3dd9c0b7027 --- /dev/null +++ b/arch/um/include/asm/irq_regs.h @@ -0,0 +1 @@ +#include diff --git a/arch/um/include/asm/irq_vectors.h b/arch/um/include/asm/irq_vectors.h new file mode 100644 index 00000000000..62ddba6fc73 --- /dev/null +++ b/arch/um/include/asm/irq_vectors.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __UM_IRQ_VECTORS_H +#define __UM_IRQ_VECTORS_H + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/arch/um/include/asm/irqflags.h b/arch/um/include/asm/irqflags.h new file mode 100644 index 00000000000..659b9abdfdb --- /dev/null +++ b/arch/um/include/asm/irqflags.h @@ -0,0 +1,6 @@ +#ifndef __UM_IRQFLAGS_H +#define __UM_IRQFLAGS_H + +/* Empty for now */ + +#endif diff --git a/arch/um/include/asm/kdebug.h b/arch/um/include/asm/kdebug.h new file mode 100644 index 00000000000..6ece1b03766 --- /dev/null +++ b/arch/um/include/asm/kdebug.h @@ -0,0 +1 @@ +#include diff --git a/arch/um/include/asm/kmap_types.h b/arch/um/include/asm/kmap_types.h new file mode 100644 index 00000000000..6c03acdb440 --- /dev/null +++ b/arch/um/include/asm/kmap_types.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __UM_KMAP_TYPES_H +#define __UM_KMAP_TYPES_H + +/* No more #include "asm/arch/kmap_types.h" ! */ + +enum km_type { + KM_BOUNCE_READ, + KM_SKB_SUNRPC_DATA, + KM_SKB_DATA_SOFTIRQ, + KM_USER0, + KM_USER1, + KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */ + KM_BIO_SRC_IRQ, + KM_BIO_DST_IRQ, + KM_PTE0, + KM_PTE1, + KM_IRQ0, + KM_IRQ1, + KM_SOFTIRQ0, + KM_SOFTIRQ1, + KM_TYPE_NR +}; + +#endif diff --git a/arch/um/include/asm/ldt.h b/arch/um/include/asm/ldt.h new file mode 100644 index 00000000000..52af512f5e7 --- /dev/null +++ b/arch/um/include/asm/ldt.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2004 Fujitsu Siemens Computers GmbH + * Licensed under the GPL + * + * Author: Bodo Stroesser + */ + +#ifndef __ASM_LDT_H +#define __ASM_LDT_H + +#include +#include "asm/host_ldt.h" + +extern void ldt_host_info(void); + +#define LDT_PAGES_MAX \ + ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) +#define LDT_ENTRIES_PER_PAGE \ + (PAGE_SIZE/LDT_ENTRY_SIZE) +#define LDT_DIRECT_ENTRIES \ + ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) + +struct ldt_entry { + __u32 a; + __u32 b; +}; + +typedef struct uml_ldt { + int entry_count; + struct mutex lock; + union { + struct ldt_entry * pages[LDT_PAGES_MAX]; + struct ldt_entry entries[LDT_DIRECT_ENTRIES]; + } u; +} uml_ldt_t; + +#endif diff --git a/arch/um/include/asm/linkage.h b/arch/um/include/asm/linkage.h new file mode 100644 index 00000000000..7dfce37adc8 --- /dev/null +++ b/arch/um/include/asm/linkage.h @@ -0,0 +1,6 @@ +#ifndef __ASM_UM_LINKAGE_H +#define __ASM_UM_LINKAGE_H + +#include "asm/arch/linkage.h" + +#endif diff --git a/arch/um/include/asm/local.h b/arch/um/include/asm/local.h new file mode 100644 index 00000000000..9a280c5bb60 --- /dev/null +++ b/arch/um/include/asm/local.h @@ -0,0 +1,6 @@ +#ifndef __UM_LOCAL_H +#define __UM_LOCAL_H + +#include "asm/arch/local.h" + +#endif diff --git a/arch/um/include/asm/locks.h b/arch/um/include/asm/locks.h new file mode 100644 index 00000000000..f80030a3ef5 --- /dev/null +++ b/arch/um/include/asm/locks.h @@ -0,0 +1,6 @@ +#ifndef __UM_LOCKS_H +#define __UM_LOCKS_H + +#include "asm/arch/locks.h" + +#endif diff --git a/arch/um/include/asm/mca_dma.h b/arch/um/include/asm/mca_dma.h new file mode 100644 index 00000000000..e492e4ec139 --- /dev/null +++ b/arch/um/include/asm/mca_dma.h @@ -0,0 +1,6 @@ +#ifndef mca___UM_DMA_H +#define mca___UM_DMA_H + +#include "asm/arch/mca_dma.h" + +#endif diff --git a/arch/um/include/asm/mman.h b/arch/um/include/asm/mman.h new file mode 100644 index 00000000000..b09ed523019 --- /dev/null +++ b/arch/um/include/asm/mman.h @@ -0,0 +1,6 @@ +#ifndef __UM_MMAN_H +#define __UM_MMAN_H + +#include "asm/arch/mman.h" + +#endif diff --git a/arch/um/include/asm/mmu.h b/arch/um/include/asm/mmu.h new file mode 100644 index 00000000000..2cf35c21d69 --- /dev/null +++ b/arch/um/include/asm/mmu.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __MMU_H +#define __MMU_H + +#include "um_mmu.h" + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h new file mode 100644 index 00000000000..54f42e8b010 --- /dev/null +++ b/arch/um/include/asm/mmu_context.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * Licensed under the GPL + */ + +#ifndef __UM_MMU_CONTEXT_H +#define __UM_MMU_CONTEXT_H + +#include "linux/sched.h" +#include "um_mmu.h" + +extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm); +extern void arch_exit_mmap(struct mm_struct *mm); + +#define get_mmu_context(task) do ; while(0) +#define activate_context(tsk) do ; while(0) + +#define deactivate_mm(tsk,mm) do { } while (0) + +extern void force_flush_all(void); + +static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) +{ + /* + * This is called by fs/exec.c and sys_unshare() + * when the new ->mm is used for the first time. + */ + __switch_mm(&new->context.id); + arch_dup_mmap(old, new); +} + +static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, + struct task_struct *tsk) +{ + unsigned cpu = smp_processor_id(); + + if(prev != next){ + cpu_clear(cpu, prev->cpu_vm_mask); + cpu_set(cpu, next->cpu_vm_mask); + if(next != &init_mm) + __switch_mm(&next->context.id); + } +} + +static inline void enter_lazy_tlb(struct mm_struct *mm, + struct task_struct *tsk) +{ +} + +extern int init_new_context(struct task_struct *task, struct mm_struct *mm); + +extern void destroy_context(struct mm_struct *mm); + +#endif diff --git a/arch/um/include/asm/module-generic.h b/arch/um/include/asm/module-generic.h new file mode 100644 index 00000000000..5a265f56b17 --- /dev/null +++ b/arch/um/include/asm/module-generic.h @@ -0,0 +1,6 @@ +#ifndef __UM_MODULE_GENERIC_H +#define __UM_MODULE_GENERIC_H + +#include "asm/arch/module.h" + +#endif diff --git a/arch/um/include/asm/module-i386.h b/arch/um/include/asm/module-i386.h new file mode 100644 index 00000000000..5ead4a0b2e3 --- /dev/null +++ b/arch/um/include/asm/module-i386.h @@ -0,0 +1,13 @@ +#ifndef __UM_MODULE_I386_H +#define __UM_MODULE_I386_H + +/* UML is simple */ +struct mod_arch_specific +{ +}; + +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define Elf_Ehdr Elf32_Ehdr + +#endif diff --git a/arch/um/include/asm/module-x86_64.h b/arch/um/include/asm/module-x86_64.h new file mode 100644 index 00000000000..35b5491d3e9 --- /dev/null +++ b/arch/um/include/asm/module-x86_64.h @@ -0,0 +1,30 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_MODULE_X86_64_H +#define __UM_MODULE_X86_64_H + +/* UML is simple */ +struct mod_arch_specific +{ +}; + +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define Elf_Ehdr Elf64_Ehdr + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/arch/um/include/asm/msgbuf.h b/arch/um/include/asm/msgbuf.h new file mode 100644 index 00000000000..8ce8c30d537 --- /dev/null +++ b/arch/um/include/asm/msgbuf.h @@ -0,0 +1,6 @@ +#ifndef __UM_MSGBUF_H +#define __UM_MSGBUF_H + +#include "asm/arch/msgbuf.h" + +#endif diff --git a/arch/um/include/asm/mtrr.h b/arch/um/include/asm/mtrr.h new file mode 100644 index 00000000000..5e9cd12c578 --- /dev/null +++ b/arch/um/include/asm/mtrr.h @@ -0,0 +1,6 @@ +#ifndef __UM_MTRR_H +#define __UM_MTRR_H + +#include "asm/arch/mtrr.h" + +#endif diff --git a/arch/um/include/asm/mutex.h b/arch/um/include/asm/mutex.h new file mode 100644 index 00000000000..458c1f7fbc1 --- /dev/null +++ b/arch/um/include/asm/mutex.h @@ -0,0 +1,9 @@ +/* + * Pull in the gen