summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/Makefile2
-rw-r--r--src/kernel/lib/sched.cpp (renamed from src/kernel/lib/sched.c)1
-rw-r--r--src/kernel/task/task.cpp4
-rw-r--r--src/kernel/task/task.h4
4 files changed, 6 insertions, 5 deletions
diff --git a/src/kernel/Makefile b/src/kernel/Makefile
index a6ad58a..ba65580 100644
--- a/src/kernel/Makefile
+++ b/src/kernel/Makefile
@@ -10,7 +10,7 @@ Obj = core/loader_.o core/kmain.o core/sys.o \
include $(SrcPath)/common.make
-CFLAGS += -I $(SrcPath)/include -I . -I ./lib
+CFLAGS += -I $(SrcPath)/include -I . -I ./lib -Wno-error=unused-variable
LDFLAGS += -T link.ld -Map kernel.map
diff --git a/src/kernel/lib/sched.c b/src/kernel/lib/sched.cpp
index 29ea8a8..06900d1 100644
--- a/src/kernel/lib/sched.c
+++ b/src/kernel/lib/sched.cpp
@@ -1,4 +1,5 @@
#include <sched.h>
+#include <task/task.h>
/* Internal use only. This function is atomic, meaning it cannot be interrupted by a system task switch. */
static uint32_t atomic_exchange(uint32_t* ptr, uint32_t newval) {
diff --git a/src/kernel/task/task.cpp b/src/kernel/task/task.cpp
index 7eb2b36..03425b5 100644
--- a/src/kernel/task/task.cpp
+++ b/src/kernel/task/task.cpp
@@ -349,7 +349,7 @@ static void process_finish(process *pr, int retval) {
if (proc_count == 0) PANIC("No more processes are running! This is bad! Or is it?");
}
-size_t process::sbrk(size_t size) {
+size_t process::sbrk(ptrdiff_t size) {
if (data == 0) return -1;
ASSERT(data < K_HIGHHALF_ADDR);
if (data + size >= K_HIGHHALF_ADDR) return -1;
@@ -420,7 +420,7 @@ void* process::set_args(char** args) {
// ===================== SYSTEM CALLS
-size_t process_sbrk(size_t size) {
+size_t process_sbrk(ptrdiff_t size) {
return current_process->sbrk(size);
}
diff --git a/src/kernel/task/task.h b/src/kernel/task/task.h
index 8a0e94a..e6e0c6e 100644
--- a/src/kernel/task/task.h
+++ b/src/kernel/task/task.h
@@ -44,7 +44,7 @@ class process {
process(process *parent, uint32_t uid, uint32_t privilege);
void* set_args(char** args);
- size_t sbrk(size_t size);
+ size_t sbrk(ptrdiff_t size);
};
class thread {
@@ -81,7 +81,7 @@ int proc_priv(); //Returns current privilege level
// syscalls
void thread_exit();
void process_exit(size_t retval);
-size_t process_sbrk(size_t size);
+size_t process_sbrk(ptrdiff_t size);
void process_brk(size_t ptr);
int process_run(char* file, char** args, FILE zero_fd);
int process_waitpid(int pid, int block);