]> Devi Nivas Git - cs3210-lab0.git/commitdiff
thanks eyalz800
authorFrans Kaashoek <kaashoek@mit.edu>
Thu, 30 Aug 2018 17:46:48 +0000 (13:46 -0400)
committerFrans Kaashoek <kaashoek@mit.edu>
Thu, 30 Aug 2018 17:46:48 +0000 (13:46 -0400)
main.c
memlayout.h

diff --git a/main.c b/main.c
index 774ed5467cea421576b75a885879ff85bd4904d2..9924e64ba41eb78f2a2195f3c218ba5e7aedf3c1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -83,7 +83,7 @@ startothers(void)
     // is running in low  memory, so we use entrypgdir for the APs too.
     stack = kalloc();
     *(void**)(code-4) = stack + KSTACKSIZE;
-    *(void**)(code-8) = mpenter;
+    *(void(**)(void))(code-8) = mpenter;
     *(int**)(code-12) = (void *) V2P(entrypgdir);
 
     lapicstartap(c->apicid, V2P(code));
index 70c1968e1a3c421c32262ff2255af7ab5a67b302..d1615f7abcaa0edbd1bf86d3d62ab341eb7c90c0 100644 (file)
@@ -9,7 +9,7 @@
 #define KERNLINK (KERNBASE+EXTMEM)  // Address where kernel is linked
 
 #define V2P(a) (((uint) (a)) - KERNBASE)
-#define P2V(a) (((void *) (a)) + KERNBASE)
+#define P2V(a) ((void *)(((char *) (a)) + KERNBASE))
 
 #define V2P_WO(x) ((x) - KERNBASE)    // same as V2P, but without casts
 #define P2V_WO(x) ((x) + KERNBASE)    // same as P2V, but without casts