From owner-p4-projects Sat Sep 21 12:40:40 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 85E0737B404; Sat, 21 Sep 2002 12:40:36 -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 2F41437B401 for ; Sat, 21 Sep 2002 12:40:36 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3F2C43E77 for ; Sat, 21 Sep 2002 12:40:35 -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 g8LJeZCo046636 for ; Sat, 21 Sep 2002 12:40:35 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8LJeZq5046633 for perforce@freebsd.org; Sat, 21 Sep 2002 12:40:35 -0700 (PDT) Date: Sat, 21 Sep 2002 12:40:35 -0700 (PDT) Message-Id: <200209211940.g8LJeZq5046633@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 17877 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=17877 Change 17877 by peter@peter_overcee on 2002/09/21 12:40:00 In response to prodding by jake, move some variables to C, and use bss. Since we depend on loader, which clears bss before starting us, this is now safe. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#13 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#19 edit .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#5 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#13 (text+ko) ==== @@ -93,30 +93,16 @@ /* * Globals */ - .data + .bss ALIGN_DATA /* just to be sure */ - .globl HIDENAME(tmpstk) .space 0x2000 /* space for tmpstk - temporary stack */ HIDENAME(tmpstk): - .globl modulep -modulep: .long 0 /* phys addr of metadata table */ - - .globl KERNend -KERNend: .long 0 /* phys addr end of kernel (just after bss) */ -physfree: .long 0 /* phys addr of next free page */ - - .globl IdlePTD -IdlePTD: .long 0 /* phys addr of kernel PTD */ - -KPTphys: .long 0 /* phys addr of kernel page tables */ - - .globl proc0uarea, proc0kstack -proc0uarea: .long 0 /* address of proc 0 uarea space */ -proc0kstack: .long 0 /* address of proc 0 kstack space */ -p0upa: .long 0 /* phys addr of proc0's UAREA */ -p0kpa: .long 0 /* phys addr of proc0's STACK */ +physfree: .space 4 /* phys addr of next free page */ +KPTphys: .space 4 /* phys addr of kernel page tables */ +p0upa: .space 4 /* phys addr of proc0's UAREA */ +p0kpa: .space 4 /* phys addr of proc0's STACK */ /********************************************************************** * ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#19 (text+ko) ==== @@ -133,6 +133,12 @@ int _udatasel, _ucodesel; u_int atdevbase; +/* These are written in 32 bit mode */ +u_int32_t modulep; /* phys addr of metadata table */ +u_int32_t IdlePTD; /* phys addr of kernel PTD */ +struct user *proc0uarea; /* address of proc 0 uarea space */ +vm_offset_t proc0kstack; /* address of proc 0 kstack space */ + #if defined(SWTCH_OPTIM_STATS) extern int swtch_optim_stats; SYSCTL_INT(_debug, OID_AUTO, swtch_optim_stats, @@ -647,8 +653,6 @@ static struct i386tss dblfault_tss; static char dblfault_stack[PAGE_SIZE]; -extern struct user *proc0uarea; -extern vm_offset_t proc0kstack; /* software prototypes -- in more palatable form */ @@ -1140,7 +1144,7 @@ */ proc_linkup(&proc0, &ksegrp0, &kse0, &thread0); - preload_metadata = (caddr_t)modulep + KERNBASE; + preload_metadata = modulep + KERNBASE; preload_bootstrap_relocate(KERNBASE); kmdp = preload_search_by_type("elf kernel"); boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#5 (text+ko) ==== @@ -156,7 +156,7 @@ static int nkpt; vm_offset_t kernel_vm_end; -extern u_int32_t KERNend; +u_int32_t KERNend; /* Written in 32 bit mode */ /* * Data for the pv entry allocation mechanism To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message