MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / GetErrorMessage

Function GetErrorMessage

src/include/expected.hpp:139–334  ·  view source on GitHub ↗

获取错误码对应的错误信息

Source from the content-addressed store, hash-verified

137
138/// 获取错误码对应的错误信息
139constexpr auto GetErrorMessage(ErrorCode code) -> const char* {
140 switch (code) {
141 case ErrorCode::kSuccess:
142 return "Success";
143 case ErrorCode::kElfInvalidAddress:
144 return "Invalid ELF address";
145 case ErrorCode::kElfInvalidMagic:
146 return "Invalid ELF magic number";
147 case ErrorCode::kElfUnsupported32Bit:
148 return "32-bit ELF not supported";
149 case ErrorCode::kElfInvalidClass:
150 return "Invalid ELF class";
151 case ErrorCode::kElfSymtabNotFound:
152 return ".symtab section not found";
153 case ErrorCode::kElfStrtabNotFound:
154 return ".strtab section not found";
155 case ErrorCode::kFdtInvalidAddress:
156 return "Invalid FDT address";
157 case ErrorCode::kFdtInvalidHeader:
158 return "Invalid FDT header";
159 case ErrorCode::kFdtNodeNotFound:
160 return "FDT node not found";
161 case ErrorCode::kFdtPropertyNotFound:
162 return "FDT property not found";
163 case ErrorCode::kFdtParseFailed:
164 return "FDT parse failed";
165 case ErrorCode::kFdtInvalidPropertySize:
166 return "Invalid FDT property size";
167 case ErrorCode::kSpinLockRecursiveLock:
168 return "Recursive spinlock detected";
169 case ErrorCode::kSpinLockNotOwned:
170 return "Spinlock not owned by current core";
171 case ErrorCode::kMutexNoTaskContext:
172 return "Mutex operation outside task context";
173 case ErrorCode::kMutexRecursiveLock:
174 return "Recursive mutex lock detected";
175 case ErrorCode::kMutexNotOwned:
176 return "Mutex not owned by current task";
177 case ErrorCode::kMutexNotLocked:
178 return "Mutex not locked";
179 case ErrorCode::kVmAllocationFailed:
180 return "Virtual memory allocation failed";
181 case ErrorCode::kVmMapFailed:
182 return "Virtual memory mapping failed";
183 case ErrorCode::kVmUnmapFailed:
184 return "Virtual memory unmapping failed";
185 case ErrorCode::kVmInvalidPageTable:
186 return "Invalid page table";
187 case ErrorCode::kVmPageNotMapped:
188 return "Page not mapped";
189 case ErrorCode::kIpiTargetOutOfRange:
190 return "IPI target CPU mask out of range";
191 case ErrorCode::kIpiSendFailed:
192 return "IPI send failed";
193 case ErrorCode::kTaskNoCurrentTask:
194 return "No current task";
195 case ErrorCode::kTaskPidAllocationFailed:
196 return "PID allocation failed";

Callers 1

messageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected