diff options
Diffstat (limited to 'lib/inc')
-rw-r--r-- | lib/inc/mem.h | 1 | ||||
-rw-r--r-- | lib/inc/sys.h | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/inc/mem.h b/lib/inc/mem.h index 9399b54..0030b3d 100644 --- a/lib/inc/mem.h +++ b/lib/inc/mem.h @@ -17,7 +17,6 @@ #error "No lib target specified. Please use -Dkernel or -Duserspace" #endif -// TODO: Use malloc as syscall u32 HEAP; u32 HEAP_START; diff --git a/lib/inc/sys.h b/lib/inc/sys.h index aefaead..16d3c4f 100644 --- a/lib/inc/sys.h +++ b/lib/inc/sys.h @@ -4,7 +4,7 @@ #ifndef SYS_H #define SYS_H -enum sys { SYS_LOOP, SYS_MALLOC, SYS_FREE, SYS_EXEC }; +enum sys { SYS_LOOP, SYS_MALLOC, SYS_FREE, SYS_EXEC, SYS_EXIT }; int sys0(enum sys num); int sys1(enum sys num, int d1); @@ -13,4 +13,15 @@ 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); +/** + * Wrappers + */ + +#define loop() sys0(SYS_LOOP) +#define exec(path) sys1(SYS_EXEC, (int)path) +#define exit() \ + sys0(SYS_EXIT); \ + while (1) { \ + } + #endif |