diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index ff81df09c0..65cb333a41 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -17,6 +17,10 @@ #endif // !_ASSEMBLER +#undef PAUSE +#define PAUSE() asm volatile ("pause;") + + // MSR registers (possibly Intel specific) #define IA32_MSR_APIC_BASE 0x1b diff --git a/headers/private/kernel/cpu.h b/headers/private/kernel/cpu.h index 40f4edcc78..23b5d288ce 100644 --- a/headers/private/kernel/cpu.h +++ b/headers/private/kernel/cpu.h @@ -15,6 +15,12 @@ #include +// define PAUSE, if not done in arch/cpu.h +#ifndef PAUSE +# define PAUSE() +#endif + + /* CPU local data structure */ typedef struct cpu_ent { @@ -30,7 +36,7 @@ typedef struct cpu_ent { bigtime_t last_user_time; bool disabled; - + // arch-specific stuff arch_cpu_info arch; } cpu_ent __attribute__((aligned(64))); diff --git a/src/system/kernel/smp.cpp b/src/system/kernel/smp.cpp index dddbc7d1f3..a4c5d08ddb 100644 --- a/src/system/kernel/smp.cpp +++ b/src/system/kernel/smp.cpp @@ -33,12 +33,6 @@ # define TRACE(x) ; #endif -#if __INTEL__ -# define PAUSE() asm volatile ("pause;") -#else -# define PAUSE() -#endif - #define MSG_POOL_SIZE (SMP_MAX_CPUS * 4) struct smp_msg { diff --git a/src/system/kernel/timer.cpp b/src/system/kernel/timer.cpp index 680762596a..ee908e8029 100644 --- a/src/system/kernel/timer.cpp +++ b/src/system/kernel/timer.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -36,12 +37,6 @@ static per_cpu_timer_data sPerCPU[B_MAX_CPU_COUNT]; # define TRACE(x) ; #endif -#if __INTEL__ -# define PAUSE() asm volatile ("pause;") -#else -# define PAUSE() -#endif - status_t timer_init(kernel_args *args) @@ -168,7 +163,7 @@ add_timer(timer *event, timer_hook hook, bigtime_t period, int32 flags) bigtime_t scheduleTime; bigtime_t currentTime = system_time(); cpu_status state; - + if (event == NULL || hook == NULL || period < 0) return B_BAD_VALUE;