PERFORCE change 28345 for review

Peter Wemm peter at FreeBSD.org
Sun Apr 6 11:37:50 PDT 2003


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

Change 28345 by peter at peter_overcee on 2003/04/06 11:36:54

	connect up the x86-64 trampoline to elf64_freebsd

Affected files ...

.. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#4 edit

Differences ...

==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#4 (text+ko) ====

@@ -53,6 +53,8 @@
 u_int32_t entry_hi;
 u_int32_t entry_lo;
 
+extern x86_64_tramp();
+
 /*
  * There is an a.out kernel and one or more a.out modules loaded.  
  * We wish to start executing the kernel image, so make such 
@@ -98,12 +100,12 @@
 	bzero(PT2, PAGE_SIZE);
 
 	/* single PML4 entry */
-	PT4[0] = (p4_entry_t)&PT3[0];
+	PT4[0] = (p4_entry_t)(uintptr_t)&PT3[0];
 	PT4[0] |= PG_V | PG_RW | PG_U;
 
 	/* four PDP entries, 1G each */
 	for (i = 0; i < 4; i++) {
-		PT3[i] = (p3_entry_t)&PT2[i * 512];
+		PT3[i] = (p3_entry_t)(uintptr_t)&PT2[i * 512];
 		PT3[i] |= PG_V | PG_RW | PG_U;
 	}
 
@@ -113,10 +115,12 @@
 		PT2[i] |= PG_V | PG_RW | PG_PS | PG_U;
 	}
 
-    printf("Start @ 0x%lx ...\n", entry);
+    printf("entry_hi: %#x \n", entry_hi);
+    printf("entry_lo: %#x \n", entry_lo);
+    printf("Start @ %#llx ...\n", entry);
 
     dev_cleanup();
-    __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend);
+    __exec((void *)x86_64_tramp, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend);
 
     panic("exec returned");
 }


More information about the p4-projects mailing list