Deleted Added
full compact
linux32_sysvec.c (216255) linux32_sysvec.c (216634)
1/*-
2 * Copyright (c) 2004 Tim J. Robbins
3 * Copyright (c) 2003 Peter Wemm
4 * Copyright (c) 2002 Doug Rabson
5 * Copyright (c) 1998-1999 Andrew Gallatin
6 * Copyright (c) 1994-1996 S�ren Schmidt
7 * All rights reserved.
8 *

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

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004 Tim J. Robbins
3 * Copyright (c) 2003 Peter Wemm
4 * Copyright (c) 2002 Doug Rabson
5 * Copyright (c) 1998-1999 Andrew Gallatin
6 * Copyright (c) 1994-1996 S�ren Schmidt
7 * All rights reserved.
8 *

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

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_sysvec.c 216255 2010-12-07 12:44:33Z kib $");
34__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_sysvec.c 216634 2010-12-22 00:18:42Z jkim $");
35#include "opt_compat.h"
36
37#ifndef COMPAT_FREEBSD32
38#error "Unable to compile Linux-emulator due to missing COMPAT_FREEBSD32 option!"
39#endif
40
41#define __ELF_WORD_SIZE 32
42

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

417 regs->tf_rflags &= ~(PSL_T | PSL_D);
418 regs->tf_cs = _ucode32sel;
419 regs->tf_ss = _udatasel;
420 regs->tf_ds = _udatasel;
421 regs->tf_es = _udatasel;
422 regs->tf_fs = _ufssel;
423 regs->tf_gs = _ugssel;
424 regs->tf_flags = TF_HASSEGS;
35#include "opt_compat.h"
36
37#ifndef COMPAT_FREEBSD32
38#error "Unable to compile Linux-emulator due to missing COMPAT_FREEBSD32 option!"
39#endif
40
41#define __ELF_WORD_SIZE 32
42

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

417 regs->tf_rflags &= ~(PSL_T | PSL_D);
418 regs->tf_cs = _ucode32sel;
419 regs->tf_ss = _udatasel;
420 regs->tf_ds = _udatasel;
421 regs->tf_es = _udatasel;
422 regs->tf_fs = _ufssel;
423 regs->tf_gs = _ugssel;
424 regs->tf_flags = TF_HASSEGS;
425 td->td_pcb->pcb_full_iret = 1;
425 set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
426 PROC_LOCK(p);
427 mtx_lock(&psp->ps_mtx);
428}
429
430
431/*
432 * Send an interrupt to process.
433 *

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

540 regs->tf_rflags &= ~(PSL_T | PSL_D);
541 regs->tf_cs = _ucode32sel;
542 regs->tf_ss = _udatasel;
543 regs->tf_ds = _udatasel;
544 regs->tf_es = _udatasel;
545 regs->tf_fs = _ufssel;
546 regs->tf_gs = _ugssel;
547 regs->tf_flags = TF_HASSEGS;
426 PROC_LOCK(p);
427 mtx_lock(&psp->ps_mtx);
428}
429
430
431/*
432 * Send an interrupt to process.
433 *

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

540 regs->tf_rflags &= ~(PSL_T | PSL_D);
541 regs->tf_cs = _ucode32sel;
542 regs->tf_ss = _udatasel;
543 regs->tf_ds = _udatasel;
544 regs->tf_es = _udatasel;
545 regs->tf_fs = _ufssel;
546 regs->tf_gs = _ugssel;
547 regs->tf_flags = TF_HASSEGS;
548 td->td_pcb->pcb_full_iret = 1;
548 set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
549 PROC_LOCK(p);
550 mtx_lock(&psp->ps_mtx);
551}
552
553/*
554 * System call to cleanup state after a signal
555 * has been taken. Reset signal mask and
556 * stack state from context left by sendsig (above).

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

638 regs->tf_cs = frame.sf_sc.sc_cs;
639 regs->tf_ds = frame.sf_sc.sc_ds;
640 regs->tf_es = frame.sf_sc.sc_es;
641 regs->tf_fs = frame.sf_sc.sc_fs;
642 regs->tf_gs = frame.sf_sc.sc_gs;
643 regs->tf_rflags = eflags;
644 regs->tf_rsp = frame.sf_sc.sc_esp_at_signal;
645 regs->tf_ss = frame.sf_sc.sc_ss;
549 PROC_LOCK(p);
550 mtx_lock(&psp->ps_mtx);
551}
552
553/*
554 * System call to cleanup state after a signal
555 * has been taken. Reset signal mask and
556 * stack state from context left by sendsig (above).

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

638 regs->tf_cs = frame.sf_sc.sc_cs;
639 regs->tf_ds = frame.sf_sc.sc_ds;
640 regs->tf_es = frame.sf_sc.sc_es;
641 regs->tf_fs = frame.sf_sc.sc_fs;
642 regs->tf_gs = frame.sf_sc.sc_gs;
643 regs->tf_rflags = eflags;
644 regs->tf_rsp = frame.sf_sc.sc_esp_at_signal;
645 regs->tf_ss = frame.sf_sc.sc_ss;
646 td->td_pcb->pcb_full_iret = 1;
646 set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
647
648 return (EJUSTRETURN);
649}
650
651/*
652 * System call to cleanup state after a signal
653 * has been taken. Reset signal mask and
654 * stack state from context left by rt_sendsig (above).

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

737 regs->tf_rdx = context->sc_edx;
738 regs->tf_rcx = context->sc_ecx;
739 regs->tf_rax = context->sc_eax;
740 regs->tf_rip = context->sc_eip;
741 regs->tf_cs = context->sc_cs;
742 regs->tf_rflags = eflags;
743 regs->tf_rsp = context->sc_esp_at_signal;
744 regs->tf_ss = context->sc_ss;
647
648 return (EJUSTRETURN);
649}
650
651/*
652 * System call to cleanup state after a signal
653 * has been taken. Reset signal mask and
654 * stack state from context left by rt_sendsig (above).

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

737 regs->tf_rdx = context->sc_edx;
738 regs->tf_rcx = context->sc_ecx;
739 regs->tf_rax = context->sc_eax;
740 regs->tf_rip = context->sc_eip;
741 regs->tf_cs = context->sc_cs;
742 regs->tf_rflags = eflags;
743 regs->tf_rsp = context->sc_esp_at_signal;
744 regs->tf_ss = context->sc_ss;
745 td->td_pcb->pcb_full_iret = 1;
745 set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
746
747 /*
748 * call sigaltstack & ignore results..
749 */
750 lss = &uc.uc_stack;
751 ss.ss_sp = PTRIN(lss->ss_sp);
752 ss.ss_size = lss->ss_size;
753 ss.ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);

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

864 regs->tf_ss = _udatasel;
865 regs->tf_flags = TF_HASSEGS;
866 regs->tf_cs = _ucode32sel;
867 regs->tf_rbx = imgp->ps_strings;
868 load_cr0(rcr0() | CR0_MP | CR0_TS);
869 fpstate_drop(td);
870
871 /* Do full restore on return so that we can change to a different %cs */
746
747 /*
748 * call sigaltstack & ignore results..
749 */
750 lss = &uc.uc_stack;
751 ss.ss_sp = PTRIN(lss->ss_sp);
752 ss.ss_size = lss->ss_size;
753 ss.ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);

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

864 regs->tf_ss = _udatasel;
865 regs->tf_flags = TF_HASSEGS;
866 regs->tf_cs = _ucode32sel;
867 regs->tf_rbx = imgp->ps_strings;
868 load_cr0(rcr0() | CR0_MP | CR0_TS);
869 fpstate_drop(td);
870
871 /* Do full restore on return so that we can change to a different %cs */
872 pcb->pcb_flags |= PCB_32BIT;
873 pcb->pcb_flags &= ~PCB_GS32BIT;
874 pcb->pcb_full_iret = 1;
872 set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET);
873 clear_pcb_flags(pcb, PCB_GS32BIT);
875 td->td_retval[1] = 0;
876}
877
878/*
879 * XXX copied from ia32_sysvec.c.
880 */
881static register_t *
882linux_copyout_strings(struct image_params *imgp)

--- 331 unchanged lines hidden ---
874 td->td_retval[1] = 0;
875}
876
877/*
878 * XXX copied from ia32_sysvec.c.
879 */
880static register_t *
881linux_copyout_strings(struct image_params *imgp)

--- 331 unchanged lines hidden ---