PERFORCE change 41542 for review

Peter Wemm peter at FreeBSD.org
Wed Nov 5 19:20:03 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=41542

Change 41542 by peter at peter_daintree on 2003/11/05 19:19:57

	make things compile.
	deal with new mpboot.S

Affected files ...

.. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#23 edit
.. //depot/projects/hammer/sys/amd64/amd64/mpboot.S#2 edit
.. //depot/projects/hammer/sys/amd64/include/smp.h#10 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#23 (text+ko) ====

@@ -147,6 +147,7 @@
 static int	hlt_cpus_mask;
 static int	hlt_logical_cpus = 1;
 static struct	sysctl_ctx_list logical_cpu_clist;
+static u_int	bootMP_size;
 
 /*
  * Calculate usable address in base memory for AP trampoline code.
@@ -155,9 +156,10 @@
 mp_bootaddress(u_int basemem)
 {
 
-	boot_address = basemem & ~0xfff;	/* round down to 4k boundary */
+	bootMP_size = mptramp_end - mptramp_start;
+	boot_address = basemem & ~PAGE_MASK;	/* round down to 4k boundary */
 	if ((basemem - boot_address) < bootMP_size)
-		boot_address -= 4096;	/* not enough, lower by 4k */
+		boot_address -= PAGE_SIZE;	/* not enough, lower by 4k */
 
 	return boot_address;
 }

==== //depot/projects/hammer/sys/amd64/amd64/mpboot.S#2 (text+ko) ====

@@ -88,7 +88,7 @@
 	 * means we are required to use a temporary page table that is below
 	 * the 4GB limit.
 	 */
-	movl	$pagetables, %eax	XXX
+	movl	$pagetables, %eax
 	mov	%eax, %cr3
 
 	/*
@@ -111,13 +111,13 @@
 	mov	%eax, %cr3
 
 	.byte	0xea		/* opcode for far jump */
-	.long	entry_64	/* 64 bit flat address */
+	.quad	entry_64	/* 64 bit flat address */
 	.word	kernelcode-gdt	/* selector offset */
 
 	.p2align 4,0
 gdt:
 	/*
-	 * All segment descriptor tables start with a null descriptor */
+	 * All segment descriptor tables start with a null descriptor
 	 */
 	.long	0x00000000
 	.long	0x00000000
@@ -155,6 +155,9 @@
 
 gdtend:
 
+	.globl	pagetables
+pagetables:
+	.long	0
 	/*
 	 * The pseudo descriptor for lgdt to use.
 	 */

==== //depot/projects/hammer/sys/amd64/include/smp.h#10 (text+ko) ====

@@ -24,11 +24,9 @@
 #include <machine/intr_machdep.h>
 #include <machine/apicvar.h>
 
-/* global data in mpboot.s */
-extern int			bootMP_size;
-
-/* functions in mpboot.s */
-void	bootMP(void);
+/* global data in mpboot.S */
+extern char			mptramp_start[];
+extern char			mptramp_end[];
 
 /* global data in mp_machdep.c */
 extern int			mp_naps;


More information about the p4-projects mailing list