Page MenuHomeFreeBSD

D23828.id68785.diff
No OneTemporary

D23828.id68785.diff

Index: sys/powerpc/aim/aim_machdep.c
===================================================================
--- sys/powerpc/aim/aim_machdep.c
+++ sys/powerpc/aim/aim_machdep.c
@@ -113,6 +113,7 @@
#include <machine/fpu.h>
#include <machine/hid.h>
#include <machine/kdb.h>
+#include <machine/machdep.h>
#include <machine/md_var.h>
#include <machine/metadata.h>
#include <machine/mmuvar.h>
@@ -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 <machine/cpu.h>
#include <machine/fpu.h> /* For save_fpu() */
#include <machine/hid.h>
+#include <machine/machdep.h>
#include <machine/platformvar.h>
#include <machine/setjmp.h>
#include <machine/smp.h>
@@ -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

File Metadata

Mime Type
text/plain
Expires
Fri, Jul 10, 10:36 AM (14 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34925553
Default Alt Text
D23828.id68785.diff (2 KB)

Event Timeline