support the machines that support amd64, but don't have mwait. Reference: /n/atom/patch/applied2013/mwaitless Date: Sat Dec 21 16:46:52 CET 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/k10/fns.h Sat Dec 21 16:46:23 2013 +++ /sys/src/nix/k10/fns.h Sat Dec 21 16:46:23 2013 @@ -19,6 +19,7 @@ void cpuid(u32int, u32int, u32int[4]); int dbgprint(char*, ...); void delay(int); +void devacpiinit(void); void dumpmmu(Proc*); void dumpmmuwalk(uintmem); void dumpptepg(int, uintmem); @@ -148,9 +149,11 @@ #define BIOSSEG(a) KADDR(((uint)(a))<<4) /* - * archk10.c + * archk10.c; l64v.s */ -void monmwait(void*, uintptr); +void (*monmwait)(void*, uintptr); +void nopmonmwait(void*, uintptr); +void k10monmwait(void*, uintptr); /* * i8259.c --- /sys/src/nix/k10/l64v.s Sat Dec 21 16:46:24 2013 +++ /sys/src/nix/k10/l64v.s Sat Dec 21 16:46:25 2013 @@ -375,7 +375,7 @@ /* * uintptr monmwait(void*, uintptr) */ -TEXT monmwait(SB),1,$16 +TEXT k10monmwait(SB),1,$16 MOVQ val+8(FP), BX _mmstart: --- /sys/src/nix/k10/archk10.c Sat Dec 21 16:46:26 2013 +++ /sys/src/nix/k10/archk10.c Sat Dec 21 16:46:26 2013 @@ -6,14 +6,22 @@ #include "adr.h" #include "io.h" +void (*monmwait)(void*, uintptr) = nopmonmwait; + +void +nopmonmwait(void*, uintptr) +{ +// pause(); +} + static void k10archinit(void) { u32int info[4]; cpuid(1, 0, info); - if((info[2] & 8) == 0) - panic("k10archinit: mwait required"); + if(info[2] & 8) + monmwait = k10monmwait; } static int @@ -177,17 +185,6 @@ void archfmtinstall(void) { - /* - * Architecture-specific formatting. Not as neat as they - * could be (e.g. there's no defined type for a 'register': - * R - register - * With a little effort these routines could be written - * in a fairly architecturally-independent manner, relying - * on the compiler to optimise-away impossible conditions, - * and/or by exploiting the innards of the fmt library. - */ -// fmtinstall('R', fmtR); -// fmtinstall('W', fmtW); } void