Deleted Added
full compact
linux32_sysvec.c (191973) linux32_sysvec.c (195486)
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 191973 2009-05-10 18:43:43Z dchagin $");
34__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_sysvec.c 195486 2009-07-09 09:34:11Z kib $");
35#include "opt_compat.h"
36
37#ifndef COMPAT_IA32
38#error "Unable to compile Linux-emulator due to missing COMPAT_IA32 option!"
39#endif
40
41#define __ELF_WORD_SIZE 32
42

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

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

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

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

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

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

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

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

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

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

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

741 regs->tf_rdx = context->sc_edx;
742 regs->tf_rcx = context->sc_ecx;
743 regs->tf_rax = context->sc_eax;
744 regs->tf_rip = context->sc_eip;
745 regs->tf_cs = context->sc_cs;
746 regs->tf_rflags = eflags;
747 regs->tf_rsp = context->sc_esp_at_signal;
748 regs->tf_ss = context->sc_ss;
651
652 return (EJUSTRETURN);
653}
654
655/*
656 * System call to cleanup state after a signal
657 * has been taken. Reset signal mask and
658 * stack state from context left by rt_sendsig (above).

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

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

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

859 regs->tf_gs = _ugssel;
860 regs->tf_fs = _ufssel;
861 regs->tf_es = _udatasel;
862 regs->tf_ds = _udatasel;
863 regs->tf_ss = _udatasel;
864 regs->tf_flags = TF_HASSEGS;
865 regs->tf_cs = _ucode32sel;
866 regs->tf_rbx = ps_strings;
753
754 /*
755 * call sigaltstack & ignore results..
756 */
757 lss = &uc.uc_stack;
758 ss.ss_sp = PTRIN(lss->ss_sp);
759 ss.ss_size = lss->ss_size;
760 ss.ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);

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

863 regs->tf_gs = _ugssel;
864 regs->tf_fs = _ufssel;
865 regs->tf_es = _udatasel;
866 regs->tf_ds = _udatasel;
867 regs->tf_ss = _udatasel;
868 regs->tf_flags = TF_HASSEGS;
869 regs->tf_cs = _ucode32sel;
870 regs->tf_rbx = ps_strings;
871 td->td_pcb->pcb_full_iret = 1;
867 load_cr0(rcr0() | CR0_MP | CR0_TS);
868 fpstate_drop(td);
869
870 /* Return via doreti so that we can change to a different %cs */
871 pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT;
872 pcb->pcb_flags &= ~PCB_GS32BIT;
873 td->td_retval[1] = 0;
874}

--- 310 unchanged lines hidden ---
872 load_cr0(rcr0() | CR0_MP | CR0_TS);
873 fpstate_drop(td);
874
875 /* Return via doreti so that we can change to a different %cs */
876 pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT;
877 pcb->pcb_flags &= ~PCB_GS32BIT;
878 td->td_retval[1] = 0;
879}

--- 310 unchanged lines hidden ---