From 21f2723545cd9efdfcfd0b51abf611414fe4819c Mon Sep 17 00:00:00 2001 From: NicJA Date: Thu, 30 Apr 2015 10:37:29 +0000 Subject: [PATCH] use the spinlock_t header, and add the stubs to the kernel git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@50521 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- rom/kernel/kernel.conf | 7 +++++++ rom/kernel/mmakefile.src | 3 ++- rom/kernel/spininit.c | 3 ++- rom/kernel/spinislocked.c | 3 ++- rom/kernel/spinlock.c | 3 ++- rom/kernel/spintrylock.c | 3 ++- rom/kernel/spinunlock.c | 3 ++- 7 files changed, 19 insertions(+), 6 deletions(-) diff --git a/rom/kernel/kernel.conf b/rom/kernel/kernel.conf index ed0751e71a..6b7b75f9b1 100644 --- a/rom/kernel/kernel.conf +++ b/rom/kernel/kernel.conf @@ -6,6 +6,7 @@ libbasetype struct KernelBase options noresident ##end config ##begin cdef +#include #include #include #include @@ -31,6 +32,7 @@ static inline void __inline_KrnPrintf(APTR __KernelBase, const char *format, ... ##end cdef ##begin cdefprivate +#include #include #include ##end cdefprivate @@ -72,5 +74,10 @@ unsigned int KrnGetCPUCount() () uint32_t KrnGetCPUNumber() () uint32_t KrnGetCPUMask(uint32_t number) (D0) void KrnModifyIRQHandler(void *handle, void *handlerData, void *handlerData2) (A0, A1, A2) +void KrnSpinInit(spinlock_t *lock) (A0) +int KrnSpinIsLocked(spinlock_t *lock) (A0) +spinlock_t *KrnSpinTryLock(spinlock_t *lock, ULONG mode) (A0, D0) +spinlock_t *KrnSpinLock(spinlock_t *lock, ULONG mode) (A0, D0) +void KrnSpinUnLock(spinlock_t *lock) (A0) # One LVO is reserved here for IPI ##end functionlist diff --git a/rom/kernel/mmakefile.src b/rom/kernel/mmakefile.src index 114a2367ee..ccd4e6aaed 100644 --- a/rom/kernel/mmakefile.src +++ b/rom/kernel/mmakefile.src @@ -21,7 +21,8 @@ ifneq ($(AROS_TARGET_VARIANT),) -include $(SRCDIR)/arch/$(CPU)-$(ARCH)/$(AROS_TARGET_VARIANT)/kernel/make.opts endif -FUNCS := addexceptionhandler addirqhandler bug cause cli createcontext deletecontext \ +FUNCS := spininit spinislocked spintrylock spinlock spinunlock addexceptionhandler \ + addirqhandler bug cause cli createcontext deletecontext \ displayalert dispatch getbootinfo getscheduler issuper mapglobal modifyirqhandler \ remexceptionhandler remirqhandler schedule setprotection setscheduler sti \ switch unmapglobal virtualtophysical obtaininput releaseinput \ diff --git a/rom/kernel/spininit.c b/rom/kernel/spininit.c index 548e01e662..8702b1afb7 100644 --- a/rom/kernel/spininit.c +++ b/rom/kernel/spininit.c @@ -5,6 +5,7 @@ Desc: */ +#include #include #include @@ -21,7 +22,7 @@ AROS_LHA(spinlock_t *, lock, A0), /* LOCATION */ - struct KernelBase *, KernelBase, 38, Kernel) + struct KernelBase *, KernelBase, 40, Kernel) /* FUNCTION diff --git a/rom/kernel/spinislocked.c b/rom/kernel/spinislocked.c index ffb0058486..7f3a35f48c 100644 --- a/rom/kernel/spinislocked.c +++ b/rom/kernel/spinislocked.c @@ -5,6 +5,7 @@ Desc: */ +#include #include #include @@ -21,7 +22,7 @@ AROS_LHA(spinlock_t *, lock, A0), /* LOCATION */ - struct KernelBase *, KernelBase, 38, Kernel) + struct KernelBase *, KernelBase, 41, Kernel) /* FUNCTION diff --git a/rom/kernel/spinlock.c b/rom/kernel/spinlock.c index e88a9c0dc8..4ad4f8e84f 100644 --- a/rom/kernel/spinlock.c +++ b/rom/kernel/spinlock.c @@ -5,6 +5,7 @@ Desc: */ +#include #include #include @@ -22,7 +23,7 @@ AROS_LHA(ULONG, mode, D0), /* LOCATION */ - struct KernelBase *, KernelBase, 38, Kernel) + struct KernelBase *, KernelBase, 43, Kernel) /* FUNCTION diff --git a/rom/kernel/spintrylock.c b/rom/kernel/spintrylock.c index 5d873e828d..1140f94937 100644 --- a/rom/kernel/spintrylock.c +++ b/rom/kernel/spintrylock.c @@ -5,6 +5,7 @@ Desc: */ +#include #include #include @@ -22,7 +23,7 @@ AROS_LHA(ULONG, mode, D0), /* LOCATION */ - struct KernelBase *, KernelBase, 38, Kernel) + struct KernelBase *, KernelBase, 42, Kernel) /* FUNCTION diff --git a/rom/kernel/spinunlock.c b/rom/kernel/spinunlock.c index 19ccc159d6..4a77c1d1f7 100644 --- a/rom/kernel/spinunlock.c +++ b/rom/kernel/spinunlock.c @@ -5,6 +5,7 @@ Desc: */ +#include #include #include @@ -21,7 +22,7 @@ AROS_LHA(spinlock_t *, lock, A0), /* LOCATION */ - struct KernelBase *, KernelBase, 38, Kernel) + struct KernelBase *, KernelBase, 44, Kernel) /* FUNCTION -- 2.11.4.GIT