mirror of
https://github.com/devkitPro/wut.git
synced 2026-09-30 05:54:29 -05:00
`find . -regex '.*\.\(cpp\|hpp\|cu\|cuh\|c\|h\)' -exec clang-format -style=file -i {} \;`
This commit is contained in:
committed by
Dave Murphy
parent
4f18f8041a
commit
2c98cc91aa
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#include <wut.h>
|
||||
#include "context.h"
|
||||
#include "threadqueue.h"
|
||||
#include "time.h"
|
||||
#include "context.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_alarms Alarms
|
||||
|
||||
@@ -17,62 +17,62 @@ typedef uint32_t BSPConsoleTypeRaw;
|
||||
|
||||
typedef enum BSPError
|
||||
{
|
||||
BSP_ERROR_OK = 0x0,
|
||||
BSP_ERROR_UNKNOWN_ENTITY = 0x1,
|
||||
BSP_ERROR_UNKNOWN_ATTRIBUTE = 0x2,
|
||||
BSP_ERROR_INVALID_INSTANCE = 0x4,
|
||||
BSP_ERROR_CFG_CORRUPTED = 0x8,
|
||||
BSP_ERROR_DEVICE_ERROR = 0x10,
|
||||
BSP_ERROR_DEVICE_BUSY = 0x20,
|
||||
BSP_ERROR_IOS_ERROR = 0x40,
|
||||
BSP_ERROR_SPECIFIED_SIZE_INVALID = 0x80,
|
||||
BSP_ERROR_HEAP_ERROR = 0x100,
|
||||
BSP_ERROR_ENTITY_LIST_FULL = 0x200,
|
||||
BSP_ERROR_UNSUPPORTED_METHOD = 0x400,
|
||||
BSP_ERROR_UNKNOWN_HARDWARE_VERSION = 0x800,
|
||||
BSP_ERROR_QUERY_UNAVAILABLE = 0x1000,
|
||||
BSP_ERROR_UNKNOWN_DEVICE = 0x2000,
|
||||
BSP_ERROR_INVALID_PARAMETER = 0x4000,
|
||||
BSP_ERROR_DEVICE_NOT_FOUND = 0x8000,
|
||||
BSP_ERROR_REQUEST_DENIED = 0x10000,
|
||||
BSP_ERROR_UNSUPPORTED_PARAMETER = 0x20000,
|
||||
BSP_ERROR_BOARD_CONFIG_INVALID = 0x40000,
|
||||
BSP_ERROR_OK = 0x0,
|
||||
BSP_ERROR_UNKNOWN_ENTITY = 0x1,
|
||||
BSP_ERROR_UNKNOWN_ATTRIBUTE = 0x2,
|
||||
BSP_ERROR_INVALID_INSTANCE = 0x4,
|
||||
BSP_ERROR_CFG_CORRUPTED = 0x8,
|
||||
BSP_ERROR_DEVICE_ERROR = 0x10,
|
||||
BSP_ERROR_DEVICE_BUSY = 0x20,
|
||||
BSP_ERROR_IOS_ERROR = 0x40,
|
||||
BSP_ERROR_SPECIFIED_SIZE_INVALID = 0x80,
|
||||
BSP_ERROR_HEAP_ERROR = 0x100,
|
||||
BSP_ERROR_ENTITY_LIST_FULL = 0x200,
|
||||
BSP_ERROR_UNSUPPORTED_METHOD = 0x400,
|
||||
BSP_ERROR_UNKNOWN_HARDWARE_VERSION = 0x800,
|
||||
BSP_ERROR_QUERY_UNAVAILABLE = 0x1000,
|
||||
BSP_ERROR_UNKNOWN_DEVICE = 0x2000,
|
||||
BSP_ERROR_INVALID_PARAMETER = 0x4000,
|
||||
BSP_ERROR_DEVICE_NOT_FOUND = 0x8000,
|
||||
BSP_ERROR_REQUEST_DENIED = 0x10000,
|
||||
BSP_ERROR_UNSUPPORTED_PARAMETER = 0x20000,
|
||||
BSP_ERROR_BOARD_CONFIG_INVALID = 0x40000,
|
||||
} BSPError;
|
||||
|
||||
typedef enum BSPHardwareVersions
|
||||
{
|
||||
BSP_HARDWARE_VERSION_UNKNOWN = 0x00000000,
|
||||
BSP_HARDWARE_VERSION_UNKNOWN = 0x00000000,
|
||||
|
||||
// vWii Hardware Versions
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_1 = 0x00000001,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_2 = 0x10000001,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_PROD_FOR_WII = 0x10100001,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO = 0x10100008,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO_ESPRESSO = 0x1010000C,
|
||||
BSP_HARDWARE_VERSION_BOLLYWOOD = 0x20000001,
|
||||
BSP_HARDWARE_VERSION_BOLLYWOOD_PROD_FOR_WII = 0x20100001,
|
||||
// vWii Hardware Versions
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_1 = 0x00000001,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_ENG_SAMPLE_2 = 0x10000001,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_PROD_FOR_WII = 0x10100001,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO = 0x10100008,
|
||||
BSP_HARDWARE_VERSION_HOLLYWOOD_CORTADO_ESPRESSO = 0x1010000C,
|
||||
BSP_HARDWARE_VERSION_BOLLYWOOD = 0x20000001,
|
||||
BSP_HARDWARE_VERSION_BOLLYWOOD_PROD_FOR_WII = 0x20100001,
|
||||
|
||||
// WiiU Hardware Versions
|
||||
BSP_HARDWARE_VERSION_LATTE_A11_EV = 0x21100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A11_CAT = 0x21100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A12_EV = 0x21200010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A12_CAT = 0x21200020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A2X_EV = 0x22100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A2X_CAT = 0x22100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A3X_EV = 0x23100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A3X_CAT = 0x23100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A3X_CAFE = 0x23100028,
|
||||
BSP_HARDWARE_VERSION_LATTE_A4X_EV = 0x24100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A4X_CAT = 0x24100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A4X_CAFE = 0x24100028,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_EV = 0x25100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_EV_Y = 0x25100011,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_CAT = 0x25100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_CAFE = 0x25100028,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_EV = 0x26100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_EV_Y = 0x26100011,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_CAT = 0x26100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_CAFE = 0x26100028
|
||||
// WiiU Hardware Versions
|
||||
BSP_HARDWARE_VERSION_LATTE_A11_EV = 0x21100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A11_CAT = 0x21100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A12_EV = 0x21200010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A12_CAT = 0x21200020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A2X_EV = 0x22100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A2X_CAT = 0x22100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A3X_EV = 0x23100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A3X_CAT = 0x23100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A3X_CAFE = 0x23100028,
|
||||
BSP_HARDWARE_VERSION_LATTE_A4X_EV = 0x24100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A4X_CAT = 0x24100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A4X_CAFE = 0x24100028,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_EV = 0x25100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_EV_Y = 0x25100011,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_CAT = 0x25100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_A5X_CAFE = 0x25100028,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_EV = 0x26100010,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_EV_Y = 0x26100011,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_CAT = 0x26100020,
|
||||
BSP_HARDWARE_VERSION_LATTE_B1X_CAFE = 0x26100028
|
||||
} BSPHardwareVersions;
|
||||
|
||||
BSPError
|
||||
|
||||
@@ -191,7 +191,7 @@ DCTouchRange(void *addr,
|
||||
void
|
||||
ICInvalidateRange(void *addr,
|
||||
uint32_t size);
|
||||
|
||||
|
||||
void
|
||||
OSMemoryBarrier();
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ extern "C" {
|
||||
//! The memory permissions for the codegen area.
|
||||
typedef enum OSCodegenSecMode
|
||||
{
|
||||
//! The area can be read or written to, but not executed.
|
||||
CODEGEN_RW_ = 0,
|
||||
//! The area can be read or executed, but not written to.
|
||||
CODEGEN_R_X = 1,
|
||||
//! The area can be read or written to, but not executed.
|
||||
CODEGEN_RW_ = 0,
|
||||
//! The area can be read or executed, but not written to.
|
||||
CODEGEN_R_X = 1,
|
||||
} OSCodegenSecMode;
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,9 +15,10 @@ extern "C" {
|
||||
//! A bitfield of enum OS_CONTEXT_STATE.
|
||||
typedef uint16_t OSContextState;
|
||||
|
||||
enum OS_CONTEXT_STATE {
|
||||
OS_CONTEXT_STATE_OSCALLBACK = 1 << 3,
|
||||
OS_CONTEXT_STATE_USERMODE_SAVED = 1 << 4
|
||||
enum OS_CONTEXT_STATE
|
||||
{
|
||||
OS_CONTEXT_STATE_OSCALLBACK = 1 << 3,
|
||||
OS_CONTEXT_STATE_USERMODE_SAVED = 1 << 4
|
||||
};
|
||||
|
||||
typedef struct OSContext OSContext;
|
||||
|
||||
@@ -12,48 +12,50 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum COSReportLevel{
|
||||
COS_REPORT_LEVEL_ERROR = 0,
|
||||
COS_REPORT_LEVEL_WARN = 1,
|
||||
COS_REPORT_LEVEL_INFO = 2,
|
||||
COS_REPORT_LEVEL_VERBOSE = 3,
|
||||
typedef enum COSReportLevel
|
||||
{
|
||||
COS_REPORT_LEVEL_ERROR = 0,
|
||||
COS_REPORT_LEVEL_WARN = 1,
|
||||
COS_REPORT_LEVEL_INFO = 2,
|
||||
COS_REPORT_LEVEL_VERBOSE = 3,
|
||||
} COSReportLevel;
|
||||
|
||||
typedef enum COSReportModule{
|
||||
COS_REPORT_MODULE_UNKNOWN_0 = 0,
|
||||
COS_REPORT_MODULE_UNKNOWN_1 = 1,
|
||||
COS_REPORT_MODULE_UNKNOWN_2 = 2,
|
||||
COS_REPORT_MODULE_UNKNOWN_5 = 5,
|
||||
typedef enum COSReportModule
|
||||
{
|
||||
COS_REPORT_MODULE_UNKNOWN_0 = 0,
|
||||
COS_REPORT_MODULE_UNKNOWN_1 = 1,
|
||||
COS_REPORT_MODULE_UNKNOWN_2 = 2,
|
||||
COS_REPORT_MODULE_UNKNOWN_5 = 5,
|
||||
} COSReportModule;
|
||||
|
||||
void
|
||||
COSVReport(COSReportModule module,
|
||||
COSReportLevel level,
|
||||
const char* fmt,
|
||||
const char *fmt,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(3, 4);
|
||||
|
||||
void
|
||||
COSError(COSReportModule module,
|
||||
const char* fmt,
|
||||
const char *fmt,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
void
|
||||
COSInfo(COSReportModule module,
|
||||
const char* fmt,
|
||||
const char *fmt,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
void
|
||||
COSVerbose(COSReportModule module,
|
||||
const char* fmt,
|
||||
const char *fmt,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
void
|
||||
COSWarn(COSReportModule module,
|
||||
const char* fmt,
|
||||
const char *fmt,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(2, 3);
|
||||
|
||||
|
||||
@@ -24,18 +24,18 @@ typedef enum DisassemblePPCFlags
|
||||
|
||||
typedef enum OSFatalErrorMessageType
|
||||
{
|
||||
OS_FATAL_ERROR_UNKOWN = 0,
|
||||
OS_FATAL_ERROR_GENERAL = 1,
|
||||
OS_FATAL_ERROR_UNKOWN = 0,
|
||||
OS_FATAL_ERROR_GENERAL = 1,
|
||||
|
||||
//! These are only valid for errorCode 1600200 - 1609999
|
||||
OS_FATAL_ERROR_CORRUPTION = 2,
|
||||
OS_FATAL_ERROR_FATAL_SYSTEM_OR_USB = 3,
|
||||
OS_FATAL_ERROR_CORRUPTION_SLC = 4,
|
||||
OS_FATAL_ERROR_CORRUPTION_USB = 5,
|
||||
OS_FATAL_ERROR_STORAGE_REMOVED = 6,
|
||||
OS_FATAL_ERROR_DISC_REMOVED = 7,
|
||||
OS_FATAL_ERROR_CORRUPTION_DISC = 8,
|
||||
OS_FATAL_ERROR_WRITE_PROTECT = 9,
|
||||
OS_FATAL_ERROR_CORRUPTION = 2,
|
||||
OS_FATAL_ERROR_FATAL_SYSTEM_OR_USB = 3,
|
||||
OS_FATAL_ERROR_CORRUPTION_SLC = 4,
|
||||
OS_FATAL_ERROR_CORRUPTION_USB = 5,
|
||||
OS_FATAL_ERROR_STORAGE_REMOVED = 6,
|
||||
OS_FATAL_ERROR_DISC_REMOVED = 7,
|
||||
OS_FATAL_ERROR_CORRUPTION_DISC = 8,
|
||||
OS_FATAL_ERROR_WRITE_PROTECT = 9,
|
||||
} OSFatalErrorMessageType;
|
||||
|
||||
struct OSFatalError
|
||||
@@ -87,7 +87,8 @@ OSReportWarn(const char *fmt, ...)
|
||||
void
|
||||
OSPanic(const char *file,
|
||||
uint32_t line,
|
||||
const char *fmt, ...)
|
||||
const char *fmt,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(3, 4);
|
||||
|
||||
|
||||
|
||||
@@ -23,31 +23,32 @@ typedef struct OSDynLoad_InternalData OSDynLoad_InternalData;
|
||||
|
||||
typedef enum OSDynLoad_Error
|
||||
{
|
||||
OS_DYNLOAD_OK = 0,
|
||||
OS_DYNLOAD_OUT_OF_MEMORY = 0xBAD10002,
|
||||
OS_DYNLOAD_INVALID_NOTIFY_PTR = 0xBAD1000E,
|
||||
OS_DYNLOAD_INVALID_MODULE_NAME_PTR = 0xBAD1000F,
|
||||
OS_DYNLOAD_INVALID_MODULE_NAME = 0xBAD10010,
|
||||
OS_DYNLOAD_INVALID_ACQUIRE_PTR = 0xBAD10011,
|
||||
OS_DYNLOAD_EMPTY_MODULE_NAME = 0xBAD10012,
|
||||
OS_DYNLOAD_INVALID_ALLOCATOR_PTR = 0xBAD10017,
|
||||
OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY = 0xBAD1002F,
|
||||
OS_DYNLOAD_TLS_ALLOCATOR_LOCKED = 0xBAD10031,
|
||||
OS_DYNLOAD_MODULE_NOT_FOUND = 0xFFFFFFFA,
|
||||
OS_DYNLOAD_OK = 0,
|
||||
OS_DYNLOAD_OUT_OF_MEMORY = 0xBAD10002,
|
||||
OS_DYNLOAD_INVALID_NOTIFY_PTR = 0xBAD1000E,
|
||||
OS_DYNLOAD_INVALID_MODULE_NAME_PTR = 0xBAD1000F,
|
||||
OS_DYNLOAD_INVALID_MODULE_NAME = 0xBAD10010,
|
||||
OS_DYNLOAD_INVALID_ACQUIRE_PTR = 0xBAD10011,
|
||||
OS_DYNLOAD_EMPTY_MODULE_NAME = 0xBAD10012,
|
||||
OS_DYNLOAD_INVALID_ALLOCATOR_PTR = 0xBAD10017,
|
||||
OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY = 0xBAD1002F,
|
||||
OS_DYNLOAD_TLS_ALLOCATOR_LOCKED = 0xBAD10031,
|
||||
OS_DYNLOAD_MODULE_NOT_FOUND = 0xFFFFFFFA,
|
||||
} OSDynLoad_Error;
|
||||
|
||||
typedef OSDynLoad_Error (*OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr);
|
||||
typedef void (*OSDynLoadFreeFn)(void *addr);
|
||||
|
||||
typedef enum OSDynLoad_ExportType {
|
||||
OS_DYNLOAD_EXPORT_FUNC = 0,
|
||||
OS_DYNLOAD_EXPORT_DATA = 1,
|
||||
typedef enum OSDynLoad_ExportType
|
||||
{
|
||||
OS_DYNLOAD_EXPORT_FUNC = 0,
|
||||
OS_DYNLOAD_EXPORT_DATA = 1,
|
||||
} OSDynLoad_ExportType;
|
||||
|
||||
typedef enum OSDynLoad_EntryReason
|
||||
{
|
||||
OS_DYNLOAD_LOADED = 1,
|
||||
OS_DYNLOAD_UNLOADED = 2,
|
||||
OS_DYNLOAD_LOADED = 1,
|
||||
OS_DYNLOAD_UNLOADED = 2,
|
||||
} OSDynLoad_EntryReason;
|
||||
|
||||
struct OSDynLoad_NotifyData
|
||||
@@ -97,18 +98,18 @@ WUT_CHECK_SIZE(OSDynLoad_LoaderHeapStatistics, 0x18);
|
||||
|
||||
struct OSDynLoad_LoaderUserFileInfo
|
||||
{
|
||||
uint32_t size;
|
||||
uint32_t magic;
|
||||
uint32_t pathStringLength;
|
||||
char *pathString;
|
||||
uint32_t fileInfoFlags;
|
||||
int16_t tlsModuleIndex;
|
||||
int16_t tlsAlignShift;
|
||||
void *tlsAddressStart;
|
||||
uint32_t tlsSectionSize;
|
||||
uint32_t shstrndx;
|
||||
uint32_t titleLocation;
|
||||
WUT_UNKNOWN_BYTES(0x60 - 0x28);
|
||||
uint32_t size;
|
||||
uint32_t magic;
|
||||
uint32_t pathStringLength;
|
||||
char *pathString;
|
||||
uint32_t fileInfoFlags;
|
||||
int16_t tlsModuleIndex;
|
||||
int16_t tlsAlignShift;
|
||||
void *tlsAddressStart;
|
||||
uint32_t tlsSectionSize;
|
||||
uint32_t shstrndx;
|
||||
uint32_t titleLocation;
|
||||
WUT_UNKNOWN_BYTES(0x60 - 0x28);
|
||||
};
|
||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderUserFileInfo, 0x00, size);
|
||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderUserFileInfo, 0x04, magic);
|
||||
@@ -126,17 +127,18 @@ WUT_CHECK_SIZE(OSDynLoad_LoaderUserFileInfo, 0x60);
|
||||
|
||||
struct OSDynLoad_LoaderSectionInfo
|
||||
{
|
||||
uint32_t type;
|
||||
uint32_t flags;
|
||||
void *address;
|
||||
uint32_t type;
|
||||
uint32_t flags;
|
||||
void *address;
|
||||
|
||||
union {
|
||||
//! Size of the section, set when type != SHT_RPL_IMPORTS
|
||||
uint32_t size;
|
||||
union
|
||||
{
|
||||
//! Size of the section, set when type != SHT_RPL_IMPORTS
|
||||
uint32_t size;
|
||||
|
||||
//! Name offset of the section, set when type == SHT_RPL_IMPORTS
|
||||
uint32_t name;
|
||||
};
|
||||
//! Name offset of the section, set when type == SHT_RPL_IMPORTS
|
||||
uint32_t name;
|
||||
};
|
||||
};
|
||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderSectionInfo, 0x00, type);
|
||||
WUT_CHECK_OFFSET(OSDynLoad_LoaderSectionInfo, 0x04, flags);
|
||||
@@ -148,29 +150,29 @@ WUT_CHECK_SIZE(OSDynLoad_LoaderSectionInfo, 0x10);
|
||||
|
||||
struct OSDynLoad_InternalData
|
||||
{
|
||||
uint32_t handle;
|
||||
void *loaderHandle;
|
||||
char *moduleName;
|
||||
uint32_t moduleNameLen;
|
||||
uint32_t sectionInfoCount;
|
||||
OSDynLoad_LoaderSectionInfo *sectionInfo;
|
||||
OSDynLoad_InternalData **importModules;
|
||||
uint32_t importModuleCount;
|
||||
uint32_t userFileInfoSize;
|
||||
OSDynLoad_LoaderUserFileInfo *userFileInfo;
|
||||
OSDynLoad_NotifyData *notifyData;
|
||||
void *entryPoint;
|
||||
uint32_t dataSectionSize;
|
||||
void *dataSection;
|
||||
uint32_t loadSectionSize;
|
||||
void *loadSection;
|
||||
OSDynLoadFreeFn dynLoadFreeFn;
|
||||
void *codeExports;
|
||||
uint32_t numCodeExports;
|
||||
void *dataExports;
|
||||
uint32_t numDataExports;
|
||||
OSDynLoad_InternalData *next;
|
||||
WUT_UNKNOWN_BYTES(0x94 - 0x58);
|
||||
uint32_t handle;
|
||||
void *loaderHandle;
|
||||
char *moduleName;
|
||||
uint32_t moduleNameLen;
|
||||
uint32_t sectionInfoCount;
|
||||
OSDynLoad_LoaderSectionInfo *sectionInfo;
|
||||
OSDynLoad_InternalData **importModules;
|
||||
uint32_t importModuleCount;
|
||||
uint32_t userFileInfoSize;
|
||||
OSDynLoad_LoaderUserFileInfo *userFileInfo;
|
||||
OSDynLoad_NotifyData *notifyData;
|
||||
void *entryPoint;
|
||||
uint32_t dataSectionSize;
|
||||
void *dataSection;
|
||||
uint32_t loadSectionSize;
|
||||
void *loadSection;
|
||||
OSDynLoadFreeFn dynLoadFreeFn;
|
||||
void *codeExports;
|
||||
uint32_t numCodeExports;
|
||||
void *dataExports;
|
||||
uint32_t numDataExports;
|
||||
OSDynLoad_InternalData *next;
|
||||
WUT_UNKNOWN_BYTES(0x94 - 0x58);
|
||||
};
|
||||
WUT_CHECK_OFFSET(OSDynLoad_InternalData, 0x00, handle);
|
||||
WUT_CHECK_OFFSET(OSDynLoad_InternalData, 0x04, loaderHandle);
|
||||
@@ -198,8 +200,8 @@ WUT_CHECK_SIZE(OSDynLoad_InternalData, 0x94);
|
||||
|
||||
typedef enum OSDynLoad_NotifyReason
|
||||
{
|
||||
OS_DYNLOAD_NOTIFY_UNLOADED = 0,
|
||||
OS_DYNLOAD_NOTIFY_LOADED = 1
|
||||
OS_DYNLOAD_NOTIFY_UNLOADED = 0,
|
||||
OS_DYNLOAD_NOTIFY_LOADED = 1
|
||||
} OSDynLoad_NotifyReason;
|
||||
|
||||
typedef void (*OSDynLoadNotifyFunc)(OSDynLoad_Module module,
|
||||
@@ -328,14 +330,14 @@ OSDynLoad_IsModuleLoaded(char const *name,
|
||||
* Registers a callback that's called whenever a new .rpl is loaded or unloaded
|
||||
**/
|
||||
OSDynLoad_Error
|
||||
OSDynLoad_AddNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
||||
OSDynLoad_AddNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
||||
void *userContext);
|
||||
|
||||
/**
|
||||
* Removes a previously added a callback
|
||||
**/
|
||||
OSDynLoad_Error
|
||||
OSDynLoad_DelNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
||||
OSDynLoad_DelNotifyCallback(OSDynLoadNotifyFunc notifyFn,
|
||||
void *userContext);
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,10 +22,10 @@ typedef struct OSEvent OSEvent;
|
||||
typedef enum OSEventMode
|
||||
{
|
||||
//! A manual event will only reset when OSResetEvent is called.
|
||||
OS_EVENT_MODE_MANUAL = 0,
|
||||
OS_EVENT_MODE_MANUAL = 0,
|
||||
|
||||
//! An auto event will reset everytime a thread is woken.
|
||||
OS_EVENT_MODE_AUTO = 1,
|
||||
OS_EVENT_MODE_AUTO = 1,
|
||||
} OSEventMode;
|
||||
|
||||
#define OS_EVENT_TAG 0x65566E54u
|
||||
|
||||
@@ -16,30 +16,30 @@ typedef BOOL (*OSExceptionCallbackFn)(OSContext *context);
|
||||
|
||||
typedef enum OSExceptionMode
|
||||
{
|
||||
OS_EXCEPTION_MODE_SYSTEM = 0,
|
||||
OS_EXCEPTION_MODE_THREAD = 1,
|
||||
OS_EXCEPTION_MODE_GLOBAL = 2,
|
||||
OS_EXCEPTION_MODE_THREAD_ALL_CORES = 3,
|
||||
OS_EXCEPTION_MODE_GLOBAL_ALL_CORES = 4,
|
||||
OS_EXCEPTION_MODE_SYSTEM = 0,
|
||||
OS_EXCEPTION_MODE_THREAD = 1,
|
||||
OS_EXCEPTION_MODE_GLOBAL = 2,
|
||||
OS_EXCEPTION_MODE_THREAD_ALL_CORES = 3,
|
||||
OS_EXCEPTION_MODE_GLOBAL_ALL_CORES = 4,
|
||||
} OSExceptionMode;
|
||||
|
||||
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,
|
||||
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;
|
||||
|
||||
OSExceptionCallbackFn
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*OSFiberEntryFn)();
|
||||
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2,
|
||||
uint32_t arg3, uint32_t arg4);
|
||||
typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4);
|
||||
|
||||
int32_t
|
||||
OSSwitchFiber(OSFiberEntryFn entry,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
#include <wut.h>
|
||||
#include <coreinit/alarm.h>
|
||||
#include <coreinit/fastmutex.h>
|
||||
#include <coreinit/ios.h>
|
||||
#include <coreinit/messagequeue.h>
|
||||
#include <coreinit/time.h>
|
||||
#include <coreinit/ios.h>
|
||||
#include <coreinit/fastmutex.h>
|
||||
#include <coreinit/alarm.h>
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_fs Filesystem
|
||||
@@ -25,7 +25,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FS_MAX_PATH (0x27F)
|
||||
#define FS_MAX_PATH (0x27F)
|
||||
#define FS_MODE_LENGTH (0x10)
|
||||
|
||||
typedef uint32_t FSDirectoryHandle;
|
||||
@@ -52,100 +52,100 @@ typedef struct FSVolumeInfo FSVolumeInfo;
|
||||
|
||||
typedef enum FSErrorFlag
|
||||
{
|
||||
FS_ERROR_FLAG_NONE = 0x0,
|
||||
FS_ERROR_FLAG_MAX = 0x1,
|
||||
FS_ERROR_FLAG_ALREADY_OPEN = 0x2,
|
||||
FS_ERROR_FLAG_EXISTS = 0x4,
|
||||
FS_ERROR_FLAG_NOT_FOUND = 0x8,
|
||||
FS_ERROR_FLAG_NOT_FILE = 0x10,
|
||||
FS_ERROR_FLAG_NOT_DIR = 0x20,
|
||||
FS_ERROR_FLAG_ACCESS_ERROR = 0x40,
|
||||
FS_ERROR_FLAG_PERMISSION_ERROR = 0x80,
|
||||
FS_ERROR_FLAG_FILE_TOO_BIG = 0x100,
|
||||
FS_ERROR_FLAG_STORAGE_FULL = 0x200,
|
||||
FS_ERROR_FLAG_UNSUPPORTED_CMD = 0x400,
|
||||
FS_ERROR_FLAG_JOURNAL_FULL = 0x800,
|
||||
FS_ERROR_FLAG_ALL = 0xFFFFFFFF,
|
||||
FS_ERROR_FLAG_NONE = 0x0,
|
||||
FS_ERROR_FLAG_MAX = 0x1,
|
||||
FS_ERROR_FLAG_ALREADY_OPEN = 0x2,
|
||||
FS_ERROR_FLAG_EXISTS = 0x4,
|
||||
FS_ERROR_FLAG_NOT_FOUND = 0x8,
|
||||
FS_ERROR_FLAG_NOT_FILE = 0x10,
|
||||
FS_ERROR_FLAG_NOT_DIR = 0x20,
|
||||
FS_ERROR_FLAG_ACCESS_ERROR = 0x40,
|
||||
FS_ERROR_FLAG_PERMISSION_ERROR = 0x80,
|
||||
FS_ERROR_FLAG_FILE_TOO_BIG = 0x100,
|
||||
FS_ERROR_FLAG_STORAGE_FULL = 0x200,
|
||||
FS_ERROR_FLAG_UNSUPPORTED_CMD = 0x400,
|
||||
FS_ERROR_FLAG_JOURNAL_FULL = 0x800,
|
||||
FS_ERROR_FLAG_ALL = 0xFFFFFFFF,
|
||||
} FSErrorFlag;
|
||||
|
||||
typedef enum FSStatus
|
||||
{
|
||||
FS_STATUS_OK = 0,
|
||||
FS_STATUS_CANCELLED = -1,
|
||||
FS_STATUS_END = -2,
|
||||
FS_STATUS_MAX = -3,
|
||||
FS_STATUS_ALREADY_OPEN = -4,
|
||||
FS_STATUS_EXISTS = -5,
|
||||
FS_STATUS_NOT_FOUND = -6,
|
||||
FS_STATUS_NOT_FILE = -7,
|
||||
FS_STATUS_NOT_DIR = -8,
|
||||
FS_STATUS_ACCESS_ERROR = -9,
|
||||
FS_STATUS_PERMISSION_ERROR = -10,
|
||||
FS_STATUS_FILE_TOO_BIG = -11,
|
||||
FS_STATUS_STORAGE_FULL = -12,
|
||||
FS_STATUS_JOURNAL_FULL = -13,
|
||||
FS_STATUS_UNSUPPORTED_CMD = -14,
|
||||
FS_STATUS_MEDIA_NOT_READY = -15,
|
||||
FS_STATUS_MEDIA_ERROR = -17,
|
||||
FS_STATUS_CORRUPTED = -18,
|
||||
FS_STATUS_FATAL_ERROR = -0x400,
|
||||
FS_STATUS_OK = 0,
|
||||
FS_STATUS_CANCELLED = -1,
|
||||
FS_STATUS_END = -2,
|
||||
FS_STATUS_MAX = -3,
|
||||
FS_STATUS_ALREADY_OPEN = -4,
|
||||
FS_STATUS_EXISTS = -5,
|
||||
FS_STATUS_NOT_FOUND = -6,
|
||||
FS_STATUS_NOT_FILE = -7,
|
||||
FS_STATUS_NOT_DIR = -8,
|
||||
FS_STATUS_ACCESS_ERROR = -9,
|
||||
FS_STATUS_PERMISSION_ERROR = -10,
|
||||
FS_STATUS_FILE_TOO_BIG = -11,
|
||||
FS_STATUS_STORAGE_FULL = -12,
|
||||
FS_STATUS_JOURNAL_FULL = -13,
|
||||
FS_STATUS_UNSUPPORTED_CMD = -14,
|
||||
FS_STATUS_MEDIA_NOT_READY = -15,
|
||||
FS_STATUS_MEDIA_ERROR = -17,
|
||||
FS_STATUS_CORRUPTED = -18,
|
||||
FS_STATUS_FATAL_ERROR = -0x400,
|
||||
} FSStatus;
|
||||
|
||||
typedef enum FSError
|
||||
{
|
||||
FS_ERROR_OK = 0,
|
||||
FS_ERROR_NOT_INIT = -0x30001,
|
||||
FS_ERROR_BUSY = -0x30002,
|
||||
FS_ERROR_CANCELLED = -0x30003,
|
||||
FS_ERROR_END_OF_DIR = -0x30004,
|
||||
FS_ERROR_END_OF_FILE = -0x30005,
|
||||
FS_ERROR_MAX_MOUNT_POINTS = -0x30010,
|
||||
FS_ERROR_MAX_VOLUMES = -0x30011,
|
||||
FS_ERROR_MAX_CLIENTS = -0x30012,
|
||||
FS_ERROR_MAX_FILES = -0x30013,
|
||||
FS_ERROR_MAX_DIRS = -0x30014,
|
||||
FS_ERROR_ALREADY_OPEN = -0x30015,
|
||||
FS_ERROR_ALREADY_EXISTS = -0x30016,
|
||||
FS_ERROR_NOT_FOUND = -0x30017,
|
||||
FS_ERROR_NOT_EMPTY = -0x30018,
|
||||
FS_ERROR_ACCESS_ERROR = -0x30019,
|
||||
FS_ERROR_PERMISSION_ERROR = -0x3001A,
|
||||
FS_ERROR_DATA_CORRUPTED = -0x3001B,
|
||||
FS_ERROR_STORAGE_FULL = -0x3001C,
|
||||
FS_ERROR_JOURNAL_FULL = -0x3001D,
|
||||
FS_ERROR_UNAVAILABLE_COMMAND = -0x3001F,
|
||||
FS_ERROR_UNSUPPORTED_COMMAND = -0x30020,
|
||||
FS_ERROR_INVALID_PARAM = -0x30021,
|
||||
FS_ERROR_INVALID_PATH = -0x30022,
|
||||
FS_ERROR_INVALID_BUFFER = -0x30023,
|
||||
FS_ERROR_INVALID_ALIGNMENT = -0x30024,
|
||||
FS_ERROR_INVALID_CLIENTHANDLE = -0x30025,
|
||||
FS_ERROR_INVALID_FILEHANDLE = -0x30026,
|
||||
FS_ERROR_INVALID_DIRHANDLE = -0x30027,
|
||||
FS_ERROR_NOT_FILE = -0x30028,
|
||||
FS_ERROR_NOT_DIR = -0x30029,
|
||||
FS_ERROR_FILE_TOO_BIG = -0x3002A,
|
||||
FS_ERROR_OUT_OF_RANGE = -0x3002B,
|
||||
FS_ERROR_OUT_OF_RESOURCES = -0x3002C,
|
||||
FS_ERROR_MEDIA_NOT_READY = -0x30040,
|
||||
FS_ERROR_MEDIA_ERROR = -0x30041,
|
||||
FS_ERROR_WRITE_PROTECTED = -0x30042,
|
||||
FS_ERROR_INVALID_MEDIA = -0x30043,
|
||||
FS_ERROR_OK = 0,
|
||||
FS_ERROR_NOT_INIT = -0x30001,
|
||||
FS_ERROR_BUSY = -0x30002,
|
||||
FS_ERROR_CANCELLED = -0x30003,
|
||||
FS_ERROR_END_OF_DIR = -0x30004,
|
||||
FS_ERROR_END_OF_FILE = -0x30005,
|
||||
FS_ERROR_MAX_MOUNT_POINTS = -0x30010,
|
||||
FS_ERROR_MAX_VOLUMES = -0x30011,
|
||||
FS_ERROR_MAX_CLIENTS = -0x30012,
|
||||
FS_ERROR_MAX_FILES = -0x30013,
|
||||
FS_ERROR_MAX_DIRS = -0x30014,
|
||||
FS_ERROR_ALREADY_OPEN = -0x30015,
|
||||
FS_ERROR_ALREADY_EXISTS = -0x30016,
|
||||
FS_ERROR_NOT_FOUND = -0x30017,
|
||||
FS_ERROR_NOT_EMPTY = -0x30018,
|
||||
FS_ERROR_ACCESS_ERROR = -0x30019,
|
||||
FS_ERROR_PERMISSION_ERROR = -0x3001A,
|
||||
FS_ERROR_DATA_CORRUPTED = -0x3001B,
|
||||
FS_ERROR_STORAGE_FULL = -0x3001C,
|
||||
FS_ERROR_JOURNAL_FULL = -0x3001D,
|
||||
FS_ERROR_UNAVAILABLE_COMMAND = -0x3001F,
|
||||
FS_ERROR_UNSUPPORTED_COMMAND = -0x30020,
|
||||
FS_ERROR_INVALID_PARAM = -0x30021,
|
||||
FS_ERROR_INVALID_PATH = -0x30022,
|
||||
FS_ERROR_INVALID_BUFFER = -0x30023,
|
||||
FS_ERROR_INVALID_ALIGNMENT = -0x30024,
|
||||
FS_ERROR_INVALID_CLIENTHANDLE = -0x30025,
|
||||
FS_ERROR_INVALID_FILEHANDLE = -0x30026,
|
||||
FS_ERROR_INVALID_DIRHANDLE = -0x30027,
|
||||
FS_ERROR_NOT_FILE = -0x30028,
|
||||
FS_ERROR_NOT_DIR = -0x30029,
|
||||
FS_ERROR_FILE_TOO_BIG = -0x3002A,
|
||||
FS_ERROR_OUT_OF_RANGE = -0x3002B,
|
||||
FS_ERROR_OUT_OF_RESOURCES = -0x3002C,
|
||||
FS_ERROR_MEDIA_NOT_READY = -0x30040,
|
||||
FS_ERROR_MEDIA_ERROR = -0x30041,
|
||||
FS_ERROR_WRITE_PROTECTED = -0x30042,
|
||||
FS_ERROR_INVALID_MEDIA = -0x30043,
|
||||
} FSError;
|
||||
|
||||
typedef enum FSMode
|
||||
{
|
||||
FS_MODE_READ_OWNER = 0x400,
|
||||
FS_MODE_WRITE_OWNER = 0x200,
|
||||
FS_MODE_EXEC_OWNER = 0x100,
|
||||
FS_MODE_READ_OWNER = 0x400,
|
||||
FS_MODE_WRITE_OWNER = 0x200,
|
||||
FS_MODE_EXEC_OWNER = 0x100,
|
||||
|
||||
FS_MODE_READ_GROUP = 0x040,
|
||||
FS_MODE_WRITE_GROUP = 0x020,
|
||||
FS_MODE_EXEC_GROUP = 0x010,
|
||||
FS_MODE_READ_GROUP = 0x040,
|
||||
FS_MODE_WRITE_GROUP = 0x020,
|
||||
FS_MODE_EXEC_GROUP = 0x010,
|
||||
|
||||
FS_MODE_READ_OTHER = 0x004,
|
||||
FS_MODE_WRITE_OTHER = 0x002,
|
||||
FS_MODE_EXEC_OTHER = 0x001,
|
||||
FS_MODE_READ_OTHER = 0x004,
|
||||
FS_MODE_WRITE_OTHER = 0x002,
|
||||
FS_MODE_EXEC_OTHER = 0x001,
|
||||
} FSMode;
|
||||
|
||||
//! Flags for \link FSStat \endlink.
|
||||
@@ -153,81 +153,83 @@ typedef enum FSMode
|
||||
typedef enum FSStatFlags
|
||||
{
|
||||
//! The retrieved file entry is a (link to a) directory.
|
||||
FS_STAT_DIRECTORY = 0x80000000,
|
||||
FS_STAT_DIRECTORY = 0x80000000,
|
||||
//! The retrieved file entry also has a quota set.
|
||||
FS_STAT_QUOTA = 0x60000000,
|
||||
FS_STAT_QUOTA = 0x60000000,
|
||||
//! The retrieved file entry is a (link to a) file.
|
||||
FS_STAT_FILE = 0x01000000,
|
||||
FS_STAT_FILE = 0x01000000,
|
||||
//! The retrieved file entry also is encrypted and can't be opened (see vWii files for example).
|
||||
FS_STAT_ENCRYPTED_FILE = 0x00800000,
|
||||
FS_STAT_ENCRYPTED_FILE = 0x00800000,
|
||||
//! The retrieved file entry also is a link to a different file on the filesystem.
|
||||
//! Note: It's currently not known how one can read the linked-to file entry.
|
||||
FS_STAT_LINK = 0x00010000,
|
||||
FS_STAT_LINK = 0x00010000,
|
||||
} FSStatFlags;
|
||||
|
||||
typedef enum FSVolumeState
|
||||
{
|
||||
FS_VOLUME_STATE_INITIAL = 0,
|
||||
FS_VOLUME_STATE_READY = 1,
|
||||
FS_VOLUME_STATE_NO_MEDIA = 2,
|
||||
FS_VOLUME_STATE_INVALID_MEDIA = 3,
|
||||
FS_VOLUME_STATE_DIRTY_MEDIA = 4,
|
||||
FS_VOLUME_STATE_WRONG_MEDIA = 5,
|
||||
FS_VOLUME_STATE_MEDIA_ERROR = 6,
|
||||
FS_VOLUME_STATE_DATA_CORRUPTED = 7,
|
||||
FS_VOLUME_STATE_WRITE_PROTECTED = 8,
|
||||
FS_VOLUME_STATE_JOURNAL_FULL = 9,
|
||||
FS_VOLUME_STATE_FATAL = 10,
|
||||
FS_VOLUME_STATE_INVALID = 11,
|
||||
FS_VOLUME_STATE_INITIAL = 0,
|
||||
FS_VOLUME_STATE_READY = 1,
|
||||
FS_VOLUME_STATE_NO_MEDIA = 2,
|
||||
FS_VOLUME_STATE_INVALID_MEDIA = 3,
|
||||
FS_VOLUME_STATE_DIRTY_MEDIA = 4,
|
||||
FS_VOLUME_STATE_WRONG_MEDIA = 5,
|
||||
FS_VOLUME_STATE_MEDIA_ERROR = 6,
|
||||
FS_VOLUME_STATE_DATA_CORRUPTED = 7,
|
||||
FS_VOLUME_STATE_WRITE_PROTECTED = 8,
|
||||
FS_VOLUME_STATE_JOURNAL_FULL = 9,
|
||||
FS_VOLUME_STATE_FATAL = 10,
|
||||
FS_VOLUME_STATE_INVALID = 11,
|
||||
} FSVolumeState;
|
||||
|
||||
typedef enum FSMediaState {
|
||||
FS_MEDIA_STATE_READY = 0,
|
||||
FS_MEDIA_STATE_NO_MEDIA = 1,
|
||||
FS_MEDIA_STATE_INVALID_MEDIA = 2,
|
||||
FS_MEDIA_STATE_DIRTY_MEDIA = 3,
|
||||
FS_MEDIA_STATE_MEDIA_ERROR = 4,
|
||||
typedef enum FSMediaState
|
||||
{
|
||||
FS_MEDIA_STATE_READY = 0,
|
||||
FS_MEDIA_STATE_NO_MEDIA = 1,
|
||||
FS_MEDIA_STATE_INVALID_MEDIA = 2,
|
||||
FS_MEDIA_STATE_DIRTY_MEDIA = 3,
|
||||
FS_MEDIA_STATE_MEDIA_ERROR = 4,
|
||||
} FSMediaState;
|
||||
|
||||
typedef enum FSMountSourceType {
|
||||
FS_MOUNT_SOURCE_SD = 0,
|
||||
FS_MOUNT_SOURCE_UNK = 1,
|
||||
typedef enum FSMountSourceType
|
||||
{
|
||||
FS_MOUNT_SOURCE_SD = 0,
|
||||
FS_MOUNT_SOURCE_UNK = 1,
|
||||
} FSMountSourceType;
|
||||
|
||||
typedef enum FSOpenFileFlags
|
||||
{
|
||||
//! Open file normally
|
||||
FS_OPEN_FLAG_NONE = (0 << 0),
|
||||
FS_OPEN_FLAG_NONE = (0 << 0),
|
||||
//! Open (new) unencrypted file. Used for vWii files since it allows for direct access without the Wii U filesystem through it's block address.
|
||||
FS_OPEN_FLAG_UNENCRYPTED = (1 << 0),
|
||||
FS_OPEN_FLAG_UNENCRYPTED = (1 << 0),
|
||||
//! Preallocates new file size using given size
|
||||
FS_OPEN_FLAG_PREALLOC_SIZE = (1 << 1)
|
||||
} FSOpenFileFlags;
|
||||
|
||||
typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
|
||||
typedef void(*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
|
||||
typedef void (*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
|
||||
typedef void (*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
|
||||
|
||||
struct FSFsm
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x38);
|
||||
WUT_UNKNOWN_BYTES(0x38);
|
||||
};
|
||||
WUT_CHECK_SIZE(FSFsm, 0x38);
|
||||
|
||||
struct FSCmdQueue
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x44);
|
||||
WUT_UNKNOWN_BYTES(0x44);
|
||||
};
|
||||
WUT_CHECK_SIZE(FSCmdQueue, 0x44);
|
||||
|
||||
struct FSMessage
|
||||
{
|
||||
//! Message data
|
||||
void *data;
|
||||
//! Message data
|
||||
void *data;
|
||||
|
||||
WUT_UNKNOWN_BYTES(8);
|
||||
WUT_UNKNOWN_BYTES(8);
|
||||
|
||||
//! Type of message
|
||||
OSFunctionType type;
|
||||
//! Type of message
|
||||
OSFunctionType type;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSMessage, 0x00, data);
|
||||
WUT_CHECK_OFFSET(FSMessage, 0x0C, type);
|
||||
@@ -238,8 +240,8 @@ WUT_CHECK_SIZE(FSMessage, 0x10);
|
||||
*/
|
||||
struct FSClientBodyLink
|
||||
{
|
||||
FSClientBody* next;
|
||||
FSClientBody* prev;
|
||||
FSClientBody *next;
|
||||
FSClientBody *prev;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSClientBodyLink, 0x00, next);
|
||||
WUT_CHECK_OFFSET(FSClientBodyLink, 0x04, prev);
|
||||
@@ -247,52 +249,52 @@ WUT_CHECK_SIZE(FSClientBodyLink, 0x8);
|
||||
|
||||
struct FSClientBody
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x1444);
|
||||
WUT_UNKNOWN_BYTES(0x1444);
|
||||
|
||||
//! IOSHandle returned from fsaShimOpen.
|
||||
IOSHandle clientHandle;
|
||||
//! IOSHandle returned from fsaShimOpen.
|
||||
IOSHandle clientHandle;
|
||||
|
||||
//! State machine.
|
||||
FSFsm fsm;
|
||||
//! State machine.
|
||||
FSFsm fsm;
|
||||
|
||||
//! Command queue of FS commands.
|
||||
FSCmdQueue cmdQueue;
|
||||
//! Command queue of FS commands.
|
||||
FSCmdQueue cmdQueue;
|
||||
|
||||
//! The last dequeued command.
|
||||
FSCmdBlockBody* lastDequeuedCommand;
|
||||
//! The last dequeued command.
|
||||
FSCmdBlockBody *lastDequeuedCommand;
|
||||
|
||||
//! Emulated error, set with FSSetEmulatedError.
|
||||
FSError emulatedError;
|
||||
//! Emulated error, set with FSSetEmulatedError.
|
||||
FSError emulatedError;
|
||||
|
||||
WUT_UNKNOWN_BYTES(0x1560 - 0x14CC);
|
||||
WUT_UNKNOWN_BYTES(0x1560 - 0x14CC);
|
||||
|
||||
//! Mutex used to protect FSClientBody data.
|
||||
OSFastMutex mutex;
|
||||
//! Mutex used to protect FSClientBody data.
|
||||
OSFastMutex mutex;
|
||||
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
|
||||
//! Alarm used by fsm for unknown reasons.
|
||||
OSAlarm fsmAlarm;
|
||||
//! Alarm used by fsm for unknown reasons.
|
||||
OSAlarm fsmAlarm;
|
||||
|
||||
//! Error of last FS command.
|
||||
FSError lastError;
|
||||
//! Error of last FS command.
|
||||
FSError lastError;
|
||||
|
||||
bool isLastErrorWithoutVolume;
|
||||
bool isLastErrorWithoutVolume;
|
||||
|
||||
//! Message used to send FsCmdHandler message when FSA async callback is received.
|
||||
FSMessage fsCmdHandlerMsg;
|
||||
//! Message used to send FsCmdHandler message when FSA async callback is received.
|
||||
FSMessage fsCmdHandlerMsg;
|
||||
|
||||
//! Device name of the last mount source returned by FSGetMountSourceNext.
|
||||
char lastMountSourceDevice[0x10];
|
||||
//! Device name of the last mount source returned by FSGetMountSourceNext.
|
||||
char lastMountSourceDevice[0x10];
|
||||
|
||||
//! Mount source type to find with FSGetMountSourceNext.
|
||||
FSMountSourceType findMountSourceType;
|
||||
//! Mount source type to find with FSGetMountSourceNext.
|
||||
FSMountSourceType findMountSourceType;
|
||||
|
||||
//! Link used for linked list of clients.
|
||||
FSClientBodyLink link;
|
||||
//! Link used for linked list of clients.
|
||||
FSClientBodyLink link;
|
||||
|
||||
//! Pointer to unaligned FSClient structure.
|
||||
FSClient* client;
|
||||
//! Pointer to unaligned FSClient structure.
|
||||
FSClient *client;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSClientBody, 0x1444, clientHandle);
|
||||
WUT_CHECK_OFFSET(FSClientBody, 0x1448, fsm);
|
||||
@@ -397,10 +399,11 @@ WUT_CHECK_OFFSET(FSAsyncResult, 0x20, block);
|
||||
WUT_CHECK_OFFSET(FSAsyncResult, 0x24, status);
|
||||
WUT_CHECK_SIZE(FSAsyncResult, 0x28);
|
||||
|
||||
struct FSCmdBlockBody {
|
||||
WUT_UNKNOWN_BYTES(0x96C);
|
||||
FSAsyncResult asyncResult;
|
||||
WUT_UNKNOWN_BYTES(0x68);
|
||||
struct FSCmdBlockBody
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x96C);
|
||||
FSAsyncResult asyncResult;
|
||||
WUT_UNKNOWN_BYTES(0x68);
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSCmdBlockBody, 0x96C, asyncResult);
|
||||
WUT_CHECK_SIZE(FSCmdBlockBody, 0x9FC);
|
||||
@@ -419,19 +422,20 @@ struct FSMountSource
|
||||
};
|
||||
WUT_CHECK_SIZE(FSMountSource, 0x300);
|
||||
|
||||
struct WUT_PACKED FSVolumeInfo {
|
||||
uint32_t flags;
|
||||
FSMediaState mediaState;
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint32_t unk0x0C;
|
||||
uint32_t unk0x10;
|
||||
int32_t unk0x14;
|
||||
int32_t unk0x18;
|
||||
WUT_UNKNOWN_BYTES(0x10);
|
||||
char volumeLabel[128];
|
||||
char volumeId[128];
|
||||
char devicePath[16];
|
||||
char mountPath[128];
|
||||
struct WUT_PACKED FSVolumeInfo
|
||||
{
|
||||
uint32_t flags;
|
||||
FSMediaState mediaState;
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint32_t unk0x0C;
|
||||
uint32_t unk0x10;
|
||||
int32_t unk0x14;
|
||||
int32_t unk0x18;
|
||||
WUT_UNKNOWN_BYTES(0x10);
|
||||
char volumeLabel[128];
|
||||
char volumeId[128];
|
||||
char devicePath[16];
|
||||
char mountPath[128];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSVolumeInfo, 0x00, flags);
|
||||
WUT_CHECK_OFFSET(FSVolumeInfo, 0x04, mediaState);
|
||||
@@ -450,22 +454,24 @@ WUT_CHECK_SIZE(FSVolumeInfo, 444);
|
||||
* Get an aligned FSClientBody from an FSClient.
|
||||
*/
|
||||
static inline FSClientBody *
|
||||
FSGetClientBody(FSClient *client) {
|
||||
FSGetClientBody(FSClient *client)
|
||||
{
|
||||
if (!client) {
|
||||
return NULL;
|
||||
}
|
||||
return (FSClientBody *) ((((uint32_t) client) + 0x3F) & ~0x3F);
|
||||
return (FSClientBody *)((((uint32_t)client) + 0x3F) & ~0x3F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an aligned FSCmdBlockBody from an FSCmdBlock.
|
||||
*/
|
||||
static inline FSCmdBlockBody *
|
||||
FSGetCmdBlockBody(FSCmdBlock *cmdBlock) {
|
||||
FSGetCmdBlockBody(FSCmdBlock *cmdBlock)
|
||||
{
|
||||
if (!cmdBlock) {
|
||||
return NULL;
|
||||
}
|
||||
return (FSCmdBlockBody *) ((((uint32_t) cmdBlock) + 0x3F) & ~0x3F);
|
||||
return (FSCmdBlockBody *)((((uint32_t)cmdBlock) + 0x3F) & ~0x3F);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -536,16 +542,16 @@ FSGetStatAsync(FSClient *client,
|
||||
|
||||
FSStatus
|
||||
FSRemove(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSErrorFlag errorMask);
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSRemoveAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
|
||||
FSStatus
|
||||
@@ -624,10 +630,10 @@ FSMakeDir(FSClient *client,
|
||||
|
||||
FSStatus
|
||||
FSMakeDirAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
FSStatus
|
||||
FSReadDir(FSClient *client,
|
||||
@@ -646,9 +652,9 @@ FSReadDirAsync(FSClient *client,
|
||||
|
||||
FSStatus
|
||||
FSRewindDir(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
FSDirectoryHandle handle,
|
||||
FSErrorFlag errorMask);
|
||||
FSCmdBlock *block,
|
||||
FSDirectoryHandle handle,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSCloseDir(FSClient *client,
|
||||
@@ -657,18 +663,18 @@ FSCloseDir(FSClient *client,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSGetVolumeInfo(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSVolumeInfo *volumeInfo,
|
||||
FSErrorFlag errorMask);
|
||||
FSGetVolumeInfo(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSVolumeInfo *volumeInfo,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSGetVolumeInfoAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSVolumeInfo *volumeInfo,
|
||||
FSErrorFlag errorMask,
|
||||
FSGetVolumeInfoAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *path,
|
||||
FSVolumeInfo *volumeInfo,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
FSStatus
|
||||
@@ -770,47 +776,47 @@ FSReadFileWithPosAsync(FSClient *client,
|
||||
|
||||
FSStatus
|
||||
FSWriteFile(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask);
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSWriteFileAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
FSStatus
|
||||
FSWriteFileWithPos(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
uint32_t pos,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask);
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
uint32_t pos,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSWriteFileWithPosAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
uint32_t pos,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
FSCmdBlock *block,
|
||||
uint8_t *buffer,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
uint32_t pos,
|
||||
FSFileHandle handle,
|
||||
uint32_t unk1,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
FSStatus
|
||||
FSGetPosFile(FSClient *client,
|
||||
@@ -844,44 +850,44 @@ FSSetPosFileAsync(FSClient *client,
|
||||
|
||||
FSStatus
|
||||
FSFlushFile(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask);
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSFlushFileAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
FSStatus
|
||||
FSTruncateFile(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask);
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSTruncateFileAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
FSCmdBlock *block,
|
||||
FSFileHandle handle,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
FSStatus
|
||||
FSRename(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *oldPath,
|
||||
const char *newPath,
|
||||
FSErrorFlag errorMask);
|
||||
FSCmdBlock *block,
|
||||
const char *oldPath,
|
||||
const char *newPath,
|
||||
FSErrorFlag errorMask);
|
||||
|
||||
FSStatus
|
||||
FSRenameAsync(FSClient *client,
|
||||
FSCmdBlock *block,
|
||||
const char *oldPath,
|
||||
const char *newPath,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
FSCmdBlock *block,
|
||||
const char *oldPath,
|
||||
const char *newPath,
|
||||
FSErrorFlag errorMask,
|
||||
FSAsyncData *asyncData);
|
||||
|
||||
FSVolumeState
|
||||
FSGetVolumeState(FSClient *client);
|
||||
|
||||
@@ -82,19 +82,21 @@ typedef void (*FSAAsyncCallbackFn)(FSError result,
|
||||
/**
|
||||
* Block information.
|
||||
*/
|
||||
struct FSABlockInfo {
|
||||
WUT_UNKNOWN_BYTES(0x14);
|
||||
struct FSABlockInfo
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x14);
|
||||
};
|
||||
WUT_CHECK_SIZE(FSABlockInfo, 0x14);
|
||||
|
||||
/**
|
||||
* Device information.
|
||||
*/
|
||||
struct FSADeviceInfo {
|
||||
WUT_UNKNOWN_BYTES(0x08);
|
||||
uint64_t deviceSizeInSectors;
|
||||
uint32_t deviceSectorSize;
|
||||
WUT_UNKNOWN_BYTES(0x14);
|
||||
struct FSADeviceInfo
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x08);
|
||||
uint64_t deviceSizeInSectors;
|
||||
uint32_t deviceSectorSize;
|
||||
WUT_UNKNOWN_BYTES(0x14);
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSADeviceInfo, 0x08, deviceSizeInSectors);
|
||||
WUT_CHECK_OFFSET(FSADeviceInfo, 0x10, deviceSectorSize);
|
||||
@@ -103,38 +105,43 @@ WUT_CHECK_SIZE(FSADeviceInfo, 0x28);
|
||||
/**
|
||||
* File System information.
|
||||
*/
|
||||
struct FSAFileSystemInfo {
|
||||
WUT_UNKNOWN_BYTES(0x1E);
|
||||
struct FSAFileSystemInfo
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x1E);
|
||||
};
|
||||
WUT_CHECK_SIZE(FSAFileSystemInfo, 0x1E);
|
||||
|
||||
typedef enum FSAMountPriority {
|
||||
FSA_MOUNT_PRIORITY_BASE = 0x1,
|
||||
FSA_MOUNT_PRIORITY_RAM_DISK_CACHE = 0x4,
|
||||
FSA_MOUNT_PRIORITY_TITLE_UPDATE = 0x9,
|
||||
FSA_MOUNT_PRIORITY_UNMOUNT_ALL = 0x80000000,
|
||||
typedef enum FSAMountPriority
|
||||
{
|
||||
FSA_MOUNT_PRIORITY_BASE = 0x1,
|
||||
FSA_MOUNT_PRIORITY_RAM_DISK_CACHE = 0x4,
|
||||
FSA_MOUNT_PRIORITY_TITLE_UPDATE = 0x9,
|
||||
FSA_MOUNT_PRIORITY_UNMOUNT_ALL = 0x80000000,
|
||||
} FSAMountPriority;
|
||||
|
||||
typedef enum FSAQueryInfoType {
|
||||
FSA_QUERY_INFO_FREE_SPACE_SIZE = 0x0,
|
||||
FSA_QUERY_INFO_DIR_SIZE = 0x1,
|
||||
FSA_QUERY_INFO_ENTRY_NUM = 0x2,
|
||||
FSA_QUERY_INFO_FILE_SYSTEM_INFO = 0x3,
|
||||
FSA_QUERY_INFO_DEVICE_INFO = 0x4,
|
||||
FSA_QUERY_INFO_STAT = 0x5,
|
||||
FSA_QUERY_INFO_BAD_BLOCK_INFO = 0x6,
|
||||
FSA_QUERY_INFO_JOURNAL_FREE_SPACE_SIZE = 0x7,
|
||||
FSA_QUERY_INFO_FRAGMENT_BLOCK_INFO = 0x8,
|
||||
typedef enum FSAQueryInfoType
|
||||
{
|
||||
FSA_QUERY_INFO_FREE_SPACE_SIZE = 0x0,
|
||||
FSA_QUERY_INFO_DIR_SIZE = 0x1,
|
||||
FSA_QUERY_INFO_ENTRY_NUM = 0x2,
|
||||
FSA_QUERY_INFO_FILE_SYSTEM_INFO = 0x3,
|
||||
FSA_QUERY_INFO_DEVICE_INFO = 0x4,
|
||||
FSA_QUERY_INFO_STAT = 0x5,
|
||||
FSA_QUERY_INFO_BAD_BLOCK_INFO = 0x6,
|
||||
FSA_QUERY_INFO_JOURNAL_FREE_SPACE_SIZE = 0x7,
|
||||
FSA_QUERY_INFO_FRAGMENT_BLOCK_INFO = 0x8,
|
||||
} FSAQueryInfoType;
|
||||
|
||||
typedef enum FSAReadFlag {
|
||||
FSA_READ_FLAG_NONE = 0x0,
|
||||
FSA_READ_FLAG_READ_WITH_POS = 0x1
|
||||
typedef enum FSAReadFlag
|
||||
{
|
||||
FSA_READ_FLAG_NONE = 0x0,
|
||||
FSA_READ_FLAG_READ_WITH_POS = 0x1
|
||||
} FSAReadFlag;
|
||||
|
||||
typedef enum FSAWriteFlag {
|
||||
FSA_WRITE_FLAG_NONE = 0x0,
|
||||
FSA_WRITE_FLAG_READ_WITH_POS = 0x1
|
||||
typedef enum FSAWriteFlag
|
||||
{
|
||||
FSA_WRITE_FLAG_NONE = 0x0,
|
||||
FSA_WRITE_FLAG_READ_WITH_POS = 0x1
|
||||
} FSAWriteFlag;
|
||||
|
||||
/**
|
||||
@@ -142,33 +149,36 @@ typedef enum FSAWriteFlag {
|
||||
*/
|
||||
struct FSAProcessInfo
|
||||
{
|
||||
uint64_t titleId;
|
||||
uint32_t processId;
|
||||
uint32_t groupId;
|
||||
uint64_t titleId;
|
||||
uint32_t processId;
|
||||
uint32_t groupId;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAProcessInfo, 0x00, titleId);
|
||||
WUT_CHECK_OFFSET(FSAProcessInfo, 0x08, processId);
|
||||
WUT_CHECK_OFFSET(FSAProcessInfo, 0x0C, groupId);
|
||||
WUT_CHECK_SIZE(FSAProcessInfo, 0x10);
|
||||
|
||||
struct FSARequestRawOpen {
|
||||
char path[0x280];
|
||||
struct FSARequestRawOpen
|
||||
{
|
||||
char path[0x280];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRawOpen, 0x0, path);
|
||||
WUT_CHECK_SIZE(FSARequestRawOpen, 0x280);
|
||||
|
||||
struct FSARequestRawClose {
|
||||
int32_t handle;
|
||||
struct FSARequestRawClose
|
||||
{
|
||||
int32_t handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRawClose, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestRawClose, 0x04);
|
||||
|
||||
struct WUT_PACKED FSARequestRawRead {
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint64_t blocks_offset;
|
||||
uint32_t count;
|
||||
uint32_t size;
|
||||
uint32_t device_handle;
|
||||
struct WUT_PACKED FSARequestRawRead
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint64_t blocks_offset;
|
||||
uint32_t count;
|
||||
uint32_t size;
|
||||
uint32_t device_handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRawRead, 0x04, blocks_offset);
|
||||
WUT_CHECK_OFFSET(FSARequestRawRead, 0x0C, count);
|
||||
@@ -176,12 +186,13 @@ WUT_CHECK_OFFSET(FSARequestRawRead, 0x10, size);
|
||||
WUT_CHECK_OFFSET(FSARequestRawRead, 0x14, device_handle);
|
||||
WUT_CHECK_SIZE(FSARequestRawRead, 0x18);
|
||||
|
||||
struct WUT_PACKED FSARequestRawWrite {
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint64_t blocks_offset;
|
||||
uint32_t count;
|
||||
uint32_t size;
|
||||
uint32_t device_handle;
|
||||
struct WUT_PACKED FSARequestRawWrite
|
||||
{
|
||||
WUT_UNKNOWN_BYTES(0x4);
|
||||
uint64_t blocks_offset;
|
||||
uint32_t count;
|
||||
uint32_t size;
|
||||
uint32_t device_handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRawWrite, 0x04, blocks_offset);
|
||||
WUT_CHECK_OFFSET(FSARequestRawWrite, 0x0C, count);
|
||||
@@ -194,10 +205,10 @@ WUT_CHECK_SIZE(FSARequestRawWrite, 0x18);
|
||||
*/
|
||||
struct FSARequestAppendFile
|
||||
{
|
||||
uint32_t size;
|
||||
uint32_t count;
|
||||
FSAFileHandle handle;
|
||||
uint32_t unk0x0C;
|
||||
uint32_t size;
|
||||
uint32_t count;
|
||||
FSAFileHandle handle;
|
||||
uint32_t unk0x0C;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestAppendFile, 0x0, size);
|
||||
WUT_CHECK_OFFSET(FSARequestAppendFile, 0x4, count);
|
||||
@@ -210,7 +221,7 @@ WUT_CHECK_SIZE(FSARequestAppendFile, 0x10);
|
||||
*/
|
||||
struct FSARequestChangeDir
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char path[FS_MAX_PATH + 1];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestChangeDir, 0x0, path);
|
||||
WUT_CHECK_SIZE(FSARequestChangeDir, 0x280);
|
||||
@@ -221,9 +232,9 @@ WUT_CHECK_SIZE(FSARequestChangeDir, 0x280);
|
||||
*/
|
||||
struct FSARequestChangeMode
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
uint32_t mode1;
|
||||
uint32_t mode2;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
uint32_t mode1;
|
||||
uint32_t mode2;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestChangeMode, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestChangeMode, 0x280, mode1);
|
||||
@@ -236,7 +247,7 @@ WUT_CHECK_SIZE(FSARequestChangeMode, 0x288);
|
||||
*/
|
||||
struct FSARequestCloseDir
|
||||
{
|
||||
FSADirectoryHandle handle;
|
||||
FSADirectoryHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestCloseDir, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestCloseDir, 0x4);
|
||||
@@ -247,7 +258,7 @@ WUT_CHECK_SIZE(FSARequestCloseDir, 0x4);
|
||||
*/
|
||||
struct FSARequestCloseFile
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFileHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestCloseFile, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestCloseFile, 0x4);
|
||||
@@ -258,7 +269,7 @@ WUT_CHECK_SIZE(FSARequestCloseFile, 0x4);
|
||||
*/
|
||||
struct FSARequestFlushFile
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFileHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestFlushFile, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestFlushFile, 0x4);
|
||||
@@ -269,7 +280,7 @@ WUT_CHECK_SIZE(FSARequestFlushFile, 0x4);
|
||||
*/
|
||||
struct FSARequestFlushQuota
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char path[FS_MAX_PATH + 1];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestFlushQuota, 0x0, path);
|
||||
WUT_CHECK_SIZE(FSARequestFlushQuota, 0x280);
|
||||
@@ -280,8 +291,8 @@ WUT_CHECK_SIZE(FSARequestFlushQuota, 0x280);
|
||||
*/
|
||||
struct FSARequestGetInfoByQuery
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
FSAQueryInfoType type;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
FSAQueryInfoType type;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestGetInfoByQuery, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestGetInfoByQuery, 0x280, type);
|
||||
@@ -293,7 +304,7 @@ WUT_CHECK_SIZE(FSARequestGetInfoByQuery, 0x284);
|
||||
*/
|
||||
struct FSARequestGetPosFile
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFileHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestGetPosFile, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestGetPosFile, 0x4);
|
||||
@@ -304,7 +315,7 @@ WUT_CHECK_SIZE(FSARequestGetPosFile, 0x4);
|
||||
*/
|
||||
struct FSARequestIsEof
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFileHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestIsEof, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestIsEof, 0x4);
|
||||
@@ -315,8 +326,8 @@ WUT_CHECK_SIZE(FSARequestIsEof, 0x4);
|
||||
*/
|
||||
struct FSARequestMakeDir
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
uint32_t permission;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
uint32_t permission;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestMakeDir, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestMakeDir, 0x280, permission);
|
||||
@@ -327,9 +338,9 @@ WUT_CHECK_SIZE(FSARequestMakeDir, 0x284);
|
||||
*/
|
||||
struct WUT_PACKED FSARequestMakeQuota
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
uint32_t mode;
|
||||
uint64_t size;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
uint32_t mode;
|
||||
uint64_t size;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestMakeQuota, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestMakeQuota, 0x280, mode);
|
||||
@@ -342,11 +353,11 @@ WUT_CHECK_SIZE(FSARequestMakeQuota, 0x28C);
|
||||
*/
|
||||
struct FSARequestMount
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char target[FS_MAX_PATH +1];
|
||||
uint32_t unk0x500;
|
||||
void* unkBuf;
|
||||
uint32_t unkBufLen;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
char target[FS_MAX_PATH + 1];
|
||||
uint32_t unk0x500;
|
||||
void *unkBuf;
|
||||
uint32_t unkBufLen;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestMount, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestMount, 0x280, target);
|
||||
@@ -361,12 +372,12 @@ WUT_CHECK_SIZE(FSARequestMount, 0x50C);
|
||||
*/
|
||||
struct WUT_PACKED FSARequestMountWithProcess
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char target[FS_MAX_PATH +1];
|
||||
FSAMountPriority priority;
|
||||
FSAProcessInfo process;
|
||||
void* unkBuf;
|
||||
uint32_t unkBufLen;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
char target[FS_MAX_PATH + 1];
|
||||
FSAMountPriority priority;
|
||||
FSAProcessInfo process;
|
||||
void *unkBuf;
|
||||
uint32_t unkBufLen;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestMountWithProcess, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestMountWithProcess, 0x280, target);
|
||||
@@ -382,7 +393,7 @@ WUT_CHECK_SIZE(FSARequestMountWithProcess, 0x51C);
|
||||
*/
|
||||
struct FSARequestOpenDir
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char path[FS_MAX_PATH + 1];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestOpenDir, 0x0, path);
|
||||
WUT_CHECK_SIZE(FSARequestOpenDir, 0x280);
|
||||
@@ -392,11 +403,11 @@ WUT_CHECK_SIZE(FSARequestOpenDir, 0x280);
|
||||
*/
|
||||
struct FSARequestOpenFile
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char mode[FS_MODE_LENGTH];
|
||||
uint32_t unk0x290;
|
||||
uint32_t unk0x294;
|
||||
uint32_t unk0x298;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
char mode[FS_MODE_LENGTH];
|
||||
uint32_t unk0x290;
|
||||
uint32_t unk0x294;
|
||||
uint32_t unk0x298;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestOpenFile, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestOpenFile, 0x280, mode);
|
||||
@@ -411,7 +422,7 @@ WUT_CHECK_SIZE(FSARequestOpenFile, 0x29C);
|
||||
*/
|
||||
struct FSARequestReadDir
|
||||
{
|
||||
FSADirectoryHandle handle;
|
||||
FSADirectoryHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestReadDir, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestReadDir, 0x4);
|
||||
@@ -422,13 +433,13 @@ WUT_CHECK_SIZE(FSARequestReadDir, 0x4);
|
||||
*/
|
||||
struct FSARequestReadFile
|
||||
{
|
||||
//! Virtual pointer used only by Cafe, for IOS we should use ioctlv.vecs[1]
|
||||
uint8_t* buffer;
|
||||
uint32_t size;
|
||||
uint32_t count;
|
||||
FSAFilePosition pos;
|
||||
FSAFileHandle handle;
|
||||
FSAReadFlag readFlags;
|
||||
//! Virtual pointer used only by Cafe, for IOS we should use ioctlv.vecs[1]
|
||||
uint8_t *buffer;
|
||||
uint32_t size;
|
||||
uint32_t count;
|
||||
FSAFilePosition pos;
|
||||
FSAFileHandle handle;
|
||||
FSAReadFlag readFlags;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestReadFile, 0x00, buffer);
|
||||
WUT_CHECK_OFFSET(FSARequestReadFile, 0x04, size);
|
||||
@@ -444,7 +455,7 @@ WUT_CHECK_SIZE(FSARequestReadFile, 0x18);
|
||||
*/
|
||||
struct FSARequestRemove
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char path[FS_MAX_PATH + 1];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRemove, 0x0, path);
|
||||
WUT_CHECK_SIZE(FSARequestRemove, 0x280);
|
||||
@@ -455,8 +466,8 @@ WUT_CHECK_SIZE(FSARequestRemove, 0x280);
|
||||
*/
|
||||
struct FSARequestRename
|
||||
{
|
||||
char oldPath[FS_MAX_PATH +1];
|
||||
char newPath[FS_MAX_PATH +1];
|
||||
char oldPath[FS_MAX_PATH + 1];
|
||||
char newPath[FS_MAX_PATH + 1];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRename, 0x0, oldPath);
|
||||
WUT_CHECK_OFFSET(FSARequestRename, 0x280, newPath);
|
||||
@@ -468,7 +479,7 @@ WUT_CHECK_SIZE(FSARequestRename, 0x500);
|
||||
*/
|
||||
struct FSARequestRewindDir
|
||||
{
|
||||
FSADirectoryHandle handle;
|
||||
FSADirectoryHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestRewindDir, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestRewindDir, 0x4);
|
||||
@@ -479,8 +490,8 @@ WUT_CHECK_SIZE(FSARequestRewindDir, 0x4);
|
||||
*/
|
||||
struct FSARequestSetPosFile
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFilePosition pos;
|
||||
FSAFileHandle handle;
|
||||
FSAFilePosition pos;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestSetPosFile, 0x0, handle);
|
||||
WUT_CHECK_OFFSET(FSARequestSetPosFile, 0x4, pos);
|
||||
@@ -492,7 +503,7 @@ WUT_CHECK_SIZE(FSARequestSetPosFile, 0x8);
|
||||
*/
|
||||
struct FSARequestStatFile
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFileHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestStatFile, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestStatFile, 0x4);
|
||||
@@ -503,7 +514,7 @@ WUT_CHECK_SIZE(FSARequestStatFile, 0x4);
|
||||
*/
|
||||
struct FSARequestTruncateFile
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFileHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestTruncateFile, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSARequestTruncateFile, 0x4);
|
||||
@@ -514,8 +525,8 @@ WUT_CHECK_SIZE(FSARequestTruncateFile, 0x4);
|
||||
*/
|
||||
struct FSARequestUnmount
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
uint32_t unk0x280;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
uint32_t unk0x280;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestUnmount, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestUnmount, 0x280, unk0x280);
|
||||
@@ -527,9 +538,9 @@ WUT_CHECK_SIZE(FSARequestUnmount, 0x284);
|
||||
*/
|
||||
struct WUT_PACKED FSARequestUnmountWithProcess
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
FSAMountPriority priority;
|
||||
FSAProcessInfo process;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
FSAMountPriority priority;
|
||||
FSAProcessInfo process;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestUnmountWithProcess, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestUnmountWithProcess, 0x280, priority);
|
||||
@@ -542,13 +553,13 @@ WUT_CHECK_SIZE(FSARequestUnmountWithProcess, 0x294);
|
||||
*/
|
||||
struct FSARequestWriteFile
|
||||
{
|
||||
//! Virtual pointer used only by Cafe, for IOS we should use ioctlv.vecs[1]
|
||||
const uint8_t* buffer;
|
||||
uint32_t size;
|
||||
uint32_t count;
|
||||
FSAFilePosition pos;
|
||||
FSAFileHandle handle;
|
||||
FSAWriteFlag writeFlags;
|
||||
//! Virtual pointer used only by Cafe, for IOS we should use ioctlv.vecs[1]
|
||||
const uint8_t *buffer;
|
||||
uint32_t size;
|
||||
uint32_t count;
|
||||
FSAFilePosition pos;
|
||||
FSAFileHandle handle;
|
||||
FSAWriteFlag writeFlags;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestWriteFile, 0x00, buffer);
|
||||
WUT_CHECK_OFFSET(FSARequestWriteFile, 0x04, size);
|
||||
@@ -560,108 +571,112 @@ WUT_CHECK_SIZE(FSARequestWriteFile, 0x18);
|
||||
|
||||
struct FSARequestChangeOwner
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
uint32_t owner;
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
uint32_t group;
|
||||
char path[FS_MAX_PATH + 1];
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
uint32_t owner;
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
uint32_t group;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequestChangeOwner, 0x0, path);
|
||||
WUT_CHECK_OFFSET(FSARequestChangeOwner, 0x284, owner);
|
||||
WUT_CHECK_OFFSET(FSARequestChangeOwner, 0x28C, group);
|
||||
WUT_CHECK_SIZE(FSARequestChangeOwner, 0x290);
|
||||
|
||||
struct FSARequest {
|
||||
FSError emulatedError;
|
||||
struct FSARequest
|
||||
{
|
||||
FSError emulatedError;
|
||||
|
||||
union {
|
||||
FSARequestRawOpen rawOpen;
|
||||
FSARequestRawClose rawClose;
|
||||
FSARequestRawRead rawRead;
|
||||
FSARequestRawWrite rawWrite;
|
||||
FSARequestAppendFile appendFile;
|
||||
FSARequestChangeDir changeDir;
|
||||
FSARequestChangeMode changeMode;
|
||||
FSARequestCloseDir closeDir;
|
||||
FSARequestCloseFile closeFile;
|
||||
FSARequestFlushFile flushFile;
|
||||
FSARequestFlushQuota flushQuota;
|
||||
FSARequestGetInfoByQuery getInfoByQuery;
|
||||
FSARequestGetPosFile getPosFile;
|
||||
FSARequestIsEof isEof;
|
||||
FSARequestMakeDir makeDir;
|
||||
FSARequestMakeQuota makeQuota;
|
||||
FSARequestMount mount;
|
||||
FSARequestMountWithProcess mountWithProcess;
|
||||
FSARequestOpenDir openDir;
|
||||
FSARequestOpenFile openFile;
|
||||
FSARequestReadDir readDir;
|
||||
FSARequestReadFile readFile;
|
||||
FSARequestRemove remove;
|
||||
FSARequestRename rename;
|
||||
FSARequestRewindDir rewindDir;
|
||||
FSARequestSetPosFile setPosFile;
|
||||
FSARequestStatFile statFile;
|
||||
FSARequestTruncateFile truncateFile;
|
||||
FSARequestUnmount unmount;
|
||||
FSARequestUnmountWithProcess unmountWithProcess;
|
||||
FSARequestWriteFile writeFile;
|
||||
FSARequestChangeOwner changeOwner;
|
||||
WUT_UNKNOWN_BYTES(0x51C);
|
||||
};
|
||||
union
|
||||
{
|
||||
FSARequestRawOpen rawOpen;
|
||||
FSARequestRawClose rawClose;
|
||||
FSARequestRawRead rawRead;
|
||||
FSARequestRawWrite rawWrite;
|
||||
FSARequestAppendFile appendFile;
|
||||
FSARequestChangeDir changeDir;
|
||||
FSARequestChangeMode changeMode;
|
||||
FSARequestCloseDir closeDir;
|
||||
FSARequestCloseFile closeFile;
|
||||
FSARequestFlushFile flushFile;
|
||||
FSARequestFlushQuota flushQuota;
|
||||
FSARequestGetInfoByQuery getInfoByQuery;
|
||||
FSARequestGetPosFile getPosFile;
|
||||
FSARequestIsEof isEof;
|
||||
FSARequestMakeDir makeDir;
|
||||
FSARequestMakeQuota makeQuota;
|
||||
FSARequestMount mount;
|
||||
FSARequestMountWithProcess mountWithProcess;
|
||||
FSARequestOpenDir openDir;
|
||||
FSARequestOpenFile openFile;
|
||||
FSARequestReadDir readDir;
|
||||
FSARequestReadFile readFile;
|
||||
FSARequestRemove remove;
|
||||
FSARequestRename rename;
|
||||
FSARequestRewindDir rewindDir;
|
||||
FSARequestSetPosFile setPosFile;
|
||||
FSARequestStatFile statFile;
|
||||
FSARequestTruncateFile truncateFile;
|
||||
FSARequestUnmount unmount;
|
||||
FSARequestUnmountWithProcess unmountWithProcess;
|
||||
FSARequestWriteFile writeFile;
|
||||
FSARequestChangeOwner changeOwner;
|
||||
WUT_UNKNOWN_BYTES(0x51C);
|
||||
};
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSARequest, 0x00, emulatedError);
|
||||
WUT_CHECK_OFFSET(FSARequest, 0x04, rawOpen);
|
||||
WUT_CHECK_SIZE(FSARequest, 0x520);
|
||||
|
||||
|
||||
struct FSAResponseRawOpen {
|
||||
int handle;
|
||||
struct FSAResponseRawOpen
|
||||
{
|
||||
int handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseRawOpen, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSAResponseRawOpen, 0x4);
|
||||
|
||||
struct FSAResponseGetCwd
|
||||
{
|
||||
char path[FS_MAX_PATH +1];
|
||||
char path[FS_MAX_PATH + 1];
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseGetCwd, 0x0, path);
|
||||
WUT_CHECK_SIZE(FSAResponseGetCwd, 0x280);
|
||||
|
||||
struct FSAResponseGetFileBlockAddress
|
||||
{
|
||||
uint32_t address;
|
||||
uint32_t address;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseGetFileBlockAddress, 0x0, address);
|
||||
WUT_CHECK_SIZE(FSAResponseGetFileBlockAddress, 0x4);
|
||||
|
||||
struct FSAResponseGetPosFile
|
||||
{
|
||||
FSAFilePosition pos;
|
||||
FSAFilePosition pos;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseGetPosFile, 0x0, pos);
|
||||
WUT_CHECK_SIZE(FSAResponseGetPosFile, 0x4);
|
||||
|
||||
struct FSAResponseGetVolumeInfo
|
||||
{
|
||||
FSAVolumeInfo volumeInfo;
|
||||
FSAVolumeInfo volumeInfo;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseGetVolumeInfo, 0x0, volumeInfo);
|
||||
WUT_CHECK_SIZE(FSAResponseGetVolumeInfo, 0x1BC);
|
||||
|
||||
struct WUT_PACKED FSAResponseGetInfoByQuery
|
||||
{
|
||||
union WUT_PACKED {
|
||||
FSABlockInfo badBlockInfo;
|
||||
FSADeviceInfo deviceInfo;
|
||||
uint64_t dirSize;
|
||||
FSAEntryNum entryNum;
|
||||
FSAFileSystemInfo fileSystemInfo;
|
||||
FSABlockInfo fragmentBlockInfo;
|
||||
uint64_t freeSpaceSize;
|
||||
uint64_t journalFreeSpaceSize;
|
||||
FSAStat stat;
|
||||
};
|
||||
union WUT_PACKED
|
||||
{
|
||||
FSABlockInfo badBlockInfo;
|
||||
FSADeviceInfo deviceInfo;
|
||||
uint64_t dirSize;
|
||||
FSAEntryNum entryNum;
|
||||
FSAFileSystemInfo fileSystemInfo;
|
||||
FSABlockInfo fragmentBlockInfo;
|
||||
uint64_t freeSpaceSize;
|
||||
uint64_t journalFreeSpaceSize;
|
||||
FSAStat stat;
|
||||
};
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseGetInfoByQuery, 0x0, badBlockInfo);
|
||||
WUT_CHECK_OFFSET(FSAResponseGetInfoByQuery, 0x0, deviceInfo);
|
||||
@@ -676,149 +691,154 @@ WUT_CHECK_SIZE(FSAResponseGetInfoByQuery, 0x64);
|
||||
|
||||
struct FSAResponseOpenFile
|
||||
{
|
||||
FSAFileHandle handle;
|
||||
FSAFileHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseOpenFile, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSAResponseOpenFile, 0x4);
|
||||
|
||||
struct FSAResponseOpenDir
|
||||
{
|
||||
FSADirectoryHandle handle;
|
||||
FSADirectoryHandle handle;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseOpenDir, 0x0, handle);
|
||||
WUT_CHECK_SIZE(FSAResponseOpenDir, 0x4);
|
||||
|
||||
struct FSAResponseReadDir
|
||||
{
|
||||
FSADirectoryEntry entry;
|
||||
FSADirectoryEntry entry;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseReadDir, 0x0, entry);
|
||||
WUT_CHECK_SIZE(FSAResponseReadDir, 0x164);
|
||||
|
||||
struct FSAResponseStatFile
|
||||
{
|
||||
FSAStat stat;
|
||||
FSAStat stat;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponseStatFile, 0x0, stat);
|
||||
WUT_CHECK_SIZE(FSAResponseStatFile, 0x64);
|
||||
|
||||
struct WUT_PACKED FSAResponse {
|
||||
uint32_t word0;
|
||||
union WUT_PACKED {
|
||||
FSAResponseRawOpen rawOpen;
|
||||
FSAResponseGetCwd getCwd;
|
||||
FSAResponseGetFileBlockAddress getFileBlockAddress;
|
||||
FSAResponseGetPosFile getPosFile;
|
||||
FSAResponseGetVolumeInfo getVolumeInfo;
|
||||
FSAResponseGetInfoByQuery getInfoByQuery;
|
||||
FSAResponseOpenDir openDir;
|
||||
FSAResponseOpenFile openFile;
|
||||
FSAResponseReadDir readDir;
|
||||
FSAResponseStatFile statFile;
|
||||
WUT_UNKNOWN_BYTES(0x28F);
|
||||
};
|
||||
struct WUT_PACKED FSAResponse
|
||||
{
|
||||
uint32_t word0;
|
||||
union WUT_PACKED
|
||||
{
|
||||
FSAResponseRawOpen rawOpen;
|
||||
FSAResponseGetCwd getCwd;
|
||||
FSAResponseGetFileBlockAddress getFileBlockAddress;
|
||||
FSAResponseGetPosFile getPosFile;
|
||||
FSAResponseGetVolumeInfo getVolumeInfo;
|
||||
FSAResponseGetInfoByQuery getInfoByQuery;
|
||||
FSAResponseOpenDir openDir;
|
||||
FSAResponseOpenFile openFile;
|
||||
FSAResponseReadDir readDir;
|
||||
FSAResponseStatFile statFile;
|
||||
WUT_UNKNOWN_BYTES(0x28F);
|
||||
};
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAResponse, 0x0, word0);
|
||||
WUT_CHECK_OFFSET(FSAResponse, 0x4, rawOpen);
|
||||
WUT_CHECK_SIZE(FSAResponse, 0x293);
|
||||
|
||||
enum FSACommandEnum {
|
||||
FSA_COMMAND_INVALID = 0x0,
|
||||
FSA_COMMAND_MOUNT = 0x1,
|
||||
FSA_COMMAND_UNMOUNT = 0x2,
|
||||
FSA_COMMAND_GET_VOLUME_INFO = 0x3,
|
||||
FSA_COMMAND_GET_ATTACH = 0x4,
|
||||
FSA_COMMAND_CHANGE_DIR = 0x5,
|
||||
FSA_COMMAND_GET_CWD = 0x6,
|
||||
FSA_COMMAND_MAKE_DIR = 0x7,
|
||||
FSA_COMMAND_REMOVE = 0x8,
|
||||
FSA_COMMAND_RENAME = 0x9,
|
||||
FSA_COMMAND_OPEN_DIR = 0xA,
|
||||
FSA_COMMAND_READ_DIR = 0xB,
|
||||
FSA_COMMAND_REWIND_DIR = 0xC,
|
||||
FSA_COMMAND_CLOSE_DIR = 0xD,
|
||||
FSA_COMMAND_OPEN_FILE = 0xE,
|
||||
FSA_COMMAND_READ_FILE = 0xF,
|
||||
FSA_COMMAND_WRITE_FILE = 0x10,
|
||||
FSA_COMMAND_GET_POS_FILE = 0x11,
|
||||
FSA_COMMAND_SET_POS_FILE = 0x12,
|
||||
FSA_COMMAND_IS_EOF = 0x13,
|
||||
FSA_COMMAND_STAT_FILE = 0x14,
|
||||
FSA_COMMAND_CLOSE_FILE = 0x15,
|
||||
FSA_COMMAND_GET_ERROR = 0x16,
|
||||
FSA_COMMAND_FLUSH_FILE = 0x17,
|
||||
FSA_COMMAND_GET_INFO_BY_QUERY = 0x18,
|
||||
FSA_COMMAND_APPEND_FILE = 0x19,
|
||||
FSA_COMMAND_TRUNCATE_FILE = 0x1A,
|
||||
FSA_COMMAND_FLUSH_VOLUME = 0x1B,
|
||||
FSA_COMMAND_ROLLBACK_VOLUME = 0x1C,
|
||||
FSA_COMMAND_MAKE_QUOTA = 0x1D,
|
||||
FSA_COMMAND_FLUSH_QUOTA = 0x1E,
|
||||
FSA_COMMAND_ROLLBACK_QUOTA = 0x1F,
|
||||
FSA_COMMAND_CHANGE_MODE = 0x20,
|
||||
FSA_COMMAND_OPEN_FILE_BY_STAT = 0x21,
|
||||
FSA_COMMAND_REGISTER_FLUSH_QUOTA = 0x22,
|
||||
FSA_COMMAND_FLUSH_MULTI_QUOTA = 0x23,
|
||||
FSA_COMMAND_GET_FILE_BLOCK_ADDRESS = 0x25,
|
||||
FSA_COMMAND_ADD_USER_PROCESS = 0x65,
|
||||
FSA_COMMAND_DEL_USER_PROCESS = 0x66,
|
||||
FSA_COMMAND_MOUNT_WITH_PROCESS = 0x67,
|
||||
FSA_COMMAND_UNMOUNT_WITH_PROCESS = 0x68,
|
||||
FSA_COMMAND_FORMAT = 0x69,
|
||||
FSA_COMMAND_RAW_OPEN = 0x6A,
|
||||
FSA_COMMAND_RAW_READ = 0x6B,
|
||||
FSA_COMMAND_RAW_WRITE = 0x6C,
|
||||
FSA_COMMAND_RAW_CLOSE = 0x6D,
|
||||
FSA_COMMAND_GET_LAST_FAILED_VOLUME = 0x6E,
|
||||
FSA_COMMAND_GET_VOLUME_EXISTENCE = 0x6F,
|
||||
FSA_COMMAND_CHANGE_OWNER = 0x70,
|
||||
FSA_COMMAND_CANCEL_GET_ATTACH = 0x71,
|
||||
FSA_COMMAND_REMOVE_QUOTA = 0x72,
|
||||
FSA_COMMAND_SET_CLIENT_PRIORITY = 0x73,
|
||||
FSA_COMMAND_APPLY_MEMORY_CACHE = 0x74,
|
||||
FSA_COMMAND_MAKE_LINK = 0x75,
|
||||
FSA_COMMAND_XFER_PARAMS = 0x76,
|
||||
FSA_COMMAND_EXEC_DEBUG_PROC = 0x78,
|
||||
FSA_COMMAND_DEBUG_SET_TITLE_ID = 0x79,
|
||||
FSA_COMMAND_DEBUG_SET_CAPABILITY = 0x7A,
|
||||
FSA_COMMAND_SET_PROCESS_CONFIG = 0x82,
|
||||
FSA_COMMAND_CONFIG_SET_MEMORY_CACHE = 0x83,
|
||||
FSA_COMMAND_CONFIG_UNSET_MEMORY_CACHE = 0x84,
|
||||
FSA_COMMAND_CONFIG_SET_PRF2_CHAR_CODE = 0x85,
|
||||
FSA_COMMAND_GET_PROC_RESOURCE_USAGE = 0x8C,
|
||||
FSA_COMMAND_GET_ALL_RESOURCE_USAGE = 0x8D,
|
||||
FSA_COMMAND_SEND_PROFILE_CMD = 0x8E,
|
||||
enum FSACommandEnum
|
||||
{
|
||||
FSA_COMMAND_INVALID = 0x0,
|
||||
FSA_COMMAND_MOUNT = 0x1,
|
||||
FSA_COMMAND_UNMOUNT = 0x2,
|
||||
FSA_COMMAND_GET_VOLUME_INFO = 0x3,
|
||||
FSA_COMMAND_GET_ATTACH = 0x4,
|
||||
FSA_COMMAND_CHANGE_DIR = 0x5,
|
||||
FSA_COMMAND_GET_CWD = 0x6,
|
||||
FSA_COMMAND_MAKE_DIR = 0x7,
|
||||
FSA_COMMAND_REMOVE = 0x8,
|
||||
FSA_COMMAND_RENAME = 0x9,
|
||||
FSA_COMMAND_OPEN_DIR = 0xA,
|
||||
FSA_COMMAND_READ_DIR = 0xB,
|
||||
FSA_COMMAND_REWIND_DIR = 0xC,
|
||||
FSA_COMMAND_CLOSE_DIR = 0xD,
|
||||
FSA_COMMAND_OPEN_FILE = 0xE,
|
||||
FSA_COMMAND_READ_FILE = 0xF,
|
||||
FSA_COMMAND_WRITE_FILE = 0x10,
|
||||
FSA_COMMAND_GET_POS_FILE = 0x11,
|
||||
FSA_COMMAND_SET_POS_FILE = 0x12,
|
||||
FSA_COMMAND_IS_EOF = 0x13,
|
||||
FSA_COMMAND_STAT_FILE = 0x14,
|
||||
FSA_COMMAND_CLOSE_FILE = 0x15,
|
||||
FSA_COMMAND_GET_ERROR = 0x16,
|
||||
FSA_COMMAND_FLUSH_FILE = 0x17,
|
||||
FSA_COMMAND_GET_INFO_BY_QUERY = 0x18,
|
||||
FSA_COMMAND_APPEND_FILE = 0x19,
|
||||
FSA_COMMAND_TRUNCATE_FILE = 0x1A,
|
||||
FSA_COMMAND_FLUSH_VOLUME = 0x1B,
|
||||
FSA_COMMAND_ROLLBACK_VOLUME = 0x1C,
|
||||
FSA_COMMAND_MAKE_QUOTA = 0x1D,
|
||||
FSA_COMMAND_FLUSH_QUOTA = 0x1E,
|
||||
FSA_COMMAND_ROLLBACK_QUOTA = 0x1F,
|
||||
FSA_COMMAND_CHANGE_MODE = 0x20,
|
||||
FSA_COMMAND_OPEN_FILE_BY_STAT = 0x21,
|
||||
FSA_COMMAND_REGISTER_FLUSH_QUOTA = 0x22,
|
||||
FSA_COMMAND_FLUSH_MULTI_QUOTA = 0x23,
|
||||
FSA_COMMAND_GET_FILE_BLOCK_ADDRESS = 0x25,
|
||||
FSA_COMMAND_ADD_USER_PROCESS = 0x65,
|
||||
FSA_COMMAND_DEL_USER_PROCESS = 0x66,
|
||||
FSA_COMMAND_MOUNT_WITH_PROCESS = 0x67,
|
||||
FSA_COMMAND_UNMOUNT_WITH_PROCESS = 0x68,
|
||||
FSA_COMMAND_FORMAT = 0x69,
|
||||
FSA_COMMAND_RAW_OPEN = 0x6A,
|
||||
FSA_COMMAND_RAW_READ = 0x6B,
|
||||
FSA_COMMAND_RAW_WRITE = 0x6C,
|
||||
FSA_COMMAND_RAW_CLOSE = 0x6D,
|
||||
FSA_COMMAND_GET_LAST_FAILED_VOLUME = 0x6E,
|
||||
FSA_COMMAND_GET_VOLUME_EXISTENCE = 0x6F,
|
||||
FSA_COMMAND_CHANGE_OWNER = 0x70,
|
||||
FSA_COMMAND_CANCEL_GET_ATTACH = 0x71,
|
||||
FSA_COMMAND_REMOVE_QUOTA = 0x72,
|
||||
FSA_COMMAND_SET_CLIENT_PRIORITY = 0x73,
|
||||
FSA_COMMAND_APPLY_MEMORY_CACHE = 0x74,
|
||||
FSA_COMMAND_MAKE_LINK = 0x75,
|
||||
FSA_COMMAND_XFER_PARAMS = 0x76,
|
||||
FSA_COMMAND_EXEC_DEBUG_PROC = 0x78,
|
||||
FSA_COMMAND_DEBUG_SET_TITLE_ID = 0x79,
|
||||
FSA_COMMAND_DEBUG_SET_CAPABILITY = 0x7A,
|
||||
FSA_COMMAND_SET_PROCESS_CONFIG = 0x82,
|
||||
FSA_COMMAND_CONFIG_SET_MEMORY_CACHE = 0x83,
|
||||
FSA_COMMAND_CONFIG_UNSET_MEMORY_CACHE = 0x84,
|
||||
FSA_COMMAND_CONFIG_SET_PRF2_CHAR_CODE = 0x85,
|
||||
FSA_COMMAND_GET_PROC_RESOURCE_USAGE = 0x8C,
|
||||
FSA_COMMAND_GET_ALL_RESOURCE_USAGE = 0x8D,
|
||||
FSA_COMMAND_SEND_PROFILE_CMD = 0x8E,
|
||||
};
|
||||
|
||||
enum FSAIpcRequestTypeEnum {
|
||||
FSA_IPC_REQUEST_IOCTL = 0,
|
||||
FSA_IPC_REQUEST_IOCTLV = 1,
|
||||
enum FSAIpcRequestTypeEnum
|
||||
{
|
||||
FSA_IPC_REQUEST_IOCTL = 0,
|
||||
FSA_IPC_REQUEST_IOCTLV = 1,
|
||||
};
|
||||
|
||||
struct FSAAsyncResult {
|
||||
//! Queue to put a message on when command is complete.
|
||||
OSMessageQueue *ioMsgQueue;
|
||||
struct FSAAsyncResult
|
||||
{
|
||||
//! Queue to put a message on when command is complete.
|
||||
OSMessageQueue *ioMsgQueue;
|
||||
|
||||
//! Message used for ioMsgQueue.
|
||||
FSMessage msg;
|
||||
//! Message used for ioMsgQueue.
|
||||
FSMessage msg;
|
||||
|
||||
//! Callback to call when the command is complete.
|
||||
FSAAsyncCallbackFn userCallback;
|
||||
//! Callback to call when the command is complete.
|
||||
FSAAsyncCallbackFn userCallback;
|
||||
|
||||
//! Result.
|
||||
FSError error;
|
||||
//! Result.
|
||||
FSError error;
|
||||
|
||||
//! FSA command.
|
||||
FSACommand command;
|
||||
//! FSA command.
|
||||
FSACommand command;
|
||||
|
||||
//! Pointer to allocated FSA IPC Request.
|
||||
FSARequest *request;
|
||||
//! Pointer to allocated FSA IPC Request.
|
||||
FSARequest *request;
|
||||
|
||||
//! Pointer to allocated FSA IPC Response.
|
||||
FSAResponse *response;
|
||||
//! Pointer to allocated FSA IPC Response.
|
||||
FSAResponse *response;
|
||||
|
||||
//! Callback to call when the command is complete.
|
||||
void *userContext;
|
||||
//! Callback to call when the command is complete.
|
||||
void *userContext;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAAsyncResult, 0x00, ioMsgQueue);
|
||||
WUT_CHECK_OFFSET(FSAAsyncResult, 0x04, msg);
|
||||
@@ -830,37 +850,38 @@ WUT_CHECK_OFFSET(FSAAsyncResult, 0x24, response);
|
||||
WUT_CHECK_OFFSET(FSAAsyncResult, 0x28, userContext);
|
||||
WUT_CHECK_SIZE(FSAAsyncResult, 0x2C);
|
||||
|
||||
struct WUT_PACKED FSAShimBuffer {
|
||||
//! Buffer for FSA IPC request.
|
||||
FSARequest request;
|
||||
WUT_UNKNOWN_BYTES(0x60);
|
||||
struct WUT_PACKED FSAShimBuffer
|
||||
{
|
||||
//! Buffer for FSA IPC request.
|
||||
FSARequest request;
|
||||
WUT_UNKNOWN_BYTES(0x60);
|
||||
|
||||
//! Buffer for FSA IPC response.
|
||||
FSAResponse response;
|
||||
WUT_UNKNOWN_BYTES(0x880 - 0x813);
|
||||
//! Buffer for FSA IPC response.
|
||||
FSAResponse response;
|
||||
WUT_UNKNOWN_BYTES(0x880 - 0x813);
|
||||
|
||||
//! Memory to use for ioctlv calls, unknown maximum count - but at least 3.
|
||||
IOSVec ioctlvVec[3];
|
||||
//! Memory to use for ioctlv calls, unknown maximum count - but at least 3.
|
||||
IOSVec ioctlvVec[3];
|
||||
|
||||
WUT_UNKNOWN_BYTES(0x900 - 0x8A4);
|
||||
WUT_UNKNOWN_BYTES(0x900 - 0x8A4);
|
||||
|
||||
//! Command for FSA.
|
||||
FSACommand command;
|
||||
//! Command for FSA.
|
||||
FSACommand command;
|
||||
|
||||
//! Handle to FSA device.
|
||||
uint32_t clientHandle;
|
||||
//! Handle to FSA device.
|
||||
uint32_t clientHandle;
|
||||
|
||||
//! IOS IPC request type to use.
|
||||
FSAIpcRequestType ipcReqType;
|
||||
//! IOS IPC request type to use.
|
||||
FSAIpcRequestType ipcReqType;
|
||||
|
||||
//! Number of ioctlv input vectors.
|
||||
uint8_t ioctlvVecIn;
|
||||
//! Number of ioctlv input vectors.
|
||||
uint8_t ioctlvVecIn;
|
||||
|
||||
//! Number of ioctlv output vectors.
|
||||
uint8_t ioctlvVecOut;
|
||||
//! Number of ioctlv output vectors.
|
||||
uint8_t ioctlvVecOut;
|
||||
|
||||
//! FSAAsyncResult used for FSA* functions.
|
||||
FSAAsyncResult fsaAsyncResult;
|
||||
//! FSAAsyncResult used for FSA* functions.
|
||||
FSAAsyncResult fsaAsyncResult;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAShimBuffer, 0x0, request);
|
||||
WUT_CHECK_OFFSET(FSAShimBuffer, 0x580, response);
|
||||
@@ -879,31 +900,34 @@ typedef void (*FSAClientAttachAsyncCallbackFn)(FSError result,
|
||||
FSAResponse *response,
|
||||
void *userContext);
|
||||
|
||||
struct FSAClientAttachAsyncData {
|
||||
//! Callback to call when an attach has happened.
|
||||
FSAClientAttachAsyncCallbackFn userCallback;
|
||||
struct FSAClientAttachAsyncData
|
||||
{
|
||||
//! Callback to call when an attach has happened.
|
||||
FSAClientAttachAsyncCallbackFn userCallback;
|
||||
|
||||
//! Callback context
|
||||
void *userContext;
|
||||
//! Callback context
|
||||
void *userContext;
|
||||
|
||||
//! Queue to put a message on when command is complete.
|
||||
OSMessageQueue *ioMsgQueue;
|
||||
//! Queue to put a message on when command is complete.
|
||||
OSMessageQueue *ioMsgQueue;
|
||||
};
|
||||
WUT_CHECK_OFFSET(FSAClientAttachAsyncData, 0x00, userCallback);
|
||||
WUT_CHECK_OFFSET(FSAClientAttachAsyncData, 0x04, userContext);
|
||||
WUT_CHECK_OFFSET(FSAClientAttachAsyncData, 0x08, ioMsgQueue);
|
||||
WUT_CHECK_SIZE(FSAClientAttachAsyncData, 0xC);
|
||||
|
||||
typedef enum FSAMountFlags {
|
||||
FSA_MOUNT_FLAG_LOCAL_MOUNT = 0,
|
||||
FSA_MOUNT_FLAG_BIND_MOUNT = 1,
|
||||
FSA_MOUNT_FLAG_GLOBAL_MOUNT = 2,
|
||||
typedef enum FSAMountFlags
|
||||
{
|
||||
FSA_MOUNT_FLAG_LOCAL_MOUNT = 0,
|
||||
FSA_MOUNT_FLAG_BIND_MOUNT = 1,
|
||||
FSA_MOUNT_FLAG_GLOBAL_MOUNT = 2,
|
||||
} FSAMountFlags;
|
||||
|
||||
typedef enum FSAUnmountFlags {
|
||||
FSA_UNMOUNT_FLAG_NONE = 0x00000000,
|
||||
FSA_UNMOUNT_FLAG_FORCE = 0x00000002,
|
||||
FSA_UNMOUNT_FLAG_BIND_MOUNT = 0x80000000,
|
||||
typedef enum FSAUnmountFlags
|
||||
{
|
||||
FSA_UNMOUNT_FLAG_NONE = 0x00000000,
|
||||
FSA_UNMOUNT_FLAG_FORCE = 0x00000002,
|
||||
FSA_UNMOUNT_FLAG_BIND_MOUNT = 0x80000000,
|
||||
} FSAUnmountFlags;
|
||||
|
||||
FSError
|
||||
|
||||
@@ -30,12 +30,12 @@ typedef enum IMPadType
|
||||
|
||||
typedef enum IMDeviceState
|
||||
{
|
||||
IM_DEVICE_STATE_CLEAR = 0,
|
||||
IM_DEVICE_STATE_INACTIVE = 1,
|
||||
IM_DEVICE_STATE_ACTIVE = 2,
|
||||
IM_DEVICE_STATE_HOME = 3,
|
||||
IM_DEVICE_STATE_POWER = 4,
|
||||
IM_DEVICE_STATE_SYNC = 5,
|
||||
IM_DEVICE_STATE_CLEAR = 0,
|
||||
IM_DEVICE_STATE_INACTIVE = 1,
|
||||
IM_DEVICE_STATE_ACTIVE = 2,
|
||||
IM_DEVICE_STATE_HOME = 3,
|
||||
IM_DEVICE_STATE_POWER = 4,
|
||||
IM_DEVICE_STATE_SYNC = 5,
|
||||
} IMDeviceState;
|
||||
|
||||
struct WUT_PACKED IMRequest
|
||||
@@ -97,18 +97,18 @@ WUT_CHECK_SIZE(IMDeviceStateEx, 0xC);
|
||||
|
||||
typedef enum IMParameter
|
||||
{
|
||||
IM_PARAMETER_INACTIVE_SECONDS = 0,
|
||||
IM_PARAMETER_DIM_ENABLED = 1,
|
||||
IM_PARAMETER_DIM_PERIOD = 2,
|
||||
IM_PARAMETER_APD_ENABLED = 3,
|
||||
IM_PARAMETER_APD_PERIOD = 4,
|
||||
IM_PARAMETER_RESET_ENABLE = 5,
|
||||
IM_PARAMETER_RESET_SECONDS = 6,
|
||||
IM_PARAMETER_POWER_OFF_ENABLE = 7,
|
||||
IM_PARAMETER_APD_OCCURED = 8,
|
||||
IM_PARAMETER_DIM_ENABLE_TV = 9,
|
||||
IM_PARAMETER_DIM_ENABLE_DRC = 10,
|
||||
IM_PARAMETER_MAX = 11,
|
||||
IM_PARAMETER_INACTIVE_SECONDS = 0,
|
||||
IM_PARAMETER_DIM_ENABLED = 1,
|
||||
IM_PARAMETER_DIM_PERIOD = 2,
|
||||
IM_PARAMETER_APD_ENABLED = 3,
|
||||
IM_PARAMETER_APD_PERIOD = 4,
|
||||
IM_PARAMETER_RESET_ENABLE = 5,
|
||||
IM_PARAMETER_RESET_SECONDS = 6,
|
||||
IM_PARAMETER_POWER_OFF_ENABLE = 7,
|
||||
IM_PARAMETER_APD_OCCURED = 8,
|
||||
IM_PARAMETER_DIM_ENABLE_TV = 9,
|
||||
IM_PARAMETER_DIM_ENABLE_DRC = 10,
|
||||
IM_PARAMETER_MAX = 11,
|
||||
} IMParameter;
|
||||
|
||||
typedef enum IMTimer
|
||||
@@ -158,7 +158,7 @@ IM_GetParameter(IOSHandle handle,
|
||||
void *asyncCallbackContext);
|
||||
|
||||
IOSError
|
||||
IM_GetParameters(IMParameters* parameters);
|
||||
IM_GetParameters(IMParameters *parameters);
|
||||
|
||||
IOSError
|
||||
IM_GetNvParameter(IOSHandle handle,
|
||||
|
||||
@@ -6,7 +6,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
int
|
||||
__os_snprintf(char *buf, size_t n, const char *format, ... )
|
||||
__os_snprintf(char *buf,
|
||||
size_t n,
|
||||
const char *format,
|
||||
...)
|
||||
WUT_FORMAT_PRINTF(3, 4);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -29,8 +29,8 @@ typedef enum OSInterruptType
|
||||
OS_INTERRUPT_TYPE_AHB = 12
|
||||
} OSInterruptType;
|
||||
|
||||
typedef void(*OSUserInterruptHandler)(OSInterruptType type, OSContext* interruptedContext);
|
||||
|
||||
typedef void (*OSUserInterruptHandler)(OSInterruptType type, OSContext *interruptedContext);
|
||||
|
||||
BOOL
|
||||
OSEnableInterrupts();
|
||||
|
||||
|
||||
@@ -16,56 +16,56 @@ typedef int32_t IOSHandle;
|
||||
|
||||
typedef enum IOSOpenMode
|
||||
{
|
||||
IOS_OPEN_READ = 1 << 0,
|
||||
IOS_OPEN_WRITE = 1 << 1,
|
||||
IOS_OPEN_READWRITE = IOS_OPEN_READ | IOS_OPEN_WRITE,
|
||||
IOS_OPEN_READ = 1 << 0,
|
||||
IOS_OPEN_WRITE = 1 << 1,
|
||||
IOS_OPEN_READWRITE = IOS_OPEN_READ | IOS_OPEN_WRITE,
|
||||
} IOSOpenMode;
|
||||
|
||||
typedef enum IOSError
|
||||
{
|
||||
IOS_ERROR_OK = 0,
|
||||
IOS_ERROR_ACCESS = -1,
|
||||
IOS_ERROR_EXISTS = -2,
|
||||
IOS_ERROR_INTR = -3,
|
||||
IOS_ERROR_INVALID = -4,
|
||||
IOS_ERROR_MAX = -5,
|
||||
IOS_ERROR_NOEXISTS = -6,
|
||||
IOS_ERROR_QEMPTY = -7,
|
||||
IOS_ERROR_QFULL = -8,
|
||||
IOS_ERROR_UNKNOWN = -9,
|
||||
IOS_ERROR_NOTREADY = -10,
|
||||
IOS_ERROR_ECC = -11,
|
||||
IOS_ERROR_ECCCRIT = -12,
|
||||
IOS_ERROR_BADBLOCK = -13,
|
||||
IOS_ERROR_INVALIDOBJTYPE = -14,
|
||||
IOS_ERROR_INVALIDRNG = -15,
|
||||
IOS_ERROR_INVALIDFLAG = -16,
|
||||
IOS_ERROR_INVALIDFORMAT = -17,
|
||||
IOS_ERROR_INVALIDVERSION = -18,
|
||||
IOS_ERROR_INVALIDSIGNER = -19,
|
||||
IOS_ERROR_FAILCHECKVALUE = -20,
|
||||
IOS_ERROR_FAILINTERNAL = -21,
|
||||
IOS_ERROR_FAILALLOC = -22,
|
||||
IOS_ERROR_INVALIDSIZE = -23,
|
||||
IOS_ERROR_NOLINK = -24,
|
||||
IOS_ERROR_ANFAILED = -25,
|
||||
IOS_ERROR_MAXSEMCOUNT = -26,
|
||||
IOS_ERROR_SEMUNAVAILABLE = -27,
|
||||
IOS_ERROR_INVALIDHANDLE = -28,
|
||||
IOS_ERROR_INVALIDARG = -29,
|
||||
IOS_ERROR_NORESOURCE = -30,
|
||||
IOS_ERROR_BUSY = -31,
|
||||
IOS_ERROR_TIMEOUT = -32,
|
||||
IOS_ERROR_ALIGNMENT = -33,
|
||||
IOS_ERROR_BSP = -34,
|
||||
IOS_ERROR_DATAPENDING = -35,
|
||||
IOS_ERROR_EXPIRED = -36,
|
||||
IOS_ERROR_NOREADACCESS = -37,
|
||||
IOS_ERROR_NOWRITEACCESS = -38,
|
||||
IOS_ERROR_NOREADWRITEACCESS = -39,
|
||||
IOS_ERROR_CLIENTTXNLIMIT = -40,
|
||||
IOS_ERROR_STALEHANDLE = -41,
|
||||
IOS_ERROR_UNKNOWNVALUE = -42,
|
||||
IOS_ERROR_OK = 0,
|
||||
IOS_ERROR_ACCESS = -1,
|
||||
IOS_ERROR_EXISTS = -2,
|
||||
IOS_ERROR_INTR = -3,
|
||||
IOS_ERROR_INVALID = -4,
|
||||
IOS_ERROR_MAX = -5,
|
||||
IOS_ERROR_NOEXISTS = -6,
|
||||
IOS_ERROR_QEMPTY = -7,
|
||||
IOS_ERROR_QFULL = -8,
|
||||
IOS_ERROR_UNKNOWN = -9,
|
||||
IOS_ERROR_NOTREADY = -10,
|
||||
IOS_ERROR_ECC = -11,
|
||||
IOS_ERROR_ECCCRIT = -12,
|
||||
IOS_ERROR_BADBLOCK = -13,
|
||||
IOS_ERROR_INVALIDOBJTYPE = -14,
|
||||
IOS_ERROR_INVALIDRNG = -15,
|
||||
IOS_ERROR_INVALIDFLAG = -16,
|
||||
IOS_ERROR_INVALIDFORMAT = -17,
|
||||
IOS_ERROR_INVALIDVERSION = -18,
|
||||
IOS_ERROR_INVALIDSIGNER = -19,
|
||||
IOS_ERROR_FAILCHECKVALUE = -20,
|
||||
IOS_ERROR_FAILINTERNAL = -21,
|
||||
IOS_ERROR_FAILALLOC = -22,
|
||||
IOS_ERROR_INVALIDSIZE = -23,
|
||||
IOS_ERROR_NOLINK = -24,
|
||||
IOS_ERROR_ANFAILED = -25,
|
||||
IOS_ERROR_MAXSEMCOUNT = -26,
|
||||
IOS_ERROR_SEMUNAVAILABLE = -27,
|
||||
IOS_ERROR_INVALIDHANDLE = -28,
|
||||
IOS_ERROR_INVALIDARG = -29,
|
||||
IOS_ERROR_NORESOURCE = -30,
|
||||
IOS_ERROR_BUSY = -31,
|
||||
IOS_ERROR_TIMEOUT = -32,
|
||||
IOS_ERROR_ALIGNMENT = -33,
|
||||
IOS_ERROR_BSP = -34,
|
||||
IOS_ERROR_DATAPENDING = -35,
|
||||
IOS_ERROR_EXPIRED = -36,
|
||||
IOS_ERROR_NOREADACCESS = -37,
|
||||
IOS_ERROR_NOWRITEACCESS = -38,
|
||||
IOS_ERROR_NOREADWRITEACCESS = -39,
|
||||
IOS_ERROR_CLIENTTXNLIMIT = -40,
|
||||
IOS_ERROR_STALEHANDLE = -41,
|
||||
IOS_ERROR_UNKNOWNVALUE = -42,
|
||||
} IOSError;
|
||||
|
||||
struct IOSVec
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <wut.h>
|
||||
#include "mutex.h"
|
||||
#include "ios.h"
|
||||
#include "mutex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -17,21 +17,22 @@ typedef struct IPCBufPool IPCBufPool;
|
||||
*
|
||||
* Functions similar to a ring buffer.
|
||||
*/
|
||||
struct IPCBufPoolFIFO {
|
||||
//! The current message index to push to.
|
||||
int32_t pushIndex;
|
||||
struct IPCBufPoolFIFO
|
||||
{
|
||||
//! The current message index to push to.
|
||||
int32_t pushIndex;
|
||||
|
||||
//! The current message index to pop from.
|
||||
int32_t popIndex;
|
||||
//! The current message index to pop from.
|
||||
int32_t popIndex;
|
||||
|
||||
//! The number of messages in the queue.
|
||||
int32_t count;
|
||||
//! The number of messages in the queue.
|
||||
int32_t count;
|
||||
|
||||
//! Tracks the total number of messages in the count.
|
||||
int32_t maxCount;
|
||||
//! Tracks the total number of messages in the count.
|
||||
int32_t maxCount;
|
||||
|
||||
//! Messages in the queue.
|
||||
void **messages;
|
||||
//! Messages in the queue.
|
||||
void **messages;
|
||||
};
|
||||
WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x00, pushIndex);
|
||||
WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x04, popIndex);
|
||||
@@ -43,15 +44,16 @@ WUT_CHECK_SIZE(IPCBufPoolFIFO, 0x14);
|
||||
/**
|
||||
* Attributes returned by IPCBufPoolGetAttributes.
|
||||
*/
|
||||
struct IPCBufPoolAttributes {
|
||||
//! Size of a message in the buffer pool.
|
||||
uint32_t messageSize;
|
||||
struct IPCBufPoolAttributes
|
||||
{
|
||||
//! Size of a message in the buffer pool.
|
||||
uint32_t messageSize;
|
||||
|
||||
//! Size of the buffer pool.
|
||||
uint32_t poolSize;
|
||||
//! Size of the buffer pool.
|
||||
uint32_t poolSize;
|
||||
|
||||
//! Number of pending messages in the pool fifo.
|
||||
uint32_t numMessages;
|
||||
//! Number of pending messages in the pool fifo.
|
||||
uint32_t numMessages;
|
||||
};
|
||||
WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x00, messageSize);
|
||||
WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x04, poolSize);
|
||||
@@ -63,41 +65,42 @@ WUT_CHECK_SIZE(IPCBufPoolAttributes, 0x0C);
|
||||
/**
|
||||
* A simple message buffer pool used for IPC communication.
|
||||
*/
|
||||
struct IPCBufPool {
|
||||
//! Magic header always set to IPCBufPool::MagicHeader.
|
||||
uint32_t magic;
|
||||
struct IPCBufPool
|
||||
{
|
||||
//! Magic header always set to IPCBufPool::MagicHeader.
|
||||
uint32_t magic;
|
||||
|
||||
//! Pointer to buffer used for this IPCBufPool.
|
||||
void *buffer;
|
||||
//! Pointer to buffer used for this IPCBufPool.
|
||||
void *buffer;
|
||||
|
||||
//! Size of buffer.
|
||||
uint32_t size;
|
||||
//! Size of buffer.
|
||||
uint32_t size;
|
||||
|
||||
uint32_t unk0x0C;
|
||||
uint32_t unk0x10;
|
||||
uint32_t unk0x0C;
|
||||
uint32_t unk0x10;
|
||||
|
||||
//! Message size from IPCBufPoolCreate.
|
||||
uint32_t messageSize0x14;
|
||||
//! Message size from IPCBufPoolCreate.
|
||||
uint32_t messageSize0x14;
|
||||
|
||||
//! Message size from IPCBufPoolCreate.
|
||||
uint32_t messageSize0x18;
|
||||
//! Message size from IPCBufPoolCreate.
|
||||
uint32_t messageSize0x18;
|
||||
|
||||
//! Number of messages in the IPCBufPoolFIFO.
|
||||
uint32_t messageCount;
|
||||
//! Number of messages in the IPCBufPoolFIFO.
|
||||
uint32_t messageCount;
|
||||
|
||||
//! Pointer to start of messages.
|
||||
void *messages;
|
||||
//! Pointer to start of messages.
|
||||
void *messages;
|
||||
|
||||
//! Number of bytes used for the message pointers in IPCBufPoolFIFO.
|
||||
uint32_t *messageIndexSize;
|
||||
//! Number of bytes used for the message pointers in IPCBufPoolFIFO.
|
||||
uint32_t *messageIndexSize;
|
||||
|
||||
//! FIFO queue of messages.
|
||||
IPCBufPoolFIFO fifo;
|
||||
//! FIFO queue of messages.
|
||||
IPCBufPoolFIFO fifo;
|
||||
|
||||
//! Mutex used to secure access to fifo.
|
||||
OSMutex mutex;
|
||||
//! Mutex used to secure access to fifo.
|
||||
OSMutex mutex;
|
||||
|
||||
WUT_UNKNOWN_BYTES(0x04);
|
||||
WUT_UNKNOWN_BYTES(0x04);
|
||||
};
|
||||
WUT_CHECK_OFFSET(IPCBufPool, 0x00, magic);
|
||||
WUT_CHECK_OFFSET(IPCBufPool, 0x04, buffer);
|
||||
|
||||
@@ -12,86 +12,90 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum OSICICommand {
|
||||
OS_ICI_COMMAND_INVALID_IC_RANGE = 1,
|
||||
OS_ICI_COMMAND_RESCHEDULE_CORE = 2,
|
||||
OS_ICI_COMMAND_HALT_CORE = 3,
|
||||
OS_ICI_COMMAND_PROC_EXIT = 4,
|
||||
OS_ICI_COMMAND_SET_DABR = 5,
|
||||
OS_ICI_COMMAND_PROC_SCHED = 6,
|
||||
OS_ICI_COMMAND_FAST_BG_EXIT = 7,
|
||||
OS_ICI_COMMAND_IOP_SHELL_CORE_TRACE = 8,
|
||||
OS_ICI_COMMAND_SYSTEM_FATAL = 9,
|
||||
OS_ICI_COMMAND_SET_IABR = 10,
|
||||
OS_ICI_COMMAND_PANIC_0X15 = 0xB,
|
||||
OS_ICI_COMMAND_PROC_KILL = 0xC,
|
||||
OS_ICI_COMMAND_PROC_CRASH = 0xD,
|
||||
OS_ICI_COMMAND_UNKNOWN = 0xE, // Waits for rendezvous, then updates heartbeat
|
||||
OS_ICI_COMMAND_OVERLAY_ARENA = 0xF,
|
||||
typedef enum OSICICommand
|
||||
{
|
||||
OS_ICI_COMMAND_INVALID_IC_RANGE = 1,
|
||||
OS_ICI_COMMAND_RESCHEDULE_CORE = 2,
|
||||
OS_ICI_COMMAND_HALT_CORE = 3,
|
||||
OS_ICI_COMMAND_PROC_EXIT = 4,
|
||||
OS_ICI_COMMAND_SET_DABR = 5,
|
||||
OS_ICI_COMMAND_PROC_SCHED = 6,
|
||||
OS_ICI_COMMAND_FAST_BG_EXIT = 7,
|
||||
OS_ICI_COMMAND_IOP_SHELL_CORE_TRACE = 8,
|
||||
OS_ICI_COMMAND_SYSTEM_FATAL = 9,
|
||||
OS_ICI_COMMAND_SET_IABR = 10,
|
||||
OS_ICI_COMMAND_PANIC_0X15 = 0xB,
|
||||
OS_ICI_COMMAND_PROC_KILL = 0xC,
|
||||
OS_ICI_COMMAND_PROC_CRASH = 0xD,
|
||||
OS_ICI_COMMAND_UNKNOWN = 0xE, // Waits for rendezvous, then updates heartbeat
|
||||
OS_ICI_COMMAND_OVERLAY_ARENA = 0xF,
|
||||
} OSICICommand;
|
||||
|
||||
typedef void (*OSExceptionCallbackExFn)(OSExceptionType exceptionType, OSContext * interruptedContext, OSContext *cbContext);
|
||||
typedef void (*OSExceptionCallbackExFn)(OSExceptionType exceptionType, OSContext *interruptedContext, OSContext *cbContext);
|
||||
|
||||
typedef void (*KernelTimerCallbackFn)(OSExceptionType exception, OSContext *interruptedContext, OSContext *currentContext);
|
||||
|
||||
typedef uint32_t KernelTimerHandle;
|
||||
|
||||
typedef struct OSExceptionChainInfo {
|
||||
OSExceptionCallbackExFn callback;
|
||||
void *stack;
|
||||
OSContext *context;
|
||||
typedef struct OSExceptionChainInfo
|
||||
{
|
||||
OSExceptionCallbackExFn callback;
|
||||
void *stack;
|
||||
OSContext *context;
|
||||
} OSExceptionChainInfo;
|
||||
WUT_CHECK_OFFSET(OSExceptionChainInfo, 0, callback);
|
||||
WUT_CHECK_OFFSET(OSExceptionChainInfo, 4, stack);
|
||||
WUT_CHECK_OFFSET(OSExceptionChainInfo, 8, context);
|
||||
WUT_CHECK_SIZE(OSExceptionChainInfo, 12);
|
||||
|
||||
typedef struct KernelInfo0 {
|
||||
struct CoreinitInfo {
|
||||
void *loaderHandle;
|
||||
void *textAddr;
|
||||
uint32_t textOffset;
|
||||
uint32_t textSize;
|
||||
void *dataAddr;
|
||||
uint32_t dataOffset;
|
||||
uint32_t dataSize;
|
||||
void *loadAddr;
|
||||
uint32_t loadOffset;
|
||||
uint32_t loadSize;
|
||||
};
|
||||
typedef struct KernelInfo0
|
||||
{
|
||||
struct CoreinitInfo
|
||||
{
|
||||
void *loaderHandle;
|
||||
void *textAddr;
|
||||
uint32_t textOffset;
|
||||
uint32_t textSize;
|
||||
void *dataAddr;
|
||||
uint32_t dataOffset;
|
||||
uint32_t dataSize;
|
||||
void *loadAddr;
|
||||
uint32_t loadOffset;
|
||||
uint32_t loadSize;
|
||||
};
|
||||
|
||||
int32_t upid;
|
||||
int32_t rampid;
|
||||
uint32_t appFlags;
|
||||
void *dataAreaStart;
|
||||
void *dataAreaEnd;
|
||||
void *physDataAreaStart;
|
||||
void *physDataAreaEnd;
|
||||
void *physAvailStart;
|
||||
void *physAvailEnd;
|
||||
void *physCodeGenStart;
|
||||
void *physCodeGenEnd;
|
||||
void *sdaBase;
|
||||
void *sda2Base;
|
||||
uint32_t systemHeapSize;
|
||||
void *stackEnd0;
|
||||
void *stackEnd1;
|
||||
void *stackEnd2;
|
||||
void *stackBase0;
|
||||
void *stackBase1;
|
||||
void *stackBase2;
|
||||
void *exceptionStackEnd0;
|
||||
void *exceptionStackEnd1;
|
||||
void *exceptionStackEnd2;
|
||||
void *exceptionStackBase0;
|
||||
void *exceptionStackBase1;
|
||||
void *exceptionStackBase2;
|
||||
void *lockedCacheBase0;
|
||||
void *lockedCacheBase1;
|
||||
void *lockedCacheBase2;
|
||||
struct CoreinitInfo coreinit;
|
||||
uint32_t unk0x9C;
|
||||
uint64_t titleId;
|
||||
int32_t upid;
|
||||
int32_t rampid;
|
||||
uint32_t appFlags;
|
||||
void *dataAreaStart;
|
||||
void *dataAreaEnd;
|
||||
void *physDataAreaStart;
|
||||
void *physDataAreaEnd;
|
||||
void *physAvailStart;
|
||||
void *physAvailEnd;
|
||||
void *physCodeGenStart;
|
||||
void *physCodeGenEnd;
|
||||
void *sdaBase;
|
||||
void *sda2Base;
|
||||
uint32_t systemHeapSize;
|
||||
void *stackEnd0;
|
||||
void *stackEnd1;
|
||||
void *stackEnd2;
|
||||
void *stackBase0;
|
||||
void *stackBase1;
|
||||
void *stackBase2;
|
||||
void *exceptionStackEnd0;
|
||||
void *exceptionStackEnd1;
|
||||
void *exceptionStackEnd2;
|
||||
void *exceptionStackBase0;
|
||||
void *exceptionStackBase1;
|
||||
void *exceptionStackBase2;
|
||||
void *lockedCacheBase0;
|
||||
void *lockedCacheBase1;
|
||||
void *lockedCacheBase2;
|
||||
struct CoreinitInfo coreinit;
|
||||
uint32_t unk0x9C;
|
||||
uint64_t titleId;
|
||||
} KernelInfo0;
|
||||
WUT_CHECK_OFFSET(KernelInfo0, 0x00, upid);
|
||||
WUT_CHECK_OFFSET(KernelInfo0, 0x04, rampid);
|
||||
@@ -127,23 +131,43 @@ WUT_CHECK_OFFSET(KernelInfo0, 0x9C, unk0x9C);
|
||||
WUT_CHECK_OFFSET(KernelInfo0, 0xA0, titleId);
|
||||
WUT_CHECK_SIZE(KernelInfo0, 0xA8);
|
||||
|
||||
typedef struct KernelInfo6 {
|
||||
uint64_t osTitleId;
|
||||
uint32_t unk0x08;
|
||||
WUT_PADDING_BYTES(0x108 - 0xC);
|
||||
typedef struct KernelInfo6
|
||||
{
|
||||
uint64_t osTitleId;
|
||||
uint32_t unk0x08;
|
||||
WUT_PADDING_BYTES(0x108 - 0xC);
|
||||
} KernelInfo6;
|
||||
WUT_CHECK_OFFSET(KernelInfo6, 0x00, osTitleId);
|
||||
WUT_CHECK_OFFSET(KernelInfo6, 0x08, unk0x08);
|
||||
WUT_CHECK_SIZE(KernelInfo6, 0x108);
|
||||
|
||||
void __KernelSetUserModeExHandler(OSExceptionType exceptionType, OSExceptionChainInfo *chainInfo, OSExceptionChainInfo *prevChainInfo);
|
||||
void
|
||||
__KernelSetUserModeExHandler(OSExceptionType exceptionType,
|
||||
OSExceptionChainInfo *chainInfo,
|
||||
OSExceptionChainInfo *prevChainInfo);
|
||||
|
||||
KernelTimerHandle __KernelAllocateTimer(KernelTimerCallbackFn, void *exceptionStack, OSContext *context);
|
||||
uint32_t __KernelPrimeTimer(KernelTimerHandle handle, uint64_t startTimeInTicks, uint64_t intervalInTicks, uint32_t unknown);
|
||||
KernelTimerHandle
|
||||
__KernelAllocateTimer(KernelTimerCallbackFn,
|
||||
void *exceptionStack,
|
||||
OSContext *context);
|
||||
|
||||
void __KernelSendICI(OSICICommand cmd, void *arg1, uint32_t unknown1, uint32_t unknown2);
|
||||
uint32_t
|
||||
__KernelPrimeTimer(KernelTimerHandle handle,
|
||||
uint64_t startTimeInTicks,
|
||||
uint64_t intervalInTicks,
|
||||
uint32_t unknown);
|
||||
|
||||
void __KernelGetInfo(uint32_t type, void *outBuffer, uint32_t outBufferSize, uint32_t core);
|
||||
void
|
||||
__KernelSendICI(OSICICommand cmd,
|
||||
void *arg1,
|
||||
uint32_t unknown1,
|
||||
uint32_t unknown2);
|
||||
|
||||
void
|
||||
__KernelGetInfo(uint32_t type,
|
||||
void *outBuffer,
|
||||
uint32_t outBufferSize,
|
||||
uint32_t core);
|
||||
|
||||
static inline void
|
||||
__KernelGetInfo0(KernelInfo0 *outBuffer, uint32_t core)
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
/**
|
||||
* Magic title ID used for triggering a full system reboot.
|
||||
*/
|
||||
#define OS_TITLE_ID_REBOOT 0xFFFFFFFFFFFFFFFEllu
|
||||
#define OS_TITLE_ID_REBOOT 0xFFFFFFFFFFFFFFFEllu
|
||||
|
||||
/**
|
||||
* Forces a OS relaunch on the next title launch.
|
||||
|
||||
@@ -24,74 +24,74 @@ typedef struct MCPTitleListType MCPTitleListType;
|
||||
|
||||
typedef enum MCPAppType
|
||||
{
|
||||
MCP_APP_TYPE_GAME_UPDATE = 0x0800001B,
|
||||
MCP_APP_TYPE_GAME_DLC = 0x0800000E,
|
||||
MCP_APP_TYPE_BOOT1 = 0x10000009,
|
||||
MCP_APP_TYPE_SYSTEM_LIBRARIES = 0x1000000A,
|
||||
MCP_APP_TYPE_BLUETOOTH_FIRMWARE = 0x10000012,
|
||||
MCP_APP_TYPE_DRC_FIRMWARE = 0x10000013,
|
||||
MCP_APP_TYPE_DRH_FIRMWARE = 0x10000014,
|
||||
MCP_APP_TYPE_SYSTEM_VERSION = 0x10000015,
|
||||
MCP_APP_TYPE_DRC_LANGUAGE = 0x1000001A,
|
||||
MCP_APP_TYPE_EXCEPTIONS_DATA = 0x18000010,
|
||||
MCP_APP_TYPE_SHARED_DATA = 0x1800001C,
|
||||
MCP_APP_TYPE_CERT_STORE = 0x1800001E,
|
||||
MCP_APP_TYPE_PATCH_MAP_DATA = 0x18000023,
|
||||
MCP_APP_TYPE_WAGONU_MIGRATION_LIST = 0x18000029,
|
||||
MCP_APP_TYPE_CAFFEINE_TITLE_LIST = 0x18000030,
|
||||
MCP_APP_TYPE_MCP_TITLE_LIST = 0x18000031,
|
||||
MCP_APP_TYPE_GAME = 0x80000000,
|
||||
MCP_APP_TYPE_GAME_WII = 0x8000002E,
|
||||
MCP_APP_TYPE_SYSTEM_MENU = 0x90000001,
|
||||
MCP_APP_TYPE_SYSTEM_UPDATER = 0x9000000B,
|
||||
MCP_APP_TYPE_SYSTEM_APPS = 0x90000020,
|
||||
MCP_APP_TYPE_ACCOUNT_APPS = 0x90000021,
|
||||
MCP_APP_TYPE_SYSTEM_SETTINGS = 0x90000022,
|
||||
MCP_APP_TYPE_ECO_PROCESS = 0x9000002F,
|
||||
MCP_APP_TYPE_EMANUAL = 0xD0000003,
|
||||
MCP_APP_TYPE_HOME_MENU = 0xD0000004,
|
||||
MCP_APP_TYPE_ERROR_DISPLAY = 0xD0000005,
|
||||
MCP_APP_TYPE_BROWSER = 0xD0000006,
|
||||
MCP_APP_TYPE_MIIVERSE_POST = 0xD000000D,
|
||||
MCP_APP_TYPE_MIIVERSE = 0xD0000016,
|
||||
MCP_APP_TYPE_ESHOP = 0xD0000017,
|
||||
MCP_APP_TYPE_FRIEND_LIST = 0xD0000018,
|
||||
MCP_APP_TYPE_DOWNLOAD_MANAGEMENT = 0xD0000019,
|
||||
MCP_APP_TYPE_AOC_OVERLAY = 0xD000002C,
|
||||
MCP_APP_TYPE_AMIIBO_SETTINGS = 0xD0000033,
|
||||
MCP_APP_TYPE_GAME_UPDATE = 0x0800001B,
|
||||
MCP_APP_TYPE_GAME_DLC = 0x0800000E,
|
||||
MCP_APP_TYPE_BOOT1 = 0x10000009,
|
||||
MCP_APP_TYPE_SYSTEM_LIBRARIES = 0x1000000A,
|
||||
MCP_APP_TYPE_BLUETOOTH_FIRMWARE = 0x10000012,
|
||||
MCP_APP_TYPE_DRC_FIRMWARE = 0x10000013,
|
||||
MCP_APP_TYPE_DRH_FIRMWARE = 0x10000014,
|
||||
MCP_APP_TYPE_SYSTEM_VERSION = 0x10000015,
|
||||
MCP_APP_TYPE_DRC_LANGUAGE = 0x1000001A,
|
||||
MCP_APP_TYPE_EXCEPTIONS_DATA = 0x18000010,
|
||||
MCP_APP_TYPE_SHARED_DATA = 0x1800001C,
|
||||
MCP_APP_TYPE_CERT_STORE = 0x1800001E,
|
||||
MCP_APP_TYPE_PATCH_MAP_DATA = 0x18000023,
|
||||
MCP_APP_TYPE_WAGONU_MIGRATION_LIST = 0x18000029,
|
||||
MCP_APP_TYPE_CAFFEINE_TITLE_LIST = 0x18000030,
|
||||
MCP_APP_TYPE_MCP_TITLE_LIST = 0x18000031,
|
||||
MCP_APP_TYPE_GAME = 0x80000000,
|
||||
MCP_APP_TYPE_GAME_WII = 0x8000002E,
|
||||
MCP_APP_TYPE_SYSTEM_MENU = 0x90000001,
|
||||
MCP_APP_TYPE_SYSTEM_UPDATER = 0x9000000B,
|
||||
MCP_APP_TYPE_SYSTEM_APPS = 0x90000020,
|
||||
MCP_APP_TYPE_ACCOUNT_APPS = 0x90000021,
|
||||
MCP_APP_TYPE_SYSTEM_SETTINGS = 0x90000022,
|
||||
MCP_APP_TYPE_ECO_PROCESS = 0x9000002F,
|
||||
MCP_APP_TYPE_EMANUAL = 0xD0000003,
|
||||
MCP_APP_TYPE_HOME_MENU = 0xD0000004,
|
||||
MCP_APP_TYPE_ERROR_DISPLAY = 0xD0000005,
|
||||
MCP_APP_TYPE_BROWSER = 0xD0000006,
|
||||
MCP_APP_TYPE_MIIVERSE_POST = 0xD000000D,
|
||||
MCP_APP_TYPE_MIIVERSE = 0xD0000016,
|
||||
MCP_APP_TYPE_ESHOP = 0xD0000017,
|
||||
MCP_APP_TYPE_FRIEND_LIST = 0xD0000018,
|
||||
MCP_APP_TYPE_DOWNLOAD_MANAGEMENT = 0xD0000019,
|
||||
MCP_APP_TYPE_AOC_OVERLAY = 0xD000002C,
|
||||
MCP_APP_TYPE_AMIIBO_SETTINGS = 0xD0000033,
|
||||
} MCPAppType;
|
||||
|
||||
typedef enum MCPDeviceType
|
||||
{
|
||||
MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
|
||||
MCP_DEVICE_TYPE_ODD = 2,
|
||||
MCP_DEVICE_TYPE_MLC = 3,
|
||||
MCP_DEVICE_TYPE_USB = 4,
|
||||
MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
|
||||
MCP_DEVICE_TYPE_ODD = 2,
|
||||
MCP_DEVICE_TYPE_MLC = 3,
|
||||
MCP_DEVICE_TYPE_USB = 4,
|
||||
/* any value >= 5 is MCP_DEVICE_TYPE_AUTO */
|
||||
} MCPDeviceType;
|
||||
|
||||
typedef enum MCPDeviceFlags
|
||||
{
|
||||
MCP_DEVICE_FLAG_UNK_1 = 0x1,
|
||||
MCP_DEVICE_FLAG_UNK_2 = 0x2,
|
||||
MCP_DEVICE_FLAG_UNK_4 = 0x4,
|
||||
MCP_DEVICE_FLAG_UNK_8 = 0x8,
|
||||
MCP_DEVICE_FLAG_UNK_1 = 0x1,
|
||||
MCP_DEVICE_FLAG_UNK_2 = 0x2,
|
||||
MCP_DEVICE_FLAG_UNK_4 = 0x4,
|
||||
MCP_DEVICE_FLAG_UNK_8 = 0x8,
|
||||
} MCPDeviceFlags;
|
||||
|
||||
typedef enum MCPInstallTarget
|
||||
{
|
||||
MCP_INSTALL_TARGET_MLC = 0,
|
||||
MCP_INSTALL_TARGET_USB = 1,
|
||||
MCP_INSTALL_TARGET_MLC = 0,
|
||||
MCP_INSTALL_TARGET_USB = 1,
|
||||
} MCPInstallTarget;
|
||||
|
||||
typedef enum MCPRegion
|
||||
{
|
||||
MCP_REGION_JAPAN = 0x01,
|
||||
MCP_REGION_USA = 0x02,
|
||||
MCP_REGION_EUROPE = 0x04,
|
||||
MCP_REGION_CHINA = 0x10,
|
||||
MCP_REGION_KOREA = 0x20,
|
||||
MCP_REGION_TAIWAN = 0x40,
|
||||
MCP_REGION_JAPAN = 0x01,
|
||||
MCP_REGION_USA = 0x02,
|
||||
MCP_REGION_EUROPE = 0x04,
|
||||
MCP_REGION_CHINA = 0x10,
|
||||
MCP_REGION_KOREA = 0x20,
|
||||
MCP_REGION_TAIWAN = 0x40,
|
||||
} MCPRegion;
|
||||
|
||||
typedef enum MCPCompatAVFile
|
||||
@@ -382,8 +382,9 @@ MCP_ChangeEcoSettings(int32_t handle,
|
||||
uint32_t maxOnTime,
|
||||
uint16_t defaultOffTime);
|
||||
|
||||
static inline const char*
|
||||
MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType) {
|
||||
static inline const char *
|
||||
MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType)
|
||||
{
|
||||
switch (deviceType) {
|
||||
case MCP_DEVICE_TYPE_AUTO:
|
||||
return "auto";
|
||||
|
||||
@@ -17,17 +17,18 @@ extern "C" {
|
||||
typedef struct MEMAllocatorFunctions MEMAllocatorFunctions;
|
||||
typedef struct MEMAllocator MEMAllocator;
|
||||
|
||||
typedef void * (*MEMAllocatorAllocFn)(MEMAllocator *allocator, uint32_t size);
|
||||
typedef void (*MEMAllocatorFreeFn) (MEMAllocator *allocator, void *ptr);
|
||||
typedef void *(*MEMAllocatorAllocFn)(MEMAllocator *allocator, uint32_t size);
|
||||
typedef void (*MEMAllocatorFreeFn)(MEMAllocator *allocator, void *ptr);
|
||||
|
||||
//! Holds context information that will be used to allocate and free memory.
|
||||
struct MEMAllocator {
|
||||
struct MEMAllocator
|
||||
{
|
||||
//! Points to the alloc/free functions.
|
||||
MEMAllocatorFunctions *funcs;
|
||||
//! The heap handle.
|
||||
MEMHeapHandle heap;
|
||||
MEMHeapHandle heap;
|
||||
//! The alignment the allocator will use.
|
||||
uint32_t align;
|
||||
uint32_t align;
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
};
|
||||
WUT_CHECK_OFFSET(MEMAllocator, 0x0, funcs);
|
||||
@@ -36,9 +37,10 @@ WUT_CHECK_OFFSET(MEMAllocator, 0x8, align);
|
||||
WUT_CHECK_SIZE(MEMAllocator, 0x10);
|
||||
|
||||
//! The alloc/free functions.
|
||||
struct MEMAllocatorFunctions {
|
||||
struct MEMAllocatorFunctions
|
||||
{
|
||||
MEMAllocatorAllocFn alloc;
|
||||
MEMAllocatorFreeFn free;
|
||||
MEMAllocatorFreeFn free;
|
||||
};
|
||||
WUT_CHECK_OFFSET(MEMAllocatorFunctions, 0x0, alloc);
|
||||
WUT_CHECK_OFFSET(MEMAllocatorFunctions, 0x4, free);
|
||||
|
||||
@@ -16,25 +16,24 @@ typedef struct MEMExpHeap MEMExpHeap;
|
||||
typedef struct MEMExpHeapBlock MEMExpHeapBlock;
|
||||
typedef struct MEMExpHeapBlockList MEMExpHeapBlockList;
|
||||
|
||||
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap,
|
||||
void *context);
|
||||
typedef void (*MEMExpHeapBlockVisitor)(void *block, MEMHeapHandle heap, void *context);
|
||||
|
||||
typedef enum MEMExpHeapMode
|
||||
{
|
||||
MEM_EXP_HEAP_MODE_FIRST_FREE = 0,
|
||||
MEM_EXP_HEAP_MODE_NEAREST_SIZE = 1,
|
||||
MEM_EXP_HEAP_MODE_FIRST_FREE = 0,
|
||||
MEM_EXP_HEAP_MODE_NEAREST_SIZE = 1,
|
||||
} MEMExpHeapMode;
|
||||
|
||||
typedef enum MEMExpHeapDirection
|
||||
{
|
||||
MEM_EXP_HEAP_DIR_FROM_TOP = 0,
|
||||
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
|
||||
MEM_EXP_HEAP_DIR_FROM_TOP = 0,
|
||||
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
|
||||
} MEMExpHeapDirection;
|
||||
|
||||
typedef enum MEMExpHeapCheckFlags
|
||||
{
|
||||
MEM_EXP_HEAP_CHECK_FLAGS_NONE = 0,
|
||||
MEM_EXP_HEAP_CHECK_FLAGS_LOG_ERRORS = 1,
|
||||
MEM_EXP_HEAP_CHECK_FLAGS_NONE = 0,
|
||||
MEM_EXP_HEAP_CHECK_FLAGS_LOG_ERRORS = 1,
|
||||
} MEMExpHeapCheckFlags;
|
||||
|
||||
struct MEMExpHeapBlock
|
||||
|
||||
@@ -14,9 +14,9 @@ extern "C" {
|
||||
|
||||
typedef enum MEMFrmHeapFreeMode
|
||||
{
|
||||
MEM_FRM_HEAP_FREE_HEAD = 1 << 0,
|
||||
MEM_FRM_HEAP_FREE_TAIL = 1 << 1,
|
||||
MEM_FRM_HEAP_FREE_ALL = MEM_FRM_HEAP_FREE_HEAD | MEM_FRM_HEAP_FREE_TAIL,
|
||||
MEM_FRM_HEAP_FREE_HEAD = 1 << 0,
|
||||
MEM_FRM_HEAP_FREE_TAIL = 1 << 1,
|
||||
MEM_FRM_HEAP_FREE_ALL = MEM_FRM_HEAP_FREE_HEAD | MEM_FRM_HEAP_FREE_TAIL,
|
||||
} MEMFrmHeapFreeMode;
|
||||
|
||||
typedef struct MEMFrmHeap MEMFrmHeap;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <wut.h>
|
||||
#include "spinlock.h"
|
||||
#include "memlist.h"
|
||||
#include "spinlock.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_memheap Common Memory Heap
|
||||
@@ -20,9 +20,9 @@ typedef MEMHeapHeader *MEMHeapHandle;
|
||||
|
||||
typedef enum MEMBaseHeapType
|
||||
{
|
||||
MEM_BASE_HEAP_MEM1 = 0,
|
||||
MEM_BASE_HEAP_MEM2 = 1,
|
||||
MEM_BASE_HEAP_FG = 8,
|
||||
MEM_BASE_HEAP_MEM1 = 0,
|
||||
MEM_BASE_HEAP_MEM2 = 1,
|
||||
MEM_BASE_HEAP_FG = 8,
|
||||
} MEMBaseHeapType;
|
||||
|
||||
typedef enum MEMHeapFillType
|
||||
@@ -34,18 +34,18 @@ typedef enum MEMHeapFillType
|
||||
|
||||
typedef enum MEMHeapTag
|
||||
{
|
||||
MEM_BLOCK_HEAP_TAG = 0x424C4B48u,
|
||||
MEM_EXPANDED_HEAP_TAG = 0x45585048u,
|
||||
MEM_FRAME_HEAP_TAG = 0x46524D48u,
|
||||
MEM_UNIT_HEAP_TAG = 0x554E5448u,
|
||||
MEM_USER_HEAP_TAG = 0x55535248u,
|
||||
MEM_BLOCK_HEAP_TAG = 0x424C4B48u,
|
||||
MEM_EXPANDED_HEAP_TAG = 0x45585048u,
|
||||
MEM_FRAME_HEAP_TAG = 0x46524D48u,
|
||||
MEM_UNIT_HEAP_TAG = 0x554E5448u,
|
||||
MEM_USER_HEAP_TAG = 0x55535248u,
|
||||
} MEMHeapTag;
|
||||
|
||||
typedef enum MEMHeapFlags
|
||||
{
|
||||
MEM_HEAP_FLAG_ZERO_ALLOCATED = 1 << 0,
|
||||
MEM_HEAP_FLAG_DEBUG_MODE = 1 << 1,
|
||||
MEM_HEAP_FLAG_USE_LOCK = 1 << 2,
|
||||
MEM_HEAP_FLAG_ZERO_ALLOCATED = 1 << 0,
|
||||
MEM_HEAP_FLAG_DEBUG_MODE = 1 << 1,
|
||||
MEM_HEAP_FLAG_USE_LOCK = 1 << 2,
|
||||
} MEMHeapFlags;
|
||||
|
||||
struct MEMHeapHeader
|
||||
|
||||
@@ -20,11 +20,11 @@ typedef enum OSMemoryType
|
||||
|
||||
typedef enum OSSharedDataType
|
||||
{
|
||||
OS_SHAREDDATATYPE_FONT_CHINESE = 0,
|
||||
OS_SHAREDDATATYPE_FONT_KOREAN = 1,
|
||||
OS_SHAREDDATATYPE_FONT_STANDARD = 2,
|
||||
OS_SHAREDDATATYPE_FONT_TAIWANESE = 3,
|
||||
OS_SHAREDDATATYPE_FONT_MAX = 4,
|
||||
OS_SHAREDDATATYPE_FONT_CHINESE = 0,
|
||||
OS_SHAREDDATATYPE_FONT_KOREAN = 1,
|
||||
OS_SHAREDDATATYPE_FONT_STANDARD = 2,
|
||||
OS_SHAREDDATATYPE_FONT_TAIWANESE = 3,
|
||||
OS_SHAREDDATATYPE_FONT_MAX = 4,
|
||||
} OSSharedDataType;
|
||||
|
||||
BOOL
|
||||
|
||||
@@ -14,11 +14,11 @@ extern "C" {
|
||||
|
||||
typedef enum OSMemoryMapMode
|
||||
{
|
||||
OS_MAP_MEMORY_INVALID = 0,
|
||||
OS_MAP_MEMORY_READ_ONLY = 1,
|
||||
OS_MAP_MEMORY_READ_WRITE = 2,
|
||||
OS_MAP_MEMORY_FREE = 3,
|
||||
OS_MAP_MEMORY_ALLOCATED = 4,
|
||||
OS_MAP_MEMORY_INVALID = 0,
|
||||
OS_MAP_MEMORY_READ_ONLY = 1,
|
||||
OS_MAP_MEMORY_READ_WRITE = 2,
|
||||
OS_MAP_MEMORY_FREE = 3,
|
||||
OS_MAP_MEMORY_ALLOCATED = 4,
|
||||
} OSMemoryMapMode;
|
||||
|
||||
#define OS_PAGE_SIZE (128 * 1024)
|
||||
|
||||
@@ -17,24 +17,24 @@ typedef struct OSMessageQueue OSMessageQueue;
|
||||
|
||||
typedef enum OSMessageFlags
|
||||
{
|
||||
OS_MESSAGE_FLAGS_NONE = 0,
|
||||
OS_MESSAGE_FLAGS_BLOCKING = 1 << 0,
|
||||
OS_MESSAGE_FLAGS_HIGH_PRIORITY = 1 << 1,
|
||||
OS_MESSAGE_FLAGS_NONE = 0,
|
||||
OS_MESSAGE_FLAGS_BLOCKING = 1 << 0,
|
||||
OS_MESSAGE_FLAGS_HIGH_PRIORITY = 1 << 1,
|
||||
} OSMessageFlags;
|
||||
|
||||
typedef enum OSFunctionType
|
||||
{
|
||||
OS_FUNCTION_TYPE_HIO_OPEN = 1,
|
||||
OS_FUNCTION_TYPE_HIO_READ_ASYNC = 2,
|
||||
OS_FUNCTION_TYPE_HIO_WRITE_ASYNC = 3,
|
||||
OS_FUNCTION_TYPE_FSA_CMD_ASYNC = 4,
|
||||
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC = 5,
|
||||
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC = 6,
|
||||
OS_FUNCTION_TYPE_FSA_ATTACH_EVENT = 7,
|
||||
OS_FUNCTION_TYPE_FS_CMD_ASYNC = 8,
|
||||
OS_FUNCTION_TYPE_FS_CMD_HANDLER = 9,
|
||||
OS_FUNCTION_TYPE_FS_ATTACH_EVENT = 10,
|
||||
OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT = 11,
|
||||
OS_FUNCTION_TYPE_HIO_OPEN = 1,
|
||||
OS_FUNCTION_TYPE_HIO_READ_ASYNC = 2,
|
||||
OS_FUNCTION_TYPE_HIO_WRITE_ASYNC = 3,
|
||||
OS_FUNCTION_TYPE_FSA_CMD_ASYNC = 4,
|
||||
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC = 5,
|
||||
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC = 6,
|
||||
OS_FUNCTION_TYPE_FSA_ATTACH_EVENT = 7,
|
||||
OS_FUNCTION_TYPE_FS_CMD_ASYNC = 8,
|
||||
OS_FUNCTION_TYPE_FS_CMD_HANDLER = 9,
|
||||
OS_FUNCTION_TYPE_FS_ATTACH_EVENT = 10,
|
||||
OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT = 11,
|
||||
} OSFunctionType;
|
||||
|
||||
struct OSMessage
|
||||
|
||||
@@ -15,13 +15,14 @@ extern "C" {
|
||||
|
||||
|
||||
/// Used to tell OSSetPerformanceMonitor() which arguments are valid.
|
||||
typedef enum OSPerfMonArg {
|
||||
OS_PM_ARG_MMCR0 = 1u << 0u,
|
||||
OS_PM_ARG_MMCR1 = 1u << 1u,
|
||||
OS_PM_ARG_PMC1 = 1u << 2u,
|
||||
OS_PM_ARG_PMC2 = 1u << 3u,
|
||||
OS_PM_ARG_PMC3 = 1u << 4u,
|
||||
OS_PM_ARG_PMC4 = 1u << 5u,
|
||||
typedef enum OSPerfMonArg
|
||||
{
|
||||
OS_PM_ARG_MMCR0 = 1u << 0u,
|
||||
OS_PM_ARG_MMCR1 = 1u << 1u,
|
||||
OS_PM_ARG_PMC1 = 1u << 2u,
|
||||
OS_PM_ARG_PMC2 = 1u << 3u,
|
||||
OS_PM_ARG_PMC3 = 1u << 4u,
|
||||
OS_PM_ARG_PMC4 = 1u << 5u,
|
||||
} OSPerfMonArg;
|
||||
|
||||
/**
|
||||
@@ -29,49 +30,50 @@ typedef enum OSPerfMonArg {
|
||||
*
|
||||
* \sa OSSetPerformanceMonitor
|
||||
*/
|
||||
typedef enum OSPerfMonMMCR0Flags {
|
||||
OS_PM_MMCR0_PMC1_CURRENT = 0b0000000u << 6,
|
||||
OS_PM_MMCR0_PMC1_CPU_CYCLES = 0b0000001u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED = 0b0000010u << 6,
|
||||
OS_PM_MMCR0_PMC1_TBL_RISING_TRANSITIONS = 0b0000011u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_DISPATCHED = 0b0000100u << 6,
|
||||
OS_PM_MMCR0_PMC1_EIEIO_INSTRUCTIONS_COMPLETED = 0b0000101u << 6,
|
||||
OS_PM_MMCR0_PMC1_ITLB_SEARCH_CYCLES = 0b0000110u << 6,
|
||||
OS_PM_MMCR0_PMC1_L2_HITS = 0b0000111u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_EA_DELIVERED = 0b0001000u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED_MATCHES_IABR = 0b0001001u << 6,
|
||||
OS_PM_MMCR0_PMC1_SLOW_L1_MISSES = 0b0001010u << 6,
|
||||
OS_PM_MMCR0_PMC1_UNRESOLVED_BRANCHES = 0b0001011u << 6,
|
||||
OS_PM_MMCR0_PMC1_UNRESOLVED_STALL_CYCLES = 0b0001100u << 6,
|
||||
OS_PM_MMCR0_PMC1_L1_SHARED_STORES = 0b0001110u << 6,
|
||||
OS_PM_MMCR0_PMC1_L2_SHARED_INTERVENTIONS = 0b0001111u << 6,
|
||||
OS_PM_MMCR0_PMC1_CACHE_PARADOXES = 0b0010000u << 6,
|
||||
OS_PM_MMCR0_PMC1_CIU_LOAD_REQUESTS = 0b0010100u << 6,
|
||||
OS_PM_MMCR0_PMC1_BIU_ADDRESS_ONLY_REQUESTS = 0b0010101u << 6,
|
||||
OS_PM_MMCR0_PMC1_CIU_PARADOXES = 0b0010110u << 6,
|
||||
OS_PM_MMCR0_PMC1_60XE_BUS_DATA_BEATS = 0b0010111u << 6,
|
||||
typedef enum OSPerfMonMMCR0Flags
|
||||
{
|
||||
OS_PM_MMCR0_PMC1_CURRENT = 0b0000000u << 6,
|
||||
OS_PM_MMCR0_PMC1_CPU_CYCLES = 0b0000001u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED = 0b0000010u << 6,
|
||||
OS_PM_MMCR0_PMC1_TBL_RISING_TRANSITIONS = 0b0000011u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_DISPATCHED = 0b0000100u << 6,
|
||||
OS_PM_MMCR0_PMC1_EIEIO_INSTRUCTIONS_COMPLETED = 0b0000101u << 6,
|
||||
OS_PM_MMCR0_PMC1_ITLB_SEARCH_CYCLES = 0b0000110u << 6,
|
||||
OS_PM_MMCR0_PMC1_L2_HITS = 0b0000111u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_EA_DELIVERED = 0b0001000u << 6,
|
||||
OS_PM_MMCR0_PMC1_INSTRUCTIONS_COMPLETED_MATCHES_IABR = 0b0001001u << 6,
|
||||
OS_PM_MMCR0_PMC1_SLOW_L1_MISSES = 0b0001010u << 6,
|
||||
OS_PM_MMCR0_PMC1_UNRESOLVED_BRANCHES = 0b0001011u << 6,
|
||||
OS_PM_MMCR0_PMC1_UNRESOLVED_STALL_CYCLES = 0b0001100u << 6,
|
||||
OS_PM_MMCR0_PMC1_L1_SHARED_STORES = 0b0001110u << 6,
|
||||
OS_PM_MMCR0_PMC1_L2_SHARED_INTERVENTIONS = 0b0001111u << 6,
|
||||
OS_PM_MMCR0_PMC1_CACHE_PARADOXES = 0b0010000u << 6,
|
||||
OS_PM_MMCR0_PMC1_CIU_LOAD_REQUESTS = 0b0010100u << 6,
|
||||
OS_PM_MMCR0_PMC1_BIU_ADDRESS_ONLY_REQUESTS = 0b0010101u << 6,
|
||||
OS_PM_MMCR0_PMC1_CIU_PARADOXES = 0b0010110u << 6,
|
||||
OS_PM_MMCR0_PMC1_60XE_BUS_DATA_BEATS = 0b0010111u << 6,
|
||||
|
||||
OS_PM_MMCR0_PMC2_CURRENT = 0b000000u,
|
||||
OS_PM_MMCR0_PMC2_CPU_CYCLES = 0b000001u,
|
||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_COMPLETED = 0b000010u,
|
||||
OS_PM_MMCR0_PMC2_TBL_RISING_TRANSITIONS = 0b000011u,
|
||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_DISPATCHED = 0b000100u,
|
||||
OS_PM_MMCR0_PMC2_L1_ICACHE_MISSES = 0b000101u,
|
||||
OS_PM_MMCR0_PMC2_ITLB_MISSES = 0b000110u,
|
||||
OS_PM_MMCR0_PMC2_L2_INSTRUCTION_MISSES = 0b000111u,
|
||||
OS_PM_MMCR0_PMC2_PRED_BRANCHES_NOT_TAKEN = 0b001000u,
|
||||
OS_PM_MMCR0_PMC2_RESERVED_LOADS = 0b001010u,
|
||||
OS_PM_MMCR0_PMC2_LOADS_AND_STORES = 0b001011u,
|
||||
OS_PM_MMCR0_PMC2_CACHE_SNOOPS = 0b001100u,
|
||||
OS_PM_MMCR0_PMC2_L1_TO_L2_CASTOUTS = 0b001101u,
|
||||
OS_PM_MMCR0_PMC2_SYSTEM_UNIT_INSTRUCTIONS = 0b001110u,
|
||||
OS_PM_MMCR0_PMC2_L1_INSTRUCTION_MISS_CYCLES = 0b001111u,
|
||||
OS_PM_MMCR0_PMC2_FIRST_SPECULATIVE_BRANCH_RESOLVES = 0b010000u,
|
||||
OS_PM_MMCR0_PMC2_L2_SHARED_STORES = 0b010001u,
|
||||
OS_PM_MMCR0_PMC2_L1_SHARED_INTERVENTIONS = 0b010010u,
|
||||
OS_PM_MMCR0_PMC2_CIU_STORE_REQUESTS = 0b010100u,
|
||||
OS_PM_MMCR0_PMC2_SLOW_OUTSTANDING_BIU_TRANSACTIONS = 0b010101u,
|
||||
OS_PM_MMCR0_PMC2_CIU_MODIFIED_INTERVENTIONS = 0b010110u,
|
||||
OS_PM_MMCR0_PMC2_CURRENT = 0b000000u,
|
||||
OS_PM_MMCR0_PMC2_CPU_CYCLES = 0b000001u,
|
||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_COMPLETED = 0b000010u,
|
||||
OS_PM_MMCR0_PMC2_TBL_RISING_TRANSITIONS = 0b000011u,
|
||||
OS_PM_MMCR0_PMC2_INSTRUCTIONS_DISPATCHED = 0b000100u,
|
||||
OS_PM_MMCR0_PMC2_L1_ICACHE_MISSES = 0b000101u,
|
||||
OS_PM_MMCR0_PMC2_ITLB_MISSES = 0b000110u,
|
||||
OS_PM_MMCR0_PMC2_L2_INSTRUCTION_MISSES = 0b000111u,
|
||||
OS_PM_MMCR0_PMC2_PRED_BRANCHES_NOT_TAKEN = 0b001000u,
|
||||
OS_PM_MMCR0_PMC2_RESERVED_LOADS = 0b001010u,
|
||||
OS_PM_MMCR0_PMC2_LOADS_AND_STORES = 0b001011u,
|
||||
OS_PM_MMCR0_PMC2_CACHE_SNOOPS = 0b001100u,
|
||||
OS_PM_MMCR0_PMC2_L1_TO_L2_CASTOUTS = 0b001101u,
|
||||
OS_PM_MMCR0_PMC2_SYSTEM_UNIT_INSTRUCTIONS = 0b001110u,
|
||||
OS_PM_MMCR0_PMC2_L1_INSTRUCTION_MISS_CYCLES = 0b001111u,
|
||||
OS_PM_MMCR0_PMC2_FIRST_SPECULATIVE_BRANCH_RESOLVES = 0b010000u,
|
||||
OS_PM_MMCR0_PMC2_L2_SHARED_STORES = 0b010001u,
|
||||
OS_PM_MMCR0_PMC2_L1_SHARED_INTERVENTIONS = 0b010010u,
|
||||
OS_PM_MMCR0_PMC2_CIU_STORE_REQUESTS = 0b010100u,
|
||||
OS_PM_MMCR0_PMC2_SLOW_OUTSTANDING_BIU_TRANSACTIONS = 0b010101u,
|
||||
OS_PM_MMCR0_PMC2_CIU_MODIFIED_INTERVENTIONS = 0b010110u,
|
||||
} OSPerfMonMMCR0Flags;
|
||||
|
||||
/**
|
||||
@@ -79,48 +81,49 @@ typedef enum OSPerfMonMMCR0Flags {
|
||||
*
|
||||
* \sa OSSetPerformanceMonitor
|
||||
*/
|
||||
typedef enum OSPerfMonMMCR1Flags {
|
||||
OS_PM_MMCR1_PMC3_CURRENT = 0b00000u << 27,
|
||||
OS_PM_MMCR1_PMC3_CPU_CYCLES = 0b00001u << 27,
|
||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_COMPLETED = 0b00010u << 27,
|
||||
OS_PM_MMCR1_PMC3_TBL_RISING_TRANSITIONS = 0b00011u << 27,
|
||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_DISPATCHED = 0b00100u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_DCACHE_MISSES = 0b00101u << 27,
|
||||
OS_PM_MMCR1_PMC3_DTLB_MISSES = 0b00110u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_DATA_MISSES = 0b00111u << 27,
|
||||
OS_PM_MMCR1_PMC3_PRED_BRANCHES_TAKEN = 0b01000u << 27,
|
||||
OS_PM_MMCR1_PMC3_COND_STORES_COMPLETED = 0b01010u << 27,
|
||||
OS_PM_MMCR1_PMC3_FPU_INSTRUCTIONS_COMPLETED = 0b01011u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_CASTOUTS_BY_SNOOPS = 0b01100u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_CACHE_OPERATIONS = 0b01101u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_LOAD_MISS_CYCLES = 0b01111u << 27,
|
||||
OS_PM_MMCR1_PMC3_SECOND_SPECULATIVE_BRANCH_RESOLVES = 0b10000u << 27,
|
||||
OS_PM_MMCR1_PMC3_BPU_STALL_LR_CR_CYCLES = 0b10001u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_MODIFIED_INTERVENTIONS = 0b10010u << 27,
|
||||
OS_PM_MMCR1_PMC3_ICBI_SNOOPS = 0b10011u << 27,
|
||||
OS_PM_MMCR1_PMC3_CIU_ADDRESS_ONLY_REQUESTS = 0b10100u << 27,
|
||||
OS_PM_MMCR1_PMC3_BIU_LOAD_REQUESTS = 0b10101u << 27,
|
||||
OS_PM_MMCR1_PMC3_CIU_SHARED_INTERVENTIONS = 0b10110u << 27,
|
||||
typedef enum OSPerfMonMMCR1Flags
|
||||
{
|
||||
OS_PM_MMCR1_PMC3_CURRENT = 0b00000u << 27,
|
||||
OS_PM_MMCR1_PMC3_CPU_CYCLES = 0b00001u << 27,
|
||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_COMPLETED = 0b00010u << 27,
|
||||
OS_PM_MMCR1_PMC3_TBL_RISING_TRANSITIONS = 0b00011u << 27,
|
||||
OS_PM_MMCR1_PMC3_INSTRUCTIONS_DISPATCHED = 0b00100u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_DCACHE_MISSES = 0b00101u << 27,
|
||||
OS_PM_MMCR1_PMC3_DTLB_MISSES = 0b00110u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_DATA_MISSES = 0b00111u << 27,
|
||||
OS_PM_MMCR1_PMC3_PRED_BRANCHES_TAKEN = 0b01000u << 27,
|
||||
OS_PM_MMCR1_PMC3_COND_STORES_COMPLETED = 0b01010u << 27,
|
||||
OS_PM_MMCR1_PMC3_FPU_INSTRUCTIONS_COMPLETED = 0b01011u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_CASTOUTS_BY_SNOOPS = 0b01100u << 27,
|
||||
OS_PM_MMCR1_PMC3_L2_CACHE_OPERATIONS = 0b01101u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_LOAD_MISS_CYCLES = 0b01111u << 27,
|
||||
OS_PM_MMCR1_PMC3_SECOND_SPECULATIVE_BRANCH_RESOLVES = 0b10000u << 27,
|
||||
OS_PM_MMCR1_PMC3_BPU_STALL_LR_CR_CYCLES = 0b10001u << 27,
|
||||
OS_PM_MMCR1_PMC3_L1_MODIFIED_INTERVENTIONS = 0b10010u << 27,
|
||||
OS_PM_MMCR1_PMC3_ICBI_SNOOPS = 0b10011u << 27,
|
||||
OS_PM_MMCR1_PMC3_CIU_ADDRESS_ONLY_REQUESTS = 0b10100u << 27,
|
||||
OS_PM_MMCR1_PMC3_BIU_LOAD_REQUESTS = 0b10101u << 27,
|
||||
OS_PM_MMCR1_PMC3_CIU_SHARED_INTERVENTIONS = 0b10110u << 27,
|
||||
|
||||
OS_PM_MMCR1_PMC4_CURRENT = 0b00000u << 22,
|
||||
OS_PM_MMCR1_PMC4_CPU_CYCLES = 0b00001u << 22,
|
||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_COMPLETED = 0b00010u << 22,
|
||||
OS_PM_MMCR1_PMC4_TBL_RISING_TRANSITIONS = 0b00011u << 22,
|
||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_DISPATCHED = 0b00100u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_CASTOUTS = 0b00101u << 22,
|
||||
OS_PM_MMCR1_PMC4_DTLB_SEARCH_CYCLES = 0b00110u << 22,
|
||||
OS_PM_MMCR1_PMC4_BRANCHES_MISPREDICTED = 0b01000u << 22,
|
||||
OS_PM_MMCR1_PMC4_INTACT_COND_STORES_COMPLETED = 0b01010u << 22,
|
||||
OS_PM_MMCR1_PMC4_SYNC_INSTRUCTIONS_COMPLETED = 0b01011u << 22,
|
||||
OS_PM_MMCR1_PMC4_SNOOP_RETRIES = 0b01100u << 22,
|
||||
OS_PM_MMCR1_PMC4_INTEGER_OPERATIONS = 0b01101u << 22,
|
||||
OS_PM_MMCR1_PMC4_BPU_STALL_TWO_BRANCHES_CYCLES = 0b01110u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_MODIFIED_INTERVENTIONS = 0b10000u << 22,
|
||||
OS_PM_MMCR1_PMC4_TLBIE_SNOOPS = 0b10001u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_BANK_REFRESH_OVERFLOWS = 0b10010u << 22,
|
||||
OS_PM_MMCR1_PMC4_CIU_ARTRY_COUNT = 0b10100u << 22,
|
||||
OS_PM_MMCR1_PMC4_BIU_STORE_REQUESTS = 0b10101u << 22,
|
||||
OS_PM_MMCR1_PMC4_CIU_TWO_CORE_SHARED_INTERVENTIONS = 0b10110u << 22,
|
||||
OS_PM_MMCR1_PMC4_CURRENT = 0b00000u << 22,
|
||||
OS_PM_MMCR1_PMC4_CPU_CYCLES = 0b00001u << 22,
|
||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_COMPLETED = 0b00010u << 22,
|
||||
OS_PM_MMCR1_PMC4_TBL_RISING_TRANSITIONS = 0b00011u << 22,
|
||||
OS_PM_MMCR1_PMC4_INSTRUCTIONS_DISPATCHED = 0b00100u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_CASTOUTS = 0b00101u << 22,
|
||||
OS_PM_MMCR1_PMC4_DTLB_SEARCH_CYCLES = 0b00110u << 22,
|
||||
OS_PM_MMCR1_PMC4_BRANCHES_MISPREDICTED = 0b01000u << 22,
|
||||
OS_PM_MMCR1_PMC4_INTACT_COND_STORES_COMPLETED = 0b01010u << 22,
|
||||
OS_PM_MMCR1_PMC4_SYNC_INSTRUCTIONS_COMPLETED = 0b01011u << 22,
|
||||
OS_PM_MMCR1_PMC4_SNOOP_RETRIES = 0b01100u << 22,
|
||||
OS_PM_MMCR1_PMC4_INTEGER_OPERATIONS = 0b01101u << 22,
|
||||
OS_PM_MMCR1_PMC4_BPU_STALL_TWO_BRANCHES_CYCLES = 0b01110u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_MODIFIED_INTERVENTIONS = 0b10000u << 22,
|
||||
OS_PM_MMCR1_PMC4_TLBIE_SNOOPS = 0b10001u << 22,
|
||||
OS_PM_MMCR1_PMC4_L2_BANK_REFRESH_OVERFLOWS = 0b10010u << 22,
|
||||
OS_PM_MMCR1_PMC4_CIU_ARTRY_COUNT = 0b10100u << 22,
|
||||
OS_PM_MMCR1_PMC4_BIU_STORE_REQUESTS = 0b10101u << 22,
|
||||
OS_PM_MMCR1_PMC4_CIU_TWO_CORE_SHARED_INTERVENTIONS = 0b10110u << 22,
|
||||
} OSPerfMonMMCR1Flags;
|
||||
|
||||
/**
|
||||
@@ -139,64 +142,61 @@ typedef enum OSPerfMonMMCR1Flags {
|
||||
* \param pmc3 Value to write to register PMC3.
|
||||
* \param pmc4 Value to write to register PMC4.
|
||||
*/
|
||||
void OSSetPerformanceMonitor(uint32_t arg_mask,
|
||||
uint32_t mmcr0,
|
||||
uint32_t mmcr1,
|
||||
uint32_t pmc1,
|
||||
uint32_t pmc2,
|
||||
uint32_t pmc3,
|
||||
uint32_t pmc4);
|
||||
void
|
||||
OSSetPerformanceMonitor(uint32_t arg_mask,
|
||||
uint32_t mmcr0,
|
||||
uint32_t mmcr1,
|
||||
uint32_t pmc1,
|
||||
uint32_t pmc2,
|
||||
uint32_t pmc3,
|
||||
uint32_t pmc4);
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC1.
|
||||
*/
|
||||
static inline
|
||||
uint32_t
|
||||
static inline uint32_t
|
||||
OSGetUPMC1()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc1 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
uint32_t result;
|
||||
asm("mfupmc1 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC2.
|
||||
*/
|
||||
static inline
|
||||
uint32_t
|
||||
static inline uint32_t
|
||||
OSGetUPMC2()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc2 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
uint32_t result;
|
||||
asm("mfupmc2 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC3.
|
||||
*/
|
||||
static inline
|
||||
uint32_t
|
||||
static inline uint32_t
|
||||
OSGetUPMC3()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc3 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
uint32_t result;
|
||||
asm("mfupmc3 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience function to read from UPMC4.
|
||||
*/
|
||||
static inline
|
||||
uint32_t
|
||||
static inline uint32_t
|
||||
OSGetUPMC4()
|
||||
{
|
||||
uint32_t result;
|
||||
asm("mfupmc4 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
uint32_t result;
|
||||
asm("mfupmc4 %[result]"
|
||||
: [result] "=r"(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -13,14 +13,14 @@ extern "C" {
|
||||
|
||||
typedef enum OSSavedFrameType
|
||||
{
|
||||
OS_SAVED_FRAME_A = 0,
|
||||
OS_SAVED_FRAME_B = 1,
|
||||
OS_SAVED_FRAME_A = 0,
|
||||
OS_SAVED_FRAME_B = 1,
|
||||
} OSSavedFrameType;
|
||||
|
||||
typedef enum OSSavedFrameScreen
|
||||
{
|
||||
OS_SAVED_FRAME_SCREEN_TV = 2,
|
||||
OS_SAVED_FRAME_SCREEN_DRC = 4,
|
||||
OS_SAVED_FRAME_SCREEN_TV = 2,
|
||||
OS_SAVED_FRAME_SCREEN_DRC = 4,
|
||||
} OSSavedFrameScreen;
|
||||
|
||||
uint32_t
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void* __OSSchedulerLock;
|
||||
extern void *__OSSchedulerLock;
|
||||
|
||||
void
|
||||
__OSEnableScheduler();
|
||||
@@ -20,17 +20,17 @@ void
|
||||
__OSDisableScheduler();
|
||||
|
||||
void
|
||||
__OSLockScheduler(void* lockId);
|
||||
__OSLockScheduler(void *lockId);
|
||||
|
||||
void
|
||||
__OSUnlockScheduler(void* lockId);
|
||||
__OSUnlockScheduler(void *lockId);
|
||||
|
||||
BOOL
|
||||
OSIsSchedulerLocked(void* lockId);
|
||||
OSIsSchedulerLocked(void *lockId);
|
||||
|
||||
void
|
||||
__OSTryLockScheduler(void* lockId);
|
||||
|
||||
__OSTryLockScheduler(void *lockId);
|
||||
|
||||
void
|
||||
__OSTouchSchedulerLock();
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ extern "C" {
|
||||
typedef enum OSScreenID
|
||||
{
|
||||
//! Represents the TV connected to the system.
|
||||
SCREEN_TV = 0,
|
||||
SCREEN_TV = 0,
|
||||
//! Represents the screen in the DRC (gamepad).
|
||||
SCREEN_DRC = 1,
|
||||
SCREEN_DRC = 1,
|
||||
} OSScreenID;
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,39 +26,39 @@ typedef struct SmdSimpleBufPool SmdSimpleBufPool;
|
||||
|
||||
typedef enum SmdLockType
|
||||
{
|
||||
//! Locking is done with a mutex
|
||||
SMD_LOCK_TYPE_MUTEX = 0,
|
||||
//! Locking is done by disabling interrupts
|
||||
SMD_LOCK_TYPE_DISABLE_INTERRUPTS = 1,
|
||||
//! No locking is done
|
||||
SMD_LOCK_TYPE_NONE = 2,
|
||||
//! Locking is done with a mutex
|
||||
SMD_LOCK_TYPE_MUTEX = 0,
|
||||
//! Locking is done by disabling interrupts
|
||||
SMD_LOCK_TYPE_DISABLE_INTERRUPTS = 1,
|
||||
//! No locking is done
|
||||
SMD_LOCK_TYPE_NONE = 2,
|
||||
} SmdLockType;
|
||||
|
||||
typedef enum SmdPpcState
|
||||
{
|
||||
SMD_PPC_STATE_INVALID = 0,
|
||||
SMD_PPC_STATE_INITIALIZED = 1,
|
||||
SMD_PPC_STATE_CLOSED = 2,
|
||||
SMD_PPC_STATE_OPENED = 3,
|
||||
SMD_PPC_STATE_INVALID = 0,
|
||||
SMD_PPC_STATE_INITIALIZED = 1,
|
||||
SMD_PPC_STATE_CLOSED = 2,
|
||||
SMD_PPC_STATE_OPENED = 3,
|
||||
} SmdPpcState;
|
||||
|
||||
typedef enum SmdInterfaceState
|
||||
{
|
||||
SMD_INTERFACE_STATE_OPENED = 0x2222,
|
||||
SMD_INTERFACE_STATE_CLOSED = 0x3333,
|
||||
SMD_INTERFACE_STATE_OPENED = 0x2222,
|
||||
SMD_INTERFACE_STATE_CLOSED = 0x3333,
|
||||
} SmdInterfaceState;
|
||||
|
||||
typedef enum SmdElementType
|
||||
{
|
||||
SMD_ELEMENT_TYPE_MESSAGE = 0,
|
||||
SMD_ELEMENT_TYPE_VECTOR_SPEC = 1,
|
||||
SMD_ELEMENT_TYPE_VECTOR = 2,
|
||||
SMD_ELEMENT_TYPE_MESSAGE = 0,
|
||||
SMD_ELEMENT_TYPE_VECTOR_SPEC = 1,
|
||||
SMD_ELEMENT_TYPE_VECTOR = 2,
|
||||
} SmdElementType;
|
||||
|
||||
struct SmdVectorSpec
|
||||
{
|
||||
void *ptr;
|
||||
uint32_t size;
|
||||
void *ptr;
|
||||
uint32_t size;
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdVectorSpec, 0x00, ptr);
|
||||
WUT_CHECK_OFFSET(SmdVectorSpec, 0x04, size);
|
||||
@@ -66,9 +66,9 @@ WUT_CHECK_SIZE(SmdVectorSpec, 0x8);
|
||||
|
||||
struct SmdVector
|
||||
{
|
||||
uint32_t command;
|
||||
int32_t count;
|
||||
SmdVectorSpec vecs[4];
|
||||
uint32_t command;
|
||||
int32_t count;
|
||||
SmdVectorSpec vecs[4];
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdVector, 0x00, command);
|
||||
WUT_CHECK_OFFSET(SmdVector, 0x04, count);
|
||||
@@ -77,13 +77,14 @@ WUT_CHECK_SIZE(SmdVector, 0x28);
|
||||
|
||||
struct SmdElement
|
||||
{
|
||||
SmdElementType type;
|
||||
uint32_t size;
|
||||
union {
|
||||
uint8_t data[0xf8];
|
||||
SmdVector spec;
|
||||
uint32_t vectorPaddr;
|
||||
};
|
||||
SmdElementType type;
|
||||
uint32_t size;
|
||||
union
|
||||
{
|
||||
uint8_t data[0xf8];
|
||||
SmdVector spec;
|
||||
uint32_t vectorPaddr;
|
||||
};
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdElement, 0x00, type);
|
||||
WUT_CHECK_OFFSET(SmdElement, 0x04, size);
|
||||
@@ -94,13 +95,14 @@ WUT_CHECK_SIZE(SmdElement, 0x100);
|
||||
|
||||
struct SmdReceiveData
|
||||
{
|
||||
SmdElementType type;
|
||||
uint32_t size;
|
||||
union {
|
||||
uint8_t message[0x80];
|
||||
SmdVector spec;
|
||||
SmdVector *vector;
|
||||
};
|
||||
SmdElementType type;
|
||||
uint32_t size;
|
||||
union
|
||||
{
|
||||
uint8_t message[0x80];
|
||||
SmdVector spec;
|
||||
SmdVector *vector;
|
||||
};
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdReceiveData, 0x00, type);
|
||||
WUT_CHECK_OFFSET(SmdReceiveData, 0x04, size);
|
||||
@@ -111,16 +113,16 @@ WUT_CHECK_SIZE(SmdReceiveData, 0x88);
|
||||
|
||||
struct SmdInterface
|
||||
{
|
||||
SmdInterfaceState state;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
uint32_t elementCount;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
int32_t readOffset;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
int32_t writeOffset;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
uint32_t bufPaddr;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
SmdInterfaceState state;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
uint32_t elementCount;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
int32_t readOffset;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
int32_t writeOffset;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
uint32_t bufPaddr;
|
||||
WUT_PADDING_BYTES(0x7C);
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdInterface, 0x000, state);
|
||||
WUT_CHECK_OFFSET(SmdInterface, 0x080, elementCount);
|
||||
@@ -131,13 +133,13 @@ WUT_CHECK_SIZE(SmdInterface, 0x280);
|
||||
|
||||
struct SmdCtrlTable
|
||||
{
|
||||
char name[0x10];
|
||||
uint32_t reusedCount;
|
||||
WUT_PADDING_BYTES(0x6C);
|
||||
SmdInterface iopInterface;
|
||||
WUT_PADDING_BYTES(0x40);
|
||||
SmdInterface ppcInterface;
|
||||
WUT_PADDING_BYTES(0x40);
|
||||
char name[0x10];
|
||||
uint32_t reusedCount;
|
||||
WUT_PADDING_BYTES(0x6C);
|
||||
SmdInterface iopInterface;
|
||||
WUT_PADDING_BYTES(0x40);
|
||||
SmdInterface ppcInterface;
|
||||
WUT_PADDING_BYTES(0x40);
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdCtrlTable, 0x000, name);
|
||||
WUT_CHECK_OFFSET(SmdCtrlTable, 0x010, reusedCount);
|
||||
@@ -147,12 +149,12 @@ WUT_CHECK_SIZE(SmdCtrlTable, 0x600);
|
||||
|
||||
struct SmdPpcCtrlTableVectors
|
||||
{
|
||||
SmdCtrlTable *ctrlTable;
|
||||
uint32_t ctrlTableSize;
|
||||
SmdElement *writeBuf;
|
||||
uint32_t writeBufSize;
|
||||
SmdElement *readBuf;
|
||||
uint32_t readBufSize;
|
||||
SmdCtrlTable *ctrlTable;
|
||||
uint32_t ctrlTableSize;
|
||||
SmdElement *writeBuf;
|
||||
uint32_t writeBufSize;
|
||||
SmdElement *readBuf;
|
||||
uint32_t readBufSize;
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdPpcCtrlTableVectors, 0x00, ctrlTable);
|
||||
WUT_CHECK_OFFSET(SmdPpcCtrlTableVectors, 0x04, ctrlTableSize);
|
||||
@@ -164,15 +166,15 @@ WUT_CHECK_SIZE(SmdPpcCtrlTableVectors, 0x18);
|
||||
|
||||
struct SmdPpc
|
||||
{
|
||||
SmdPpc *self;
|
||||
SmdCtrlTable *ctrlTable;
|
||||
SmdLockType lockType;
|
||||
OSMutex mutex;
|
||||
uint32_t messageCount;
|
||||
SmdElement *writeBuf;
|
||||
SmdElement *readBuf;
|
||||
SmdPpcState state;
|
||||
WUT_PADDING_BYTES(0x38);
|
||||
SmdPpc *self;
|
||||
SmdCtrlTable *ctrlTable;
|
||||
SmdLockType lockType;
|
||||
OSMutex mutex;
|
||||
uint32_t messageCount;
|
||||
SmdElement *writeBuf;
|
||||
SmdElement *readBuf;
|
||||
SmdPpcState state;
|
||||
WUT_PADDING_BYTES(0x38);
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdPpc, 0x00, self);
|
||||
WUT_CHECK_OFFSET(SmdPpc, 0x04, ctrlTable);
|
||||
@@ -186,19 +188,19 @@ WUT_CHECK_SIZE(SmdPpc, 0x80);
|
||||
|
||||
struct SmdSimpleBufPool
|
||||
{
|
||||
SmdSimpleBufPool *self;
|
||||
OSMutex mutex;
|
||||
void *poolData;
|
||||
uint32_t poolDataSize;
|
||||
SmdLockType lockType;
|
||||
uint32_t allocSize;
|
||||
uint32_t realAllocSize;
|
||||
uint32_t maxAllocCount;
|
||||
void *allocPoolStart;
|
||||
void *allocPoolEnd;
|
||||
uint32_t elementsIn;
|
||||
uint32_t freeErrorCount;
|
||||
WUT_PADDING_BYTES(0x28);
|
||||
SmdSimpleBufPool *self;
|
||||
OSMutex mutex;
|
||||
void *poolData;
|
||||
uint32_t poolDataSize;
|
||||
SmdLockType lockType;
|
||||
uint32_t allocSize;
|
||||
uint32_t realAllocSize;
|
||||
uint32_t maxAllocCount;
|
||||
void *allocPoolStart;
|
||||
void *allocPoolEnd;
|
||||
uint32_t elementsIn;
|
||||
uint32_t freeErrorCount;
|
||||
WUT_PADDING_BYTES(0x28);
|
||||
};
|
||||
WUT_CHECK_OFFSET(SmdSimpleBufPool, 0x00, self);
|
||||
WUT_CHECK_OFFSET(SmdSimpleBufPool, 0x04, mutex);
|
||||
|
||||
@@ -21,19 +21,19 @@ typedef uint32_t (*MPTaskFunc)(uint32_t, uint32_t);
|
||||
|
||||
typedef enum MPTaskState
|
||||
{
|
||||
MP_TASK_STATE_INITIALISED = 1 << 0,
|
||||
MP_TASK_STATE_READY = 1 << 1,
|
||||
MP_TASK_STATE_RUNNING = 1 << 2,
|
||||
MP_TASK_STATE_FINISHED = 1 << 3,
|
||||
MP_TASK_STATE_INITIALISED = 1 << 0,
|
||||
MP_TASK_STATE_READY = 1 << 1,
|
||||
MP_TASK_STATE_RUNNING = 1 << 2,
|
||||
MP_TASK_STATE_FINISHED = 1 << 3,
|
||||
} MPTaskState;
|
||||
|
||||
typedef enum MPTaskQueueState
|
||||
{
|
||||
MP_TASK_QUEUE_STATE_INITIALISED = 1 << 0,
|
||||
MP_TASK_QUEUE_STATE_READY = 1 << 1,
|
||||
MP_TASK_QUEUE_STATE_STOPPING = 1 << 2,
|
||||
MP_TASK_QUEUE_STATE_STOPPED = 1 << 3,
|
||||
MP_TASK_QUEUE_STATE_FINISHED = 1 << 4,
|
||||
MP_TASK_QUEUE_STATE_INITIALISED = 1 << 0,
|
||||
MP_TASK_QUEUE_STATE_READY = 1 << 1,
|
||||
MP_TASK_QUEUE_STATE_STOPPING = 1 << 2,
|
||||
MP_TASK_QUEUE_STATE_STOPPED = 1 << 3,
|
||||
MP_TASK_QUEUE_STATE_FINISHED = 1 << 4,
|
||||
} MPTaskQueueState;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -177,7 +177,7 @@ MPInitTask(MPTask *task,
|
||||
uint32_t userArg2);
|
||||
|
||||
BOOL
|
||||
MPTermTask(MPTask* task);
|
||||
MPTermTask(MPTask *task);
|
||||
|
||||
BOOL
|
||||
MPGetTaskInfo(MPTask *task,
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
#include <time.h>
|
||||
#include "alarm.h"
|
||||
#include "context.h"
|
||||
#include "time.h"
|
||||
#include "threadqueue.h"
|
||||
#include "exception.h"
|
||||
#include "threadqueue.h"
|
||||
#include "time.h"
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_thread Thread
|
||||
@@ -60,73 +60,74 @@ typedef void (*OSThreadDeallocatorFn)(OSThread *thread, void *stack);
|
||||
typedef enum OSThreadSpecificID
|
||||
{
|
||||
//! These can be used by applications
|
||||
OS_THREAD_SPECIFIC_0 = 0,
|
||||
OS_THREAD_SPECIFIC_1 = 1,
|
||||
OS_THREAD_SPECIFIC_2 = 2,
|
||||
OS_THREAD_SPECIFIC_3 = 3,
|
||||
OS_THREAD_SPECIFIC_4 = 4,
|
||||
OS_THREAD_SPECIFIC_5 = 5,
|
||||
OS_THREAD_SPECIFIC_6 = 6,
|
||||
OS_THREAD_SPECIFIC_7 = 7,
|
||||
OS_THREAD_SPECIFIC_8 = 8,
|
||||
OS_THREAD_SPECIFIC_9 = 9,
|
||||
OS_THREAD_SPECIFIC_10 = 10,
|
||||
OS_THREAD_SPECIFIC_11 = 11,
|
||||
OS_THREAD_SPECIFIC_12 = 12,
|
||||
OS_THREAD_SPECIFIC_13 = 13,
|
||||
OS_THREAD_SPECIFIC_0 = 0,
|
||||
OS_THREAD_SPECIFIC_1 = 1,
|
||||
OS_THREAD_SPECIFIC_2 = 2,
|
||||
OS_THREAD_SPECIFIC_3 = 3,
|
||||
OS_THREAD_SPECIFIC_4 = 4,
|
||||
OS_THREAD_SPECIFIC_5 = 5,
|
||||
OS_THREAD_SPECIFIC_6 = 6,
|
||||
OS_THREAD_SPECIFIC_7 = 7,
|
||||
OS_THREAD_SPECIFIC_8 = 8,
|
||||
OS_THREAD_SPECIFIC_9 = 9,
|
||||
OS_THREAD_SPECIFIC_10 = 10,
|
||||
OS_THREAD_SPECIFIC_11 = 11,
|
||||
OS_THREAD_SPECIFIC_12 = 12,
|
||||
OS_THREAD_SPECIFIC_13 = 13,
|
||||
//! These are reserved to wut for internal use
|
||||
OS_THREAD_SPECIFIC_WUT_RESERVED_0 = 14,
|
||||
OS_THREAD_SPECIFIC_WUT_RESERVED_1 = 15,
|
||||
OS_THREAD_SPECIFIC_WUT_RESERVED_0 = 14,
|
||||
OS_THREAD_SPECIFIC_WUT_RESERVED_1 = 15,
|
||||
} OSThreadSpecificID;
|
||||
|
||||
enum OS_THREAD_STATE
|
||||
{
|
||||
OS_THREAD_STATE_NONE = 0,
|
||||
OS_THREAD_STATE_NONE = 0,
|
||||
|
||||
//! Thread is ready to run
|
||||
OS_THREAD_STATE_READY = 1 << 0,
|
||||
OS_THREAD_STATE_READY = 1 << 0,
|
||||
|
||||
//! Thread is running
|
||||
OS_THREAD_STATE_RUNNING = 1 << 1,
|
||||
OS_THREAD_STATE_RUNNING = 1 << 1,
|
||||
|
||||
//! Thread is waiting, i.e. on a mutex
|
||||
OS_THREAD_STATE_WAITING = 1 << 2,
|
||||
OS_THREAD_STATE_WAITING = 1 << 2,
|
||||
|
||||
//! Thread is about to terminate
|
||||
OS_THREAD_STATE_MORIBUND = 1 << 3,
|
||||
OS_THREAD_STATE_MORIBUND = 1 << 3,
|
||||
};
|
||||
|
||||
enum OS_THREAD_REQUEST
|
||||
{
|
||||
OS_THREAD_REQUEST_NONE = 0,
|
||||
OS_THREAD_REQUEST_SUSPEND = 1,
|
||||
OS_THREAD_REQUEST_CANCEL = 2,
|
||||
OS_THREAD_REQUEST_NONE = 0,
|
||||
OS_THREAD_REQUEST_SUSPEND = 1,
|
||||
OS_THREAD_REQUEST_CANCEL = 2,
|
||||
};
|
||||
|
||||
enum OS_THREAD_ATTRIB
|
||||
{
|
||||
//! Allow the thread to run on CPU0.
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU0 = 1 << 0,
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU0 = 1 << 0,
|
||||
|
||||
//! Allow the thread to run on CPU1.
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU1 = 1 << 1,
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU1 = 1 << 1,
|
||||
|
||||
//! Allow the thread to run on CPU2.
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU2 = 1 << 2,
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU2 = 1 << 2,
|
||||
|
||||
//! Allow the thread to run any CPU.
|
||||
OS_THREAD_ATTRIB_AFFINITY_ANY = ((1 << 0) | (1 << 1) | (1 << 2)),
|
||||
OS_THREAD_ATTRIB_AFFINITY_ANY = ((1 << 0) | (1 << 1) | (1 << 2)),
|
||||
|
||||
//! Start the thread detached.
|
||||
OS_THREAD_ATTRIB_DETACHED = 1 << 3,
|
||||
OS_THREAD_ATTRIB_DETACHED = 1 << 3,
|
||||
|
||||
//! Enables tracking of stack usage.
|
||||
OS_THREAD_ATTRIB_STACK_USAGE = 1 << 5,
|
||||
OS_THREAD_ATTRIB_STACK_USAGE = 1 << 5,
|
||||
|
||||
OS_THREAD_ATTRIB_UNKNOWN = 1 << 7
|
||||
OS_THREAD_ATTRIB_UNKNOWN = 1 << 7
|
||||
};
|
||||
|
||||
enum OS_THREAD_TYPE {
|
||||
enum OS_THREAD_TYPE
|
||||
{
|
||||
OS_THREAD_TYPE_DRIVER = 0,
|
||||
OS_THREAD_TYPE_IO = 1,
|
||||
OS_THREAD_TYPE_APP = 2
|
||||
@@ -169,7 +170,7 @@ WUT_CHECK_SIZE(OSFastMutexQueue, 0x08);
|
||||
|
||||
struct OSTLSSection
|
||||
{
|
||||
void* data;
|
||||
void *data;
|
||||
WUT_UNKNOWN_BYTES(4);
|
||||
};
|
||||
WUT_CHECK_OFFSET(OSTLSSection, 0x00, data);
|
||||
@@ -309,10 +310,10 @@ struct WUT_ALIGNAS(8) OSThread
|
||||
WUT_UNKNOWN_BYTES(0x2);
|
||||
|
||||
//! TLS Sections
|
||||
OSTLSSection* tlsSections;
|
||||
OSTLSSection *tlsSections;
|
||||
|
||||
//! The fast mutex we are currently waiting for
|
||||
OSFastMutex* fastMutex;
|
||||
OSFastMutex *fastMutex;
|
||||
|
||||
//! The fast mutexes we are currently contended on
|
||||
OSFastMutexQueue contendedFastMutexes;
|
||||
|
||||
@@ -53,17 +53,17 @@ WUT_CHECK_OFFSET(OSCalendarTime, 0x20, tm_msec);
|
||||
WUT_CHECK_OFFSET(OSCalendarTime, 0x24, tm_usec);
|
||||
WUT_CHECK_SIZE(OSCalendarTime, 0x28);
|
||||
|
||||
#define OSTimerClockSpeed ((OSGetSystemInfo()->busClockSpeed) / 4)
|
||||
#define OSTimerClockSpeed ((OSGetSystemInfo()->busClockSpeed) / 4)
|
||||
|
||||
#define OSSecondsToTicks(val) ((uint64_t)(val) * (uint64_t)OSTimerClockSpeed)
|
||||
#define OSMillisecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000ull)
|
||||
#define OSMicrosecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000000ull)
|
||||
#define OSNanosecondsToTicks(val) (((uint64_t)(val) * ((uint64_t)OSTimerClockSpeed) / 31250ull) / 32000ull)
|
||||
#define OSSecondsToTicks(val) ((uint64_t)(val) * (uint64_t)OSTimerClockSpeed)
|
||||
#define OSMillisecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000ull)
|
||||
#define OSMicrosecondsToTicks(val) (((uint64_t)(val) * (uint64_t)OSTimerClockSpeed) / 1000000ull)
|
||||
#define OSNanosecondsToTicks(val) (((uint64_t)(val) * ((uint64_t)OSTimerClockSpeed) / 31250ull) / 32000ull)
|
||||
|
||||
#define OSTicksToSeconds(val) ((uint64_t)(val) / (uint64_t)OSTimerClockSpeed)
|
||||
#define OSTicksToMilliseconds(val) (((uint64_t)(val) * 1000ull) / (uint64_t)OSTimerClockSpeed)
|
||||
#define OSTicksToMicroseconds(val) (((uint64_t)(val) * 1000000ull) / (uint64_t)OSTimerClockSpeed)
|
||||
#define OSTicksToNanoseconds(val) (((uint64_t)(val) * 32000ull) / ((uint64_t)OSTimerClockSpeed / 31250ull))
|
||||
#define OSTicksToSeconds(val) ((uint64_t)(val) / (uint64_t)OSTimerClockSpeed)
|
||||
#define OSTicksToMilliseconds(val) (((uint64_t)(val) * 1000ull) / (uint64_t)OSTimerClockSpeed)
|
||||
#define OSTicksToMicroseconds(val) (((uint64_t)(val) * 1000000ull) / (uint64_t)OSTimerClockSpeed)
|
||||
#define OSTicksToNanoseconds(val) (((uint64_t)(val) * 32000ull) / ((uint64_t)OSTimerClockSpeed / 31250ull))
|
||||
|
||||
OSTime
|
||||
OSGetTime();
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint64_t OSGetTitleID(void);
|
||||
uint64_t
|
||||
OSGetTitleID(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ extern "C" {
|
||||
int
|
||||
__OSGetSavedAudioFlags();
|
||||
|
||||
int __OSGetTransitionAudioBuffer(void **buffer,
|
||||
uint32_t *size);
|
||||
int
|
||||
__OSGetTransitionAudioBuffer(void **buffer,
|
||||
uint32_t *size);
|
||||
|
||||
void
|
||||
__OSSetTransitionAudioSize(uint32_t size);
|
||||
|
||||
@@ -20,75 +20,75 @@ typedef struct UCAsyncParams UCAsyncParams;
|
||||
|
||||
typedef enum UCCommand
|
||||
{
|
||||
UC_CMD_READ_SYS_CONFIG = 0x30,
|
||||
UC_CMD_WRITE_SYS_CONFIG = 0x31,
|
||||
UC_CMD_DELETE_SYS_CONFIG = 0x32,
|
||||
UC_CMD_QUERY_SYS_CONFIG = 0x33,
|
||||
UC_CMD_LIST_SYS_CONFIG = 0x34,
|
||||
UC_CMD_READ_SYS_CONFIG = 0x30,
|
||||
UC_CMD_WRITE_SYS_CONFIG = 0x31,
|
||||
UC_CMD_DELETE_SYS_CONFIG = 0x32,
|
||||
UC_CMD_QUERY_SYS_CONFIG = 0x33,
|
||||
UC_CMD_LIST_SYS_CONFIG = 0x34,
|
||||
} UCCommand;
|
||||
|
||||
typedef enum UCDataType
|
||||
{
|
||||
UC_DATATYPE_UNDEFINED = 0x00,
|
||||
UC_DATATYPE_UNSIGNED_BYTE = 0x01,
|
||||
UC_DATATYPE_UNSIGNED_SHORT = 0x02,
|
||||
UC_DATATYPE_UNSIGNED_INT = 0x03,
|
||||
UC_DATATYPE_SIGNED_INT = 0x04,
|
||||
UC_DATATYPE_FLOAT = 0x05,
|
||||
UC_DATATYPE_STRING = 0x06,
|
||||
UC_DATATYPE_HEXBINARY = 0x07,
|
||||
UC_DATATYPE_COMPLEX = 0x08,
|
||||
UC_DATATYPE_INVALID = 0xFF,
|
||||
UC_DATATYPE_UNDEFINED = 0x00,
|
||||
UC_DATATYPE_UNSIGNED_BYTE = 0x01,
|
||||
UC_DATATYPE_UNSIGNED_SHORT = 0x02,
|
||||
UC_DATATYPE_UNSIGNED_INT = 0x03,
|
||||
UC_DATATYPE_SIGNED_INT = 0x04,
|
||||
UC_DATATYPE_FLOAT = 0x05,
|
||||
UC_DATATYPE_STRING = 0x06,
|
||||
UC_DATATYPE_HEXBINARY = 0x07,
|
||||
UC_DATATYPE_COMPLEX = 0x08,
|
||||
UC_DATATYPE_INVALID = 0xFF,
|
||||
} UCDataType;
|
||||
|
||||
typedef enum UCErrors
|
||||
{
|
||||
UC_ERROR_OK = 0,
|
||||
UC_ERROR_ERROR = -1,
|
||||
UC_ERROR_OTHER = -0x200001,
|
||||
UC_ERROR_SYSTEM = -0x200002,
|
||||
UC_ERROR_ALLOC = -0x200003,
|
||||
UC_ERROR_OPCODE = -0x200004,
|
||||
UC_ERROR_INVALID_PARAM = -0x200005,
|
||||
UC_ERROR_INVALID_TYPE = -0x200006,
|
||||
UC_ERROR_UNSUPPORTED = -0x200007,
|
||||
UC_ERROR_NON_LEAF_NODE = -0x200008,
|
||||
UC_ERROR_KEY_NOT_FOUND = -0x200009,
|
||||
UC_ERROR_MODIFY = -0x20000A,
|
||||
UC_ERROR_STRING_TOO_LONG = -0x20000B,
|
||||
UC_ERROR_ROOT_KEYS_DIFFER = -0x20000C,
|
||||
UC_ERROR_INVALID_LOCATION = -0x20000D,
|
||||
UC_ERROR_BAD_COMMENT = -0x20000E,
|
||||
UC_ERROR_READ_ACCESS = -0x20000F,
|
||||
UC_ERROR_WRITE_ACCESS = -0x200010,
|
||||
UC_ERROR_CREATE_ACCESS = -0x200011,
|
||||
UC_ERROR_FILE_SYS_NAME = -0x200012,
|
||||
UC_ERROR_FILE_SYS_INIT = -0x200013,
|
||||
UC_ERROR_FILE_SYS_MOUNT = -0x200014,
|
||||
UC_ERROR_FILE_OPEN = -0x200015,
|
||||
UC_ERROR_FILE_STAT = -0x200016,
|
||||
UC_ERROR_FILE_READ = -0x200017,
|
||||
UC_ERROR_FILE_WRITE = -0x200018,
|
||||
UC_ERROR_FILE_TOO_BIG = -0x200019,
|
||||
UC_ERROR_FILE_REMOVE = -0x20001A,
|
||||
UC_ERROR_FILE_RENAME = -0x20001B,
|
||||
UC_ERROR_FILE_CLOSE = -0x20001C,
|
||||
UC_ERROR_FILE_SEEK = -0x20001D,
|
||||
UC_ERROR_FILE_CONFIRM = -0x20001E,
|
||||
UC_ERROR_FILE_BACKUP = -0x20001F,
|
||||
UC_ERROR_MALFORMED_XML = -0x200020,
|
||||
UC_ERROR_VERSION = -0x200021,
|
||||
UC_ERROR_NO_IPC_BUFFERS = -0x200022,
|
||||
UC_ERROR_FILE_LOCK_NEEDED = -0x200024,
|
||||
UC_ERROR_SYS_PROT = -0x200028,
|
||||
UC_ERROR_OK = 0,
|
||||
UC_ERROR_ERROR = -1,
|
||||
UC_ERROR_OTHER = -0x200001,
|
||||
UC_ERROR_SYSTEM = -0x200002,
|
||||
UC_ERROR_ALLOC = -0x200003,
|
||||
UC_ERROR_OPCODE = -0x200004,
|
||||
UC_ERROR_INVALID_PARAM = -0x200005,
|
||||
UC_ERROR_INVALID_TYPE = -0x200006,
|
||||
UC_ERROR_UNSUPPORTED = -0x200007,
|
||||
UC_ERROR_NON_LEAF_NODE = -0x200008,
|
||||
UC_ERROR_KEY_NOT_FOUND = -0x200009,
|
||||
UC_ERROR_MODIFY = -0x20000A,
|
||||
UC_ERROR_STRING_TOO_LONG = -0x20000B,
|
||||
UC_ERROR_ROOT_KEYS_DIFFER = -0x20000C,
|
||||
UC_ERROR_INVALID_LOCATION = -0x20000D,
|
||||
UC_ERROR_BAD_COMMENT = -0x20000E,
|
||||
UC_ERROR_READ_ACCESS = -0x20000F,
|
||||
UC_ERROR_WRITE_ACCESS = -0x200010,
|
||||
UC_ERROR_CREATE_ACCESS = -0x200011,
|
||||
UC_ERROR_FILE_SYS_NAME = -0x200012,
|
||||
UC_ERROR_FILE_SYS_INIT = -0x200013,
|
||||
UC_ERROR_FILE_SYS_MOUNT = -0x200014,
|
||||
UC_ERROR_FILE_OPEN = -0x200015,
|
||||
UC_ERROR_FILE_STAT = -0x200016,
|
||||
UC_ERROR_FILE_READ = -0x200017,
|
||||
UC_ERROR_FILE_WRITE = -0x200018,
|
||||
UC_ERROR_FILE_TOO_BIG = -0x200019,
|
||||
UC_ERROR_FILE_REMOVE = -0x20001A,
|
||||
UC_ERROR_FILE_RENAME = -0x20001B,
|
||||
UC_ERROR_FILE_CLOSE = -0x20001C,
|
||||
UC_ERROR_FILE_SEEK = -0x20001D,
|
||||
UC_ERROR_FILE_CONFIRM = -0x20001E,
|
||||
UC_ERROR_FILE_BACKUP = -0x20001F,
|
||||
UC_ERROR_MALFORMED_XML = -0x200020,
|
||||
UC_ERROR_VERSION = -0x200021,
|
||||
UC_ERROR_NO_IPC_BUFFERS = -0x200022,
|
||||
UC_ERROR_FILE_LOCK_NEEDED = -0x200024,
|
||||
UC_ERROR_SYS_PROT = -0x200028,
|
||||
} UCErrors;
|
||||
|
||||
typedef enum UCFileSys
|
||||
{
|
||||
UC_FILE_SYS_INVALID = 0x00,
|
||||
UC_FILE_SYS_SYS = 0x01,
|
||||
UC_FILE_SYS_SLC = 0x02,
|
||||
UC_FILE_SYS_RAM = 0x03,
|
||||
UC_FILE_SYS_INVALID = 0x00,
|
||||
UC_FILE_SYS_SYS = 0x01,
|
||||
UC_FILE_SYS_SLC = 0x02,
|
||||
UC_FILE_SYS_RAM = 0x03,
|
||||
} UCFileSys;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -118,13 +118,13 @@ typedef void (*UCAsyncCallbackFn)(UCError result,
|
||||
#pragma pack(push, 1)
|
||||
struct UCAsyncParams
|
||||
{
|
||||
UCAsyncCallbackFn callback;
|
||||
void *context;
|
||||
UCCommand command;
|
||||
uint32_t unk0x0C;
|
||||
uint32_t count;
|
||||
UCSysConfig *settings;
|
||||
IOSVec *vecs;
|
||||
UCAsyncCallbackFn callback;
|
||||
void *context;
|
||||
UCCommand command;
|
||||
uint32_t unk0x0C;
|
||||
uint32_t count;
|
||||
UCSysConfig *settings;
|
||||
IOSVec *vecs;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
WUT_CHECK_OFFSET(UCAsyncParams, 0x00, callback);
|
||||
|
||||
Reference in New Issue
Block a user