From: Roy Franz Subject: [PATCH RFC 10/19] move truncate_string() to efi-shared.c Date: Sat, 28 Jun 2014 02:25:26 +0100 Message-ID: <1403918735-30027-11-git-send-email-roy.franz@linaro.org> References: <1403918735-30027-1-git-send-email-roy.franz@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1403918735-30027-1-git-send-email-roy.franz@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.xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com, tim@xen.org, jbeulich@suse.com, keir@xen.org Cc: Roy Franz , fu.wei@linaro.org, linaro-uefi@lists.linaro.org List-Id: xen-devel@lists.xenproject.org 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 -- 2.0.0