From c9cbeced5b3f2bdd7407e29c0811e65954132540 Mon Sep 17 00:00:00 2001 From: Root THC Date: Tue, 24 Feb 2026 12:42:47 +0000 Subject: initial --- other/Kermit/src/sys_malloc.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 other/Kermit/src/sys_malloc.c (limited to 'other/Kermit/src/sys_malloc.c') diff --git a/other/Kermit/src/sys_malloc.c b/other/Kermit/src/sys_malloc.c new file mode 100644 index 0000000..96a3b4d --- /dev/null +++ b/other/Kermit/src/sys_malloc.c @@ -0,0 +1,27 @@ +/* + * sys_malloc: system call for malloc'ing kernel memory + * written by palmers / teso + */ +#include +#include + +/* from linux/mm.h */ +#define __GFP_WAIT 0x01 +#define __GFP_MED 0x04 +#define __GFP_IO 0x10 +#define GFP_KERNEL (__GFP_MED | __GFP_WAIT | __GFP_IO) + + +void cbegin (){} + +void *sys_malloc (size_t x) /* malloc x bytes */ +{ + USE_KMALLOC + void *y = NULL; + + y = kmalloc (x, GFP_KERNEL); + return y; +} + +void cend(){} + -- cgit v1.3