wut  v1.5.0
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,
23 
24 typedef enum IOSError
25 {
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 
101 
102 IOSError
104  IOSAsyncCallbackFn callback,
105  void *context);
106 
107 IOSError
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
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 
void * paddr
Physical address of buffer.
Definition: ios.h:80
uint32_t len
Length of buffer.
Definition: ios.h:77
void * vaddr
Virtual address of buffer.
Definition: ios.h:74
IOSError IOS_CloseAsync(IOSHandle handle, IOSAsyncCallbackFn callback, void *context)
IOSError
Definition: ios.h:25
IOSError IOS_Open(const char *device, IOSOpenMode mode)
IOSError IOS_IoctlAsync(IOSHandle handle, uint32_t request, void *inBuf, uint32_t inLen, void *outBuf, uint32_t outLen, IOSAsyncCallbackFn callback, void *context)
IOSOpenMode
Definition: ios.h:18
IOSError IOS_Ioctl(IOSHandle handle, uint32_t request, void *inBuf, uint32_t inLen, void *outBuf, uint32_t outLen)
IOSError IOS_Close(IOSHandle handle)
void(* IOSAsyncCallbackFn)(IOSError, void *)
Definition: ios.h:87
IOSError IOS_Ioctlv(IOSHandle handle, uint32_t request, uint32_t vecIn, uint32_t vecOut, IOSVec *vec)
IOSError IOS_IoctlvAsync(IOSHandle handle, uint32_t request, uint32_t vecIn, uint32_t vecOut, IOSVec *vec, IOSAsyncCallbackFn callback, void *context)
IOSError IOS_OpenAsync(const char *device, IOSOpenMode mode, IOSAsyncCallbackFn callback, void *context)
int32_t IOSHandle
Definition: ios.h:15
@ IOS_ERROR_INVALIDVERSION
Definition: ios.h:44
@ IOS_ERROR_MAXSEMCOUNT
Definition: ios.h:52
@ IOS_ERROR_INVALIDARG
Definition: ios.h:55
@ IOS_ERROR_INVALIDFORMAT
Definition: ios.h:43
@ IOS_ERROR_QFULL
Definition: ios.h:34
@ IOS_ERROR_INVALID
Definition: ios.h:30
@ IOS_ERROR_NOTREADY
Definition: ios.h:36
@ IOS_ERROR_INVALIDSIZE
Definition: ios.h:49
@ IOS_ERROR_MAX
Definition: ios.h:31
@ IOS_ERROR_BSP
Definition: ios.h:60
@ IOS_ERROR_TIMEOUT
Definition: ios.h:58
@ IOS_ERROR_NOWRITEACCESS
Definition: ios.h:64
@ IOS_ERROR_NORESOURCE
Definition: ios.h:56
@ IOS_ERROR_INVALIDFLAG
Definition: ios.h:42
@ IOS_ERROR_FAILCHECKVALUE
Definition: ios.h:46
@ IOS_ERROR_ECCCRIT
Definition: ios.h:38
@ IOS_ERROR_ANFAILED
Definition: ios.h:51
@ IOS_ERROR_QEMPTY
Definition: ios.h:33
@ IOS_ERROR_INVALIDSIGNER
Definition: ios.h:45
@ IOS_ERROR_NOREADACCESS
Definition: ios.h:63
@ IOS_ERROR_STALEHANDLE
Definition: ios.h:67
@ IOS_ERROR_UNKNOWN
Definition: ios.h:35
@ IOS_ERROR_ALIGNMENT
Definition: ios.h:59
@ IOS_ERROR_ACCESS
Definition: ios.h:27
@ IOS_ERROR_FAILINTERNAL
Definition: ios.h:47
@ IOS_ERROR_NOREADWRITEACCESS
Definition: ios.h:65
@ IOS_ERROR_EXPIRED
Definition: ios.h:62
@ IOS_ERROR_NOEXISTS
Definition: ios.h:32
@ IOS_ERROR_SEMUNAVAILABLE
Definition: ios.h:53
@ IOS_ERROR_OK
Definition: ios.h:26
@ IOS_ERROR_BUSY
Definition: ios.h:57
@ IOS_ERROR_CLIENTTXNLIMIT
Definition: ios.h:66
@ IOS_ERROR_INVALIDHANDLE
Definition: ios.h:54
@ IOS_ERROR_ECC
Definition: ios.h:37
@ IOS_ERROR_DATAPENDING
Definition: ios.h:61
@ IOS_ERROR_INVALIDRNG
Definition: ios.h:41
@ IOS_ERROR_NOLINK
Definition: ios.h:50
@ IOS_ERROR_BADBLOCK
Definition: ios.h:39
@ IOS_ERROR_INTR
Definition: ios.h:29
@ IOS_ERROR_INVALIDOBJTYPE
Definition: ios.h:40
@ IOS_ERROR_EXISTS
Definition: ios.h:28
@ IOS_ERROR_UNKNOWNVALUE
Definition: ios.h:68
@ IOS_ERROR_FAILALLOC
Definition: ios.h:48
@ IOS_OPEN_WRITE
Definition: ios.h:20
@ IOS_OPEN_READWRITE
Definition: ios.h:21
@ IOS_OPEN_READ
Definition: ios.h:19
Definition: ios.h:72