From a78a421de82e1abd44a37477609c69d446fc9301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 23 Sep 2004 13:43:57 +0000 Subject: [PATCH] Renamed sleep() to spin() as that's what it does, and sleep() also doesn't like unistd.h. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9040 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/x86/stage2_priv.h | 2 +- src/kernel/boot/arch/x86/smp_boot.c | 4 ++-- src/kernel/boot/arch/x86/stage2.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/private/kernel/arch/x86/stage2_priv.h b/headers/private/kernel/arch/x86/stage2_priv.h index b5a8ecadcd..867b5af7d8 100755 --- a/headers/private/kernel/arch/x86/stage2_priv.h +++ b/headers/private/kernel/arch/x86/stage2_priv.h @@ -11,7 +11,7 @@ extern void clearscreen(void); extern void kputs(const char *str); extern int dprintf(const char *fmt, ...); -extern void sleep(uint64 time); +extern void spin(uint64 microseconds); extern void execute_n_instructions(int count); void system_time_setup(long a); uint64 rdtsc(); diff --git a/src/kernel/boot/arch/x86/smp_boot.c b/src/kernel/boot/arch/x86/smp_boot.c index 7a8d6601d2..a5c7be4287 100644 --- a/src/kernel/boot/arch/x86/smp_boot.c +++ b/src/kernel/boot/arch/x86/smp_boot.c @@ -398,7 +398,7 @@ smp_boot_all_cpus(kernel_args *ka) ; /* wait 10ms */ - sleep(10000); + spin(10000); /* is this a local apic or an 82489dx ? */ num_startups = (ka->arch_args.cpu_apic_version[i] & 0xf0) ? 2 : 0; @@ -416,7 +416,7 @@ smp_boot_all_cpus(kernel_args *ka) apic_write(APIC_ICR1, config); /* wait */ - sleep(200); + spin(200); while ((apic_read(APIC_ICR1)& 0x00001000) == 0x00001000) ; diff --git a/src/kernel/boot/arch/x86/stage2.c b/src/kernel/boot/arch/x86/stage2.c index 6c1edcce92..583df0a154 100644 --- a/src/kernel/boot/arch/x86/stage2.c +++ b/src/kernel/boot/arch/x86/stage2.c @@ -598,11 +598,11 @@ check_cpu(void) void -sleep(uint64 time) +spin(uint64 microseconds) { uint64 start = system_time(); - while(system_time() - start <= time) + while (system_time() - start <= microseconds) ; }