From owner-p4-projects Fri Sep 20 19:53:40 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9483F37B404; Fri, 20 Sep 2002 19:53:30 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 88AA437B401 for ; Fri, 20 Sep 2002 19:53:29 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 346BE43E6A for ; Fri, 20 Sep 2002 19:53:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8L2rTCo096285 for ; Fri, 20 Sep 2002 19:53:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8L2rSYZ096282 for perforce@freebsd.org; Fri, 20 Sep 2002 19:53:28 -0700 (PDT) Date: Fri, 20 Sep 2002 19:53:28 -0700 (PDT) Message-Id: <200209210253.g8L2rSYZ096282@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 17812 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17812 Change 17812 by peter@peter_daintree on 2002/09/20 19:53:18 Remove BDE_DEBUGGER with extreme prejudice. I've wanted to do this for ages. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/segments.h#2 edit .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#4 edit .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#5 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/segments.h#2 (text+ko) ==== @@ -220,11 +220,7 @@ #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) ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#4 (text+ko) ==== @@ -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) ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#5 (text+ko) ==== @@ -149,11 +149,6 @@ p0upa: .long 0 /* phys addr of proc0's UAREA */ p0kpa: .long 0 /* phys addr of proc0's STACK */ -#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: @@ -226,16 +221,6 @@ 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 */ @@ -309,7 +294,7 @@ * 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. + * tables. The idt is not used. */ movl $R(end),%ecx movl $R(edata),%edi @@ -329,16 +314,7 @@ movl %cr4, %eax orl $CR4_VME, %eax 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 */ @@ -346,15 +322,6 @@ 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 @@ -754,12 +721,7 @@ #endif /* SMP */ /* 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 %eax,%eax xorl %edx,%edx movl $R(etext),%ecx addl $PAGE_MASK,%ecx @@ -847,83 +809,3 @@ 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 */ ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#6 (text+ko) ==== @@ -1284,14 +1284,8 @@ 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; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message