From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH v4 2/4] xen/xsm: Add xsm_core_init function Date: Fri, 21 Mar 2014 15:22:12 +0000 Message-ID: <1395415334-31538-3-git-send-email-julien.grall@linaro.org> References: <1395415334-31538-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WR1H4-00072F-Jl for xen-devel@lists.xenproject.org; Fri, 21 Mar 2014 15:22:22 +0000 Received: by mail-ee0-f48.google.com with SMTP id b57so1921914eek.35 for ; Fri, 21 Mar 2014 08:22:20 -0700 (PDT) In-Reply-To: <1395415334-31538-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Daniel De Graaf , Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org 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 Acked-by: Ian Campbell Acked-by: Daniel De Graaf --- 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; -- 1.7.10.4