Added a test for MUIA_Listview_SelectChange.
[AROS.git] / arch / all-unix / kernel / allocpages.c
blob4995c416a55c95a663326929a12f27cb91253ff2
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/libcall.h>
8 #include <kernel_base.h>
9 #include <kernel_intern.h>
11 #include <sys/mman.h>
12 #include <inttypes.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)
20 AROS_LIBFUNC_INIT
22 int flags_unix = 0;
23 void *map = 0;
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);
34 AROS_HOST_BARRIER
36 return map;
38 AROS_LIBFUNC_EXIT