Line 30:
Line 30:
int count;
int count;
int owner; // thread id
int owner; // thread id
+
}
+
</pre>
+
+
== Alarms ==
+
Alarms have two components: an event handler component and a user component. The event handler component is stored in a global variable, while the user component is stored at a pointer provided by the code.
+
+
<pre>
+
struct OSAlarm {
+
void (*handler)(struct OSAlarm *alarm, u32 unknown); // 0x0
+
u64 time; // 0x4
+
u64 repeatInterval; // 0xc
+
u64 unknown; // 0x14 - another time value
+
u32 timerId; // 0x1c
+
}
+
+
struct AlarmEventInfo {
+
u32 msg;
+
OSAlarm *alarm;
+
struct AlarmEventInfo *next;
}
}
</pre>
</pre>