From b933a9955a2a1eb0ab32b232e23d24dc207cba46 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 9 Aug 2020 18:50:17 +0200 Subject: Added syscall templates --- lib/inc/cpu.h | 1 + lib/inc/sys.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 lib/inc/sys.h (limited to 'lib/inc') diff --git a/lib/inc/cpu.h b/lib/inc/cpu.h index eb09291..2d367cb 100644 --- a/lib/inc/cpu.h +++ b/lib/inc/cpu.h @@ -17,6 +17,7 @@ void cli(); void sti(); void hlt(); void idle(); +void loop(); static inline void spinlock(int *ptr) { diff --git a/lib/inc/sys.h b/lib/inc/sys.h new file mode 100644 index 0000000..aaeb6ca --- /dev/null +++ b/lib/inc/sys.h @@ -0,0 +1,16 @@ +// MIT License, Copyright (c) 2020 Marvin Borner +// Syscall implementation + +#ifndef SYS_H +#define SYS_H + +enum sys { SYS_HALT, SYS_EXEC }; + +int sys0(enum sys num); +int sys1(enum sys num, int d1); +int sys2(enum sys num, int d1, int d2); +int sys3(enum sys num, int d1, int d2, int d3); +int sys4(enum sys num, int d1, int d2, int d3, int d4); +int sys5(enum sys num, int d1, int d2, int d3, int d4, int d5); + +#endif -- cgit v1.2.3