xref: /kvm-unit-tests/lib/powerpc/asm/rtas.h (revision 0cc3a351b925928827baa4b69cf0e46ff5837083)
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 
9 #ifndef __ASSEMBLER__
10 
11 #include <libcflat.h>
12 
13 #define RTAS_UNKNOWN_SERVICE	(-1)
14 
15 struct rtas_args {
16 	u32 token;
17 	u32 nargs;
18 	u32 nret;
19 	u32 args[16];
20 	u32 *rets;
21 };
22 
23 extern void rtas_init(void);
24 extern int rtas_token(const char *service, uint32_t *token);
25 extern int rtas_call(int token, int nargs, int nret, int *outputs, ...);
26 extern int rtas_call_unlocked(struct rtas_args *args, int token, int nargs, int nret, int *outputs, ...);
27 
28 extern void rtas_power_off(void);
29 extern void rtas_stop_self(void);
30 #endif /* __ASSEMBLER__ */
31 
32 #define RTAS_MSR_MASK 0xfffffffffffffffe
33 
34 #endif /* _ASMPOWERPC_RTAS_H_ */
35