locore.s: Made the APM stuff depend on NAPM > 0 rather than a separate

"APM" macro.
machdep.c: Made the APM-descriptors unconditional.
Bruce: if these still conflict with your debugger, please put in a reservation
for your debugger.  These three desc. can be anywhere, as long as they are
contiguous, so just move them as needed.
This commit is contained in:
Poul-Henning Kamp 1994-10-10 01:10:22 +00:00
parent a12dee4de7
commit e81c2e89d8
5 changed files with 68 additions and 119 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
* $Id: locore.s,v 1.34 1994/10/07 05:45:27 davidg Exp $
* $Id: locore.s,v 1.35 1994/10/08 06:20:52 rgrimes Exp $
*/
/*
@ -54,11 +54,12 @@
#include <machine/cputypes.h> /* x86 cpu type definitions */
#include <sys/syscall.h> /* system call numbers */
#include <machine/asmacros.h> /* miscellaneous asm macros */
#ifdef APM
#include "apm.h"
#if NAPM > 0
#define ASM
#include <machine/apm_bios.h>
#include <machine/apm_segments.h>
#endif
#endif /* NAPM */
/*
* XXX
@ -130,7 +131,7 @@ _proc0paddr: .long 0 /* address of proc 0 address space */
.globl _bdb_exists /* flag to indicate BDE debugger is available */
_bdb_exists: .long 0
#endif
#ifdef APM
#if NAPM > 0
.globl _apm_current_gdt_pdesc /* current GDT pseudo desc. */
_apm_current_gdt_pdesc:
.word 0, 0, 0
@ -138,7 +139,7 @@ _apm_current_gdt_pdesc:
.globl _bootstrap_gdt
_bootstrap_gdt:
.space SIZEOF_GDT * BOOTSTRAP_GDT_NUM
#endif /* APM */
#endif /* NAPM */
.globl tmpstk
.space 0x1000
tmpstk:
@ -293,7 +294,7 @@ NON_GPROF_ENTRY(btext)
addl $KERNBASE, %eax
movl %eax, _video_mode_ptr-KERNBASE
#ifdef APM
#if NAPM > 0
/*
* Setup APM BIOS:
*
@ -375,7 +376,7 @@ NON_GPROF_ENTRY(btext)
shrl $16, %esi
movw %si, _apm_ds_limit-KERNBASE
movw %di, _apm_flags-KERNBASE
#endif /* APM */
#endif /* NAPM */
/* Find out our CPU type. */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
* $Id: locore.s,v 1.34 1994/10/07 05:45:27 davidg Exp $
* $Id: locore.s,v 1.35 1994/10/08 06:20:52 rgrimes Exp $
*/
/*
@ -54,11 +54,12 @@
#include <machine/cputypes.h> /* x86 cpu type definitions */
#include <sys/syscall.h> /* system call numbers */
#include <machine/asmacros.h> /* miscellaneous asm macros */
#ifdef APM
#include "apm.h"
#if NAPM > 0
#define ASM
#include <machine/apm_bios.h>
#include <machine/apm_segments.h>
#endif
#endif /* NAPM */
/*
* XXX
@ -130,7 +131,7 @@ _proc0paddr: .long 0 /* address of proc 0 address space */
.globl _bdb_exists /* flag to indicate BDE debugger is available */
_bdb_exists: .long 0
#endif
#ifdef APM
#if NAPM > 0
.globl _apm_current_gdt_pdesc /* current GDT pseudo desc. */
_apm_current_gdt_pdesc:
.word 0, 0, 0
@ -138,7 +139,7 @@ _apm_current_gdt_pdesc:
.globl _bootstrap_gdt
_bootstrap_gdt:
.space SIZEOF_GDT * BOOTSTRAP_GDT_NUM
#endif /* APM */
#endif /* NAPM */
.globl tmpstk
.space 0x1000
tmpstk:
@ -293,7 +294,7 @@ NON_GPROF_ENTRY(btext)
addl $KERNBASE, %eax
movl %eax, _video_mode_ptr-KERNBASE
#ifdef APM
#if NAPM > 0
/*
* Setup APM BIOS:
*
@ -375,7 +376,7 @@ NON_GPROF_ENTRY(btext)
shrl $16, %esi
movw %si, _apm_ds_limit-KERNBASE
movw %di, _apm_flags-KERNBASE
#endif /* APM */
#endif /* NAPM */
/* Find out our CPU type. */

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.70 1994/10/04 18:44:21 ache Exp $
* $Id: machdep.c,v 1.71 1994/10/09 07:34:29 davidg Exp $
*/
#include "npx.h"
@ -162,7 +162,7 @@ cpu_startup()
register unsigned i;
register caddr_t v;
extern void (*netisrs[32])(void);
vm_offset_t minaddr, maxaddr;
vm_offset_t maxaddr;
vm_size_t size = 0;
int firstaddr;
@ -942,7 +942,7 @@ extern struct user *proc0paddr;
/* software prototypes -- in more palatable form */
struct soft_segment_descriptor gdt_segs[] = {
/* Null Descriptor */
/* GNULL_SEL 0 Null Descriptor */
{ 0x0, /* segment base address */
0x0, /* length */
0, /* segment type */
@ -951,7 +951,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Code Descriptor for kernel */
/* GCODE_SEL 1 Code Descriptor for kernel */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
SDT_MEMERA, /* segment type */
@ -960,7 +960,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
/* Data Descriptor for kernel */
/* GDATA_SEL 2 Data Descriptor for kernel */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
SDT_MEMRWA, /* segment type */
@ -969,8 +969,8 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
/* LDT Descriptor */
{ (int) ldt, /* segment base address */
/* GLDT_SEL 3 LDT Descriptor */
{ (int) ldt, /* segment base address */
sizeof(ldt)-1, /* length - all address space */
SDT_SYSLDT, /* segment type */
0, /* segment descriptor priority level */
@ -978,7 +978,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Null Descriptor - Placeholder */
/* GTGATE_SEL 4 Null Descriptor - Placeholder */
{ 0x0, /* segment base address */
0x0, /* length - all address space */
0, /* segment type */
@ -987,8 +987,8 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Panic Tss Descriptor */
{ (int) &panic_tss, /* segment base address */
/* GPANIC_SEL 5 Panic Tss Descriptor */
{ (int) &panic_tss, /* segment base address */
sizeof(tss)-1, /* length - all address space */
SDT_SYS386TSS, /* segment type */
0, /* segment descriptor priority level */
@ -996,8 +996,8 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Proc 0 Tss Descriptor */
{ (int) kstack, /* segment base address */
/* GPROC0_SEL 6 Proc 0 Tss Descriptor */
{ (int) kstack, /* segment base address */
sizeof(tss)-1, /* length - all address space */
SDT_SYS386TSS, /* segment type */
0, /* segment descriptor priority level */
@ -1005,7 +1005,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* User LDT Descriptor per process */
/* GUSERLDT_SEL 7 User LDT Descriptor per process */
{ (int) ldt, /* segment base address */
(512 * sizeof(union descriptor)-1), /* length */
SDT_SYSLDT, /* segment type */
@ -1014,60 +1014,33 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
#ifdef APM
/* APM BIOS 32-bit interface (32bit Code) */
/* GAPMCODE32_SEL 8 APM BIOS 32-bit interface (32bit Code) */
{ 0, /* segment base address (overwritten by APM) */
0xffff, /* length */
0xfffff, /* length */
SDT_MEMERA, /* segment type */
0, /* segment descriptor priority level */
1, /* segment descriptor present */
0, 0,
1, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* APM BIOS 32-bit interface (16bit Code) */
1 /* limit granularity (byte/page units)*/ },
/* GAPMCODE16_SEL 9 APM BIOS 32-bit interface (16bit Code) */
{ 0, /* segment base address (overwritten by APM) */
0xffff, /* length */
0xfffff, /* length */
SDT_MEMERA, /* segment type */
0, /* segment descriptor priority level */
1, /* segment descriptor present */
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* APM BIOS 32-bit interface (Data) */
1 /* limit granularity (byte/page units)*/ },
/* GAPMDATA_SEL 10 APM BIOS 32-bit interface (Data) */
{ 0, /* segment base address (overwritten by APM) */
0xffff, /* length */
0xfffff, /* length */
SDT_MEMRWA, /* segment type */
0, /* segment descriptor priority level */
1, /* segment descriptor present */
0, 0,
1, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
#else /* APM */
{ 0, /* segment base address */
0, /* length */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
{ 0, /* segment base address */
0, /* length */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
{ 0, /* segment base address */
0, /* length */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
#endif /* APMBIOS */
1 /* limit granularity (byte/page units)*/ },
};
struct soft_segment_descriptor ldt_segs[] = {

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
* $Id: locore.s,v 1.34 1994/10/07 05:45:27 davidg Exp $
* $Id: locore.s,v 1.35 1994/10/08 06:20:52 rgrimes Exp $
*/
/*
@ -54,11 +54,12 @@
#include <machine/cputypes.h> /* x86 cpu type definitions */
#include <sys/syscall.h> /* system call numbers */
#include <machine/asmacros.h> /* miscellaneous asm macros */
#ifdef APM
#include "apm.h"
#if NAPM > 0
#define ASM
#include <machine/apm_bios.h>
#include <machine/apm_segments.h>
#endif
#endif /* NAPM */
/*
* XXX
@ -130,7 +131,7 @@ _proc0paddr: .long 0 /* address of proc 0 address space */
.globl _bdb_exists /* flag to indicate BDE debugger is available */
_bdb_exists: .long 0
#endif
#ifdef APM
#if NAPM > 0
.globl _apm_current_gdt_pdesc /* current GDT pseudo desc. */
_apm_current_gdt_pdesc:
.word 0, 0, 0
@ -138,7 +139,7 @@ _apm_current_gdt_pdesc:
.globl _bootstrap_gdt
_bootstrap_gdt:
.space SIZEOF_GDT * BOOTSTRAP_GDT_NUM
#endif /* APM */
#endif /* NAPM */
.globl tmpstk
.space 0x1000
tmpstk:
@ -293,7 +294,7 @@ NON_GPROF_ENTRY(btext)
addl $KERNBASE, %eax
movl %eax, _video_mode_ptr-KERNBASE
#ifdef APM
#if NAPM > 0
/*
* Setup APM BIOS:
*
@ -375,7 +376,7 @@ NON_GPROF_ENTRY(btext)
shrl $16, %esi
movw %si, _apm_ds_limit-KERNBASE
movw %di, _apm_flags-KERNBASE
#endif /* APM */
#endif /* NAPM */
/* Find out our CPU type. */

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.70 1994/10/04 18:44:21 ache Exp $
* $Id: machdep.c,v 1.71 1994/10/09 07:34:29 davidg Exp $
*/
#include "npx.h"
@ -162,7 +162,7 @@ cpu_startup()
register unsigned i;
register caddr_t v;
extern void (*netisrs[32])(void);
vm_offset_t minaddr, maxaddr;
vm_offset_t maxaddr;
vm_size_t size = 0;
int firstaddr;
@ -942,7 +942,7 @@ extern struct user *proc0paddr;
/* software prototypes -- in more palatable form */
struct soft_segment_descriptor gdt_segs[] = {
/* Null Descriptor */
/* GNULL_SEL 0 Null Descriptor */
{ 0x0, /* segment base address */
0x0, /* length */
0, /* segment type */
@ -951,7 +951,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Code Descriptor for kernel */
/* GCODE_SEL 1 Code Descriptor for kernel */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
SDT_MEMERA, /* segment type */
@ -960,7 +960,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
/* Data Descriptor for kernel */
/* GDATA_SEL 2 Data Descriptor for kernel */
{ 0x0, /* segment base address */
0xfffff, /* length - all address space */
SDT_MEMRWA, /* segment type */
@ -969,8 +969,8 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ },
/* LDT Descriptor */
{ (int) ldt, /* segment base address */
/* GLDT_SEL 3 LDT Descriptor */
{ (int) ldt, /* segment base address */
sizeof(ldt)-1, /* length - all address space */
SDT_SYSLDT, /* segment type */
0, /* segment descriptor priority level */
@ -978,7 +978,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Null Descriptor - Placeholder */
/* GTGATE_SEL 4 Null Descriptor - Placeholder */
{ 0x0, /* segment base address */
0x0, /* length - all address space */
0, /* segment type */
@ -987,8 +987,8 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Panic Tss Descriptor */
{ (int) &panic_tss, /* segment base address */
/* GPANIC_SEL 5 Panic Tss Descriptor */
{ (int) &panic_tss, /* segment base address */
sizeof(tss)-1, /* length - all address space */
SDT_SYS386TSS, /* segment type */
0, /* segment descriptor priority level */
@ -996,8 +996,8 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* Proc 0 Tss Descriptor */
{ (int) kstack, /* segment base address */
/* GPROC0_SEL 6 Proc 0 Tss Descriptor */
{ (int) kstack, /* segment base address */
sizeof(tss)-1, /* length - all address space */
SDT_SYS386TSS, /* segment type */
0, /* segment descriptor priority level */
@ -1005,7 +1005,7 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* User LDT Descriptor per process */
/* GUSERLDT_SEL 7 User LDT Descriptor per process */
{ (int) ldt, /* segment base address */
(512 * sizeof(union descriptor)-1), /* length */
SDT_SYSLDT, /* segment type */
@ -1014,60 +1014,33 @@ struct soft_segment_descriptor gdt_segs[] = {
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
#ifdef APM
/* APM BIOS 32-bit interface (32bit Code) */
/* GAPMCODE32_SEL 8 APM BIOS 32-bit interface (32bit Code) */
{ 0, /* segment base address (overwritten by APM) */
0xffff, /* length */
0xfffff, /* length */
SDT_MEMERA, /* segment type */
0, /* segment descriptor priority level */
1, /* segment descriptor present */
0, 0,
1, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* APM BIOS 32-bit interface (16bit Code) */
1 /* limit granularity (byte/page units)*/ },
/* GAPMCODE16_SEL 9 APM BIOS 32-bit interface (16bit Code) */
{ 0, /* segment base address (overwritten by APM) */
0xffff, /* length */
0xfffff, /* length */
SDT_MEMERA, /* segment type */
0, /* segment descriptor priority level */
1, /* segment descriptor present */
0, 0,
0, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
/* APM BIOS 32-bit interface (Data) */
1 /* limit granularity (byte/page units)*/ },
/* GAPMDATA_SEL 10 APM BIOS 32-bit interface (Data) */
{ 0, /* segment base address (overwritten by APM) */
0xffff, /* length */
0xfffff, /* length */
SDT_MEMRWA, /* segment type */
0, /* segment descriptor priority level */
1, /* segment descriptor present */
0, 0,
1, /* default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
#else /* APM */
{ 0, /* segment base address */
0, /* length */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
{ 0, /* segment base address */
0, /* length */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
{ 0, /* segment base address */
0, /* length */
0, /* segment type */
0, /* segment descriptor priority level */
0, /* segment descriptor present */
0, 0,
0, /* unused - default 32 vs 16 bit size */
0 /* limit granularity (byte/page units)*/ },
#endif /* APMBIOS */
1 /* limit granularity (byte/page units)*/ },
};
struct soft_segment_descriptor ldt_segs[] = {