Author: kib Date: Fri Jan 14 11:36:44 2011 New Revision: 217400 URL: http://svn.freebsd.org/changeset/base/217400
Log: Enable shared page for the signal trampolines on PowerPC. Reviewed and tested by: nwhitehorn Modified: head/sys/powerpc/include/vmparam.h head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Fri Jan 14 11:34:58 2011 (r217399) +++ head/sys/powerpc/include/vmparam.h Fri Jan 14 11:36:44 2011 (r217400) @@ -35,7 +35,7 @@ #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ -#define USRSTACK VM_MAXUSER_ADDRESS +#define USRSTACK SHAREDPAGE #ifndef MAXTSIZ #define MAXTSIZ (64*1024*1024) /* max text size */ @@ -64,10 +64,12 @@ #ifdef __powerpc64__ #define VM_MIN_ADDRESS (0x0000000000000000UL) #define VM_MAXUSER_ADDRESS (0x7ffffffffffff000UL) +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) #define VM_MAX_ADDRESS (0xffffffffffffffffUL) #else #define VM_MIN_ADDRESS ((vm_offset_t)0) #define VM_MAXUSER_ADDRESS ((vm_offset_t)0x7ffff000) +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS #endif #else /* LOCORE */ @@ -77,8 +79,8 @@ #endif #endif /* LOCORE */ -#define FREEBSD32_USRSTACK 0x7ffff000 - +#define FREEBSD32_SHAREDPAGE (0x7ffff000 - PAGE_SIZE) +#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE #ifdef AIM #define KERNBASE 0x00100000UL /* start of kernel virtual */ Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Fri Jan 14 11:34:58 2011 (r217399) +++ head/sys/powerpc/powerpc/elf32_machdep.c Fri Jan 14 11:36:44 2011 (r217400) @@ -101,10 +101,13 @@ struct sysentvec elf32_freebsd_sysvec = #endif .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_ILP32, + .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, + .sv_shared_page_base = FREEBSD32_SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, }; +INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); static Elf32_Brandinfo freebsd_brand_info = { .brand = ELFOSABI_FREEBSD, Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Fri Jan 14 11:34:58 2011 (r217399) +++ head/sys/powerpc/powerpc/elf64_machdep.c Fri Jan 14 11:36:44 2011 (r217400) @@ -76,11 +76,14 @@ struct sysentvec elf64_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64, + .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, }; +INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); static Elf64_Brandinfo freebsd_brand_info = { .brand = ELFOSABI_FREEBSD, @@ -114,7 +117,6 @@ SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_AN (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_oinfo); - void elf64_dump_thread(struct thread *td __unused, void *dst __unused, size_t *off __unused) Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Fri Jan 14 11:34:58 2011 (r217399) +++ head/sys/powerpc/powerpc/exec_machdep.c Fri Jan 14 11:36:44 2011 (r217400) @@ -290,8 +290,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); - tf->srr0 = (register_t)(p->p_sysent->sv_psstrings - - *(p->p_sysent->sv_szsigcode)); + tf->srr0 = (register_t)p->p_sysent->sv_sigcode_base; /* * copy the frame out to userland. _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"