From patchwork Tue Mar 1 09:35:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 590432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 067FA140BB2 for ; Tue, 1 Mar 2016 20:35:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbcCAJfl (ORCPT ); Tue, 1 Mar 2016 04:35:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33715 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbcCAJfk (ORCPT ); Tue, 1 Mar 2016 04:35:40 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A2D717F080; Tue, 1 Mar 2016 09:35:39 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u219ZX0n012938; Tue, 1 Mar 2016 04:35:36 -0500 From: Laurent Vivier To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: drjones@redhat.com, thuth@redhat.com, dgibson@redhat.com, agraf@suse.de, pbonzini@redhat.com, Laurent Vivier Subject: [kvm-unit-tests PATCH v4 1/2] powerpc: add asm/ppc_asm.h Date: Tue, 1 Mar 2016 10:35:29 +0100 Message-Id: <1456824930-15078-2-git-send-email-lvivier@redhat.com> In-Reply-To: <1456824930-15078-1-git-send-email-lvivier@redhat.com> References: <1456824930-15078-1-git-send-email-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Move LOAD_REG_IMMEDIATE() and LOAD_REG_ADDR() from cstart64.S to ppc_asm.h Signed-off-by: Laurent Vivier Reviewed-by: Andrew Jones Reviewed-by: Thomas Huth --- 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 - -#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 .section .init