1 #include <aros/kernel.h>
2 #include <aros/libcall.h>
4 #include <kernel_base.h>
5 #include <kernel_intern.h>
7 /*****************************************************************************
10 #include <proto/kernel.h>
12 AROS_LH3(void, KrnSetProtection
,
15 AROS_LHA(void *, address
, A0
),
16 AROS_LHA(uint32_t, length
, D0
),
17 AROS_LHA(KRN_MapAttr
, flags
, D1
),
20 struct KernelBase
*, KernelBase
, 21, Kernel
)
38 ******************************************************************************/
42 BOOL invalid
= (flags
& (MAP_Readable
| MAP_Writable
| MAP_Executable
)) == 0;
43 BOOL readonly
= (flags
& MAP_Writable
) == 0;
44 BOOL supervisor
= (flags
& MAP_Supervisor
) != 0;
45 UBYTE cm
= (flags
& MAP_CacheInhibit
) ? CM_SERIALIZED
: ((flags
& MAP_WriteThrough
) ? CM_WRITETHROUGH
: CM_COPYBACK
);
47 /* We need MAP_Supervisor and MAP_CacheInhibitSerialized */
49 if ((ULONG
)address
< 0x00200000 && cm
== CM_SERIALIZED
)
50 cm
= CM_NONCACHEABLE
; /* Chip RAM does not need to be non-cacheable + serialized, only noncacheable */
52 map_region(KernelBase
, address
, NULL
, length
, invalid
, readonly
, supervisor
, cm
);