wut  1.0.0-beta9
Wii U Toolchain
ios.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef struct IOSVec IOSVec;
15 typedef int32_t IOSHandle;
16 
17 typedef enum IOSOpenMode
18 {
19  IOS_OPEN_READ = 1 << 0,
20  IOS_OPEN_WRITE = 1 << 1,
22 } IOSOpenMode;
23 
24 typedef enum IOSError
25 {
69 } IOSError;
70 
71 struct IOSVec
72 {
74  void *vaddr;
75 
77  uint32_t len;
78 
80  void *paddr;
81 };
82 WUT_CHECK_OFFSET(IOSVec, 0x00, vaddr);
83 WUT_CHECK_OFFSET(IOSVec, 0x04, len);
84 WUT_CHECK_OFFSET(IOSVec, 0x08, paddr);
85 WUT_CHECK_SIZE(IOSVec, 0x0C);
86 
87 typedef void (*IOSAsyncCallbackFn)(IOSError, void *);
88 
90 IOS_Open(const char *device,
91  IOSOpenMode mode);
92 
94 IOS_OpenAsync(const char *device,
95  IOSOpenMode mode,
96  IOSAsyncCallbackFn callback,
97  void *context);
98 
100 IOS_Close(IOSHandle handle);
101 
102 IOSError
104  IOSAsyncCallbackFn callback,
105  void *context);
106 
107 IOSError
108 IOS_Ioctl(IOSHandle handle,
109  uint32_t request,
110  void *inBuf,
111  uint32_t inLen,
112  void *outBuf,
113  uint32_t outLen);
114 
115 IOSError
117  uint32_t request,
118  void *inBuf,
119  uint32_t inLen,
120  void *outBuf,
121  uint32_t outLen,
122  IOSAsyncCallbackFn callback,
123  void *context);
124 
125 IOSError
126 IOS_Ioctlv(IOSHandle handle,
127  uint32_t request,
128  uint32_t vecIn,
129  uint32_t vecOut,
130  IOSVec *vec);
131 
132 IOSError
134  uint32_t request,
135  uint32_t vecIn,
136  uint32_t vecOut,
137  IOSVec *vec,
138  IOSAsyncCallbackFn callback,
139  void *context);
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
IOS_ERROR_INTR
@ IOS_ERROR_INTR
Definition: ios.h:29
IOS_ERROR_QEMPTY
@ IOS_ERROR_QEMPTY
Definition: ios.h:33
IOS_ERROR_NORESOURCE
@ IOS_ERROR_NORESOURCE
Definition: ios.h:56
IOS_OpenAsync
IOSError IOS_OpenAsync(const char *device, IOSOpenMode mode, IOSAsyncCallbackFn callback, void *context)
IOS_ERROR_CLIENTTXNLIMIT
@ IOS_ERROR_CLIENTTXNLIMIT
Definition: ios.h:66
IOS_OPEN_READWRITE
@ IOS_OPEN_READWRITE
Definition: ios.h:21
IOSVec::vaddr
void * vaddr
Virtual address of buffer.
Definition: ios.h:74
IOS_ERROR_ECCCRIT
@ IOS_ERROR_ECCCRIT
Definition: ios.h:38
IOS_Ioctlv
IOSError IOS_Ioctlv(IOSHandle handle, uint32_t request, uint32_t vecIn, uint32_t vecOut, IOSVec *vec)
IOS_ERROR_NOTREADY
@ IOS_ERROR_NOTREADY
Definition: ios.h:36
IOS_ERROR_INVALIDFLAG
@ IOS_ERROR_INVALIDFLAG
Definition: ios.h:42
IOS_ERROR_ALIGNMENT
@ IOS_ERROR_ALIGNMENT
Definition: ios.h:59
IOS_ERROR_INVALIDSIZE
@ IOS_ERROR_INVALIDSIZE
Definition: ios.h:49
IOS_ERROR_FAILINTERNAL
@ IOS_ERROR_FAILINTERNAL
Definition: ios.h:47
IOS_ERROR_STALEHANDLE
@ IOS_ERROR_STALEHANDLE
Definition: ios.h:67
IOS_ERROR_INVALIDHANDLE
@ IOS_ERROR_INVALIDHANDLE
Definition: ios.h:54
IOSError
IOSError
Definition: ios.h:24
IOS_ERROR_ACCESS
@ IOS_ERROR_ACCESS
Definition: ios.h:27
IOS_ERROR_INVALIDARG
@ IOS_ERROR_INVALIDARG
Definition: ios.h:55
IOS_ERROR_FAILCHECKVALUE
@ IOS_ERROR_FAILCHECKVALUE
Definition: ios.h:46
IOS_ERROR_NOREADWRITEACCESS
@ IOS_ERROR_NOREADWRITEACCESS
Definition: ios.h:65
IOS_ERROR_UNKNOWN
@ IOS_ERROR_UNKNOWN
Definition: ios.h:35
IOS_ERROR_MAXSEMCOUNT
@ IOS_ERROR_MAXSEMCOUNT
Definition: ios.h:52
IOS_ERROR_UNKNOWNVALUE
@ IOS_ERROR_UNKNOWNVALUE
Definition: ios.h:68
IOS_ERROR_BADBLOCK
@ IOS_ERROR_BADBLOCK
Definition: ios.h:39
IOS_ERROR_ECC
@ IOS_ERROR_ECC
Definition: ios.h:37
IOS_OPEN_READ
@ IOS_OPEN_READ
Definition: ios.h:19
IOS_ERROR_BSP
@ IOS_ERROR_BSP
Definition: ios.h:60
IOS_ERROR_TIMEOUT
@ IOS_ERROR_TIMEOUT
Definition: ios.h:58
IOS_OPEN_WRITE
@ IOS_OPEN_WRITE
Definition: ios.h:20
IOS_ERROR_INVALIDRNG
@ IOS_ERROR_INVALIDRNG
Definition: ios.h:41
wut.h
IOS_IoctlvAsync
IOSError IOS_IoctlvAsync(IOSHandle handle, uint32_t request, uint32_t vecIn, uint32_t vecOut, IOSVec *vec, IOSAsyncCallbackFn callback, void *context)
IOS_ERROR_NOLINK
@ IOS_ERROR_NOLINK
Definition: ios.h:50
IOS_ERROR_MAX
@ IOS_ERROR_MAX
Definition: ios.h:31
IOS_ERROR_OK
@ IOS_ERROR_OK
Definition: ios.h:26
IOS_ERROR_NOWRITEACCESS
@ IOS_ERROR_NOWRITEACCESS
Definition: ios.h:64
IOS_ERROR_INVALIDFORMAT
@ IOS_ERROR_INVALIDFORMAT
Definition: ios.h:43
IOSVec::paddr
void * paddr
Physical address of buffer.
Definition: ios.h:80
IOS_ERROR_EXPIRED
@ IOS_ERROR_EXPIRED
Definition: ios.h:62
IOS_IoctlAsync
IOSError IOS_IoctlAsync(IOSHandle handle, uint32_t request, void *inBuf, uint32_t inLen, void *outBuf, uint32_t outLen, IOSAsyncCallbackFn callback, void *context)
IOS_CloseAsync
IOSError IOS_CloseAsync(IOSHandle handle, IOSAsyncCallbackFn callback, void *context)
IOS_ERROR_NOEXISTS
@ IOS_ERROR_NOEXISTS
Definition: ios.h:32
IOS_ERROR_DATAPENDING
@ IOS_ERROR_DATAPENDING
Definition: ios.h:61
IOS_ERROR_ANFAILED
@ IOS_ERROR_ANFAILED
Definition: ios.h:51
IOS_ERROR_QFULL
@ IOS_ERROR_QFULL
Definition: ios.h:34
IOS_ERROR_INVALIDSIGNER
@ IOS_ERROR_INVALIDSIGNER
Definition: ios.h:45
IOSAsyncCallbackFn
void(* IOSAsyncCallbackFn)(IOSError, void *)
Definition: ios.h:87
IOS_Open
IOSError IOS_Open(const char *device, IOSOpenMode mode)
IOSOpenMode
IOSOpenMode
Definition: ios.h:17
IOS_ERROR_SEMUNAVAILABLE
@ IOS_ERROR_SEMUNAVAILABLE
Definition: ios.h:53
IOS_ERROR_FAILALLOC
@ IOS_ERROR_FAILALLOC
Definition: ios.h:48
IOS_ERROR_INVALIDOBJTYPE
@ IOS_ERROR_INVALIDOBJTYPE
Definition: ios.h:40
IOS_Close
IOSError IOS_Close(IOSHandle handle)
IOS_Ioctl
IOSError IOS_Ioctl(IOSHandle handle, uint32_t request, void *inBuf, uint32_t inLen, void *outBuf, uint32_t outLen)
IOSHandle
int32_t IOSHandle
Definition: ios.h:15
IOS_ERROR_INVALID
@ IOS_ERROR_INVALID
Definition: ios.h:30
IOS_ERROR_NOREADACCESS
@ IOS_ERROR_NOREADACCESS
Definition: ios.h:63
IOS_ERROR_BUSY
@ IOS_ERROR_BUSY
Definition: ios.h:57
IOS_ERROR_INVALIDVERSION
@ IOS_ERROR_INVALIDVERSION
Definition: ios.h:44
IOS_ERROR_EXISTS
@ IOS_ERROR_EXISTS
Definition: ios.h:28
IOSVec::len
uint32_t len
Length of buffer.
Definition: ios.h:77
IOSVec
Definition: ios.h:71