X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Finclude%2Farch.h;h=d82fc2c209c071cbee174286e0b9a8192316a977;hb=6adbfe017566048fc15e152aa842bbe1cd6f430c;hp=66d7a79259d667b10a66398b0568662293be1437;hpb=3764c294f21229bdf700f436fa4884f5e76e0d3a;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/include/arch.h b/Kernel/arch/x86/include/arch.h index 66d7a792..d82fc2c2 100644 --- a/Kernel/arch/x86/include/arch.h +++ b/Kernel/arch/x86/include/arch.h @@ -58,7 +58,16 @@ struct sShortSpinlock { /** * \brief Halt the CPU (shorter version of yield) */ +#if 1 +#define HALT() do { \ + Uint32 flags; \ + __asm__ __volatile__ ("pushf;pop %0" : "=a"(flags)); \ + if( !(flags & 0x200) ) Panic("HALT called with interrupts disabled"); \ + __asm__ __volatile__ ("hlt"); \ +} while(0) +#else #define HALT() __asm__ __volatile__ ("hlt") +#endif /** * \brief Fire a magic breakpoint (bochs) */ @@ -78,7 +87,7 @@ typedef signed long long Sint64; typedef Uint size_t; typedef char BOOL; -typedef Uint64 tPAddr; +typedef Uint32 tPAddr; typedef Uint32 tVAddr; typedef struct {