summaryrefslogtreecommitdiffstats
path: root/sys/ia64/ia32/ia32_signal.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-08-07 11:57:13 +0000
committerkib <kib@FreeBSD.org>2010-08-07 11:57:13 +0000
commit8e1e89f01bbc54ea8521df59192705d0c1393541 (patch)
tree1b2c02b8ea24fd18e92c7f40d0b0a4a343ef9569 /sys/ia64/ia32/ia32_signal.c
parent8043767b92a12bcc6e6e4232dc9f8691bc7d97c5 (diff)
downloadFreeBSD-src-8e1e89f01bbc54ea8521df59192705d0c1393541.zip
FreeBSD-src-8e1e89f01bbc54ea8521df59192705d0c1393541.tar.gz
Prefer struct sysentvec sv_psstrings to hardcoding FREEBSD32_PS_STRINGS
in the compat32 code. Use sv_usrstack instead of FREEBSD32_USRSTACK as well. MFC after: 1 week
Diffstat (limited to 'sys/ia64/ia32/ia32_signal.c')
-rw-r--r--sys/ia64/ia32/ia32_signal.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/ia64/ia32/ia32_signal.c b/sys/ia64/ia32/ia32_signal.c
index e5eee41..e41f0af 100644
--- a/sys/ia64/ia32/ia32_signal.c
+++ b/sys/ia64/ia32/ia32_signal.c
@@ -128,7 +128,9 @@ ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
u_int64_t codeseg, dataseg, gdtseg, ldtseg;
struct segment_descriptor desc;
struct vmspace *vmspace = td->td_proc->p_vmspace;
+ struct sysentvec *sv;
+ sv = td->td_proc->p_sysent;
exec_setregs(td, imgp, stack);
/* Non-syscall frames are cleared by exec_setregs() */
@@ -142,7 +144,7 @@ ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
tf->tf_special.sp = stack;
/* Point the RSE backstore to something harmless. */
- tf->tf_special.bspstore = (FREEBSD32_PS_STRINGS - sz_ia32_sigcode -
+ tf->tf_special.bspstore = (sv->sv_psstrings - sz_ia32_sigcode -
SPARE_USRSPACE + 15) & ~15;
codesel = LSEL(LUCODE_SEL, SEL_UPL);
@@ -157,7 +159,7 @@ ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
/*
* Build the GDT and LDT.
*/
- gdt = FREEBSD32_USRSTACK;
+ gdt = sv->sv_usrstack;
vm_map_find(&vmspace->vm_map, 0, 0, &gdt, IA32_PAGE_SIZE << 1, 0,
VM_PROT_ALL, VM_PROT_ALL, 0);
ldt = gdt + IA32_PAGE_SIZE;
@@ -173,12 +175,12 @@ ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
desc.sd_hibase = ldt >> 24;
copyout(&desc, (caddr_t) gdt + 8*GLDT_SEL, sizeof(desc));
- desc.sd_lolimit = ((FREEBSD32_USRSTACK >> 12) - 1) & 0xffff;
+ desc.sd_lolimit = ((sv->sv_usrstack >> 12) - 1) & 0xffff;
desc.sd_lobase = 0;
desc.sd_type = SDT_MEMERA;
desc.sd_dpl = SEL_UPL;
desc.sd_p = 1;
- desc.sd_hilimit = ((FREEBSD32_USRSTACK >> 12) - 1) >> 16;
+ desc.sd_hilimit = ((sv->sv_usrstack >> 12) - 1) >> 16;
desc.sd_def32 = 1;
desc.sd_gran = 1;
desc.sd_hibase = 0;
@@ -187,14 +189,14 @@ ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
copyout(&desc, (caddr_t) ldt + 8*LUDATA_SEL, sizeof(desc));
codeseg = 0 /* base */
- + (((FREEBSD32_USRSTACK >> 12) - 1) << 32) /* limit */
+ + (((sv->sv_usrstack >> 12) - 1) << 32) /* limit */
+ ((long)SDT_MEMERA << 52)
+ ((long)SEL_UPL << 57)
+ (1L << 59) /* present */
+ (1L << 62) /* 32 bits */
+ (1L << 63); /* page granularity */
dataseg = 0 /* base */
- + (((FREEBSD32_USRSTACK >> 12) - 1) << 32) /* limit */
+ + (((sv->sv_usrstack >> 12) - 1) << 32) /* limit */
+ ((long)SDT_MEMRWA << 52)
+ ((long)SEL_UPL << 57)
+ (1L << 59) /* present */
@@ -231,7 +233,7 @@ ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
ia64_set_eflag(PSL_USER);
/* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */
- tf->tf_scratch.gr11 = FREEBSD32_PS_STRINGS;
+ tf->tf_scratch.gr11 = td->td_proc->p_sysent->sv_psstrings;
/*
* XXX - Linux emulator
OpenPOWER on IntegriCloud