added some FS defines

This commit is contained in:
Maschell 2017-08-26 01:08:55 +02:00
parent 557ce334a4
commit 179ad3581e
4 changed files with 40 additions and 3 deletions

View File

@ -7,6 +7,7 @@
extern "C" {
#endif
#include "os_types.h"
/* FS defines and types */
#define FS_MAX_LOCALPATH_SIZE 511
@ -15,6 +16,7 @@ extern "C" {
#define FS_MAX_ARGPATH_SIZE FS_MAX_FULLPATH_SIZE
#define FS_STATUS_OK 0
#define FS_STATUS_EOF -2
#define FS_RET_UNSUPPORTED_CMD 0x0400
#define FS_RET_NO_ERROR 0x0000
#define FS_RET_ALL_ERROR (u32)(-1)
@ -65,9 +67,24 @@ typedef struct
{
FSAsyncCallback userCallback;
void *userContext;
void *ioMsgQueue;
OSMessageQueue *ioMsgQueue;
} FSAsyncParams;
typedef struct{
void* data; // pointer to a FSAsyncResult;
u32 unkwn1;
u32 unkwn2;
u32 unkwn3; // always 0x08
} __attribute__((packed)) FSMessage;
typedef struct FSAsyncResult_{
FSAsyncParams userParams;
FSMessage ioMsg;
struct FSClient * client;
struct FSCmdBlock * block;
u32 result;
} FSAsyncResult;
#ifdef __cplusplus
}

View File

@ -67,7 +67,7 @@ EXPORT_DECL(s32, FSCloseFile, void *pClient, void *pCmd, s32 fd, s32 errHandling
EXPORT_DECL(s32, FSFlushFile, void *pClient, void *pCmd, s32 fd, s32 error);
EXPORT_DECL(s32, FSTruncateFile, void *pClient, void *pCmd, s32 fd, s32 error);
EXPORT_DECL(s32, FSGetStatFile, void *pClient, void *pCmd, s32 fd, void *buffer, s32 error);
EXPORT_DECL(s32, FSSetPosFile, void *pClient, void *pCmd, s32 fd, s32 pos, s32 error);
EXPORT_DECL(s32, FSSetPosFile, void *pClient, void *pCmd, s32 fd, u32 pos, s32 error);
EXPORT_DECL(s32, FSWriteFile, void *pClient, void *pCmd, const void *source, s32 block_size, s32 block_count, s32 fd, s32 flag, s32 error);
EXPORT_DECL(s32, FSBindMount, void *pClient, void *pCmd, char *source, char *target, s32 error);

View File

@ -80,7 +80,7 @@ extern s32 (* FSCloseFile)(void *pClient, void *pCmd, s32 fd, s32 errHandling);
extern s32 (* FSFlushFile)(void *pClient, void *pCmd, s32 fd, s32 error);
extern s32 (* FSTruncateFile)(void *pClient, void *pCmd, s32 fd, s32 error);
extern s32 (* FSGetStatFile)(void *pClient, void *pCmd, s32 fd, void *buffer, s32 error);
extern s32 (* FSSetPosFile)(void *pClient, void *pCmd, s32 fd, s32 pos, s32 error);
extern s32 (* FSSetPosFile)(void *pClient, void *pCmd, s32 fd, u32 pos, s32 error);
extern s32 (* FSWriteFile)(void *pClient, void *pCmd, const void *source, s32 block_size, s32 block_count, s32 fd, s32 flag, s32 error);
extern s32 (* FSBindMount)(void *pClient, void *pCmd, char *source, char *target, s32 error);

View File

@ -94,6 +94,26 @@ typedef struct OSContext_ {
u32 mmcr1;
} OSContext;
typedef enum OSExceptionType
{
OS_EXCEPTION_TYPE_SYSTEM_RESET = 0,
OS_EXCEPTION_TYPE_MACHINE_CHECK = 1,
OS_EXCEPTION_TYPE_DSI = 2,
OS_EXCEPTION_TYPE_ISI = 3,
OS_EXCEPTION_TYPE_EXTERNAL_INTERRUPT = 4,
OS_EXCEPTION_TYPE_ALIGNMENT = 5,
OS_EXCEPTION_TYPE_PROGRAM = 6,
OS_EXCEPTION_TYPE_FLOATING_POINT = 7,
OS_EXCEPTION_TYPE_DECREMENTER = 8,
OS_EXCEPTION_TYPE_SYSTEM_CALL = 9,
OS_EXCEPTION_TYPE_TRACE = 10,
OS_EXCEPTION_TYPE_PERFORMANCE_MONITOR = 11,
OS_EXCEPTION_TYPE_BREAKPOINT = 12,
OS_EXCEPTION_TYPE_SYSTEM_INTERRUPT = 13,
OS_EXCEPTION_TYPE_ICI = 14,
} OSExceptionType;
typedef int (*ThreadFunc)(int argc, void *argv);
struct OSThread_ {