146 return "Invalid ELF address";
148 return "Invalid ELF magic number";
150 return "32-bit ELF not supported";
152 return "Invalid ELF class";
154 return ".symtab section not found";
156 return ".strtab section not found";
158 return "Invalid FDT address";
160 return "Invalid FDT header";
162 return "FDT node not found";
164 return "FDT property not found";
166 return "FDT parse failed";
168 return "Invalid FDT property size";
170 return "Recursive spinlock detected";
172 return "Spinlock not owned by current core";
174 return "Mutex operation outside task context";
176 return "Recursive mutex lock detected";
178 return "Mutex not owned by current task";
180 return "Mutex not locked";
182 return "Virtual memory allocation failed";
184 return "Virtual memory mapping failed";
186 return "Virtual memory unmapping failed";
188 return "Invalid page table";
190 return "Page not mapped";
192 return "IPI target CPU mask out of range";
194 return "IPI send failed";
196 return "APIC initialization failed";
198 return "Invalid IRQ number";
200 return "Invalid APIC parameter";
202 return "AP code copy verification failed";
204 return "Address not aligned to required boundary";
206 return "Address out of valid range";
208 return "IPI delivery timeout";
210 return "No current task";
212 return "PID allocation failed";
214 return "Task allocation failed";
216 return "Invalid clone flags";
218 return "Page table clone failed";
220 return "Kernel stack allocation failed";
222 return "No child process found";
224 return "Invalid PID";
226 return "Device not found";
228 return "Device already open";
230 return "Device not open";
232 return "Device read failed";
234 return "Device write failed";
236 return "Device ioctl failed";
238 return "Device mmap failed";
240 return "Operation not supported by device";
242 return "Device busy";
244 return "Device permission denied";
246 return "Invalid device offset";
248 return "Block access not aligned to block size";
250 return "Block number out of device range";
252 return "Device flush failed";
254 return "Device reported an error";
256 return "I/O operation failed";
258 return "Operation not supported";
260 return "Operation timed out";
263 return "Invalid MMIO magic value";
265 return "Unsupported virtio version";
267 return "Invalid device ID (device does not exist)";
269 return "Transport layer not initialized";
271 return "Feature negotiation failed";
274 return "Queue not available (queue_num_max == 0)";
276 return "Queue already used";
278 return "Requested queue size exceeds maximum";
280 return "No free descriptors available";
282 return "Invalid descriptor index";
284 return "No used buffers to reclaim";
286 return "File not found";
288 return "Filesystem permission denied";
290 return "Not a directory";
292 return "Is a directory";
294 return "File already exists";
296 return "No space left on device";
298 return "Mount failed";
300 return "Unmount failed";
302 return "Invalid path";
304 return "File descriptor table full";
306 return "Invalid file descriptor";
308 return "Filesystem not mounted";
310 return "Read-only filesystem";
312 return "Filesystem corrupted";
314 return "Filesystem already mounted";
316 return "Directory not empty";
318 return "Block device not found";
320 return "Block read failed";
322 return "Block write failed";
324 return "Sector out of range";
326 return "IRQ number out of controller range";
328 return "IRQ not enabled";
330 return "Failed to set IRQ CPU affinity";
332 return "IPI delivery timeout";
334 return "Invalid argument";
336 return "Out of memory";
338 return "Unknown error";
358 [[nodiscard]]
constexpr auto message() const -> const
char* {
@ kTaskPageTableCloneFailed
@ kQueueAlreadyUsed
队列已被使用
@ kTransportNotInitialized
传输层未正确初始化
@ kQueueTooLarge
请求的队列大小超过设备支持的最大值
@ kDevicePermissionDenied
@ kFeatureNegotiationFailed
特性协商失败
@ kNoFreeDescriptors
没有空闲描述符
@ kFdtInvalidPropertySize
@ kInvalidDescriptor
无效的描述符索引
@ kQueueNotAvailable
队列不可用(queue_num_max == 0)
@ kNoUsedBuffers
没有已使用的缓冲区可回收
@ kInvalidMagic
无效的 MMIO 魔数
@ kNotSupported
不支持的操作(通用,非设备特定)
@ kTaskPidAllocationFailed
@ kInvalidDeviceId
无效的设备 ID(设备不存在)
@ kTaskKernelStackAllocationFailed
constexpr auto GetErrorMessage(ErrorCode code) -> const char *
获取错误码对应的错误信息
std::expected< T, Error > Expected
std::expected 别名模板
constexpr Error(ErrorCode c)
Error(const Error &)=default
constexpr auto message() const -> const char *
auto operator=(const Error &) -> Error &=default
auto operator=(Error &&) -> Error &=default