From patchwork Sat Jun 28 01:25:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 32659 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A45C5200B9 for ; Sat, 28 Jun 2014 01:27:59 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id l6sf10942900qcy.10 for ; Fri, 27 Jun 2014 18:27:59 -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=NfzocrV9HxPkClyyAKRhRrjmc9Xe9QNW803Y95w8AuA=; b=ddbpsowbCSMRKlITSchZlj3hKG2xqWi16D/kTDbF5xpSRN12kmQoACfwwJKW/qw8nz EmfoSb2KcXNeNuvw62MJjKlPLCaKAJtRdrMZgSzzuVMkFA9niRbc/+smhWrfUg4Qa8L7 mR/4AIDiJiswl7ns9blnQwYaIQV2DKzCclI0YKC2WBrGkfLh2wz90SZjCtkvXiOOgnBj Mk855vZWcBkLUFBmpTUmGmMsTlvTIadQAw/9EYWIv45xvOTqWN/XR6RqRzrDGP4GIVxZ dKQu9QYQogheV9UxY60PKD7k9O1Q2qQpJSd+Osqz7YiHPe1lOkGbk5loVhlSlxFhBqP+ 2TMQ== X-Gm-Message-State: ALoCoQmPhccewSQUROmcbFXs34HTQoyJ3q5vmLwsElmkne9wQWG28Kwttee46JhPS8oTRxIsth9R X-Received: by 10.58.200.162 with SMTP id jt2mr13604973vec.17.1403918879513; Fri, 27 Jun 2014 18:27:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.39 with SMTP id 36ls831756qgm.75.gmail; Fri, 27 Jun 2014 18:27:59 -0700 (PDT) X-Received: by 10.58.229.162 with SMTP id sr2mr22539008vec.15.1403918879431; Fri, 27 Jun 2014 18:27:59 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id n1si7229230vem.71.2014.06.27.18.27.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Jun 2014 18:27:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so6104315veb.31 for ; Fri, 27 Jun 2014 18:27:59 -0700 (PDT) X-Received: by 10.220.174.137 with SMTP id t9mr23251726vcz.12.1403918879310; Fri, 27 Jun 2014 18:27:59 -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.221.37.5 with SMTP id tc5csp147872vcb; Fri, 27 Jun 2014 18:27:59 -0700 (PDT) X-Received: by 10.224.55.202 with SMTP id v10mr40392895qag.10.1403918878914; Fri, 27 Jun 2014 18:27:58 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v4si15997948qaf.17.2014.06.27.18.27.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 27 Jun 2014 18:27:58 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) 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 1X0hOy-0007If-TB; Sat, 28 Jun 2014 01:26:00 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X0hOx-0007Ht-Lg for xen-devel@lists.xen.org; Sat, 28 Jun 2014 01:25:59 +0000 Received: from [85.158.139.211:53867] by server-7.bemta-5.messagelabs.com id 1B/12-03657-7A91EA35; Sat, 28 Jun 2014 01:25:59 +0000 X-Env-Sender: roy.franz@linaro.org X-Msg-Ref: server-4.tower-206.messagelabs.com!1403918756!12498965!1 X-Originating-IP: [209.85.192.171] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18930 invoked from network); 28 Jun 2014 01:25:58 -0000 Received: from mail-pd0-f171.google.com (HELO mail-pd0-f171.google.com) (209.85.192.171) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jun 2014 01:25:58 -0000 Received: by mail-pd0-f171.google.com with SMTP id fp1so5137391pdb.30 for ; Fri, 27 Jun 2014 18:25:56 -0700 (PDT) X-Received: by 10.68.232.33 with SMTP id tl1mr35364975pbc.162.1403918756488; Fri, 27 Jun 2014 18:25:56 -0700 (PDT) Received: from rfranz-t520.local (c-24-10-97-91.hsd1.ca.comcast.net. [24.10.97.91]) by mx.google.com with ESMTPSA id eh4sm16637918pbc.79.2014.06.27.18.25.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Jun 2014 18:25:55 -0700 (PDT) From: Roy Franz To: xen-devel@lists.xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com, tim@xen.org, jbeulich@suse.com, keir@xen.org Date: Sat, 28 Jun 2014 02:25:26 +0100 Message-Id: <1403918735-30027-11-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403918735-30027-1-git-send-email-roy.franz@linaro.org> References: <1403918735-30027-1-git-send-email-roy.franz@linaro.org> Cc: Roy Franz , fu.wei@linaro.org, linaro-uefi@lists.linaro.org Subject: [Xen-devel] [PATCH RFC 10/19] move truncate_string() to efi-shared.c 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: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) 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: Move the newly created truncate_string() function to efi-shared.c so it can be shared with the ARM EFI stub. Signed-off-by: Roy Franz --- xen/arch/x86/efi/boot.c | 14 -------------- xen/arch/x86/efi/efi-shared.c | 15 +++++++++++++++ xen/include/efi/efi-shared.h | 1 + 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c index e61f9c9..0583c6a 100644 --- a/xen/arch/x86/efi/boot.c +++ b/xen/arch/x86/efi/boot.c @@ -174,20 +174,6 @@ void __init load_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name, ++mbi.mods_count; } -/* Truncate string at first space, and return pointer - * to remainder of string. - */ -char * __init truncate_string(char *s) -{ - while ( *s && !isspace(*s) ) - ++s; - if (*s) - { - *s = 0; - return(s + 1); - } - return(NULL); -} static void __init edd_put_string(u8 *dst, size_t n, const char *src) { diff --git a/xen/arch/x86/efi/efi-shared.c b/xen/arch/x86/efi/efi-shared.c index 0a67363..6abbc88 100644 --- a/xen/arch/x86/efi/efi-shared.c +++ b/xen/arch/x86/efi/efi-shared.c @@ -185,6 +185,21 @@ void __init PrintErrMesgExit(const CHAR16 *mesg, EFI_STATUS ErrCode) blexit(mesg); } +/* Truncate string at first space, and return pointer + * to remainder of string. + */ +char * __init truncate_string(char *s) +{ + while ( *s && !isspace(*s) ) + ++s; + if (*s) + { + *s = 0; + return(s + 1); + } + return(NULL); +} + EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image, CHAR16 **leaf) { diff --git a/xen/include/efi/efi-shared.h b/xen/include/efi/efi-shared.h index 168cf2a..98e9e89 100644 --- a/xen/include/efi/efi-shared.h +++ b/xen/include/efi/efi-shared.h @@ -56,4 +56,5 @@ void __init noreturn blexit(const CHAR16 *str); bool_t __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name, struct file *file); +char * __init truncate_string(char *s); #endif