xref: /kvm-unit-tests/lib/powerpc/asm/rtas.h (revision 0c4e631ecaf30f8065dec5cc589d5894c961e6ee)
1 #ifndef _ASMPOWERPC_RTAS_H_
2 #define _ASMPOWERPC_RTAS_H_
3 /*
4  * Copyright (C) 2016, Red Hat Inc, Andrew Jones <drjones@redhat.com>
5  *
6  * This work is licensed under the terms of the GNU LGPL, version 2.
7  */
8 #include <libcflat.h>
9 
10 #define RTAS_UNKNOWN_SERVICE	(-1)
11 
12 struct rtas_args {
13 	u32 token;
14 	u32 nargs;
15 	u32 nret;
16 	u32 args[16];
17 	u32 *rets;
18 };
19 
20 extern void rtas_init(void);
21 extern int rtas_token(const char *service);
22 extern int rtas_call(int token, int nargs, int nret, int *outputs, ...);
23 
24 extern void rtas_power_off(void);
25 
26 #endif /* _ASMPOWERPC_RTAS_H_ */
27