2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/kernel.h>
7 #include <aros/libcall.h>
9 #include <kernel_base.h>
10 #include <kernel_intern.h>
12 #include <proto/kernel.h>
14 /* See rom/kernel/mapglobal.c for documentation */
16 AROS_LH4(int, KrnMapGlobal
,
17 AROS_LHA(void *, virtual, A0
),
18 AROS_LHA(void *, physical
, A1
),
19 AROS_LHA(uint32_t, length
, D0
),
20 AROS_LHA(KRN_MapAttr
, flags
, D1
),
21 struct KernelBase
*, KernelBase
, 16, Kernel
)
25 BOOL invalid
= (flags
& (MAP_Readable
| MAP_Writable
| MAP_Executable
)) == 0;
26 BOOL readonly
= (flags
& MAP_Writable
) == 0;
27 BOOL supervisor
= (flags
& MAP_Supervisor
) != 0;
28 UBYTE cm
= (flags
& MAP_CacheInhibit
) ? CM_SERIALIZED
: ((flags
& MAP_WriteThrough
) ? CM_WRITETHROUGH
: CM_COPYBACK
);
30 return map_region(KernelBase
, virtual, physical
, length
, invalid
, readonly
, supervisor
, cm
);