Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/linux32/linux32_machdep.c
Show First 20 Lines • Show All 388 Lines • ▼ Show 20 Lines | linux_old_select(struct thread *td, struct linux_old_select_args *args) | ||||
newsel.exceptfds = PTRIN(linux_args.exceptfds); | newsel.exceptfds = PTRIN(linux_args.exceptfds); | ||||
newsel.timeout = PTRIN(linux_args.timeout); | newsel.timeout = PTRIN(linux_args.timeout); | ||||
return (linux_select(td, &newsel)); | return (linux_select(td, &newsel)); | ||||
} | } | ||||
int | int | ||||
linux_set_cloned_tls(struct thread *td, void *desc) | linux_set_cloned_tls(struct thread *td, void *desc) | ||||
{ | { | ||||
struct user_segment_descriptor sd; | |||||
struct l_user_desc info; | struct l_user_desc info; | ||||
struct pcb *pcb; | struct pcb *pcb; | ||||
int error; | int error; | ||||
int a[2]; | |||||
error = copyin(desc, &info, sizeof(struct l_user_desc)); | error = copyin(desc, &info, sizeof(struct l_user_desc)); | ||||
if (error) { | if (error) { | ||||
linux_msg(td, "set_cloned_tls copyin info failed!"); | linux_msg(td, "set_cloned_tls copyin info failed!"); | ||||
} else { | } else { | ||||
/* We might copy out the entry_number as GUGS32_SEL. */ | /* We might copy out the entry_number as GUGS32_SEL. */ | ||||
info.entry_number = GUGS32_SEL; | info.entry_number = GUGS32_SEL; | ||||
error = copyout(&info, desc, sizeof(struct l_user_desc)); | error = copyout(&info, desc, sizeof(struct l_user_desc)); | ||||
if (error) | if (error) | ||||
linux_msg(td, "set_cloned_tls copyout info failed!"); | linux_msg(td, "set_cloned_tls copyout info failed!"); | ||||
a[0] = LINUX_LDT_entry_a(&info); | |||||
a[1] = LINUX_LDT_entry_b(&info); | |||||
memcpy(&sd, &a, sizeof(a)); | |||||
pcb = td->td_pcb; | pcb = td->td_pcb; | ||||
update_pcb_bases(pcb); | |||||
pcb->pcb_gsbase = (register_t)info.base_addr; | pcb->pcb_gsbase = (register_t)info.base_addr; | ||||
td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL); | td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL); | ||||
set_pcb_flags(pcb, PCB_32BIT); | |||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
int | int | ||||
linux_set_upcall_kse(struct thread *td, register_t stack) | linux_set_upcall_kse(struct thread *td, register_t stack) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | linux_getrusage(struct thread *td, struct linux_getrusage_args *uap) | ||||
return (error); | return (error); | ||||
} | } | ||||
int | int | ||||
linux_set_thread_area(struct thread *td, | linux_set_thread_area(struct thread *td, | ||||
struct linux_set_thread_area_args *args) | struct linux_set_thread_area_args *args) | ||||
{ | { | ||||
struct l_user_desc info; | struct l_user_desc info; | ||||
struct user_segment_descriptor sd; | |||||
struct pcb *pcb; | struct pcb *pcb; | ||||
int a[2]; | |||||
int error; | int error; | ||||
error = copyin(args->desc, &info, sizeof(struct l_user_desc)); | error = copyin(args->desc, &info, sizeof(struct l_user_desc)); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
/* | /* | ||||
* Semantics of Linux version: every thread in the system has array | * Semantics of Linux version: every thread in the system has array | ||||
Show All 34 Lines | linux_set_thread_area(struct thread *td, | ||||
* | * | ||||
* XXX: What if a user space program does not check the return value | * XXX: What if a user space program does not check the return value | ||||
* and tries to use 6, 7 or 8? | * and tries to use 6, 7 or 8? | ||||
*/ | */ | ||||
error = copyout(&info, args->desc, sizeof(struct l_user_desc)); | error = copyout(&info, args->desc, sizeof(struct l_user_desc)); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
if (LINUX_LDT_empty(&info)) { | |||||
a[0] = 0; | |||||
a[1] = 0; | |||||
} else { | |||||
a[0] = LINUX_LDT_entry_a(&info); | |||||
a[1] = LINUX_LDT_entry_b(&info); | |||||
} | |||||
memcpy(&sd, &a, sizeof(a)); | |||||
pcb = td->td_pcb; | pcb = td->td_pcb; | ||||
update_pcb_bases(pcb); | |||||
pcb->pcb_gsbase = (register_t)info.base_addr; | pcb->pcb_gsbase = (register_t)info.base_addr; | ||||
set_pcb_flags(pcb, PCB_32BIT); | |||||
update_gdt_gsbase(td, info.base_addr); | update_gdt_gsbase(td, info.base_addr); | ||||
return (0); | return (0); | ||||
} | } | ||||
int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); | int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); | ||||
int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); | int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); | ||||
DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *)) | DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *)) | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |