Skip to content

Commit

Permalink
Fix style in monitor/src/util.c
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan-Velickovic <[email protected]>
  • Loading branch information
Ivan-Velickovic committed Dec 22, 2024
1 parent c9af9ee commit 229ebea
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions monitor/src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,27 @@

#include "util.h"

void
putc(uint8_t ch)
void putc(uint8_t ch)
{
#if defined(CONFIG_PRINTING)
seL4_DebugPutChar(ch);
#endif
}

void
puts(const char *s)
void puts(const char *s)
{
while (*s) {
putc(*s);
s++;
}
}

static char
hexchar(unsigned int v)
static char hexchar(unsigned int v)
{
return v < 10 ? '0' + v : ('a' - 10) + v;
}

void
puthex32(uint32_t val)
void puthex32(uint32_t val)
{
char buffer[8 + 3];
buffer[0] = '0';
Expand All @@ -44,8 +40,7 @@ puthex32(uint32_t val)
puts(buffer);
}

void
puthex64(uint64_t val)
void puthex64(uint64_t val)
{
char buffer[16 + 3];
buffer[0] = '0';
Expand All @@ -58,30 +53,39 @@ puthex64(uint64_t val)
puts(buffer);
}

void
fail(char *s)
void fail(char *s)
{
puts("FAIL: ");
puts(s);
puts("\n");
for (;;) {}
}

char*
sel4_strerror(seL4_Word err)
char *sel4_strerror(seL4_Word err)
{
switch (err) {
case seL4_NoError: return "seL4_NoError";
case seL4_InvalidArgument: return "seL4_InvalidArgument";
case seL4_InvalidCapability: return "seL4_InvalidCapability";
case seL4_IllegalOperation: return "seL4_IllegalOperation";
case seL4_RangeError: return "seL4_RangeError";
case seL4_AlignmentError: return "seL4_AlignmentError";
case seL4_FailedLookup: return "seL4_FailedLookup";
case seL4_TruncatedMessage: return "seL4_TruncatedMessage";
case seL4_DeleteFirst: return "seL4_DeleteFirst";
case seL4_RevokeFirst: return "seL4_RevokeFirst";
case seL4_NotEnoughMemory: return "seL4_NotEnoughMemory";
case seL4_NoError:
return "seL4_NoError";
case seL4_InvalidArgument:
return "seL4_InvalidArgument";
case seL4_InvalidCapability:
return "seL4_InvalidCapability";
case seL4_IllegalOperation:
return "seL4_IllegalOperation";
case seL4_RangeError:
return "seL4_RangeError";
case seL4_AlignmentError:
return "seL4_AlignmentError";
case seL4_FailedLookup:
return "seL4_FailedLookup";
case seL4_TruncatedMessage:
return "seL4_TruncatedMessage";
case seL4_DeleteFirst:
return "seL4_DeleteFirst";
case seL4_RevokeFirst:
return "seL4_RevokeFirst";
case seL4_NotEnoughMemory:
return "seL4_NotEnoughMemory";
}

return "<invalid seL4 error>";
Expand Down

0 comments on commit 229ebea

Please sign in to comment.