From patchwork Mon Mar 17 14:06:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26364 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 515A0202FA for ; Mon, 17 Mar 2014 14:07:13 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf1125998oac.11 for ; Mon, 17 Mar 2014 07:07:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=3TBX6+TfBtzXSHMiW5eNtlwBFNoz3h2VPdXpEZgVXdo=; b=L5kjhyDwDeiAWvuaF7EyVgCiSCWyEoHuPQtvGnqfFLlXLdP7r8jqVT8w0G7flz2tD/ U2QBhu5QH6URGn+Su6JGkCrtKkg+NtTO6ZzKKzW91rr3dWeD2p8IijffZk4pql5asd5N 1a/1X4FgNdKiwMJCRrmbMRuHRcfpw56y8GcdwTodIRKbjm8tjSHB0iTpJ+r8rAzrQrRt OIs2213yFNHj+B9NlZUFQQj9SmjiZBTWlyVjVzSN4AevldctpWGa0DkaePloyS77P2dq IX3CiATSD46WKNkPtBFyfUlcdmKkbL5bUjkEh0s3bY1opJ9SurGRSbYTPWFH26yluINB yyhA== X-Gm-Message-State: ALoCoQlwieee8rFt3euExvpZwoOANZ4+tq2YNS+1rMcrR9MwhlRCNTemVNs4OoE6206K2yOUKnRw X-Received: by 10.43.125.196 with SMTP id gt4mr8703450icc.32.1395065232871; Mon, 17 Mar 2014 07:07:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.75 with SMTP id j69ls1568096qge.96.gmail; Mon, 17 Mar 2014 07:07:12 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr20002053vcm.11.1395065232713; Mon, 17 Mar 2014 07:07:12 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id z15si5285280vcj.36.2014.03.17.07.07.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so5722346vcb.20 for ; Mon, 17 Mar 2014 07:07:12 -0700 (PDT) X-Received: by 10.58.37.232 with SMTP id b8mr1372247vek.27.1395065232633; Mon, 17 Mar 2014 07:07:12 -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.78.9 with SMTP id i9csp130012vck; Mon, 17 Mar 2014 07:07:11 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr2009837vco.25.1395065231607; Mon, 17 Mar 2014 07:07:11 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id rx10si1770658vdc.204.2014.03.17.07.07.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPYBd-0002W3-1r; Mon, 17 Mar 2014 14:06:41 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPYBb-0002Rb-DL for xen-devel@lists.xenproject.org; Mon, 17 Mar 2014 14:06:39 +0000 Received: from [193.109.254.147:38954] by server-15.bemta-14.messagelabs.com id 6D/69-15813-D6107235; Mon, 17 Mar 2014 14:06:37 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-15.tower-27.messagelabs.com!1395065196!2216029!1 X-Originating-IP: [74.125.83.46] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 729 invoked from network); 17 Mar 2014 14:06:36 -0000 Received: from mail-ee0-f46.google.com (HELO mail-ee0-f46.google.com) (74.125.83.46) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Mar 2014 14:06:36 -0000 Received: by mail-ee0-f46.google.com with SMTP id t10so4153989eei.19 for ; Mon, 17 Mar 2014 07:06:36 -0700 (PDT) X-Received: by 10.15.35.200 with SMTP id g48mr933069eev.111.1395065196411; Mon, 17 Mar 2014 07:06:36 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id x3sm39716538eep.17.2014.03.17.07.06.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Mar 2014 07:06:35 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 17 Mar 2014 14:06:03 +0000 Message-Id: <1395065165-15915-14-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395065165-15915-1-git-send-email-julien.grall@linaro.org> References: <1395065165-15915-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Daniel De Graaf , Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v2 13/15] xen/xsm: Add xsm_core_init function X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 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 List-Archive: This function contains non-specific architecture code (mostly the tail of xsm_multiboot_init). It will be used later to avoid code duplication. Signed-off-by: Julien Grall Cc: Daniel De Graaf Acked-by: Ian Campbell --- Changes in v2: - Patch added --- xen/xsm/xsm_core.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c index 11a9ca7..24b0ff4 100644 --- a/xen/xsm/xsm_core.c +++ b/xen/xsm/xsm_core.c @@ -43,6 +43,21 @@ static void __init do_xsm_initcalls(void) } } +static int __init xsm_core_init(void) +{ + if ( verify(&dummy_xsm_ops) ) + { + printk("%s could not verify " + "dummy_xsm_ops structure.\n", __FUNCTION__); + return -EIO; + } + + xsm_ops = &dummy_xsm_ops; + do_xsm_initcalls(); + + return 0; +} + #ifdef CONFIG_MULTIBOOT int __init xsm_multiboot_init(unsigned long *module_map, const multiboot_info_t *mbi, @@ -63,16 +78,7 @@ int __init xsm_multiboot_init(unsigned long *module_map, } } - if ( verify(&dummy_xsm_ops) ) - { - bootstrap_map(NULL); - printk("%s could not verify " - "dummy_xsm_ops structure.\n", __FUNCTION__); - return -EIO; - } - - xsm_ops = &dummy_xsm_ops; - do_xsm_initcalls(); + ret = xsm_core_init(); bootstrap_map(NULL); return 0;