Index: sys/powerpc/aim/aim_machdep.c =================================================================== --- sys/powerpc/aim/aim_machdep.c +++ sys/powerpc/aim/aim_machdep.c @@ -113,6 +113,7 @@ #include #include #include +#include #include #include #include @@ -647,8 +648,9 @@ mtmsr(msr); } +#ifndef __powerpc64__ void -cpu_sleep() +mpc745x_sleep() { static u_quad_t timebase = 0; static register_t sprgs[4]; @@ -711,4 +713,5 @@ enable_vec(curthread); powerpc_sync(); } +#endif Index: sys/powerpc/include/machdep.h =================================================================== --- sys/powerpc/include/machdep.h +++ sys/powerpc/include/machdep.h @@ -37,4 +37,5 @@ void booke_enable_bpred(void); void booke_init_tlb(vm_paddr_t); +void mpc745x_sleep(void); #endif /* _POWERPC_MACHDEP_H_ */ Index: sys/powerpc/powermac/platform_powermac.c =================================================================== --- sys/powerpc/powermac/platform_powermac.c +++ sys/powerpc/powermac/platform_powermac.c @@ -45,6 +45,7 @@ #include #include /* For save_fpu() */ #include +#include #include #include #include @@ -68,7 +69,9 @@ static int powermac_smp_start_cpu(platform_t, struct pcpu *cpu); static void powermac_smp_timebase_sync(platform_t, u_long tb, int ap); static void powermac_reset(platform_t); +#ifndef __powerpc64__ static void powermac_sleep(platform_t); +#endif static platform_method_t powermac_methods[] = { PLATFORMMETHOD(platform_probe, powermac_probe), @@ -83,7 +86,9 @@ PLATFORMMETHOD(platform_smp_timebase_sync, powermac_smp_timebase_sync), PLATFORMMETHOD(platform_reset, powermac_reset), +#ifndef __powerpc64__ PLATFORMMETHOD(platform_sleep, powermac_sleep), +#endif PLATFORMMETHOD_END }; @@ -406,11 +411,18 @@ OF_reboot(); } +#ifndef __powerpc64__ void powermac_sleep(platform_t platform) { + /* Only supports MPC745x for now. */ + if (!MPC745X_P(mfspr(SPR_PVR) >> 16)) { + printf("sleep only supported for G4 PowerMac hardware.\n"); + return; + } *(unsigned long *)0x80 = 0x100; - cpu_sleep(); + mpc745x_sleep(); } +#endif