summaryrefslogtreecommitdiff
path: root/arm7
diff options
context:
space:
mode:
Diffstat (limited to 'arm7')
-rw-r--r--arm7/arm7.lsf1
-rw-r--r--arm7/asm/OS_mutex_s.s (renamed from arm7/asm/OS_mutex.s)10
-rw-r--r--arm7/lib/include/OS_mutex.h1
-rw-r--r--arm7/lib/src/OS_mutex.c8
4 files changed, 10 insertions, 10 deletions
diff --git a/arm7/arm7.lsf b/arm7/arm7.lsf
index cbffa45a..bfc823a6 100644
--- a/arm7/arm7.lsf
+++ b/arm7/arm7.lsf
@@ -22,6 +22,7 @@ Autoload WRAM
Object OS_thread.o
Object OS_context.o
Object OS_message.o
+ Object OS_mutex_s.o
Object OS_mutex.o
Object OS_init.o
Object OS_arena.o
diff --git a/arm7/asm/OS_mutex.s b/arm7/asm/OS_mutex_s.s
index 981842b8..22ac4ef6 100644
--- a/arm7/asm/OS_mutex.s
+++ b/arm7/asm/OS_mutex_s.s
@@ -119,13 +119,3 @@ _037F9B50:
ldmia sp!, {r4, r5, r6, r7, lr}
bx lr
_037F9B64: .word OSi_ThreadInfo
-
- arm_func_start OS_InitMutex
-OS_InitMutex: ; 0x037F9B68
- mov r2, #0
- str r2, [r0, #4]
- ldr r1, [r0, #4]
- str r1, [r0]
- str r2, [r0, #8]
- str r2, [r0, #12]
- bx lr
diff --git a/arm7/lib/include/OS_mutex.h b/arm7/lib/include/OS_mutex.h
index b41ac9f8..216da68c 100644
--- a/arm7/lib/include/OS_mutex.h
+++ b/arm7/lib/include/OS_mutex.h
@@ -4,6 +4,7 @@
#include "OS_context.h"
#include "nitro/OS_mutex_shared.h"
+void OS_InitMutex(OSMutex* mutex);
void OSi_UnlockAllMutex(OSThread * thread);
#endif //POKEDIAMOND_ARM7_OS_MUTEX_H
diff --git a/arm7/lib/src/OS_mutex.c b/arm7/lib/src/OS_mutex.c
new file mode 100644
index 00000000..8fe167f3
--- /dev/null
+++ b/arm7/lib/src/OS_mutex.c
@@ -0,0 +1,8 @@
+#include "function_target.h"
+#include "OS_mutex.h"
+
+ARM_FUNC void OS_InitMutex(OSMutex* mutex) {
+ OS_InitThreadQueue(&mutex->queue);
+ mutex->thread = NULL;
+ mutex->count = 0;
+}