From owner-svn-src-head@FreeBSD.ORG Fri Jan 14 11:36:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 614A1106564A; Fri, 14 Jan 2011 11:36:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 502B48FC0A; Fri, 14 Jan 2011 11:36:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EBaicm086704; Fri, 14 Jan 2011 11:36:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EBai6a086699; Fri, 14 Jan 2011 11:36:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101141136.p0EBai6a086699@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 14 Jan 2011 11:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217400 - in head/sys/powerpc: include powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 11:36:44 -0000 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.