Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/mips/freebsd32_machdep.c
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
#include <machine/sigframe.h> | #include <machine/sigframe.h> | ||||
#include <machine/sysarch.h> | #include <machine/sysarch.h> | ||||
#include <machine/tls.h> | #include <machine/tls.h> | ||||
#include <compat/freebsd32/freebsd32_signal.h> | #include <compat/freebsd32/freebsd32_signal.h> | ||||
#include <compat/freebsd32/freebsd32_util.h> | #include <compat/freebsd32/freebsd32_util.h> | ||||
#include <compat/freebsd32/freebsd32_proto.h> | #include <compat/freebsd32/freebsd32_proto.h> | ||||
static void freebsd32_exec_setregs(struct thread *, struct image_params *, | |||||
uintptr_t); | |||||
static int get_mcontext32(struct thread *, mcontext32_t *, int); | static int get_mcontext32(struct thread *, mcontext32_t *, int); | ||||
static int set_mcontext32(struct thread *, mcontext32_t *); | static int set_mcontext32(struct thread *, mcontext32_t *); | ||||
static void freebsd32_sendsig(sig_t, ksiginfo_t *, sigset_t *); | static void freebsd32_sendsig(sig_t, ksiginfo_t *, sigset_t *); | ||||
extern const char *freebsd32_syscallnames[]; | extern const char *freebsd32_syscallnames[]; | ||||
struct sysentvec elf32_freebsd_sysvec = { | struct sysentvec elf32_freebsd_sysvec = { | ||||
.sv_size = SYS_MAXSYSCALL, | .sv_size = SYS_MAXSYSCALL, | ||||
Show All 11 Lines | struct sysentvec elf32_freebsd_sysvec = { | ||||
.sv_minsigstksz = MINSIGSTKSZ, | .sv_minsigstksz = MINSIGSTKSZ, | ||||
.sv_minuser = VM_MIN_ADDRESS, | .sv_minuser = VM_MIN_ADDRESS, | ||||
.sv_maxuser = ((vm_offset_t)0x80000000), | .sv_maxuser = ((vm_offset_t)0x80000000), | ||||
.sv_usrstack = FREEBSD32_USRSTACK, | .sv_usrstack = FREEBSD32_USRSTACK, | ||||
.sv_psstrings = FREEBSD32_PS_STRINGS, | .sv_psstrings = FREEBSD32_PS_STRINGS, | ||||
.sv_stackprot = VM_PROT_ALL, | .sv_stackprot = VM_PROT_ALL, | ||||
.sv_copyout_auxargs = __elfN(freebsd_copyout_auxargs), | .sv_copyout_auxargs = __elfN(freebsd_copyout_auxargs), | ||||
.sv_copyout_strings = freebsd32_copyout_strings, | .sv_copyout_strings = freebsd32_copyout_strings, | ||||
.sv_setregs = freebsd32_exec_setregs, | .sv_setregs = exec_setregs, | ||||
.sv_fixlimit = NULL, | .sv_fixlimit = NULL, | ||||
.sv_maxssiz = NULL, | .sv_maxssiz = NULL, | ||||
.sv_flags = SV_ABI_FREEBSD | SV_ILP32, | .sv_flags = SV_ABI_FREEBSD | SV_ILP32, | ||||
.sv_set_syscall_retval = cpu_set_syscall_retval, | .sv_set_syscall_retval = cpu_set_syscall_retval, | ||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args, | .sv_fetch_syscall_args = cpu_fetch_syscall_args, | ||||
.sv_syscallnames = freebsd32_syscallnames, | .sv_syscallnames = freebsd32_syscallnames, | ||||
.sv_schedtail = NULL, | .sv_schedtail = NULL, | ||||
.sv_thread_detach = NULL, | .sv_thread_detach = NULL, | ||||
Show All 11 Lines | static Elf32_Brandinfo freebsd_brand_info = { | ||||
.interp_newpath = "/libexec/ld-elf32.so.1", | .interp_newpath = "/libexec/ld-elf32.so.1", | ||||
.brand_note = &elf32_freebsd_brandnote, | .brand_note = &elf32_freebsd_brandnote, | ||||
.flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | ||||
}; | }; | ||||
SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, | SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, | ||||
(sysinit_cfunc_t) elf32_insert_brand_entry, | (sysinit_cfunc_t) elf32_insert_brand_entry, | ||||
&freebsd_brand_info); | &freebsd_brand_info); | ||||
static void | |||||
freebsd32_exec_setregs(struct thread *td, struct image_params *imgp, | |||||
uintptr_t stack) | |||||
{ | |||||
exec_setregs(td, imgp, stack); | |||||
/* | |||||
* See comment in exec_setregs about running 32-bit binaries with 64-bit | |||||
* registers. | |||||
*/ | |||||
td->td_frame->sp -= 65536; | |||||
/* | |||||
* Clear extended address space bit for userland. | |||||
*/ | |||||
td->td_frame->sr &= ~MIPS_SR_UX; | |||||
td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; | |||||
} | |||||
int | int | ||||
set_regs32(struct thread *td, struct reg32 *regs) | set_regs32(struct thread *td, struct reg32 *regs) | ||||
{ | { | ||||
struct reg r; | struct reg r; | ||||
unsigned i; | unsigned i; | ||||
for (i = 0; i < NUMSAVEREGS; i++) | for (i = 0; i < NUMSAVEREGS; i++) | ||||
▲ Show 20 Lines • Show All 342 Lines • Show Last 20 Lines |