X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-um%2Farchparam-i386.h;h=5b5df118d9a5ff73dabb8f0baaf3eed6e4dd327a;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=85fd03358521128f7467aa83540f6f5d25a39971;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/include/asm-um/archparam-i386.h b/include/asm-um/archparam-i386.h index 85fd03358..5b5df118d 100644 --- a/include/asm-um/archparam-i386.h +++ b/include/asm-um/archparam-i386.h @@ -10,7 +10,8 @@ #include "user.h" -#define ELF_PLATFORM "i586" +extern char * elf_aux_platform; +#define ELF_PLATFORM (elf_aux_platform) #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) @@ -56,15 +57,20 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; pr_reg[16] = PT_REGS_SS(regs); \ } while(0); -#if 0 /* Turn this back on when UML has VSYSCALL working */ -#define VSYSCALL_BASE (__fix_to_virt(FIX_VSYSCALL)) -#else -#define VSYSCALL_BASE 0 -#endif -#define VSYSCALL_EHDR ((const struct elfhdr *) VSYSCALL_BASE) -#define VSYSCALL_ENTRY ((unsigned long) &__kernel_vsyscall) -extern void *__kernel_vsyscall; +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 @@ -75,8 +81,10 @@ extern void *__kernel_vsyscall; #define ARCH_DLINFO \ do { \ - NEW_AUX_ENT(AT_SYSINFO, VSYSCALL_ENTRY); \ - NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE); \ + if ( vsyscall_ehdr ) { \ + NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \ + NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \ + } \ } while (0) /* @@ -87,22 +95,18 @@ do { \ * Dumping its extra ELF program headers includes all the other information * a debugger needs to easily find how the vsyscall DSO was being used. */ -#if 0 -#define ELF_CORE_EXTRA_PHDRS (VSYSCALL_EHDR->e_phnum) -#endif - -#undef ELF_CORE_EXTRA_PHDRS +#define ELF_CORE_EXTRA_PHDRS \ + (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 ) -#if 0 #define ELF_CORE_WRITE_EXTRA_PHDRS \ -do { \ - const struct elf_phdr *const vsyscall_phdrs = \ - (const struct elf_phdr *) (VSYSCALL_BASE \ - + VSYSCALL_EHDR->e_phoff); \ +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 < VSYSCALL_EHDR->e_phnum; ++i) { \ - struct elf_phdr phdr = vsyscall_phdrs[i]; \ + 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; \ @@ -112,23 +116,19 @@ do { \ phdr.p_paddr = 0; /* match other core phdrs */ \ DUMP_WRITE(&phdr, sizeof(phdr)); \ } \ -} while (0) +} #define ELF_CORE_WRITE_EXTRA_DATA \ -do { \ - const struct elf_phdr *const vsyscall_phdrs = \ - (const struct elf_phdr *) (VSYSCALL_BASE \ - + VSYSCALL_EHDR->e_phoff); \ +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 < VSYSCALL_EHDR->e_phnum; ++i) { \ - if (vsyscall_phdrs[i].p_type == PT_LOAD) \ - DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ - vsyscall_phdrs[i].p_filesz); \ + 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); \ } \ -} while (0) -#endif - -#undef ELF_CORE_WRITE_EXTRA_PHDRS -#undef ELF_CORE_WRITE_EXTRA_DATA +} #define R_386_NONE 0 #define R_386_32 1 @@ -143,10 +143,6 @@ do { \ #define R_386_GOTPC 10 #define R_386_NUM 11 -/********* Bits for asm-um/delay.h **********/ - -typedef unsigned long um_udelay_t; - /********* Nothing for asm-um/hardirq.h **********/ /********* Nothing for asm-um/hw_irq.h **********/