diff mbox

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

Message ID 1456768146-10136-2-git-send-email-lvivier@redhat.com
State Superseded
Headers show

Commit Message

Laurent Vivier Feb. 29, 2016, 5:49 p.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>
---
 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

Comments

Andrew Jones Feb. 29, 2016, 6:56 p.m. UTC | #1
On Mon, Feb 29, 2016 at 06:49:05PM +0100, Laurent Vivier wrote:
> 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>
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Huth March 1, 2016, 8:30 a.m. UTC | #2
On 29.02.2016 18:49, Laurent Vivier wrote:
> Move LOAD_REG_IMMEDIATE() and LOAD_REG_ADDR()
> from cstart64.S to ppc_asm.h
> 
> Signed-off-by: Laurent Vivier <lvivier@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 --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

Reviewed-by: Thomas Huth <thuth@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
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