diff options
Diffstat (limited to 'arch/sparc64/prom/misc.c')
-rw-r--r-- | arch/sparc64/prom/misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
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 @@ | |||
15 | #include <asm/oplib.h> | 15 | #include <asm/oplib.h> |
16 | #include <asm/system.h> | 16 | #include <asm/system.h> |
17 | 17 | ||
18 | int prom_service_exists(const char *service_name) | ||
19 | { | ||
20 | int err = p1275_cmd("test", P1275_ARG(0, P1275_ARG_IN_STRING) | | ||
21 | P1275_INOUT(1, 1), service_name); | ||
22 | |||
23 | if (err) | ||
24 | return 0; | ||
25 | return 1; | ||
26 | } | ||
27 | |||
28 | void prom_sun4v_guest_soft_state(void) | ||
29 | { | ||
30 | const char *svc = "SUNW,soft-state-supported"; | ||
31 | |||
32 | if (!prom_service_exists(svc)) | ||
33 | return; | ||
34 | p1275_cmd(svc, P1275_INOUT(0, 0)); | ||
35 | } | ||
36 | |||
18 | /* Reset and reboot the machine with the command 'bcommand'. */ | 37 | /* Reset and reboot the machine with the command 'bcommand'. */ |
19 | void prom_reboot(const char *bcommand) | 38 | void prom_reboot(const char *bcommand) |
20 | { | 39 | { |