1 #include <aros/libcall.h>
3 #include <kernel_base.h>
4 #include <kernel_intern.h>
9 AROS_LH3I(void *, KrnAllocPages
,
10 AROS_LHA(uint32_t, length
, D0
),
11 AROS_LHA(uint32_t, flags
, D1
),
12 AROS_LHA(KRN_MapAttr
, protection
, D2
),
13 struct KernelBase
*, KernelBase
, 27, Kernel
)
20 if (protection
& MAP_Readable
)
21 flags_unix
|= PROT_READ
;
22 if (protection
& MAP_Writable
)
23 flags_unix
|= PROT_WRITE
;
24 if (protection
& MAP_Executable
)
25 flags_unix
|= PROT_EXEC
;
27 /* Darwin does not define MAP_ANONYMOUS */
28 map
= KernelIFace
.mmap(NULL
, length
, flags_unix
, MAP_PRIVATE
| MAP_ANON
, -1, 0);