mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 10:07:52 +00:00
powerpc/fsl: Modernise mt/mfpmr
With the addition of the machine directives, these are no longer simple 1-2 liner macros. So modernise them to be static inlines and use named asm parameters. Acked-by: Segher Boessenkool <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
This commit is contained in:
@@ -11,17 +11,27 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/* Performance Monitor Registers */
|
||||
#define mfpmr(rn) ({unsigned int rval; \
|
||||
asm volatile(".machine push; " \
|
||||
".machine e300; " \
|
||||
"mfpmr %0," __stringify(rn) ";" \
|
||||
".machine pop; " \
|
||||
: "=r" (rval)); rval;})
|
||||
#define mtpmr(rn, v) asm volatile(".machine push; " \
|
||||
".machine e300; " \
|
||||
"mtpmr " __stringify(rn) ",%0; " \
|
||||
".machine pop; " \
|
||||
: : "r" (v))
|
||||
static inline unsigned int mfpmr(unsigned int rn)
|
||||
{
|
||||
unsigned int rval;
|
||||
|
||||
asm (".machine push; "
|
||||
".machine e300; "
|
||||
"mfpmr %[rval], %[rn];"
|
||||
".machine pop;"
|
||||
: [rval] "=r" (rval) : [rn] "i" (rn));
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
static inline void mtpmr(unsigned int rn, unsigned int val)
|
||||
{
|
||||
asm (".machine push; "
|
||||
".machine e300; "
|
||||
"mtpmr %[rn], %[val];"
|
||||
".machine pop;"
|
||||
: [val] "=r" (val) : [rn] "i" (rn));
|
||||
}
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/* Freescale Book E Performance Monitor APU Registers */
|
||||
|
||||
Reference in New Issue
Block a user