diff mbox

[kvm-unit-tests,v4,1/2] powerpc: add asm/ppc_asm.h

Message ID 1456824930-15078-2-git-send-email-lvivier@redhat.com
State Accepted
Headers show

Commit Message

Laurent Vivier March 1, 2016, 9:35 a.m. UTC
Move LOAD_REG_IMMEDIATE() and LOAD_REG_ADDR()
from cstart64.S to ppc_asm.h

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
 lib/powerpc/asm/ppc_asm.h | 14 ++++++++++++++
 lib/ppc64/asm/ppc_asm.h   |  1 +
 powerpc/cstart64.S        | 11 +----------
 3 files changed, 16 insertions(+), 10 deletions(-)
 create mode 100644 lib/powerpc/asm/ppc_asm.h
 create mode 100644 lib/ppc64/asm/ppc_asm.h
diff mbox

Patch

diff --git a/lib/powerpc/asm/ppc_asm.h b/lib/powerpc/asm/ppc_asm.h
new file mode 100644
index 0000000..f63bb72
--- /dev/null
+++ b/lib/powerpc/asm/ppc_asm.h
@@ -0,0 +1,14 @@ 
+#ifndef _ASMPOWERPC_PPC_ASM_H
+#define _ASMPOWERPC_PPC_ASM_H
+
+#define LOAD_REG_IMMEDIATE(reg,expr)		\
+	lis	reg,(expr)@highest;		\
+	ori	reg,reg,(expr)@higher;		\
+	rldicr	reg,reg,32,31;			\
+	oris	reg,reg,(expr)@h;		\
+	ori	reg,reg,(expr)@l;
+
+#define LOAD_REG_ADDR(reg,name)			\
+	ld	reg,name@got(r2)
+
+#endif /* _ASMPOWERPC_PPC_ASM_H */
diff --git a/lib/ppc64/asm/ppc_asm.h b/lib/ppc64/asm/ppc_asm.h
new file mode 100644
index 0000000..e3929ee
--- /dev/null
+++ b/lib/ppc64/asm/ppc_asm.h
@@ -0,0 +1 @@ 
+#include "../../powerpc/asm/ppc_asm.h"
diff --git a/powerpc/cstart64.S b/powerpc/cstart64.S
index 4693ba1..6072597 100644
--- a/powerpc/cstart64.S
+++ b/powerpc/cstart64.S
@@ -7,16 +7,7 @@ 
  */
 #define __ASSEMBLY__
 #include <asm/hcall.h>
-
-#define LOAD_REG_IMMEDIATE(reg,expr)		\
-	lis	reg,(expr)@highest;		\
-	ori	reg,reg,(expr)@higher;		\
-	rldicr	reg,reg,32,31;			\
-	oris	reg,reg,(expr)@h;		\
-	ori	reg,reg,(expr)@l;
-
-#define LOAD_REG_ADDR(reg,name)			\
-	ld	reg,name@got(r2)
+#include <asm/ppc_asm.h>
 
 .section .init