1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Enable shared page for the signal trampolines on PowerPC.

Reviewed and tested by:	nwhitehorn
This commit is contained in:
Konstantin Belousov 2011-01-14 11:36:44 +00:00
parent 33e6b543c7
commit 640c77e126
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217400
4 changed files with 14 additions and 8 deletions

View File

@ -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 */

View File

@ -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,

View File

@ -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_ANY,
(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)

View File

@ -290,8 +290,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
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.