Use global descriptor 7 for mach traps. Unfortunately this is already

used by apm 16 bit code segments so we cannot have both at the same time.
This commit is contained in:
christos 2001-07-14 02:02:45 +00:00
parent 661d4f4564
commit 75dabe22c7
3 changed files with 19 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: apm.c,v 1.60 2001/03/24 02:07:54 christos Exp $ */
/* $NetBSD: apm.c,v 1.61 2001/07/14 02:02:45 christos Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -42,6 +42,7 @@
#endif
#include "opt_apm.h"
#include "opt_compat_mach.h" /* Needed to get the right segment def */
#ifdef APM_NOIDLE
#error APM_NOIDLE option deprecated; use APM_NO_IDLE instead
@ -1349,10 +1350,12 @@ apmattach(parent, self, aux)
ISA_HOLE_VADDR(apminfo.apm_code32_seg_base),
apminfo.apm_code32_seg_len - 1,
SDT_MEMERA, SEL_KPL, 1, 0);
#ifdef GAPM16CODE_SEL
setsegment(&gdt[GAPM16CODE_SEL].sd,
ISA_HOLE_VADDR(apminfo.apm_code16_seg_base),
apminfo.apm_code16_seg_len - 1,
SDT_MEMERA, SEL_KPL, 0, 0);
#endif
if (apminfo.apm_data_seg_len == 0) {
/*
*if no data area needed, set up the segment

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.446 2001/06/19 15:54:48 sommerfeld Exp $ */
/* $NetBSD: machdep.c,v 1.447 2001/07/14 02:02:46 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -85,6 +85,7 @@
#include "opt_cpureset_delay.h"
#include "opt_compat_svr4.h"
#include "opt_realmem.h"
#include "opt_compat_mach.h" /* need to get the right segment def */
#include <sys/param.h>
#include <sys/systm.h>
@ -2134,6 +2135,9 @@ extern vector *IDTVEC(exceptions)[];
#ifdef COMPAT_SVR4
extern vector IDTVEC(svr4_fasttrap);
#endif /* COMPAT_SVR4 */
#ifdef COMPAT_MACH
extern vector IDTVEC(mach_trap);
#endif
#define KBTOB(x) ((size_t)(x) * 1024UL)
@ -2604,10 +2608,15 @@ init386(first_avail)
setsegment(&gdt[GBIOSDATA_SEL].sd, 0, 0xfffff, SDT_MEMRWA, SEL_KPL, 0,
0);
#endif
#ifdef GMACHCALLS_SEL
setgate(&gdt[GMACHCALLS_SEL].gd, &IDTVEC(mach_trap), 1,
SDT_SYS386CGT, SEL_UPL);
#endif
/* make ldt gates and memory segments */
setgate(&ldt[LSYS5CALLS_SEL].gd, &IDTVEC(osyscall), 1,
SDT_SYS386CGT, SEL_UPL);
ldt[LUCODE_SEL] = gdt[GUCODE_SEL];
ldt[LUDATA_SEL] = gdt[GUDATA_SEL];
ldt[LSOL26CALLS_SEL] = ldt[LBSDICALLS_SEL] = ldt[LSYS5CALLS_SEL];

View File

@ -1,4 +1,4 @@
/* $NetBSD: segments.h,v 1.31 2001/05/30 12:28:45 mrg Exp $ */
/* $NetBSD: segments.h,v 1.32 2001/07/14 02:02:45 christos Exp $ */
/*-
* Copyright (c) 1995, 1997
@ -222,7 +222,11 @@ void setsegment __P((struct segment_descriptor *, void *, size_t, int, int,
#define GUCODE_SEL 4 /* User code descriptor */
#define GUDATA_SEL 5 /* User data descriptor */
#define GAPM32CODE_SEL 6
#ifndef COMPAT_MACH
#define GAPM16CODE_SEL 7
#else
#define GMACHCALLS_SEL 7 /* Darwin (mach trap) system call gate */
#endif
#define GAPMDATA_SEL 8
#define GBIOSCODE_SEL 9
#define GBIOSDATA_SEL 10