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 roy.franz@linaro.org --- 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