2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/libcall.h>
8 #include <kernel_base.h>
9 #include <kernel_intern.h>
14 AROS_LH3I(void *, KrnAllocPages
,
15 AROS_LHA(uint32_t, length
, D0
),
16 AROS_LHA(uint32_t, flags
, D1
),
17 AROS_LHA(KRN_MapAttr
, protection
, D2
),
18 struct KernelBase
*, KernelBase
, 27, Kernel
)
25 if (protection
& MAP_Readable
)
26 flags_unix
|= PROT_READ
;
27 if (protection
& MAP_Writable
)
28 flags_unix
|= PROT_WRITE
;
29 if (protection
& MAP_Executable
)
30 flags_unix
|= PROT_EXEC
;
32 /* Darwin does not define MAP_ANONYMOUS */
33 map
= KernelIFace
.mmap(NULL
, length
, flags_unix
, MAP_PRIVATE
| MAP_ANON
, -1, 0);