os: Added osStrError().
This will summarize an error-code given by the OS/sysmodules in few words. Useful for debugging.
This commit is contained in:
parent
89e29dbe06
commit
9ff9ce5ad4
@ -2,5 +2,6 @@
|
|||||||
#define OS_H
|
#define OS_H
|
||||||
|
|
||||||
u32 osConvertVirtToPhys(u32 vaddr);
|
u32 osConvertVirtToPhys(u32 vaddr);
|
||||||
|
const char* osStrError(u32 error);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,3 +12,32 @@ u32 osConvertVirtToPhys(u32 vaddr)
|
|||||||
return vaddr - 0x07000000; // VRAM
|
return vaddr - 0x07000000; // VRAM
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* osStrError(u32 error) {
|
||||||
|
switch((error>>26) & 0x3F) {
|
||||||
|
case 0:
|
||||||
|
return "Success.";
|
||||||
|
case 1:
|
||||||
|
return "Nothing happened.";
|
||||||
|
case 2:
|
||||||
|
return "Would block.";
|
||||||
|
case 3:
|
||||||
|
return "Not enough resources.";
|
||||||
|
case 4:
|
||||||
|
return "Not found.";
|
||||||
|
case 5:
|
||||||
|
return "Invalid state.";
|
||||||
|
case 6:
|
||||||
|
return "Unsupported.";
|
||||||
|
case 7:
|
||||||
|
return "Invalid argument.";
|
||||||
|
case 8:
|
||||||
|
return "Wrong argument.";
|
||||||
|
case 9:
|
||||||
|
return "Interrupted.";
|
||||||
|
case 10:
|
||||||
|
return "Internal error.";
|
||||||
|
default:
|
||||||
|
return "Unknown.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user