From patchwork Thu Apr 17 10:33:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 28551 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C0FBB20674 for ; Thu, 17 Apr 2014 11:45:47 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id wp4sf1556108obc.8 for ; Thu, 17 Apr 2014 04:45:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=WbCWHS+C6wy9+jjy1MLSUMy2YagIDtHUB1e7pTqkbsw=; b=UULMqSyRlx8UV3EUUw4hAC24k9W9NZDoOrbr14Sd8QBpHa1Fi8UBat8JXZFfWH78xp ImBAMD8hZTOyKzthNQx8D/0xVMFLQPsGJs3997wkDgz4tugthxzeiL6HnZJfb+sk635M UWBext8YgHUxOeSgdG/DBF0AgF6O4iy3HcqQRULTvuCfgmgR0hi++yd5K8GkrxZf1Rb6 uCczYumGogLJZ8JBCR89U5YJ2Fk8qdQt60BYGKUPTZQgFBd+OSHiLwsuPZjciLQJKYQt f/AbWWzvoerJAjw/V7iPmvl4r+Gos8vNzHobzDbjW3KYC94R753OXlOouVBQ/nat1JNE cuSw== X-Gm-Message-State: ALoCoQm7X+oaYCZdxGVqbD92cuLy1baz/v+d8VCNR8+lSxo7BXvECSXsjtGUohsxw7++EV6xd746 X-Received: by 10.182.33.161 with SMTP id s1mr7157250obi.12.1397735147069; Thu, 17 Apr 2014 04:45:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.100 with SMTP id b91ls1055794qgf.26.gmail; Thu, 17 Apr 2014 04:45:46 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr7262149vco.25.1397735146918; Thu, 17 Apr 2014 04:45:46 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id fn10si4393168vdc.117.2014.04.17.04.45.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 04:45:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so346116veb.33 for ; Thu, 17 Apr 2014 04:45:46 -0700 (PDT) X-Received: by 10.52.130.225 with SMTP id oh1mr6897800vdb.8.1397735146726; Thu, 17 Apr 2014 04:45:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp28357vcb; Thu, 17 Apr 2014 04:45:46 -0700 (PDT) X-Received: by 10.224.29.206 with SMTP id r14mr9543601qac.91.1397735146238; Thu, 17 Apr 2014 04:45:46 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s3si4637625qas.273.2014.04.17.04.45.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 17 Apr 2014 04:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:59521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wajpw-0002yq-EY for patch@linaro.org; Thu, 17 Apr 2014 06:46:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Waje4-0007f0-Ke for qemu-devel@nongnu.org; Thu, 17 Apr 2014 06:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Waje3-0002PW-8F for qemu-devel@nongnu.org; Thu, 17 Apr 2014 06:34:16 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:47842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Waje2-0002OB-UV for qemu-devel@nongnu.org; Thu, 17 Apr 2014 06:34:15 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Wajdv-0001yj-0i for qemu-devel@nongnu.org; Thu, 17 Apr 2014 11:34:07 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 17 Apr 2014 11:33:16 +0100 Message-Id: <1397730846-7576-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397730846-7576-1-git-send-email-peter.maydell@linaro.org> References: <1397730846-7576-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 01/51] target-arm: Split out private-to-target functions into internals.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Currently cpu.h defines a mixture of functions and types needed by the rest of QEMU and those needed only by files within target-arm/. Split the latter out into a new header so they aren't needlessly exposed further than required. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- target-arm/cpu.c | 1 + target-arm/cpu.h | 20 ------------------- target-arm/helper.c | 1 + target-arm/internals.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++ target-arm/kvm32.c | 1 + target-arm/op_helper.c | 1 + target-arm/translate-a64.c | 1 + target-arm/translate.c | 1 + 8 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 target-arm/internals.h diff --git a/target-arm/cpu.c b/target-arm/cpu.c index c32d8c4..0b1ad10 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -19,6 +19,7 @@ */ #include "cpu.h" +#include "internals.h" #include "qemu-common.h" #include "hw/qdev-properties.h" #include "qapi/qmp/qerror.h" diff --git a/target-arm/cpu.h b/target-arm/cpu.h index bf37cd6..78d4fc5 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -111,11 +111,6 @@ typedef struct ARMGenericTimer { #define GTIMER_VIRT 1 #define NUM_GTIMERS 2 -/* Scale factor for generic timers, ie number of ns per tick. - * This gives a 62.5MHz timer. - */ -#define GTIMER_SCALE 16 - typedef struct CPUARMState { /* Regs for current mode. */ uint32_t regs[16]; @@ -322,11 +317,7 @@ typedef struct CPUARMState { #include "cpu-qom.h" ARMCPU *cpu_arm_init(const char *cpu_model); -void arm_translate_init(void); -void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu); int cpu_arm_exec(CPUARMState *s); -int bank_number(int mode); -void switch_mode(CPUARMState *, int); uint32_t do_arm_semihosting(CPUARMState *env); static inline bool is_a64(CPUARMState *env) @@ -548,17 +539,6 @@ static inline void vfp_set_fpcr(CPUARMState *env, uint32_t val) vfp_set_fpscr(env, new_fpscr); } -enum arm_fprounding { - FPROUNDING_TIEEVEN, - FPROUNDING_POSINF, - FPROUNDING_NEGINF, - FPROUNDING_ZERO, - FPROUNDING_TIEAWAY, - FPROUNDING_ODD -}; - -int arm_rmode_to_sf(int rmode); - enum arm_cpu_mode { ARM_CPU_MODE_USR = 0x10, ARM_CPU_MODE_FIQ = 0x11, diff --git a/target-arm/helper.c b/target-arm/helper.c index 55077ed..e642b30 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1,4 +1,5 @@ #include "cpu.h" +#include "internals.h" #include "exec/gdbstub.h" #include "helper.h" #include "qemu/host-utils.h" diff --git a/target-arm/internals.h b/target-arm/internals.h new file mode 100644 index 0000000..a38a57f --- /dev/null +++ b/target-arm/internals.h @@ -0,0 +1,49 @@ +/* + * QEMU ARM CPU -- internal functions and types + * + * Copyright (c) 2014 Linaro Ltd + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see + * + * + * This header defines functions, types, etc which need to be shared + * between different source files within target-arm/ but which are + * private to it and not required by the rest of QEMU. + */ + +#ifndef TARGET_ARM_INTERNALS_H +#define TARGET_ARM_INTERNALS_H + +/* Scale factor for generic timers, ie number of ns per tick. + * This gives a 62.5MHz timer. + */ +#define GTIMER_SCALE 16 + +int bank_number(int mode); +void switch_mode(CPUARMState *, int); +void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu); +void arm_translate_init(void); + +enum arm_fprounding { + FPROUNDING_TIEEVEN, + FPROUNDING_POSINF, + FPROUNDING_NEGINF, + FPROUNDING_ZERO, + FPROUNDING_TIEAWAY, + FPROUNDING_ODD +}; + +int arm_rmode_to_sf(int rmode); + +#endif diff --git a/target-arm/kvm32.c b/target-arm/kvm32.c index a4fde07..b21f844 100644 --- a/target-arm/kvm32.c +++ b/target-arm/kvm32.c @@ -21,6 +21,7 @@ #include "sysemu/kvm.h" #include "kvm_arm.h" #include "cpu.h" +#include "internals.h" #include "hw/arm/arm.h" static inline void set_feature(uint64_t *features, int feature) diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c index 21ff58e..4193eca 100644 --- a/target-arm/op_helper.c +++ b/target-arm/op_helper.c @@ -18,6 +18,7 @@ */ #include "cpu.h" #include "helper.h" +#include "internals.h" #define SIGNBIT (uint32_t)0x80000000 #define SIGNBIT64 ((uint64_t)1 << 63) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 9175e48..6689165 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -26,6 +26,7 @@ #include "tcg-op.h" #include "qemu/log.h" #include "translate.h" +#include "internals.h" #include "qemu/host-utils.h" #include "exec/gen-icount.h" diff --git a/target-arm/translate.c b/target-arm/translate.c index 56e3b4b..f869bc6 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -25,6 +25,7 @@ #include #include "cpu.h" +#include "internals.h" #include "disas/disas.h" #include "tcg-op.h" #include "qemu/log.h"