From 96e4e2f4d1dd9a8634088dcd19a9e343b711f7ea Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Thu, 30 Aug 2018 13:46:48 -0400 Subject: [PATCH] thanks eyalz800 --- main.c | 2 +- memlayout.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 774ed54..9924e64 100644 --- 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)); diff --git a/memlayout.h b/memlayout.h index 70c1968..d1615f7 100644 --- a/memlayout.h +++ b/memlayout.h @@ -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