minix/drivers/memory/allocmem.c
Philip Homburg e9aabcf2f8 Disabled building rescue driver (no longer needed). Moved allocmem from
library to the memory driver. Always put output from within TTY directly on
the console. Removed second include of driver.h from tty.c. Made tty_inrepcode
bigger. First step to move PM and FS calls that are not regular (API)
system calls out of callnr.h (renumbered them, and removed them from the
table.c files). Imported the Minix-vmd uname implementation. This provides
a more stable ABI than the current implementation. Added a bit of security
checking. Unfortunately not nearly enough to get a secure system. Fixed a
bug related to the sizes of the programs in the image (in PM patch_mem_chunks).
2006-05-19 12:19:37 +00:00

14 lines
289 B
C

#include <lib.h>
#include <unistd.h>
PUBLIC int allocmem(size, base)
phys_bytes size; /* size of mem chunk requested */
phys_bytes *base; /* return base address */
{
message m;
m.m4_l1 = size;
if (_syscall(MM, ALLOCMEM, &m) < 0) return(-1);
*base = m.m4_l2;
return(0);
}