libtransistor
A userland library for the Nintendo Switch
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
include
libtransistor
err.h
Go to the documentation of this file.
1
6
#pragma once
7
8
#ifdef __cplusplus
9
extern
"C"
{
10
#endif
11
12
#include<
libtransistor/types.h
>
13
#include<libtransistor/err/modules.h>
14
15
typedef
struct
{
16
result_t
code;
17
const
char
*module;
18
const
char
*group;
19
const
char
*description;
20
int
closest_errno;
21
}
trn_result_description_t
;
22
26
void
trn_lookup_result
(
result_t
code,
trn_result_description_t
*out);
27
28
#define MAKE_RESULT(module, code) (((code) << 9) | (module))
29
30
#define LIBTRANSISTOR_RESULT(code) MAKE_RESULT(MODULE_LIBTRANSISTOR, code)
31
32
// Misc
33
#define LIBTRANSISTOR_ERR_UNSPECIFIED LIBTRANSISTOR_RESULT(1)
34
#define LIBTRANSISTOR_ERR_UNIMPLEMENTED LIBTRANSISTOR_RESULT(2)
35
#define LIBTRANSISTOR_ERR_OUT_OF_MEMORY LIBTRANSISTOR_RESULT(3)
36
#define LIBTRANSISTOR_ERR_ASSERTION_FAILED LIBTRANSISTOR_RESULT(4)
37
#define LIBTRANSISTOR_ERR_LEGACY_CONTEXT LIBTRANSISTOR_RESULT(5)
38
#define LIBTRANSISTOR_ERR_MODULE_NOT_INITIALIZED LIBTRANSISTOR_RESULT(6)
39
#define LIBTRANSISTOR_ERR_INVALID_ARGUMENT LIBTRANSISTOR_RESULT(7)
40
41
// IPC
42
#define LIBTRANSISTOR_ERR_UNSUPPORTED_BUFFER_TYPE LIBTRANSISTOR_RESULT(1001)
43
#define LIBTRANSISTOR_ERR_TOO_MANY_BUFFERS LIBTRANSISTOR_RESULT(1002)
44
#define LIBTRANSISTOR_ERR_INVALID_REQUEST_TYPE LIBTRANSISTOR_RESULT(1003)
45
#define LIBTRANSISTOR_ERR_TOO_MANY_HANDLES LIBTRANSISTOR_RESULT(1004)
46
#define LIBTRANSISTOR_ERR_INVALID_BUFFER_ADDRESS LIBTRANSISTOR_RESULT(1005)
47
#define LIBTRANSISTOR_ERR_INVALID_BUFFER_SIZE LIBTRANSISTOR_RESULT(1006)
48
#define LIBTRANSISTOR_ERR_INVALID_PROTECTION LIBTRANSISTOR_RESULT(1007)
49
#define LIBTRANSISTOR_ERR_INVALID_IPC_RESPONSE_TYPE LIBTRANSISTOR_RESULT(1008)
50
#define LIBTRANSISTOR_ERR_INVALID_IPC_RESPONSE_MAGIC LIBTRANSISTOR_RESULT(1009)
51
#define LIBTRANSISTOR_ERR_INVALID_RAW_DATA_SIZE LIBTRANSISTOR_RESULT(1010)
52
#define LIBTRANSISTOR_ERR_UNEXPECTED_RAW_DATA_SIZE LIBTRANSISTOR_RESULT(1011)
53
#define LIBTRANSISTOR_ERR_UNEXPECTED_PID LIBTRANSISTOR_RESULT(1012)
54
#define LIBTRANSISTOR_ERR_UNEXPECTED_COPY_HANDLES LIBTRANSISTOR_RESULT(1013)
55
#define LIBTRANSISTOR_ERR_UNEXPECTED_MOVE_HANDLES LIBTRANSISTOR_RESULT(1014)
56
#define LIBTRANSISTOR_ERR_ALREADY_A_DOMAIN LIBTRANSISTOR_RESULT(1015)
57
#define LIBTRANSISTOR_ERR_CANT_SEND_OBJECT_ACROSS_DOMAINS LIBTRANSISTOR_RESULT(1016)
58
#define LIBTRANSISTOR_ERR_CANT_SEND_DOMAIN_OBJECT_TO_SESSION LIBTRANSISTOR_RESULT(1017)
59
#define LIBTRANSISTOR_ERR_TOO_MANY_OBJECTS LIBTRANSISTOR_RESULT(1018)
60
#define LIBTRANSISTOR_ERR_UNEXPECTED_DOMAIN_HEADER_COMMAND LIBTRANSISTOR_RESULT(1018)
61
#define LIBTRANSISTOR_ERR_UNEXPECTED_OBJECTS LIBTRANSISTOR_RESULT(1019)
62
#define LIBTRANSISTOR_ERR_CANT_CLOSE_SESSIONS_LIKE_DOMAIN_OBJECTS LIBTRANSISTOR_RESULT(1020)
63
#define LIBTRANSISTOR_ERR_MALFORMED_CLOSE_REQUEST LIBTRANSISTOR_RESULT(1021)
64
#define LIBTRANSISTOR_ERR_INVALID_IPC_REQUEST_MAGIC LIBTRANSISTOR_RESULT(1022)
65
#define LIBTRANSISTOR_ERR_CANT_SEND_SESSION_OBJECT_FROM_DOMAIN LIBTRANSISTOR_RESULT(1023)
66
#define LIBTRANSISTOR_ERR_CANT_SEND_DOMAIN_OBJECT_FROM_SESSION LIBTRANSISTOR_RESULT(1024)
67
#define LIBTRANSISTOR_ERR_UNEXPECTED_BUFFER_PROTECTION LIBTRANSISTOR_RESULT(1025)
68
#define LIBTRANSISTOR_ERR_REFUSAL_TO_CONVERT_BORROWED_OBJECT LIBTRANSISTOR_RESULT(1026)
69
#define LIBTRANSISTOR_ERR_EXPECTED_SESSION_CLOSURE LIBTRANSISTOR_RESULT(1027)
70
71
// SM
72
#define LIBTRANSISTOR_ERR_SM_NOT_INITIALIZED LIBTRANSISTOR_RESULT(2001)
73
#define LIBTRANSISTOR_ERR_SM_SERVICE_NAME_TOO_LONG LIBTRANSISTOR_RESULT(2002)
74
75
// BSD
76
#define LIBTRANSISTOR_ERR_BSD_ERRNO_SET LIBTRANSISTOR_RESULT(3001)
77
#define LIBTRANSISTOR_ERR_BSD_BUFFER_TOO_SMALL LIBTRANSISTOR_RESULT(3002)
78
#define LIBTRANSISTOR_ERR_BSD_INVALID_MAGIC LIBTRANSISTOR_RESULT(3003)
79
#define LIBTRANSISTOR_ERR_BSD_UNRECOGNIZED_SOCKET_SERVICE LIBTRANSISTOR_RESULT(3004)
80
81
// NV
82
#define LIBTRANSISTOR_ERR_NV_INITIALIZE_FAILED LIBTRANSISTOR_RESULT(4001)
83
#define LIBTRANSISTOR_ERR_NV_OPEN_FAILED LIBTRANSISTOR_RESULT(4002)
84
85
// Parcel & Display
86
#define LIBTRANSISTOR_ERR_PARCEL_INVALID_BINDER_TYPE LIBTRANSISTOR_RESULT(5001)
87
#define LIBTRANSISTOR_ERR_PARCEL_DATA_TOO_BIG LIBTRANSISTOR_RESULT(5002)
88
#define LIBTRANSISTOR_ERR_PARCEL_DATA_UNDERRUN LIBTRANSISTOR_RESULT(5003)
89
#define LIBTRANSISTOR_ERR_DISPLAY_FENCE_TOO_MANY_FDS LIBTRANSISTOR_RESULT(5004)
90
#define LIBTRANSISTOR_ERR_DISPLAY_GRAPHIC_BUFFER_LENGTH_MISMATCH LIBTRANSISTOR_RESULT(5005)
91
#define LIBTRANSISTOR_ERR_SURFACE_CONNECT_FAILED LIBTRANSISTOR_RESULT(5006)
92
#define LIBTRANSISTOR_ERR_SURFACE_DEQUEUE_BUFFER_FAILED LIBTRANSISTOR_RESULT(5007)
93
#define LIBTRANSISTOR_ERR_SURFACE_QUEUE_BUFFER_FAILED LIBTRANSISTOR_RESULT(5008)
94
#define LIBTRANSISTOR_ERR_SURFACE_INVALID_STATE LIBTRANSISTOR_RESULT(5009)
95
#define LIBTRANSISTOR_ERR_DISPLAY_INVALID_FENCE LIBTRANSISTOR_RESULT(5010)
96
97
// GPU
98
#define LIBTRANSISTOR_ERR_GPU_BUFFER_UNALIGNED LIBTRANSISTOR_RESULT(6001)
99
100
// HID
101
#define LIBTRANSISTOR_ERR_HID_BAD_STRUCTURE LIBTRANSISTOR_RESULT(7001)
102
103
// FS
104
#define LIBTRANSISTOR_ERR_FS_INTERNAL_ERROR LIBTRANSISTOR_RESULT(8001)
105
#define LIBTRANSISTOR_ERR_FS_OUT_OF_DIR_ENTRIES LIBTRANSISTOR_RESULT(8002)
106
#define LIBTRANSISTOR_ERR_FS_NAME_TOO_LONG LIBTRANSISTOR_RESULT(8003)
107
#define LIBTRANSISTOR_ERR_FS_NOT_A_DIRECTORY LIBTRANSISTOR_RESULT(8004)
108
#define LIBTRANSISTOR_ERR_FS_NOT_A_FILE LIBTRANSISTOR_RESULT(8005)
109
#define LIBTRANSISTOR_ERR_FS_NOT_FOUND LIBTRANSISTOR_RESULT(8006)
110
#define LIBTRANSISTOR_ERR_FS_INVALID_PATH LIBTRANSISTOR_RESULT(8007)
111
#define LIBTRANSISTOR_ERR_FS_PATH_TOO_DEEP LIBTRANSISTOR_RESULT(8008)
112
#define LIBTRANSISTOR_ERR_FS_PATH_EXISTS LIBTRANSISTOR_RESULT(8009)
113
#define LIBTRANSISTOR_ERR_FS_READ_ONLY LIBTRANSISTOR_RESULT(8010)
114
#define LIBTRANSISTOR_ERR_FS_ACCESS_DENIED LIBTRANSISTOR_RESULT(8011)
115
#define LIBTRANSISTOR_ERR_FS_IO_ERROR LIBTRANSISTOR_RESULT(8012)
116
117
// AM
118
#define LIBTRANSISTOR_ERR_AM_WORKAROUND_ACTIVE LIBTRANSISTOR_RESULT(9001)
119
120
// IPC Server
121
#define LIBTRANSISTOR_ERR_IPCSERVER_INVALID_SESSION_STATE LIBTRANSISTOR_RESULT(10001)
122
#define LIBTRANSISTOR_ERR_IPCSERVER_TOO_MANY_SESSIONS LIBTRANSISTOR_RESULT(10002)
123
#define LIBTRANSISTOR_ERR_IPCSERVER_NO_SUCH_OBJECT LIBTRANSISTOR_RESULT(10003)
124
#define LIBTRANSISTOR_ERR_IPCSERVER_OBJECT_NOT_ACTIVE LIBTRANSISTOR_RESULT(10004)
125
#define LIBTRANSISTOR_ERR_IPCSERVER_SESSION_OBJECT_WAS_DOMAIN LIBTRANSISTOR_RESULT(10005)
126
#define LIBTRANSISTOR_ERR_IPCSERVER_CANT_SEND_ROOT_OBJECT LIBTRANSISTOR_RESULT(10006)
127
#define LIBTRANSISTOR_ERR_IPCSERVER_NO_SUCH_COMMAND LIBTRANSISTOR_RESULT(10007)
128
#define LIBTRANSISTOR_ERR_IPCSERVER_TOO_MANY_PORTS LIBTRANSISTOR_RESULT(10008)
129
130
// Page Allocator
131
#define LIBTRANSISTOR_ERR_AP_OUT_OF_PAGES LIBTRANSISTOR_RESULT(11001)
132
#define LIBTRANSISTOR_ERR_AP_DUPLICATE_BLOCK LIBTRANSISTOR_RESULT(11002)
133
#define LIBTRANSISTOR_ERR_AP_INSERT_FAILED LIBTRANSISTOR_RESULT(11003)
134
135
// Transistor Linker
136
#define LIBTRANSISTOR_ERR_TRNLD_INVALID_MODULE_HEADER LIBTRANSISTOR_RESULT(12001)
137
#define LIBTRANSISTOR_ERR_TRNLD_DUPLICATE_DT_ENTRY LIBTRANSISTOR_RESULT(12002)
138
#define LIBTRANSISTOR_ERR_TRNLD_MISSING_DT_ENTRY LIBTRANSISTOR_RESULT(12003)
139
#define LIBTRANSISTOR_ERR_TRNLD_INVALID_RELOC_ENT LIBTRANSISTOR_RESULT(12004)
140
#define LIBTRANSISTOR_ERR_TRNLD_INVALID_RELOC_TABLE_SIZE LIBTRANSISTOR_RESULT(12005)
141
#define LIBTRANSISTOR_ERR_TRNLD_RELA_SYMBOL_UNSUPPORTED LIBTRANSISTOR_RESULT(12006)
142
#define LIBTRANSISTOR_ERR_TRNLD_UNRECOGNIZED_RELOC_TYPE LIBTRANSISTOR_RESULT(12007)
143
#define LIBTRANSISTOR_ERR_TRNLD_FAILED_TO_READ_MODULE LIBTRANSISTOR_RESULT(12008)
144
#define LIBTRANSISTOR_ERR_TRNLD_FAILED_TO_FIND_MODULE LIBTRANSISTOR_RESULT(12009)
145
#define LIBTRANSISTOR_ERR_TRNLD_NOT_EXECUTABLE LIBTRANSISTOR_RESULT(12010)
146
#define LIBTRANSISTOR_ERR_TRNLD_INVALID_RELOC_TABLE_TYPE LIBTRANSISTOR_RESULT(12011)
147
#define LIBTRANSISTOR_ERR_TRNLD_INVALID_SYM_ENT LIBTRANSISTOR_RESULT(12012)
148
#define LIBTRANSISTOR_ERR_TRNLD_NEEDS_STRTAB LIBTRANSISTOR_RESULT(12013)
149
#define LIBTRANSISTOR_ERR_TRNLD_NEEDS_SYMTAB LIBTRANSISTOR_RESULT(12014)
150
#define LIBTRANSISTOR_ERR_TRNLD_COULD_NOT_RESOLVE_SYMBOL LIBTRANSISTOR_RESULT(12015)
151
#define LIBTRANSISTOR_ERR_TRNLD_INVALID_MODULE_TYPE LIBTRANSISTOR_RESULT(12016)
152
#define LIBTRANSISTOR_ERR_TRNLD_INVALID_MODULE_STATE LIBTRANSISTOR_RESULT(12017)
153
#define LIBTRANSISTOR_ERR_TRNLD_NO_LOADER_FOR_MODULE LIBTRANSISTOR_RESULT(12018)
154
#define LIBTRANSISTOR_ERR_TRNLD_MALFORMED_NRO LIBTRANSISTOR_RESULT(12019)
155
#define LIBTRANSISTOR_ERR_TRNLD_NEEDS_PROCESS_HANDLE LIBTRANSISTOR_RESULT(12020)
156
#define LIBTRANSISTOR_ERR_TRNLD_MALFORMED_ELF LIBTRANSISTOR_RESULT(12021)
157
#define LIBTRANSISTOR_ERR_TRNLD_UNSUPPORTED_ELF LIBTRANSISTOR_RESULT(12021)
158
159
// Syscalls
160
#define LIBTRANSISTOR_ERR_NEEDS_SYSCALL(id) LIBTRANSISTOR_RESULT(13000 + id)
161
162
// USB
163
#define LIBTRANSISTOR_ERR_USB_REPORT_NOT_FOUND LIBTRANSISTOR_RESULT(14001)
164
#define LIBTRANSISTOR_ERR_USB_TRANSFER_FAILED LIBTRANSISTOR_RESULT(14002)
165
#define LIBTRANSISTOR_ERR_USB_ALREADY_BOUND_OTHER_COMPLEX LIBTRANSISTOR_RESULT(14003)
166
167
/* +----------------------------------------------------------+
168
| Please don't forget to add new error codes to lib/err.c! |
169
+----------------------------------------------------------+ */
170
171
// Homebrew ABI
172
#define HOMEBREW_ABI_RESULT(code) MAKE_RESULT(MODULE_HOMEBREW_ABI, code)
173
#define HOMEBREW_ABI_UNRECOGNIZED_KEY(key) HOMEBREW_ABI_RESULT(100 + key)
174
#define HOMEBREW_ABI_KEY_NOT_PRESENT(key) HOMEBREW_ABI_RESULT(200 + key)
175
#define HOMEBREW_ABI_KEY_INVALID(key) HOMEBREW_ABI_RESULT(300 + key)
176
177
#ifdef __cplusplus
178
}
179
#endif
trn_lookup_result
void trn_lookup_result(result_t code, trn_result_description_t *out)
Look up a result code.
types.h
Various system types.
result_t
uint32_t result_t
Function result.
Definition:
types.h:51
trn_result_description_t
Definition:
err.h:15
Generated on Thu Oct 3 2019 01:41:37 for libtransistor by
1.8.6