Deleted Added
full compact
linux32_sysvec.c (164860) linux32_sysvec.c (168035)
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 164860 2006-12-03 21:06:07Z netchild $");
34__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_sysvec.c 168035 2007-03-30 00:06:21Z jkim $");
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

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

403 linux_sznonrtsigcode;
404 regs->tf_rflags &= ~PSL_T;
405 regs->tf_cs = _ucode32sel;
406 regs->tf_ss = _udatasel;
407 load_ds(_udatasel);
408 td->td_pcb->pcb_ds = _udatasel;
409 load_es(_udatasel);
410 td->td_pcb->pcb_es = _udatasel;
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

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

403 linux_sznonrtsigcode;
404 regs->tf_rflags &= ~PSL_T;
405 regs->tf_cs = _ucode32sel;
406 regs->tf_ss = _udatasel;
407 load_ds(_udatasel);
408 td->td_pcb->pcb_ds = _udatasel;
409 load_es(_udatasel);
410 td->td_pcb->pcb_es = _udatasel;
411 /* leave user %fs and %gs untouched */
411 PROC_LOCK(p);
412 mtx_lock(&psp->ps_mtx);
413}
414
415
416/*
417 * Send an interrupt to process.
418 *

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

523 regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
524 regs->tf_rflags &= ~PSL_T;
525 regs->tf_cs = _ucode32sel;
526 regs->tf_ss = _udatasel;
527 load_ds(_udatasel);
528 td->td_pcb->pcb_ds = _udatasel;
529 load_es(_udatasel);
530 td->td_pcb->pcb_es = _udatasel;
412 PROC_LOCK(p);
413 mtx_lock(&psp->ps_mtx);
414}
415
416
417/*
418 * Send an interrupt to process.
419 *

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

524 regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
525 regs->tf_rflags &= ~PSL_T;
526 regs->tf_cs = _ucode32sel;
527 regs->tf_ss = _udatasel;
528 load_ds(_udatasel);
529 td->td_pcb->pcb_ds = _udatasel;
530 load_es(_udatasel);
531 td->td_pcb->pcb_es = _udatasel;
532 /* leave user %fs and %gs untouched */
531 PROC_LOCK(p);
532 mtx_lock(&psp->ps_mtx);
533}
534
535/*
536 * System call to cleanup state after a signal
537 * has been taken. Reset signal mask and
538 * stack state from context left by sendsig (above).

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

808 struct thread *td;
809 u_long entry;
810 u_long stack;
811 u_long ps_strings;
812{
813 struct trapframe *regs = td->td_frame;
814 struct pcb *pcb = td->td_pcb;
815
533 PROC_LOCK(p);
534 mtx_lock(&psp->ps_mtx);
535}
536
537/*
538 * System call to cleanup state after a signal
539 * has been taken. Reset signal mask and
540 * stack state from context left by sendsig (above).

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

810 struct thread *td;
811 u_long entry;
812 u_long stack;
813 u_long ps_strings;
814{
815 struct trapframe *regs = td->td_frame;
816 struct pcb *pcb = td->td_pcb;
817
818 critical_enter();
816 wrmsr(MSR_FSBASE, 0);
817 wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */
818 pcb->pcb_fsbase = 0;
819 pcb->pcb_gsbase = 0;
819 wrmsr(MSR_FSBASE, 0);
820 wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */
821 pcb->pcb_fsbase = 0;
822 pcb->pcb_gsbase = 0;
823 critical_exit();
820 load_ds(_udatasel);
821 load_es(_udatasel);
822 load_fs(_udatasel);
824 load_ds(_udatasel);
825 load_es(_udatasel);
826 load_fs(_udatasel);
823 load_gs(0);
827 load_gs(_udatasel);
824 pcb->pcb_ds = _udatasel;
825 pcb->pcb_es = _udatasel;
826 pcb->pcb_fs = _udatasel;
828 pcb->pcb_ds = _udatasel;
829 pcb->pcb_es = _udatasel;
830 pcb->pcb_fs = _udatasel;
827 pcb->pcb_gs = 0;
831 pcb->pcb_gs = _udatasel;
828
829 bzero((char *)regs, sizeof(struct trapframe));
830 regs->tf_rip = entry;
831 regs->tf_rsp = stack;
832 regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
833 regs->tf_ss = _udatasel;
834 regs->tf_cs = _ucode32sel;
835 regs->tf_rbx = ps_strings;

--- 299 unchanged lines hidden ---
832
833 bzero((char *)regs, sizeof(struct trapframe));
834 regs->tf_rip = entry;
835 regs->tf_rsp = stack;
836 regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
837 regs->tf_ss = _udatasel;
838 regs->tf_cs = _ucode32sel;
839 regs->tf_rbx = ps_strings;

--- 299 unchanged lines hidden ---