Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 2002 12:40:35 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17877 for review
Message-ID:  <200209211940.g8LJeZq5046633@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209211940.g8LJeZq5046633>