aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/efi.h
diff options
context:
space:
mode:
authorDave Howells <dhowells@redhat.com>2018-12-09 01:57:02 +0530
committerMimi Zohar <zohar@linux.ibm.com>2018-12-12 22:04:29 -0500
commit0bc9ae395b3f3b6557f0c5f0a0b0cd2fd5c00a04 (patch)
tree73395796ee5d31a7a13dc73b8ee11a07f68d9403 /include/linux/efi.h
parentefi: Add EFI signature data types (diff)
downloadlinux-dev-0bc9ae395b3f3b6557f0c5f0a0b0cd2fd5c00a04.tar.xz
linux-dev-0bc9ae395b3f3b6557f0c5f0a0b0cd2fd5c00a04.zip
efi: Add an EFI signature blob parser
Add a function to parse an EFI signature blob looking for elements of interest. A list is made up of a series of sublists, where all the elements in a sublist are of the same type, but sublists can be of different types. For each sublist encountered, the function pointed to by the get_handler_for_guid argument is called with the type specifier GUID and returns either a pointer to a function to handle elements of that type or NULL if the type is not of interest. If the sublist is of interest, each element is passed to the handler function in turn. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r--include/linux/efi.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 3d3de1673b15..d916311f2a51 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1141,6 +1141,15 @@ extern int efi_memattr_apply_permissions(struct mm_struct *mm,
char * __init efi_md_typeattr_format(char *buf, size_t size,
const efi_memory_desc_t *md);
+
+typedef void (*efi_element_handler_t)(const char *source,
+ const void *element_data,
+ size_t element_size);
+extern int __init parse_efi_signature_list(
+ const char *source,
+ const void *data, size_t size,
+ efi_element_handler_t (*get_handler_for_guid)(const efi_guid_t *));
+
/**
* efi_range_is_wc - check the WC bit on an address range
* @start: starting kvirt address