aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/efi.h
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-04-30 06:30:24 -0400
committerMatt Fleming <matt.fleming@intel.com>2013-04-30 06:42:13 -0400
commita614e1923d5389d01f3545ee4a90e39a04d0c90d (patch)
treee8e32dba12a66ffd26d78f015a142ac28e19ad8e /include/linux/efi.h
parentf53f292eeaa234615c31a1306babe703fc4263f2 (diff)
parentc1be5a5b1b355d40e6cf79cc979eb66dafa24ad1 (diff)
Merge tag 'v3.9' into efi-for-tip2
Resolve conflicts for Ingo. Conflicts: drivers/firmware/Kconfig drivers/firmware/efivars.c Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r--include/linux/efi.h54
1 files changed, 8 insertions, 46 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 2fc816682714..3f7257f1f5e8 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -333,6 +333,7 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
333 unsigned long count, 333 unsigned long count,
334 u64 *max_size, 334 u64 *max_size,
335 int *reset_type); 335 int *reset_type);
336typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size);
336 337
337/* 338/*
338 * EFI Configuration Table and GUID definitions 339 * EFI Configuration Table and GUID definitions
@@ -575,9 +576,15 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos
575#ifdef CONFIG_X86 576#ifdef CONFIG_X86
576extern void efi_late_init(void); 577extern void efi_late_init(void);
577extern void efi_free_boot_services(void); 578extern void efi_free_boot_services(void);
579extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size);
578#else 580#else
579static inline void efi_late_init(void) {} 581static inline void efi_late_init(void) {}
580static inline void efi_free_boot_services(void) {} 582static inline void efi_free_boot_services(void) {}
583
584static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
585{
586 return EFI_SUCCESS;
587}
581#endif 588#endif
582extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); 589extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr);
583extern u64 efi_get_iobase (void); 590extern u64 efi_get_iobase (void);
@@ -725,51 +732,6 @@ static inline void memrange_efi_to_native(u64 *addr, u64 *npages)
725 *addr &= PAGE_MASK; 732 *addr &= PAGE_MASK;
726} 733}
727 734
728/* Return the number of unicode characters in data */
729static inline unsigned long
730utf16_strnlen(efi_char16_t *s, size_t maxlength)
731{
732 unsigned long length = 0;
733
734 while (*s++ != 0 && length < maxlength)
735 length++;
736 return length;
737}
738
739static inline unsigned long
740utf16_strlen(efi_char16_t *s)
741{
742 return utf16_strnlen(s, ~0UL);
743}
744
745/*
746 * Return the number of bytes is the length of this string
747 * Note: this is NOT the same as the number of unicode characters
748 */
749static inline unsigned long
750utf16_strsize(efi_char16_t *data, unsigned long maxlength)
751{
752 return utf16_strnlen(data, maxlength/sizeof(efi_char16_t)) * sizeof(efi_char16_t);
753}
754
755static inline int
756utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len)
757{
758 while (1) {
759 if (len == 0)
760 return 0;
761 if (*a < *b)
762 return -1;
763 if (*a > *b)
764 return 1;
765 if (*a == 0) /* implies *b == 0 */
766 return 0;
767 a++;
768 b++;
769 len--;
770 }
771}
772
773/* 735/*
774 * EFI Variable support. 736 * EFI Variable support.
775 * 737 *
@@ -781,7 +743,7 @@ struct efivar_operations {
781 efi_get_variable_t *get_variable; 743 efi_get_variable_t *get_variable;
782 efi_get_next_variable_t *get_next_variable; 744 efi_get_next_variable_t *get_next_variable;
783 efi_set_variable_t *set_variable; 745 efi_set_variable_t *set_variable;
784 efi_query_variable_info_t *query_variable_info; 746 efi_query_variable_store_t *query_variable_store;
785}; 747};
786 748
787struct efivars { 749struct efivars {