Skip to content

Commit

Permalink
thanks eyalz800
Browse files Browse the repository at this point in the history
  • Loading branch information
kaashoek committed Aug 30, 2018
1 parent 8f63bea commit 96e4e2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion memlayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 96e4e2f

Please sign in to comment.