summaryrefslogtreecommitdiff
path: root/arm7
diff options
context:
space:
mode:
authorEgor Ananyin <ananinegor@gmail.com>2020-06-20 09:14:40 +0300
committerEgor Ananyin <ananinegor@gmail.com>2020-06-20 09:14:40 +0300
commit70556fc300ba85dad248d20b3c79c415e2ef88e5 (patch)
tree900bcd9bfbc5101d4d8f01ce057429658909e273 /arm7
parentc4263506fa96acc210d1cf356023a3ffde805a0b (diff)
Begin decompiling OS_mutex
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.h9
-rw-r--r--arm7/lib/src/OS_mutex.c8
4 files changed, 18 insertions, 10 deletions
diff --git a/arm7/arm7.lsf b/arm7/arm7.lsf
index 46486c4f..e5809c12 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
new file mode 100644
index 00000000..6b8da6a8
--- /dev/null
+++ b/arm7/lib/include/OS_mutex.h
@@ -0,0 +1,9 @@
+#ifndef GUARD_OS_MUTEX_H
+#define GUARD_OS_MUTEX_H
+
+#include "nitro/OS_mutex_shared.h"
+#include "nitro/types.h"
+
+void OS_InitMutex(OSMutex* mutex);
+
+#endif
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;
+}