From 22d6a1cba3e9ec9baf8ce4d8dd1d088e112a64f1 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Fri, 25 May 2007 00:37:12 -0700 Subject: [SPARC64]: Report proper system soft state to the hypervisor. Signed-off-by: David S. Miller --- arch/sparc64/prom/misc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'arch/sparc64/prom') diff --git a/arch/sparc64/prom/misc.c b/arch/sparc64/prom/misc.c index 0b4213720d43..f3e0c14e9eef 100644 --- a/arch/sparc64/prom/misc.c +++ b/arch/sparc64/prom/misc.c @@ -15,6 +15,25 @@ #include #include +int prom_service_exists(const char *service_name) +{ + int err = p1275_cmd("test", P1275_ARG(0, P1275_ARG_IN_STRING) | + P1275_INOUT(1, 1), service_name); + + if (err) + return 0; + return 1; +} + +void prom_sun4v_guest_soft_state(void) +{ + const char *svc = "SUNW,soft-state-supported"; + + if (!prom_service_exists(svc)) + return; + p1275_cmd(svc, P1275_INOUT(0, 0)); +} + /* Reset and reboot the machine with the command 'bcommand'. */ void prom_reboot(const char *bcommand) { -- cgit v1.2.3