Remove BDE_DEBUGGER.

Discussed with:	bde
This commit is contained in:
Jake Burkholder 2003-01-28 19:05:44 +00:00
parent f959d23788
commit aff81a81d6
12 changed files with 10 additions and 450 deletions

View File

@ -81,34 +81,16 @@
.type __CONCAT(X,name),@function; __CONCAT(X,name):
#define TRAP(a) pushl $(a) ; jmp alltraps
#ifdef BDE_DEBUGGER
#define BDBTRAP(name) \
ss ; \
cmpb $0,_bdb_exists ; \
je 1f ; \
testb $SEL_RPL_MASK,4(%esp) ; \
jne 1f ; \
ss ; \
.globl __CONCAT(__CONCAT(bdb_,name),_ljmp); \
__CONCAT(__CONCAT(bdb_,name),_ljmp): \
ljmp $0,$0 ; \
1:
#else
#define BDBTRAP(name)
#endif
MCOUNT_LABEL(user)
MCOUNT_LABEL(btrap)
IDTVEC(div)
pushl $0; TRAP(T_DIVIDE)
IDTVEC(dbg)
BDBTRAP(dbg)
pushl $0; TRAP(T_TRCTRAP)
IDTVEC(nmi)
pushl $0; TRAP(T_NMI)
IDTVEC(bpt)
BDBTRAP(bpt)
pushl $0; TRAP(T_BPTFLT)
IDTVEC(ofl)
pushl $0; TRAP(T_OFLOW)

View File

@ -81,34 +81,16 @@
.type __CONCAT(X,name),@function; __CONCAT(X,name):
#define TRAP(a) pushl $(a) ; jmp alltraps
#ifdef BDE_DEBUGGER
#define BDBTRAP(name) \
ss ; \
cmpb $0,_bdb_exists ; \
je 1f ; \
testb $SEL_RPL_MASK,4(%esp) ; \
jne 1f ; \
ss ; \
.globl __CONCAT(__CONCAT(bdb_,name),_ljmp); \
__CONCAT(__CONCAT(bdb_,name),_ljmp): \
ljmp $0,$0 ; \
1:
#else
#define BDBTRAP(name)
#endif
MCOUNT_LABEL(user)
MCOUNT_LABEL(btrap)
IDTVEC(div)
pushl $0; TRAP(T_DIVIDE)
IDTVEC(dbg)
BDBTRAP(dbg)
pushl $0; TRAP(T_TRCTRAP)
IDTVEC(nmi)
pushl $0; TRAP(T_NMI)
IDTVEC(bpt)
BDBTRAP(bpt)
pushl $0; TRAP(T_BPTFLT)
IDTVEC(ofl)
pushl $0; TRAP(T_OFLOW)

View File

@ -155,11 +155,6 @@ vm86phystk: .long 0 /* PA of vm86/bios stack */
vm86paddr: .long 0 /* address of vm86 region */
vm86pa: .long 0 /* phys addr of vm86 region */
#ifdef BDE_DEBUGGER
.globl _bdb_exists /* flag to indicate BDE debugger is present */
_bdb_exists: .long 0
#endif
#ifdef PC98
.globl pc98_system_parameter
pc98_system_parameter:
@ -232,16 +227,6 @@ NON_GPROF_ENTRY(btext)
rep
movsb
#else /* IBM-PC */
#ifdef BDE_DEBUGGER
#ifdef BIOS_STEALS_3K
cmpl $0x0375c339,0x95504
#else
cmpl $0x0375c339,0x96104 /* XXX - debugger signature */
#endif
jne 1f
movb $1,R(_bdb_exists)
1:
#endif
/* Tell the bios to warmboot next time */
movw $0x1234,0x472
#endif /* PC98 */
@ -314,8 +299,8 @@ NON_GPROF_ENTRY(btext)
*
* XXX the gdt and idt are still somewhere in the boot program. We
* depend on the convention that the boot program is below 1MB and we
* are above 1MB to keep the gdt and idt away from the bss and page
* tables. The idt is only used if BDE_DEBUGGER is enabled.
* are above 1MB to keep the gdt and idt away from the bss and page
* tables.
*/
movl $R(end),%ecx
movl $R(edata),%edi
@ -337,14 +322,6 @@ NON_GPROF_ENTRY(btext)
movl %eax, %cr4
1:
#ifdef BDE_DEBUGGER
/*
* Adjust as much as possible for paging before enabling paging so that the
* adjustments can be traced.
*/
call bdb_prepare_paging
#endif
/* Now enable paging */
movl R(IdlePTD), %eax
movl %eax,%cr3 /* load ptd addr into mmu */
@ -352,15 +329,6 @@ NON_GPROF_ENTRY(btext)
orl $CR0_PE|CR0_PG,%eax /* enable paging */
movl %eax,%cr0 /* and let's page NOW! */
#ifdef BDE_DEBUGGER
/*
* Complete the adjustments for paging so that we can keep tracing through
* initi386() after the low (physical) addresses for the gdt and idt become
* invalid.
*/
call bdb_commit_paging
#endif
pushl $begin /* jump to high virtualized address */
ret
@ -819,11 +787,6 @@ no_kernend:
/* Map read-only from zero to the end of the kernel text section */
xorl %eax, %eax
#ifdef BDE_DEBUGGER
/* If the debugger is present, actually map everything read-write. */
cmpl $0,R(_bdb_exists)
jne map_read_write
#endif
xorl %edx,%edx
movl $R(etext),%ecx
addl $PAGE_MASK,%ecx
@ -834,7 +797,6 @@ no_kernend:
movl $R(etext),%eax
addl $PAGE_MASK, %eax
andl $~PAGE_MASK, %eax
map_read_write:
movl $PG_RW,%edx
movl R(KERNend),%ecx
subl %eax,%ecx
@ -928,83 +890,3 @@ map_read_write:
fillkpt(R(IdlePTD), $PG_RW)
ret
#ifdef BDE_DEBUGGER
bdb_prepare_paging:
cmpl $0,R(_bdb_exists)
je bdb_prepare_paging_exit
subl $6,%esp
/*
* Copy and convert debugger entries from the bootstrap gdt and idt
* to the kernel gdt and idt. Everything is still in low memory.
* Tracing continues to work after paging is enabled because the
* low memory addresses remain valid until everything is relocated.
* However, tracing through the setidt() that initializes the trace
* trap will crash.
*/
sgdt (%esp)
movl 2(%esp),%esi /* base address of bootstrap gdt */
movl $R(_gdt),%edi
movl %edi,2(%esp) /* prepare to load kernel gdt */
movl $8*18/4,%ecx
cld
rep /* copy gdt */
movsl
movl $R(_gdt),-8+2(%edi) /* adjust gdt self-ptr */
movb $0x92,-8+5(%edi)
lgdt (%esp)
sidt (%esp)
movl 2(%esp),%esi /* base address of current idt */
movl 8+4(%esi),%eax /* convert dbg descriptor to ... */
movw 8(%esi),%ax
movl %eax,R(bdb_dbg_ljmp+1) /* ... immediate offset ... */
movl 8+2(%esi),%eax
movw %ax,R(bdb_dbg_ljmp+5) /* ... and selector for ljmp */
movl 24+4(%esi),%eax /* same for bpt descriptor */
movw 24(%esi),%ax
movl %eax,R(bdb_bpt_ljmp+1)
movl 24+2(%esi),%eax
movw %ax,R(bdb_bpt_ljmp+5)
movl R(_idt),%edi
movl %edi,2(%esp) /* prepare to load kernel idt */
movl $8*4/4,%ecx
cld
rep /* copy idt */
movsl
lidt (%esp)
addl $6,%esp
bdb_prepare_paging_exit:
ret
/* Relocate debugger gdt entries and gdt and idt pointers. */
bdb_commit_paging:
cmpl $0,_bdb_exists
je bdb_commit_paging_exit
movl $gdt+8*9,%eax /* adjust slots 9-17 */
movl $9,%ecx
reloc_gdt:
movb $KERNBASE>>24,7(%eax) /* top byte of base addresses, was 0, */
addl $8,%eax /* now KERNBASE>>24 */
loop reloc_gdt
subl $6,%esp
sgdt (%esp)
addl $KERNBASE,2(%esp)
lgdt (%esp)
sidt (%esp)
addl $KERNBASE,2(%esp)
lidt (%esp)
addl $6,%esp
int $3
bdb_commit_paging_exit:
ret
#endif /* BDE_DEBUGGER */

View File

@ -155,11 +155,6 @@ vm86phystk: .long 0 /* PA of vm86/bios stack */
vm86paddr: .long 0 /* address of vm86 region */
vm86pa: .long 0 /* phys addr of vm86 region */
#ifdef BDE_DEBUGGER
.globl _bdb_exists /* flag to indicate BDE debugger is present */
_bdb_exists: .long 0
#endif
#ifdef PC98
.globl pc98_system_parameter
pc98_system_parameter:
@ -232,16 +227,6 @@ NON_GPROF_ENTRY(btext)
rep
movsb
#else /* IBM-PC */
#ifdef BDE_DEBUGGER
#ifdef BIOS_STEALS_3K
cmpl $0x0375c339,0x95504
#else
cmpl $0x0375c339,0x96104 /* XXX - debugger signature */
#endif
jne 1f
movb $1,R(_bdb_exists)
1:
#endif
/* Tell the bios to warmboot next time */
movw $0x1234,0x472
#endif /* PC98 */
@ -314,8 +299,8 @@ NON_GPROF_ENTRY(btext)
*
* XXX the gdt and idt are still somewhere in the boot program. We
* depend on the convention that the boot program is below 1MB and we
* are above 1MB to keep the gdt and idt away from the bss and page
* tables. The idt is only used if BDE_DEBUGGER is enabled.
* are above 1MB to keep the gdt and idt away from the bss and page
* tables.
*/
movl $R(end),%ecx
movl $R(edata),%edi
@ -337,14 +322,6 @@ NON_GPROF_ENTRY(btext)
movl %eax, %cr4
1:
#ifdef BDE_DEBUGGER
/*
* Adjust as much as possible for paging before enabling paging so that the
* adjustments can be traced.
*/
call bdb_prepare_paging
#endif
/* Now enable paging */
movl R(IdlePTD), %eax
movl %eax,%cr3 /* load ptd addr into mmu */
@ -352,15 +329,6 @@ NON_GPROF_ENTRY(btext)
orl $CR0_PE|CR0_PG,%eax /* enable paging */
movl %eax,%cr0 /* and let's page NOW! */
#ifdef BDE_DEBUGGER
/*
* Complete the adjustments for paging so that we can keep tracing through
* initi386() after the low (physical) addresses for the gdt and idt become
* invalid.
*/
call bdb_commit_paging
#endif
pushl $begin /* jump to high virtualized address */
ret
@ -819,11 +787,6 @@ no_kernend:
/* Map read-only from zero to the end of the kernel text section */
xorl %eax, %eax
#ifdef BDE_DEBUGGER
/* If the debugger is present, actually map everything read-write. */
cmpl $0,R(_bdb_exists)
jne map_read_write
#endif
xorl %edx,%edx
movl $R(etext),%ecx
addl $PAGE_MASK,%ecx
@ -834,7 +797,6 @@ no_kernend:
movl $R(etext),%eax
addl $PAGE_MASK, %eax
andl $~PAGE_MASK, %eax
map_read_write:
movl $PG_RW,%edx
movl R(KERNend),%ecx
subl %eax,%ecx
@ -928,83 +890,3 @@ map_read_write:
fillkpt(R(IdlePTD), $PG_RW)
ret
#ifdef BDE_DEBUGGER
bdb_prepare_paging:
cmpl $0,R(_bdb_exists)
je bdb_prepare_paging_exit
subl $6,%esp
/*
* Copy and convert debugger entries from the bootstrap gdt and idt
* to the kernel gdt and idt. Everything is still in low memory.
* Tracing continues to work after paging is enabled because the
* low memory addresses remain valid until everything is relocated.
* However, tracing through the setidt() that initializes the trace
* trap will crash.
*/
sgdt (%esp)
movl 2(%esp),%esi /* base address of bootstrap gdt */
movl $R(_gdt),%edi
movl %edi,2(%esp) /* prepare to load kernel gdt */
movl $8*18/4,%ecx
cld
rep /* copy gdt */
movsl
movl $R(_gdt),-8+2(%edi) /* adjust gdt self-ptr */
movb $0x92,-8+5(%edi)
lgdt (%esp)
sidt (%esp)
movl 2(%esp),%esi /* base address of current idt */
movl 8+4(%esi),%eax /* convert dbg descriptor to ... */
movw 8(%esi),%ax
movl %eax,R(bdb_dbg_ljmp+1) /* ... immediate offset ... */
movl 8+2(%esi),%eax
movw %ax,R(bdb_dbg_ljmp+5) /* ... and selector for ljmp */
movl 24+4(%esi),%eax /* same for bpt descriptor */
movw 24(%esi),%ax
movl %eax,R(bdb_bpt_ljmp+1)
movl 24+2(%esi),%eax
movw %ax,R(bdb_bpt_ljmp+5)
movl R(_idt),%edi
movl %edi,2(%esp) /* prepare to load kernel idt */
movl $8*4/4,%ecx
cld
rep /* copy idt */
movsl
lidt (%esp)
addl $6,%esp
bdb_prepare_paging_exit:
ret
/* Relocate debugger gdt entries and gdt and idt pointers. */
bdb_commit_paging:
cmpl $0,_bdb_exists
je bdb_commit_paging_exit
movl $gdt+8*9,%eax /* adjust slots 9-17 */
movl $9,%ecx
reloc_gdt:
movb $KERNBASE>>24,7(%eax) /* top byte of base addresses, was 0, */
addl $8,%eax /* now KERNBASE>>24 */
loop reloc_gdt
subl $6,%esp
sgdt (%esp)
addl $KERNBASE,2(%esp)
lgdt (%esp)
sidt (%esp)
addl $KERNBASE,2(%esp)
lidt (%esp)
addl $6,%esp
int $3
bdb_commit_paging_exit:
ret
#endif /* BDE_DEBUGGER */

View File

@ -1937,14 +1937,8 @@ init386(first)
gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss;
for (x = 0; x < NGDT; x++) {
#ifdef BDE_DEBUGGER
/* avoid overwriting db entries with APM ones */
if (x >= GAPMCODE32_SEL && x <= GAPMDATA_SEL)
continue;
#endif
for (x = 0; x < NGDT; x++)
ssdtosd(&gdt_segs[x], &gdt[x].sd);
}
r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1;
r_gdt.rd_base = (int) gdt;

View File

@ -199,11 +199,7 @@ struct region_descriptor {
#define GBIOSUTIL_SEL 13 /* BIOS interface (Utility) */
#define GBIOSARGS_SEL 14 /* BIOS interface (Arguments) */
#ifdef BDE_DEBUGGER
#define NGDT 18 /* some of 11-17 are reserved for debugger */
#else
#define NGDT 15
#endif
/*
* Entries in the Local Descriptor Table (LDT)

View File

@ -81,34 +81,16 @@
.type __CONCAT(X,name),@function; __CONCAT(X,name):
#define TRAP(a) pushl $(a) ; jmp alltraps
#ifdef BDE_DEBUGGER
#define BDBTRAP(name) \
ss ; \
cmpb $0,_bdb_exists ; \
je 1f ; \
testb $SEL_RPL_MASK,4(%esp) ; \
jne 1f ; \
ss ; \
.globl __CONCAT(__CONCAT(bdb_,name),_ljmp); \
__CONCAT(__CONCAT(bdb_,name),_ljmp): \
ljmp $0,$0 ; \
1:
#else
#define BDBTRAP(name)
#endif
MCOUNT_LABEL(user)
MCOUNT_LABEL(btrap)
IDTVEC(div)
pushl $0; TRAP(T_DIVIDE)
IDTVEC(dbg)
BDBTRAP(dbg)
pushl $0; TRAP(T_TRCTRAP)
IDTVEC(nmi)
pushl $0; TRAP(T_NMI)
IDTVEC(bpt)
BDBTRAP(bpt)
pushl $0; TRAP(T_BPTFLT)
IDTVEC(ofl)
pushl $0; TRAP(T_OFLOW)

View File

@ -155,11 +155,6 @@ vm86phystk: .long 0 /* PA of vm86/bios stack */
vm86paddr: .long 0 /* address of vm86 region */
vm86pa: .long 0 /* phys addr of vm86 region */
#ifdef BDE_DEBUGGER
.globl _bdb_exists /* flag to indicate BDE debugger is present */
_bdb_exists: .long 0
#endif
#ifdef PC98
.globl pc98_system_parameter
pc98_system_parameter:
@ -232,16 +227,6 @@ NON_GPROF_ENTRY(btext)
rep
movsb
#else /* IBM-PC */
#ifdef BDE_DEBUGGER
#ifdef BIOS_STEALS_3K
cmpl $0x0375c339,0x95504
#else
cmpl $0x0375c339,0x96104 /* XXX - debugger signature */
#endif
jne 1f
movb $1,R(_bdb_exists)
1:
#endif
/* Tell the bios to warmboot next time */
movw $0x1234,0x472
#endif /* PC98 */
@ -314,8 +299,8 @@ NON_GPROF_ENTRY(btext)
*
* XXX the gdt and idt are still somewhere in the boot program. We
* depend on the convention that the boot program is below 1MB and we
* are above 1MB to keep the gdt and idt away from the bss and page
* tables. The idt is only used if BDE_DEBUGGER is enabled.
* are above 1MB to keep the gdt and idt away from the bss and page
* tables.
*/
movl $R(end),%ecx
movl $R(edata),%edi
@ -337,14 +322,6 @@ NON_GPROF_ENTRY(btext)
movl %eax, %cr4
1:
#ifdef BDE_DEBUGGER
/*
* Adjust as much as possible for paging before enabling paging so that the
* adjustments can be traced.
*/
call bdb_prepare_paging
#endif
/* Now enable paging */
movl R(IdlePTD), %eax
movl %eax,%cr3 /* load ptd addr into mmu */
@ -352,15 +329,6 @@ NON_GPROF_ENTRY(btext)
orl $CR0_PE|CR0_PG,%eax /* enable paging */
movl %eax,%cr0 /* and let's page NOW! */
#ifdef BDE_DEBUGGER
/*
* Complete the adjustments for paging so that we can keep tracing through
* initi386() after the low (physical) addresses for the gdt and idt become
* invalid.
*/
call bdb_commit_paging
#endif
pushl $begin /* jump to high virtualized address */
ret
@ -819,11 +787,6 @@ no_kernend:
/* Map read-only from zero to the end of the kernel text section */
xorl %eax, %eax
#ifdef BDE_DEBUGGER
/* If the debugger is present, actually map everything read-write. */
cmpl $0,R(_bdb_exists)
jne map_read_write
#endif
xorl %edx,%edx
movl $R(etext),%ecx
addl $PAGE_MASK,%ecx
@ -834,7 +797,6 @@ no_kernend:
movl $R(etext),%eax
addl $PAGE_MASK, %eax
andl $~PAGE_MASK, %eax
map_read_write:
movl $PG_RW,%edx
movl R(KERNend),%ecx
subl %eax,%ecx
@ -928,83 +890,3 @@ map_read_write:
fillkpt(R(IdlePTD), $PG_RW)
ret
#ifdef BDE_DEBUGGER
bdb_prepare_paging:
cmpl $0,R(_bdb_exists)
je bdb_prepare_paging_exit
subl $6,%esp
/*
* Copy and convert debugger entries from the bootstrap gdt and idt
* to the kernel gdt and idt. Everything is still in low memory.
* Tracing continues to work after paging is enabled because the
* low memory addresses remain valid until everything is relocated.
* However, tracing through the setidt() that initializes the trace
* trap will crash.
*/
sgdt (%esp)
movl 2(%esp),%esi /* base address of bootstrap gdt */
movl $R(_gdt),%edi
movl %edi,2(%esp) /* prepare to load kernel gdt */
movl $8*18/4,%ecx
cld
rep /* copy gdt */
movsl
movl $R(_gdt),-8+2(%edi) /* adjust gdt self-ptr */
movb $0x92,-8+5(%edi)
lgdt (%esp)
sidt (%esp)
movl 2(%esp),%esi /* base address of current idt */
movl 8+4(%esi),%eax /* convert dbg descriptor to ... */
movw 8(%esi),%ax
movl %eax,R(bdb_dbg_ljmp+1) /* ... immediate offset ... */
movl 8+2(%esi),%eax
movw %ax,R(bdb_dbg_ljmp+5) /* ... and selector for ljmp */
movl 24+4(%esi),%eax /* same for bpt descriptor */
movw 24(%esi),%ax
movl %eax,R(bdb_bpt_ljmp+1)
movl 24+2(%esi),%eax
movw %ax,R(bdb_bpt_ljmp+5)
movl R(_idt),%edi
movl %edi,2(%esp) /* prepare to load kernel idt */
movl $8*4/4,%ecx
cld
rep /* copy idt */
movsl
lidt (%esp)
addl $6,%esp
bdb_prepare_paging_exit:
ret
/* Relocate debugger gdt entries and gdt and idt pointers. */
bdb_commit_paging:
cmpl $0,_bdb_exists
je bdb_commit_paging_exit
movl $gdt+8*9,%eax /* adjust slots 9-17 */
movl $9,%ecx
reloc_gdt:
movb $KERNBASE>>24,7(%eax) /* top byte of base addresses, was 0, */
addl $8,%eax /* now KERNBASE>>24 */
loop reloc_gdt
subl $6,%esp
sgdt (%esp)
addl $KERNBASE,2(%esp)
lgdt (%esp)
sidt (%esp)
addl $KERNBASE,2(%esp)
lidt (%esp)
addl $6,%esp
int $3
bdb_commit_paging_exit:
ret
#endif /* BDE_DEBUGGER */

View File

@ -1937,14 +1937,8 @@ init386(first)
gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss;
for (x = 0; x < NGDT; x++) {
#ifdef BDE_DEBUGGER
/* avoid overwriting db entries with APM ones */
if (x >= GAPMCODE32_SEL && x <= GAPMDATA_SEL)
continue;
#endif
for (x = 0; x < NGDT; x++)
ssdtosd(&gdt_segs[x], &gdt[x].sd);
}
r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1;
r_gdt.rd_base = (int) gdt;

View File

@ -199,11 +199,7 @@ struct region_descriptor {
#define GBIOSUTIL_SEL 13 /* BIOS interface (Utility) */
#define GBIOSARGS_SEL 14 /* BIOS interface (Arguments) */
#ifdef BDE_DEBUGGER
#define NGDT 18 /* some of 11-17 are reserved for debugger */
#else
#define NGDT 15
#endif
/*
* Entries in the Local Descriptor Table (LDT)

View File

@ -2016,14 +2016,8 @@ init386(first)
gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss;
for (x = 0; x < NGDT; x++) {
#ifdef BDE_DEBUGGER
/* avoid overwriting db entries with APM ones */
if (x >= GAPMCODE32_SEL && x <= GAPMDATA_SEL)
continue;
#endif
for (x = 0; x < NGDT; x++)
ssdtosd(&gdt_segs[x], &gdt[x].sd);
}
r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1;
r_gdt.rd_base = (int) gdt;

View File

@ -2016,14 +2016,8 @@ init386(first)
gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
gdt_segs[GPROC0_SEL].ssd_base = (int) &pc->pc_common_tss;
for (x = 0; x < NGDT; x++) {
#ifdef BDE_DEBUGGER
/* avoid overwriting db entries with APM ones */
if (x >= GAPMCODE32_SEL && x <= GAPMDATA_SEL)
continue;
#endif
for (x = 0; x < NGDT; x++)
ssdtosd(&gdt_segs[x], &gdt[x].sd);
}
r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1;
r_gdt.rd_base = (int) gdt;