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:
plutoo 2014-08-21 20:17:41 +02:00
parent 89e29dbe06
commit 9ff9ce5ad4
2 changed files with 30 additions and 0 deletions

View File

@ -2,5 +2,6 @@
#define OS_H
u32 osConvertVirtToPhys(u32 vaddr);
const char* osStrError(u32 error);
#endif

View File

@ -12,3 +12,32 @@ u32 osConvertVirtToPhys(u32 vaddr)
return vaddr - 0x07000000; // VRAM
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.";
}
}