]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Add firmware_devicetree_exists()
authoranonymix007 <48598263+anonymix007@users.noreply.github.com>
Tue, 5 Nov 2024 19:17:21 +0000 (22:17 +0300)
committeranonymix007 <48598263+anonymix007@users.noreply.github.com>
Tue, 5 Nov 2024 19:29:58 +0000 (22:29 +0300)
src/boot/efi/devicetree.c
src/boot/efi/devicetree.h

index 7e77ed6e60d19d03abe1336a16e047118de7aab3..f3563f296fb5e7721eea972536a67783c62b5ca8 100644 (file)
@@ -174,6 +174,10 @@ static const char* devicetree_get_compatible(const void *dtb) {
         return NULL;
 }
 
+bool firmware_devicetree_exists(void) {
+        return !!find_configuration_table(MAKE_GUID_PTR(EFI_DTB_TABLE));
+}
+
 /* This function checks if the firmware provided Devicetree
  * and a UKI provided Devicetree contain the same first entry
  * on their respective "compatible" fields (which usually defines
index 44c61fff6fd8d652d1599f04acda2cfc73b9602d..5f6720f655a36a5a946ae908e268d9d505814d39 100644 (file)
@@ -30,6 +30,7 @@ typedef struct FdtHeader {
         uint32_t size_dt_struct;
 } FdtHeader;
 
+bool firmware_devicetree_exists(void);
 EFI_STATUS devicetree_match(const void *uki_dtb, size_t uki_dtb_length);
 EFI_STATUS devicetree_match_by_compatible(const void *uki_dtb, size_t uki_dtb_length, const char *compat);
 EFI_STATUS devicetree_install(struct devicetree_state *state, EFI_FILE *root_dir, char16_t *name);