remove erroneous line
[AROS.git] / arch / all-mingw32 / kernel / setprotection.c
blob70c932ff0c819a49babd8a717acacadcbaf14c32
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/libcall.h>
7 #include <aros/kernel.h>
9 #include <inttypes.h>
11 #include "kernel_base.h"
12 #include "kernel_mingw32.h"
14 static unsigned int access_map[] =
16 PAGE_NOACCESS,
17 PAGE_READONLY,
18 PAGE_READWRITE, /* Windows has no write-only access */
19 PAGE_READWRITE
22 AROS_LH3(void, KrnSetProtection,
23 AROS_LHA(void *, address, A0),
24 AROS_LHA(uint32_t, length, D0),
25 AROS_LHA(KRN_MapAttr, flags, D1),
26 struct KernelBase *, KernelBase, 21, Kernel)
28 AROS_LIBFUNC_INIT
30 unsigned int win_flags = access_map[(flags & 0x0300) >> 8];
32 if (flags & MAP_Executable)
33 win_flags <<= 4;
35 if (flags & MAP_CacheInhibit)
36 win_flags = PAGE_NOCACHE;
37 if (flags & MAP_WriteThrough) /* FIXME: is it correct mapping? */
38 win_flags |= PAGE_WRITECOMBINE;
39 if (flags & MAP_Guarded)
40 win_flags |= PAGE_GUARD;
42 KernelIFace.core_protect(address, length, win_flags);
44 AROS_LIBFUNC_EXIT