Deleted Added
full compact
linux_sysvec.c (102808) linux_sysvec.c (102814)
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/i386/linux/linux_sysvec.c 102808 2002-09-01 21:41:24Z jake $
28 * $FreeBSD: head/sys/i386/linux/linux_sysvec.c 102814 2002-09-01 22:30:27Z iedowse $
29 */
30
31/* XXX we use functions that might not exist. */
32#include "opt_compat.h"
33
34#ifndef COMPAT_43
35#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!"
36#endif
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/imgact.h>
41#include <sys/imgact_aout.h>
42#include <sys/imgact_elf.h>
43#include <sys/lock.h>
44#include <sys/malloc.h>
45#include <sys/mutex.h>
46#include <sys/proc.h>
47#include <sys/signalvar.h>
29 */
30
31/* XXX we use functions that might not exist. */
32#include "opt_compat.h"
33
34#ifndef COMPAT_43
35#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!"
36#endif
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/imgact.h>
41#include <sys/imgact_aout.h>
42#include <sys/imgact_elf.h>
43#include <sys/lock.h>
44#include <sys/malloc.h>
45#include <sys/mutex.h>
46#include <sys/proc.h>
47#include <sys/signalvar.h>
48#include <sys/syscallsubr.h>
48#include <sys/sysent.h>
49#include <sys/sysproto.h>
50
51#include <vm/vm.h>
52#include <vm/vm_param.h>
53#include <vm/vm_page.h>
54#include <vm/vm_extern.h>
55#include <sys/exec.h>

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

592 * a machine fault.
593 */
594int
595linux_rt_sigreturn(td, args)
596 struct thread *td;
597 struct linux_rt_sigreturn_args *args;
598{
599 struct proc *p = td->td_proc;
49#include <sys/sysent.h>
50#include <sys/sysproto.h>
51
52#include <vm/vm.h>
53#include <vm/vm_param.h>
54#include <vm/vm_page.h>
55#include <vm/vm_extern.h>
56#include <sys/exec.h>

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

593 * a machine fault.
594 */
595int
596linux_rt_sigreturn(td, args)
597 struct thread *td;
598 struct linux_rt_sigreturn_args *args;
599{
600 struct proc *p = td->td_proc;
600 struct sigaltstack_args sasargs;
601 struct l_ucontext uc;
602 struct l_sigcontext *context;
603 l_stack_t *lss;
601 struct l_ucontext uc;
602 struct l_sigcontext *context;
603 l_stack_t *lss;
604 stack_t *ss;
604 stack_t ss;
605 register struct trapframe *regs;
606 int eflags;
605 register struct trapframe *regs;
606 int eflags;
607 caddr_t sg = stackgap_init();
608
609 regs = td->td_frame;
610
611#ifdef DEBUG
612 if (ldebug(rt_sigreturn))
613 printf(ARGS(rt_sigreturn, "%p"), (void *)args->ucp);
614#endif
615 /*

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

676 regs->tf_cs = context->sc_cs;
677 regs->tf_eflags = eflags;
678 regs->tf_esp = context->sc_esp_at_signal;
679 regs->tf_ss = context->sc_ss;
680
681 /*
682 * call sigaltstack & ignore results..
683 */
607
608 regs = td->td_frame;
609
610#ifdef DEBUG
611 if (ldebug(rt_sigreturn))
612 printf(ARGS(rt_sigreturn, "%p"), (void *)args->ucp);
613#endif
614 /*

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

675 regs->tf_cs = context->sc_cs;
676 regs->tf_eflags = eflags;
677 regs->tf_esp = context->sc_esp_at_signal;
678 regs->tf_ss = context->sc_ss;
679
680 /*
681 * call sigaltstack & ignore results..
682 */
684 ss = stackgap_alloc(&sg, sizeof(stack_t));
685 lss = &uc.uc_stack;
683 lss = &uc.uc_stack;
686 ss->ss_sp = lss->ss_sp;
687 ss->ss_size = lss->ss_size;
688 ss->ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);
684 ss.ss_sp = lss->ss_sp;
685 ss.ss_size = lss->ss_size;
686 ss.ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);
689
690#ifdef DEBUG
691 if (ldebug(rt_sigreturn))
692 printf(LMSG("rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"),
687
688#ifdef DEBUG
689 if (ldebug(rt_sigreturn))
690 printf(LMSG("rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"),
693 ss->ss_flags, ss->ss_sp, ss->ss_size, context->sc_mask);
691 ss.ss_flags, ss.ss_sp, ss.ss_size, context->sc_mask);
694#endif
692#endif
695 sasargs.ss = ss;
696 sasargs.oss = NULL;
697 (void) sigaltstack(td, &sasargs);
693 (void)kern_sigaltstack(td, &ss, NULL);
698
699 return (EJUSTRETURN);
700}
701
702/*
703 * MPSAFE
704 */
705static void

--- 189 unchanged lines hidden ---
694
695 return (EJUSTRETURN);
696}
697
698/*
699 * MPSAFE
700 */
701static void

--- 189 unchanged lines hidden ---