Deleted Added
full compact
linux32_machdep.c (210501) linux32_machdep.c (216634)
1/*-
2 * Copyright (c) 2004 Tim J. Robbins
3 * Copyright (c) 2002 Doug Rabson
4 * Copyright (c) 2000 Marcel Moolenaar
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004 Tim J. Robbins
3 * Copyright (c) 2002 Doug Rabson
4 * Copyright (c) 2000 Marcel Moolenaar
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_machdep.c 210501 2010-07-26 14:38:51Z kib $");
32__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_machdep.c 216634 2010-12-22 00:18:42Z jkim $");
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>
37#include <sys/file.h>
38#include <sys/fcntl.h>
39#include <sys/clock.h>
40#include <sys/imgact.h>

--- 544 unchanged lines hidden (view full) ---

585 * intact.
586 */
587 if (args->stack)
588 td2->td_frame->tf_rsp = PTROUT(args->stack);
589
590 if (args->flags & LINUX_CLONE_SETTLS) {
591 struct user_segment_descriptor sd;
592 struct l_user_desc info;
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>
37#include <sys/file.h>
38#include <sys/fcntl.h>
39#include <sys/clock.h>
40#include <sys/imgact.h>

--- 544 unchanged lines hidden (view full) ---

585 * intact.
586 */
587 if (args->stack)
588 td2->td_frame->tf_rsp = PTROUT(args->stack);
589
590 if (args->flags & LINUX_CLONE_SETTLS) {
591 struct user_segment_descriptor sd;
592 struct l_user_desc info;
593 struct pcb *pcb;
593 int a[2];
594
595 error = copyin((void *)td->td_frame->tf_rsi, &info,
596 sizeof(struct l_user_desc));
597 if (error) {
598 printf(LMSG("copyin failed!"));
599 } else {
600 /* We might copy out the entry_number as GUGS32_SEL. */

--- 13 unchanged lines hidden (view full) ---

614 "CLONE_SETTLS: lobase: %x, hibase: %x, "
615 "lolimit: %x, hilimit: %x, type: %i, "
616 "dpl: %i, p: %i, xx: %i, long: %i, "
617 "def32: %i, gran: %i\n", sd.sd_lobase,
618 sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit,
619 sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
620 sd.sd_long, sd.sd_def32, sd.sd_gran);
621#endif
594 int a[2];
595
596 error = copyin((void *)td->td_frame->tf_rsi, &info,
597 sizeof(struct l_user_desc));
598 if (error) {
599 printf(LMSG("copyin failed!"));
600 } else {
601 /* We might copy out the entry_number as GUGS32_SEL. */

--- 13 unchanged lines hidden (view full) ---

615 "CLONE_SETTLS: lobase: %x, hibase: %x, "
616 "lolimit: %x, hilimit: %x, type: %i, "
617 "dpl: %i, p: %i, xx: %i, long: %i, "
618 "def32: %i, gran: %i\n", sd.sd_lobase,
619 sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit,
620 sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
621 sd.sd_long, sd.sd_def32, sd.sd_gran);
622#endif
622 td2->td_pcb->pcb_gsbase = (register_t)info.base_addr;
623/* XXXKIB td2->td_pcb->pcb_gs32sd = sd; */
623 pcb = td2->td_pcb;
624 pcb->pcb_gsbase = (register_t)info.base_addr;
625/* XXXKIB pcb->pcb_gs32sd = sd; */
624 td2->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
626 td2->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
625 td2->td_pcb->pcb_flags |= PCB_GS32BIT | PCB_32BIT;
627 set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT);
626 }
627 }
628
629#ifdef DEBUG
630 if (ldebug(clone))
631 printf(LMSG("clone: successful rfork to %d, "
632 "stack %p sig = %d"), (int)p2->p_pid, args->stack,
633 exit_signal);

--- 530 unchanged lines hidden (view full) ---

1164}
1165
1166int
1167linux_set_thread_area(struct thread *td,
1168 struct linux_set_thread_area_args *args)
1169{
1170 struct l_user_desc info;
1171 struct user_segment_descriptor sd;
628 }
629 }
630
631#ifdef DEBUG
632 if (ldebug(clone))
633 printf(LMSG("clone: successful rfork to %d, "
634 "stack %p sig = %d"), (int)p2->p_pid, args->stack,
635 exit_signal);

--- 530 unchanged lines hidden (view full) ---

1166}
1167
1168int
1169linux_set_thread_area(struct thread *td,
1170 struct linux_set_thread_area_args *args)
1171{
1172 struct l_user_desc info;
1173 struct user_segment_descriptor sd;
1174 struct pcb *pcb;
1172 int a[2];
1173 int error;
1174
1175 error = copyin(args->desc, &info, sizeof(struct l_user_desc));
1176 if (error)
1177 return (error);
1178
1179#ifdef DEBUG

--- 72 unchanged lines hidden (view full) ---

1252 sd.sd_dpl,
1253 sd.sd_p,
1254 sd.sd_xx,
1255 sd.sd_long,
1256 sd.sd_def32,
1257 sd.sd_gran);
1258#endif
1259
1175 int a[2];
1176 int error;
1177
1178 error = copyin(args->desc, &info, sizeof(struct l_user_desc));
1179 if (error)
1180 return (error);
1181
1182#ifdef DEBUG

--- 72 unchanged lines hidden (view full) ---

1255 sd.sd_dpl,
1256 sd.sd_p,
1257 sd.sd_xx,
1258 sd.sd_long,
1259 sd.sd_def32,
1260 sd.sd_gran);
1261#endif
1262
1260 td->td_pcb->pcb_gsbase = (register_t)info.base_addr;
1261 td->td_pcb->pcb_flags |= PCB_32BIT | PCB_GS32BIT;
1263 pcb = td->td_pcb;
1264 pcb->pcb_gsbase = (register_t)info.base_addr;
1265 set_pcb_flags(pcb, PCB_32BIT | PCB_GS32BIT);
1262 update_gdt_gsbase(td, info.base_addr);
1263
1264 return (0);
1265}
1266 update_gdt_gsbase(td, info.base_addr);
1267
1268 return (0);
1269}