From 68a0ad7f21ba07b93cd63613996e27afd8780f9c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 21 Mar 2021 00:13:13 +0100 Subject: Added basic shared memory support This will be improved soon. It's very insecure right now. --- libc/sys.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libc/sys.c') diff --git a/libc/sys.c b/libc/sys.c index aac2d1e..db31f37 100644 --- a/libc/sys.c +++ b/libc/sys.c @@ -83,6 +83,17 @@ void *sys_alloc(u32 size) return (void *)sys1(SYS_ALLOC, (int)size); } +u32 shalloc(u32 size) +{ + return (u32)sys1(SYS_SHALLOC, (int)size); +} + +void *shaccess(u32 id) +{ + return (void *)sys1(SYS_SHACCESS, (int)id); +} + +// TODO: Freeing by ptr + size could be a security risk -> only by address! void sys_free(void *ptr, u32 size) { sys2(SYS_FREE, (int)ptr, (int)size); -- cgit v1.2.3