sys_mem.h 744 B

123456789101112131415161718192021
  1. /* Per-process anonymous heap (SYS_MEM_ALLOC/GROW/FREE).
  2. *
  3. * Ring-3 commands only have a 2 MB image/stack window, which is not enough
  4. * for a full-frame image. This service maps a single growable arena at
  5. * USER_HEAP_BASE into the caller's page directory. The reaper frees it with
  6. * the rest of the process.
  7. *
  8. * Ring-3 commands use the libc heap (libc/malloc.c: malloc/free/heap_reset),
  9. * which owns this arena. The SYS_MEM_* syscalls are the libc backend
  10. * (libc/ucmd_mem.c) and are not called directly by application code. */
  11. #ifndef SYS_MEM_H
  12. #define SYS_MEM_H
  13. struct process;
  14. int sys_mem_alloc(unsigned int bytes);
  15. int sys_mem_grow(unsigned int bytes);
  16. int sys_mem_free(void);
  17. void sys_mem_release(struct process *p);
  18. #endif