2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Add a low memory handler.
9 #include <aros/debug.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <proto/exec.h>
14 #include "exec_intern.h"
16 /*****************************************************************************
20 AROS_LH1(void, AddMemHandler
,
23 AROS_LHA(struct Interrupt
*, memHandler
, A1
),
26 struct ExecBase
*, SysBase
, 129, Exec
)
29 Add some function to be called if the system is low on memory.
32 memHandler - An Interrupt structure to add to the low memory
47 ******************************************************************************/
50 ASSERT_VALID_PTR(memHandler
);
52 /* Protect the low memory handler list */
53 ObtainSemaphore(&PrivExecBase(SysBase
)->LowMemSem
);
55 /* Nothing spectacular: Just add the new node */
56 Enqueue((struct List
*)&SysBase
->ex_MemHandlers
,&memHandler
->is_Node
);
58 ReleaseSemaphore(&PrivExecBase(SysBase
)->LowMemSem
);