PERFORCE change 30158 for review

Peter Wemm peter at FreeBSD.org
Wed Apr 30 15:16:03 PDT 2003


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

Change 30158 by peter at peter_daintree on 2003/04/30 15:15:52

	Tidy up a little.

Affected files ...

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

Differences ...

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

@@ -43,6 +43,11 @@
 
 struct file_format x86_64_elf = { elf64_loadfile, elf64_exec };
 
+#define PG_V	0x001
+#define PG_RW	0x002
+#define PG_U	0x004
+#define PG_PS	0x080
+
 typedef u_int64_t p4_entry_t;
 typedef u_int64_t p3_entry_t;
 typedef u_int64_t p2_entry_t;
@@ -77,37 +82,31 @@
     if (err != 0)
 	return(err);
 
-#define PG_V	0x001
-#define PG_RW	0x002
-#define PG_U	0x004
-#define PG_PS	0x080
-	bzero(PT4, PAGE_SIZE);
-	bzero(PT3, PAGE_SIZE);
-	bzero(PT2, PAGE_SIZE);
+    bzero(PT4, PAGE_SIZE);
+    bzero(PT3, PAGE_SIZE);
+    bzero(PT2, PAGE_SIZE);
 
-	/* single PML4 entry */
-	PT4[0] = (p4_entry_t)VTOP((uintptr_t)&PT3[0]);
-	PT4[0] |= PG_V | PG_RW | PG_U;
+    /* single PML4 entry */
+    PT4[0] = (p4_entry_t)VTOP((uintptr_t)&PT3[0]);
+    PT4[0] |= PG_V | PG_RW | PG_U;
 
-	/* Direct map 1GB at address zero */
-	PT3[0] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]);
-	PT3[0] |= PG_V | PG_RW | PG_U;
+    /* Direct map 1GB at address zero */
+    PT3[0] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]);
+    PT3[0] |= PG_V | PG_RW | PG_U;
 
-	/* Direct map 1GB at KERNBASE (hardcoded for now) */
-	PT3[1] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]);
-	PT3[1] |= PG_V | PG_RW | PG_U;
+    /* Direct map 1GB at KERNBASE (hardcoded for now) */
+    PT3[1] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]);
+    PT3[1] |= PG_V | PG_RW | PG_U;
 
-	/* 512 PG_PS (2MB) page mappings for 1GB of direct mapping */
-	for (i = 0; i < 512; i++) {
-		PT2[i] = i * (2 * 1024 * 1024);
-		PT2[i] |= PG_V | PG_RW | PG_PS | PG_U;
-	}
+    /* 512 PG_PS (2MB) page mappings for 1GB of direct mapping */
+    for (i = 0; i < 512; i++) {
+	PT2[i] = i * (2 * 1024 * 1024);
+	PT2[i] |= PG_V | PG_RW | PG_PS | PG_U;
+    }
 
     entry_lo = ehdr->e_entry & 0xffffffff;
     entry_hi = (ehdr->e_entry >> 32) & 0xffffffff;
 #ifdef DEBUG
-    printf("modulep: 0x%x\n", modulep);
-    printf("kernend: 0x%x\n", kernend);
     printf("Start @ %#llx ...\n", ehdr->e_entry);
 #endif
 


More information about the p4-projects mailing list