From owner-svn-src-stable-9@FreeBSD.ORG Sat Sep 22 12:34:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD1C11065674; Sat, 22 Sep 2012 12:34:02 +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 97A8A8FC08; Sat, 22 Sep 2012 12:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCY2Um066707; Sat, 22 Sep 2012 12:34:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCY2qT066703; Sat, 22 Sep 2012 12:34:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221234.q8MCY2qT066703@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240816 - in stable/9/sys/i386: i386 include X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:34:02 -0000 Author: kib Date: Sat Sep 22 12:34:02 2012 New Revision: 240816 URL: http://svn.freebsd.org/changeset/base/240816 Log: MFC r237435: Enable shared page on i386, now it has a use for vdso_timehands. MFC r237445: Commit changes missed from r237435. Properly calculate the signal trampoline addresses after the shared page is enabled. Handle FreeBSD ABIs without shared page support too. Modified: stable/9/sys/i386/i386/elf_machdep.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/vmparam.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/9/sys/i386/i386/elf_machdep.c Sat Sep 22 12:32:00 2012 (r240815) +++ stable/9/sys/i386/i386/elf_machdep.c Sat Sep 22 12:34:02 2012 (r240816) @@ -74,12 +74,15 @@ struct sysentvec elf32_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32, + .sv_flags = SV_ABI_FREEBSD | SV_IA32 | SV_ILP32 | 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, .sv_schedtail = NULL, }; +INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); static Elf32_Brandinfo freebsd_brand_info = { .brand = ELFOSABI_FREEBSD, Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Sat Sep 22 12:32:00 2012 (r240815) +++ stable/9/sys/i386/i386/machdep.c Sat Sep 22 12:34:02 2012 (r240816) @@ -472,7 +472,13 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)fp; - regs->tf_eip = PS_STRINGS - szosigcode; + if (p->p_sysent->sv_sigcode_base != 0) { + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szosigcode; + } else { + /* a.out sysentvec does not use shared page */ + regs->tf_eip = p->p_sysent->sv_psstrings - szosigcode; + } regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -599,7 +605,8 @@ freebsd4_sendsig(sig_t catcher, ksiginfo } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode; + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szfreebsd4_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -750,7 +757,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eip = p->p_sysent->sv_sigcode_base; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; Modified: stable/9/sys/i386/include/vmparam.h ============================================================================== --- stable/9/sys/i386/include/vmparam.h Sat Sep 22 12:32:00 2012 (r240815) +++ stable/9/sys/i386/include/vmparam.h Sat Sep 22 12:34:02 2012 (r240816) @@ -165,7 +165,8 @@ #define VM_MAXUSER_ADDRESS VADDR(PTDPTDI, 0) -#define USRSTACK VM_MAXUSER_ADDRESS +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) +#define USRSTACK SHAREDPAGE #define VM_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) #define VM_MIN_ADDRESS ((vm_offset_t)0)