Timed waiting with hal_wait()

This commit is contained in:
2025-08-31 00:21:17 +02:00
parent 73f27f730b
commit 13ab117b1b
3 changed files with 19 additions and 12 deletions

View File

@ -11,6 +11,12 @@
#define PROC_REAPER_FREQ 30
#define PROC_DIE() \
do { \
proc_killself(); \
for(;;); \
} while(0)
uint64_t pids = 0;
uint64_t sched_ticks = 0;
@ -114,13 +120,11 @@ int a = 0;
void proc_print(void) {
for (;;) {
for (volatile size_t i = 0; i < 0x1000000; i++) {
}
hal_wait(1 * 1000);
if (a == 10) {
proc_killself();
for(;;);
}
/* if (a == 10) { */
/* PROC_DIE(); */
/* } */
kprintf("A");
a++;
}
@ -130,13 +134,11 @@ int b = 0;
void proc_print2(void) {
for (;;) {
for (volatile size_t i = 0; i < 0x1000000; i++) {
}
hal_wait(2 * 1000);
if (b == 20) {
proc_killself();
for(;;);
}
/* if (b == 20) { */
/* PROC_DIE(); */
/* } */
kprintf("B");
b++;
}