make.tmpl: add missing compiler attribute to build_progs
[AROS.git] / arch / m68k-all / kernel / mapglobal.c
blobda9c2138b1132b6e8353ebbee1eeb175fe7c21eb
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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)
23 AROS_LIBFUNC_INIT
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);
32 AROS_LIBFUNC_EXIT