Move OSFastCondition to it's own header file.

This commit is contained in:
James Benton 2016-01-07 04:47:08 -08:00
parent d58b264cab
commit ca212889b4
3 changed files with 44 additions and 26 deletions

View File

@ -0,0 +1,39 @@
#pragma once
#include <wut.h>
#include "threadqueue.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OSFastCondition OSFastCondition;
typedef struct OSFastMutex OSFastMutex;
#define OS_FAST_CONDITION_TAG 0x664E6456u
struct OSFastCondition
{
uint32_t tag;
const char *name;
UNKNOWN(4);
OSThreadQueue queue;
};
CHECK_OFFSET(OSFastCondition, 0x00, tag);
CHECK_OFFSET(OSFastCondition, 0x04, name);
CHECK_OFFSET(OSFastCondition, 0x0c, queue);
CHECK_SIZE(OSFastCondition, 0x1c);
void
OSFastCond_Init(OSFastCondition *condition,
const char *name);
void
OSFastCond_Wait(OSFastCondition *condition,
OSFastMutex *mutex);
void
OSFastCond_Signal(OSFastCondition *condition);
#ifdef __cplusplus
}
#endif

View File

@ -36,20 +36,6 @@ CHECK_OFFSET(OSFastMutex, 0x0c, queue);
CHECK_OFFSET(OSFastMutex, 0x14, link);
CHECK_SIZE(OSFastMutex, 0x2c);
struct OSFastCondition
{
static const uint32_t Tag = 0x664E6456;
uint32_t tag;
const char *name;
UNKNOWN(4);
OSThreadQueue queue;
};
CHECK_OFFSET(OSFastCondition, 0x00, tag);
CHECK_OFFSET(OSFastCondition, 0x04, name);
CHECK_OFFSET(OSFastCondition, 0x0c, queue);
CHECK_SIZE(OSFastCondition, 0x1c);
void
OSFastMutex_Init(OSFastMutex *mutex, const char *name);
@ -62,15 +48,6 @@ OSFastMutex_Unlock(OSFastMutex *mutex);
BOOL
OSFastMutex_TryLock(OSFastMutex *mutex);
void
OSFastCond_Init(OSFastCondition *condition, const char *name);
void
OSFastCond_Wait(OSFastCondition *condition, OSFastMutex *mutex);
void
OSFastCond_Signal(OSFastCondition *condition);
#ifdef __cplusplus
}
#endif

View File

@ -76,14 +76,16 @@ EXPORT(OSSetExceptionCallbackEx);
EXPORT(exit);
EXPORT(_Exit);
// coreinit/fastcondition.h
EXPORT(OSFastCond_Init);
EXPORT(OSFastCond_Wait);
EXPORT(OSFastCond_Signal);
// coreinit/fastmutex.h
EXPORT(OSFastMutex_Init);
EXPORT(OSFastMutex_Lock);
EXPORT(OSFastMutex_Unlock);
EXPORT(OSFastMutex_TryLock);
EXPORT(OSFastCond_Init);
EXPORT(OSFastCond_Wait);
EXPORT(OSFastCond_Signal);
// coreinit/memexpandedheap.h
EXPORT(MEMCreateExpHeap);