diff options
author | Freya Murphy <freya@freyacat.org> | 2025-03-27 11:39:12 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-03-27 11:39:12 -0400 |
commit | 0ff301cda68669c59351e5854ce98f2cf460543f (patch) | |
tree | cfe8f976261962420ada64b821559b9da0a56841 /user/idle.c | |
parent | add compile_flags.txt for clangd lsp (diff) | |
download | comus-0ff301cda68669c59351e5854ce98f2cf460543f.tar.gz comus-0ff301cda68669c59351e5854ce98f2cf460543f.tar.bz2 comus-0ff301cda68669c59351e5854ce98f2cf460543f.zip |
pull upstream changes, add auto formatting
Diffstat (limited to 'user/idle.c')
-rw-r--r-- | user/idle.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/user/idle.c b/user/idle.c index dbce885..acf8497 100644 --- a/user/idle.c +++ b/user/idle.c @@ -10,13 +10,14 @@ ** Invoked as: idle */ -USERMAIN( main ) { +USERMAIN(main) +{ // this is the character we will repeatedly print char ch = '.'; // ignore the command-line arguments - (void) argc; - (void) argv; + (void)argc; + (void)argv; // get some current information uint_t pid = getpid(); @@ -24,28 +25,28 @@ USERMAIN( main ) { enum priority_e prio = getprio(); char buf[128]; - sprint( buf, "Idle [%d], started @ %u\n", pid, prio, now ); - cwrites( buf ); - + sprint(buf, "Idle [%d], started @ %u\n", pid, prio, now); + cwrites(buf); + // report our presence on the console - cwrites( "Idle started\n" ); + cwrites("Idle started\n"); - write( CHAN_SIO, &ch, 1 ); + write(CHAN_SIO, &ch, 1); // idle() should never block - it must always be available // for dispatching when we need to pick a new current process - for(;;) { + for (;;) { DELAY(LONG); - write( CHAN_SIO, &ch, 1 ); + write(CHAN_SIO, &ch, 1); } // we should never reach this point! now = gettime(); - sprint( buf, "Idle [%d] EXITING @ %u!?!?!\n", pid, now ); - cwrites( buf ); + sprint(buf, "Idle [%d] EXITING @ %u!?!?!\n", pid, now); + cwrites(buf); - exit( 1 ); + exit(1); - return( 42 ); + return (42); } |