Files
mango/kernel/status.c

25 lines
706 B
C
Raw Normal View History

2024-11-02 11:31:51 +00:00
#include <mango/status.h>
#include <mango/types.h>
2023-04-09 16:38:31 +01:00
#define ERROR_STRING_CASE(code) \
case code: \
return #code
2023-06-08 20:46:20 +01:00
2023-04-09 16:38:31 +01:00
const char *kern_status_string(kern_status_t status)
{
switch (status) {
2023-06-08 20:46:20 +01:00
ERROR_STRING_CASE(KERN_OK);
ERROR_STRING_CASE(KERN_UNIMPLEMENTED);
ERROR_STRING_CASE(KERN_NAME_EXISTS);
ERROR_STRING_CASE(KERN_INVALID_ARGUMENT);
ERROR_STRING_CASE(KERN_UNSUPPORTED);
ERROR_STRING_CASE(KERN_NO_MEMORY);
ERROR_STRING_CASE(KERN_NO_ENTRY);
ERROR_STRING_CASE(KERN_WOULD_BLOCK);
ERROR_STRING_CASE(KERN_BUSY);
ERROR_STRING_CASE(KERN_NO_DEVICE);
2023-04-09 16:38:31 +01:00
default:
return "UNKNOWN";
}
}