2 Copyright © 2015-2017, The AROS Development Team. All rights reserved.
8 #include <aros/types/spinlock_s.h>
9 #include <aros/kernel.h>
10 #include <aros/libcall.h>
11 #include <utility/hooks.h>
13 #include <kernel_base.h>
15 /*****************************************************************************
18 #include <proto/kernel.h>
20 AROS_LH3(spinlock_t
*, KrnSpinLock
,
23 AROS_LHA(spinlock_t
*, lock
, A1
),
24 AROS_LHA(struct Hook
*, failhook
, A0
),
25 AROS_LHA(ULONG
, mode
, D0
),
28 struct KernelBase
*, KernelBase
, 52, Kernel
)
33 lock - spinlock to lock
34 failhook - called if the lock is already held
35 mode - type of lock to obtain.
38 returns a pointer to the spinlock "handle".
41 The failhook is necessary, because it is not safe
42 for code running in user space to spin on a shared lock.
43 If a lower priority task holds the lock, it will never be released.
44 Because of this, Exec uses a hook that puts the task on
45 a spinning list, to allow other code to run until the lock is
46 released. At this point the "spinning" task will wake and
57 ******************************************************************************/
61 /* The implementation of this function is architecture-specific */