summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4u
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/sun4u')
-rw-r--r--usr/src/uts/sun4u/os/cpr_impl.c120
-rw-r--r--usr/src/uts/sun4u/sys/machclock.h13
2 files changed, 125 insertions, 8 deletions
diff --git a/usr/src/uts/sun4u/os/cpr_impl.c b/usr/src/uts/sun4u/os/cpr_impl.c
index 4c5b415b0a..e0c6a4b2d8 100644
--- a/usr/src/uts/sun4u/os/cpr_impl.c
+++ b/usr/src/uts/sun4u/os/cpr_impl.c
@@ -65,6 +65,10 @@
#include <vm/vm_dep.h>
extern void cpr_clear_bitmaps(void);
+extern int cpr_setbit(pfn_t ppn, int mapflag);
+extern int cpr_clrbit(pfn_t ppn, int mapflag);
+extern pgcnt_t cpr_scan_kvseg(int mapflag, bitfunc_t bitfunc, struct seg *seg);
+extern pgcnt_t cpr_count_seg_pages(int mapflag, bitfunc_t bitfunc);
extern void dtlb_wr_entry(uint_t, tte_t *, uint64_t *);
extern void itlb_wr_entry(uint_t, tte_t *, uint64_t *);
@@ -641,12 +645,6 @@ i_cpr_save_machdep_info(void)
}
-void
-i_cpr_set_tbr(void)
-{
-}
-
-
/*
* cpu0 should contain bootcpu info
*/
@@ -656,6 +654,11 @@ i_cpr_bootcpu(void)
return (&cpu0);
}
+processorid_t
+i_cpr_bootcpuid(void)
+{
+ return (0);
+}
/*
* Return the virtual address of the mapping area
@@ -1761,7 +1764,7 @@ i_cpr_dump_setup(vnode_t *vp)
int
-i_cpr_is_supported(void)
+i_cpr_is_supported(int sleeptype)
{
char es_prop[] = "energystar-v2";
pnode_t node;
@@ -1769,6 +1772,9 @@ i_cpr_is_supported(void)
extern int cpr_supported_override;
extern int cpr_platform_enable;
+ if (sleeptype != CPR_TODISK)
+ return (0);
+
/*
* The next statement tests if a specific platform has turned off
* cpr support.
@@ -1924,3 +1930,103 @@ i_cpr_alloc_bitmaps(void)
i_cpr_bitmap_cleanup();
return (err);
}
+
+
+
+/*
+ * Power down the system.
+ */
+int
+i_cpr_power_down(int sleeptype)
+{
+ int is_defined = 0;
+ char *wordexists = "p\" power-off\" find nip swap l! ";
+ char *req = "power-off";
+
+ ASSERT(sleeptype == CPR_TODISK);
+
+ /*
+ * is_defined has value -1 when defined
+ */
+ prom_interpret(wordexists, (uintptr_t)&is_defined, 0, 0, 0, 0);
+ if (is_defined) {
+ CPR_DEBUG(CPR_DEBUG1, "\ncpr: %s...\n", req);
+ prom_interpret(req, 0, 0, 0, 0, 0);
+ }
+ /*
+ * Only returns if failed
+ */
+ return (EIO);
+}
+
+void
+i_cpr_stop_other_cpus(void)
+{
+ stop_other_cpus();
+}
+
+/*
+ * Save context for the specified CPU
+ */
+/* ARGSUSED */
+void *
+i_cpr_save_context(void *arg)
+{
+ /*
+ * Not yet
+ */
+ ASSERT(0);
+ return (NULL);
+}
+
+void
+i_cpr_pre_resume_cpus(void)
+{
+ /*
+ * Not yet
+ */
+ ASSERT(0);
+}
+
+void
+i_cpr_post_resume_cpus(void)
+{
+ /*
+ * Not yet
+ */
+ ASSERT(0);
+}
+
+/*
+ * nothing to do
+ */
+void
+i_cpr_alloc_cpus(void)
+{
+}
+
+/*
+ * nothing to do
+ */
+void
+i_cpr_free_cpus(void)
+{
+}
+
+/* ARGSUSED */
+void
+i_cpr_save_configuration(dev_info_t *dip)
+{
+ /*
+ * this is a no-op on sparc
+ */
+}
+
+/* ARGSUSED */
+void
+i_cpr_restore_configuration(dev_info_t *dip)
+{
+ /*
+ * this is a no-op on sparc
+ */
+}
diff --git a/usr/src/uts/sun4u/sys/machclock.h b/usr/src/uts/sun4u/sys/machclock.h
index 3bd3ad7e7b..e0bc501de7 100644
--- a/usr/src/uts/sun4u/sys/machclock.h
+++ b/usr/src/uts/sun4u/sys/machclock.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -104,6 +104,17 @@ struct tod_ops {
extern struct tod_ops tod_ops;
extern char *tod_module_name;
+/*
+ * These defines allow common code to use TOD functions independant
+ * of hardware platform.
+ */
+#define TODOP_GET(top) ((top).tod_get())
+#define TODOP_SET(top, ts) ((top).tod_set(ts))
+#define TODOP_SETWD(top, nsec) ((top).tod_set_watchdog_timer(nsec))
+#define TODOP_CLRWD(top) ((top).tod_clear_watchdog_timer())
+#define TODOP_SETWAKE(top, ts) ((top).tod_set_power_alarm(ts))
+#define TODOP_CLRWAKE(top) ((top).tod_clear_power_alarm())
+
#endif /* _KERNEL */
#endif /* _ASM */