diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-08-23 23:28:20 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-10-23 07:55:22 +0200 |
commit | aa7bd942498512d6b77d1d0da846a8ecdd5d6186 (patch) | |
tree | 9a420b59a1e862ea47a4c5f89601ffbdf3366922 /arch/um/sys-x86_64 | |
parent | x86, um: merge Kconfig.i386 and Kconfig.x86_64 (diff) | |
download | linux-aa7bd942498512d6b77d1d0da846a8ecdd5d6186.tar.xz linux-aa7bd942498512d6b77d1d0da846a8ecdd5d6186.zip |
x86, um: get rid of header symlinks
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/um/sys-x86_64')
-rw-r--r-- | arch/um/sys-x86_64/asm/archparam.h | 26 | ||||
-rw-r--r-- | arch/um/sys-x86_64/asm/elf.h | 119 | ||||
-rw-r--r-- | arch/um/sys-x86_64/asm/module.h | 30 | ||||
-rw-r--r-- | arch/um/sys-x86_64/asm/processor.h | 56 | ||||
-rw-r--r-- | arch/um/sys-x86_64/asm/ptrace.h | 72 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/archsetjmp.h (renamed from arch/um/sys-x86_64/sysdep/archsetjmp.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/barrier.h (renamed from arch/um/sys-x86_64/sysdep/barrier.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/checksum.h (renamed from arch/um/sys-x86_64/sysdep/checksum.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/faultinfo.h (renamed from arch/um/sys-x86_64/sysdep/faultinfo.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/host_ldt.h (renamed from arch/um/sys-x86_64/sysdep/host_ldt.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/kernel-offsets.h (renamed from arch/um/sys-x86_64/sysdep/kernel-offsets.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/ptrace.h (renamed from arch/um/sys-x86_64/sysdep/ptrace.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/ptrace_user.h (renamed from arch/um/sys-x86_64/sysdep/ptrace_user.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/sc.h (renamed from arch/um/sys-x86_64/sysdep/sc.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/sigcontext.h (renamed from arch/um/sys-x86_64/sysdep/sigcontext.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/skas_ptrace.h (renamed from arch/um/sys-x86_64/sysdep/skas_ptrace.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/stub.h (renamed from arch/um/sys-x86_64/sysdep/stub.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/syscalls.h (renamed from arch/um/sys-x86_64/sysdep/syscalls.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/system.h (renamed from arch/um/sys-x86_64/sysdep/system.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/tls.h (renamed from arch/um/sys-x86_64/sysdep/tls.h) | 0 | ||||
-rw-r--r-- | arch/um/sys-x86_64/shared/sysdep/vm-flags.h (renamed from arch/um/sys-x86_64/sysdep/vm-flags.h) | 0 |
21 files changed, 303 insertions, 0 deletions
diff --git a/arch/um/sys-x86_64/asm/archparam.h b/arch/um/sys-x86_64/asm/archparam.h new file mode 100644 index 000000000000..270ed9586b68 --- /dev/null +++ b/arch/um/sys-x86_64/asm/archparam.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/sys-x86_64/asm/elf.h b/arch/um/sys-x86_64/asm/elf.h new file mode 100644 index 000000000000..6e8a9195e952 --- /dev/null +++ b/arch/um/sys-x86_64/asm/elf.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 <asm/user.h> +#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/sys-x86_64/asm/module.h b/arch/um/sys-x86_64/asm/module.h new file mode 100644 index 000000000000..35b5491d3e96 --- /dev/null +++ b/arch/um/sys-x86_64/asm/module.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/sys-x86_64/asm/processor.h b/arch/um/sys-x86_64/asm/processor.h new file mode 100644 index 000000000000..875a26a62614 --- /dev/null +++ b/arch/um/sys-x86_64/asm/processor.h @@ -0,0 +1,56 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_PROCESSOR_X86_64_H +#define __UM_PROCESSOR_X86_64_H + +/* include faultinfo structure */ +#include "sysdep/faultinfo.h" + +struct arch_thread { + unsigned long debugregs[8]; + int debugregs_seq; + unsigned long fs; + struct faultinfo faultinfo; +}; + +/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ +static inline void rep_nop(void) +{ + __asm__ __volatile__("rep;nop": : :"memory"); +} + +#define cpu_relax() rep_nop() + +#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ + .debugregs_seq = 0, \ + .fs = 0, \ + .faultinfo = { 0, 0, 0 } } + +static inline void arch_flush_thread(struct arch_thread *thread) +{ +} + +static inline void arch_copy_thread(struct arch_thread *from, + struct arch_thread *to) +{ + to->fs = from->fs; +} + +#include <asm/user.h> + +#define current_text_addr() \ + ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) + +#define ARCH_IS_STACKGROW(address) \ + (address + 128 >= UPT_SP(¤t->thread.regs.regs)) + +#define KSTK_EIP(tsk) KSTK_REG(tsk, RIP) +#define KSTK_ESP(tsk) KSTK_REG(tsk, RSP) + +#include "asm/processor-generic.h" + +#endif diff --git a/arch/um/sys-x86_64/asm/ptrace.h b/arch/um/sys-x86_64/asm/ptrace.h new file mode 100644 index 000000000000..83d8c473b905 --- /dev/null +++ b/arch/um/sys-x86_64/asm/ptrace.h @@ -0,0 +1,72 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_PTRACE_X86_64_H +#define __UM_PTRACE_X86_64_H + +#include "linux/compiler.h" +#include "asm/errno.h" + +#define __FRAME_OFFSETS /* Needed to get the R* macros */ +#include "asm/ptrace-generic.h" + +#define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64 + +#define PT_REGS_RBX(r) UPT_RBX(&(r)->regs) +#define PT_REGS_RCX(r) UPT_RCX(&(r)->regs) +#define PT_REGS_RDX(r) UPT_RDX(&(r)->regs) +#define PT_REGS_RSI(r) UPT_RSI(&(r)->regs) +#define PT_REGS_RDI(r) UPT_RDI(&(r)->regs) +#define PT_REGS_RBP(r) UPT_RBP(&(r)->regs) +#define PT_REGS_RAX(r) UPT_RAX(&(r)->regs) +#define PT_REGS_R8(r) UPT_R8(&(r)->regs) +#define PT_REGS_R9(r) UPT_R9(&(r)->regs) +#define PT_REGS_R10(r) UPT_R10(&(r)->regs) +#define PT_REGS_R11(r) UPT_R11(&(r)->regs) +#define PT_REGS_R12(r) UPT_R12(&(r)->regs) +#define PT_REGS_R13(r) UPT_R13(&(r)->regs) +#define PT_REGS_R14(r) UPT_R14(&(r)->regs) +#define PT_REGS_R15(r) UPT_R15(&(r)->regs) + +#define PT_REGS_FS(r) UPT_FS(&(r)->regs) +#define PT_REGS_GS(r) UPT_GS(&(r)->regs) +#define PT_REGS_DS(r) UPT_DS(&(r)->regs) +#define PT_REGS_ES(r) UPT_ES(&(r)->regs) +#define PT_REGS_SS(r) UPT_SS(&(r)->regs) +#define PT_REGS_CS(r) UPT_CS(&(r)->regs) + +#define PT_REGS_ORIG_RAX(r) UPT_ORIG_RAX(&(r)->regs) +#define PT_REGS_RIP(r) UPT_IP(&(r)->regs) +#define PT_REGS_RSP(r) UPT_SP(&(r)->regs) + +#define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs) + +/* XXX */ +#define user_mode(r) UPT_IS_USER(&(r)->regs) +#define PT_REGS_ORIG_SYSCALL(r) PT_REGS_RAX(r) +#define PT_REGS_SYSCALL_RET(r) PT_REGS_RAX(r) + +#define PT_FIX_EXEC_STACK(sp) do ; while(0) + +#define profile_pc(regs) PT_REGS_IP(regs) + +struct user_desc; + +static inline int ptrace_get_thread_area(struct task_struct *child, int idx, + struct user_desc __user *user_desc) +{ + return -ENOSYS; +} + +static inline int ptrace_set_thread_area(struct task_struct *child, int idx, + struct user_desc __user *user_desc) +{ + return -ENOSYS; +} + +extern long arch_prctl(struct task_struct *task, int code, + unsigned long __user *addr); +#endif diff --git a/arch/um/sys-x86_64/sysdep/archsetjmp.h b/arch/um/sys-x86_64/shared/sysdep/archsetjmp.h index 2af8f12ca161..2af8f12ca161 100644 --- a/arch/um/sys-x86_64/sysdep/archsetjmp.h +++ b/arch/um/sys-x86_64/shared/sysdep/archsetjmp.h diff --git a/arch/um/sys-x86_64/sysdep/barrier.h b/arch/um/sys-x86_64/shared/sysdep/barrier.h index 7b610befdc8f..7b610befdc8f 100644 --- a/arch/um/sys-x86_64/sysdep/barrier.h +++ b/arch/um/sys-x86_64/shared/sysdep/barrier.h diff --git a/arch/um/sys-x86_64/sysdep/checksum.h b/arch/um/sys-x86_64/shared/sysdep/checksum.h index a5be9031ea85..a5be9031ea85 100644 --- a/arch/um/sys-x86_64/sysdep/checksum.h +++ b/arch/um/sys-x86_64/shared/sysdep/checksum.h diff --git a/arch/um/sys-x86_64/sysdep/faultinfo.h b/arch/um/sys-x86_64/shared/sysdep/faultinfo.h index cb917b0d5660..cb917b0d5660 100644 --- a/arch/um/sys-x86_64/sysdep/faultinfo.h +++ b/arch/um/sys-x86_64/shared/sysdep/faultinfo.h diff --git a/arch/um/sys-x86_64/sysdep/host_ldt.h b/arch/um/sys-x86_64/shared/sysdep/host_ldt.h index e8b1be1e154f..e8b1be1e154f 100644 --- a/arch/um/sys-x86_64/sysdep/host_ldt.h +++ b/arch/um/sys-x86_64/shared/sysdep/host_ldt.h diff --git a/arch/um/sys-x86_64/sysdep/kernel-offsets.h b/arch/um/sys-x86_64/shared/sysdep/kernel-offsets.h index a307237b7964..a307237b7964 100644 --- a/arch/um/sys-x86_64/sysdep/kernel-offsets.h +++ b/arch/um/sys-x86_64/shared/sysdep/kernel-offsets.h diff --git a/arch/um/sys-x86_64/sysdep/ptrace.h b/arch/um/sys-x86_64/shared/sysdep/ptrace.h index 9ea44d111f33..9ea44d111f33 100644 --- a/arch/um/sys-x86_64/sysdep/ptrace.h +++ b/arch/um/sys-x86_64/shared/sysdep/ptrace.h diff --git a/arch/um/sys-x86_64/sysdep/ptrace_user.h b/arch/um/sys-x86_64/shared/sysdep/ptrace_user.h index 4dbccdb58f48..4dbccdb58f48 100644 --- a/arch/um/sys-x86_64/sysdep/ptrace_user.h +++ b/arch/um/sys-x86_64/shared/sysdep/ptrace_user.h diff --git a/arch/um/sys-x86_64/sysdep/sc.h b/arch/um/sys-x86_64/shared/sysdep/sc.h index 8aee45b07434..8aee45b07434 100644 --- a/arch/um/sys-x86_64/sysdep/sc.h +++ b/arch/um/sys-x86_64/shared/sysdep/sc.h diff --git a/arch/um/sys-x86_64/sysdep/sigcontext.h b/arch/um/sys-x86_64/shared/sysdep/sigcontext.h index 0155133b1458..0155133b1458 100644 --- a/arch/um/sys-x86_64/sysdep/sigcontext.h +++ b/arch/um/sys-x86_64/shared/sysdep/sigcontext.h diff --git a/arch/um/sys-x86_64/sysdep/skas_ptrace.h b/arch/um/sys-x86_64/shared/sysdep/skas_ptrace.h index 95db4be786e4..95db4be786e4 100644 --- a/arch/um/sys-x86_64/sysdep/skas_ptrace.h +++ b/arch/um/sys-x86_64/shared/sysdep/skas_ptrace.h diff --git a/arch/um/sys-x86_64/sysdep/stub.h b/arch/um/sys-x86_64/shared/sysdep/stub.h index 655f9c2de3ac..655f9c2de3ac 100644 --- a/arch/um/sys-x86_64/sysdep/stub.h +++ b/arch/um/sys-x86_64/shared/sysdep/stub.h diff --git a/arch/um/sys-x86_64/sysdep/syscalls.h b/arch/um/sys-x86_64/shared/sysdep/syscalls.h index 7cfb0b085655..7cfb0b085655 100644 --- a/arch/um/sys-x86_64/sysdep/syscalls.h +++ b/arch/um/sys-x86_64/shared/sysdep/syscalls.h diff --git a/arch/um/sys-x86_64/sysdep/system.h b/arch/um/sys-x86_64/shared/sysdep/system.h index d1b93c436200..d1b93c436200 100644 --- a/arch/um/sys-x86_64/sysdep/system.h +++ b/arch/um/sys-x86_64/shared/sysdep/system.h diff --git a/arch/um/sys-x86_64/sysdep/tls.h b/arch/um/sys-x86_64/shared/sysdep/tls.h index 18c000d0357a..18c000d0357a 100644 --- a/arch/um/sys-x86_64/sysdep/tls.h +++ b/arch/um/sys-x86_64/shared/sysdep/tls.h diff --git a/arch/um/sys-x86_64/sysdep/vm-flags.h b/arch/um/sys-x86_64/shared/sysdep/vm-flags.h index 3213edfa7888..3213edfa7888 100644 --- a/arch/um/sys-x86_64/sysdep/vm-flags.h +++ b/arch/um/sys-x86_64/shared/sysdep/vm-flags.h |