2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <exec/memory.h>
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
17 AROS_LH1(ULONG
, TypeOfMem
,
20 AROS_LHA(APTR
, address
, A1
),
23 struct ExecBase
*, SysBase
, 89, Exec
)
26 Return type of memory at a given address or 0 if there is no memory
30 address - Address to test
33 The memory flags you would give to AllocMem().
45 ******************************************************************************/
52 /* Nobody should change the memory list now. */
55 /* Follow the list of MemHeaders */
56 mh
=(struct MemHeader
*)SysBase
->MemList
.lh_Head
;
57 while(mh
->mh_Node
.ln_Succ
!=NULL
)
59 /* Check if this MemHeader fits */
60 if(address
>=mh
->mh_Lower
&&address
<mh
->mh_Upper
)
62 /* Yes. Prepare returncode */
63 ret
=mh
->mh_Attributes
;
66 /* Go to next MemHeader */
67 mh
=(struct MemHeader
*)mh
->mh_Node
.ln_Succ
;
69 /* Allow Taskswitches and return */