2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/libcall.h>
7 #include <aros/kernel.h>
11 #include "kernel_base.h"
12 #include "kernel_mingw32.h"
14 static unsigned int access_map
[] =
18 PAGE_READWRITE
, /* Windows has no write-only access */
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
)
30 unsigned int win_flags
= access_map
[(flags
& 0x0300) >> 8];
32 if (flags
& MAP_Executable
)
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
);