repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
. service tells you which device it couldn't stat
[minix3.git]
/
drivers
/
memory
/
allocmem.c
blob
31599da7380f4a5b54e21223abe5ac8da93e20b8
1
#include <lib.h>
2
#include <unistd.h>
3
4
PUBLIC
int
allocmem
(
size
,
base
)
5
phys_bytes size
;
/* size of mem chunk requested */
6
phys_bytes
*
base
;
/* return base address */
7
{
8
message m
;
9
m
.
m4_l1
=
size
;
10
if
(
_syscall
(
MM
,
ALLOCMEM
, &
m
) <
0
)
return
(-
1
);
11
*
base
=
m
.
m4_l2
;
12
return
(
0
);
13
}
14