wut  1.0.0-beta8
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 
void(* IOSAsyncCallbackFn)(IOSError, void *)
Definition: ios.h:87
IOSOpenMode
Definition: ios.h:17
IOSError IOS_Open(const char *device, IOSOpenMode mode)
IOSError IOS_Ioctl(IOSHandle handle, uint32_t request, void *inBuf, uint32_t inLen, void *outBuf, uint32_t outLen)
IOSError IOS_Close(IOSHandle handle)
void * vaddr
Virtual address of buffer.
Definition: ios.h:74
int32_t IOSHandle
Definition: ios.h:15
IOSError IOS_OpenAsync(const char *device, IOSOpenMode mode, IOSAsyncCallbackFn callback, void *context)
IOSError
Definition: ios.h:24
IOSError IOS_Ioctlv(IOSHandle handle, uint32_t request, uint32_t vecIn, uint32_t vecOut, IOSVec *vec)
uint32_t len
Length of buffer.
Definition: ios.h:77
void * paddr
Physical address of buffer.
Definition: ios.h:80
IOSError IOS_IoctlvAsync(IOSHandle handle, uint32_t request, uint32_t vecIn, uint32_t vecOut, IOSVec *vec, IOSAsyncCallbackFn callback, void *context)
Definition: ios.h:71
IOSError IOS_IoctlAsync(IOSHandle handle, uint32_t request, void *inBuf, uint32_t inLen, void *outBuf, uint32_t outLen, IOSAsyncCallbackFn callback, void *context)
IOSError IOS_CloseAsync(IOSHandle handle, IOSAsyncCallbackFn callback, void *context)