From 28870fc37564dff19161306d865ccf329357a81f Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 14 Apr 2021 18:16:31 +0200 Subject: [PATCH] Correct cast --- src/core/paging.h | 2 +- src/core/scheduler.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/paging.h b/src/core/paging.h index 58a33b2..5329384 100644 --- a/src/core/paging.h +++ b/src/core/paging.h @@ -9,7 +9,7 @@ #else #define PAGING_MAX_DIR_ENTRY PAGING_MAX_PAGES/1024 #endif -#define PADDR(entry) (entry&0xFFFFF000) +#define PADDR(entry) (((u32)entry)&0xFFFFF000) /** * Configure and enable paging diff --git a/src/core/scheduler.c b/src/core/scheduler.c index 7b1c421..848b7b7 100644 --- a/src/core/scheduler.c +++ b/src/core/scheduler.c @@ -24,7 +24,7 @@ void clock(){ void run_task(int *page_dir, void *task, int task_size){ // Compute various addresses - int*pt_addr=PADDR(page_dir[1]); + int*pt_addr=(int*)PADDR(page_dir[1]); void *entry_point=(void*)(PADDR(pt_addr[3])); void *ustack=(void*)((int)entry_point+0xFF);