Commit f2d6d2d8 authored by Nathan Lynch's avatar Nathan Lynch Committed by Paul Mackerras

[POWERPC] Add rtas_service_present() helper

To test for the existence of an RTAS function, we typically do:

   foo_token = rtas_token("foo");
   if (foo_token == RTAS_UNKNOWN_SERVICE)
      return;

Add a rtas_service_present method, which provides a more conventional
boolean interface for testing the existence of an RTAS method.
Signed-off-by: default avatarNathan Lynch <ntl@pobox.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 9d9d868e
...@@ -303,6 +303,12 @@ int rtas_token(const char *service) ...@@ -303,6 +303,12 @@ int rtas_token(const char *service)
} }
EXPORT_SYMBOL(rtas_token); EXPORT_SYMBOL(rtas_token);
int rtas_service_present(const char *service)
{
return rtas_token(service) != RTAS_UNKNOWN_SERVICE;
}
EXPORT_SYMBOL(rtas_service_present);
#ifdef CONFIG_RTAS_ERROR_LOGGING #ifdef CONFIG_RTAS_ERROR_LOGGING
/* /*
* Return the firmware-specified size of the error log buffer * Return the firmware-specified size of the error log buffer
......
...@@ -159,6 +159,7 @@ extern struct rtas_t rtas; ...@@ -159,6 +159,7 @@ extern struct rtas_t rtas;
extern void enter_rtas(unsigned long); extern void enter_rtas(unsigned long);
extern int rtas_token(const char *service); extern int rtas_token(const char *service);
extern int rtas_service_present(const char *service);
extern int rtas_call(int token, int, int, int *, ...); extern int rtas_call(int token, int, int, int *, ...);
extern void rtas_restart(char *cmd); extern void rtas_restart(char *cmd);
extern void rtas_power_off(void); extern void rtas_power_off(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment