mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-25 03:54:01 +00:00
Alt+Ctrl+C
This commit is contained in:
16
cleonos/c/apps/spin_main.c
Normal file
16
cleonos/c/apps/spin_main.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <cleonos_syscall.h>
|
||||
|
||||
int cleonos_app_main(void) {
|
||||
static const char banner[] =
|
||||
"spin: busy loop started (test Alt+Ctrl+C force stop)\n";
|
||||
volatile u64 noise = 0xC1E0C1E0ULL;
|
||||
|
||||
(void)cleonos_sys_tty_write(banner, (u64)(sizeof(banner) - 1U));
|
||||
|
||||
for (;;) {
|
||||
noise ^= (noise << 7);
|
||||
noise ^= (noise >> 9);
|
||||
noise ^= 0x9E3779B97F4A7C15ULL;
|
||||
noise += 0xA5A5A5A5A5A5A5A5ULL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user