Page MenuHomeFreeBSD

D12564.id.diff
No OneTemporary

D12564.id.diff

Index: head/sys/boot/efi/include/efilib.h
===================================================================
--- head/sys/boot/efi/include/efilib.h
+++ head/sys/boot/efi/include/efilib.h
@@ -82,6 +82,7 @@
EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *);
EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *);
bool efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
+int efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *);
void efi_free_devpath_name(CHAR16 *);
Index: head/sys/boot/efi/libefi/devpath.c
===================================================================
--- head/sys/boot/efi/libefi/devpath.c
+++ head/sys/boot/efi/libefi/devpath.c
@@ -166,3 +166,32 @@
}
return (true);
}
+
+int
+efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEVICE_PATH *path)
+{
+ int len;
+
+ if (prefix == NULL || path == NULL)
+ return (0);
+
+ while (1) {
+ if (IsDevicePathEnd(prefix))
+ break;
+
+ if (DevicePathType(prefix) != DevicePathType(path) ||
+ DevicePathSubType(prefix) != DevicePathSubType(path))
+ return (0);
+
+ len = DevicePathNodeLength(prefix);
+ if (len != DevicePathNodeLength(path))
+ return (0);
+
+ if (memcmp(prefix, path, (size_t)len) != 0)
+ return (0);
+
+ prefix = NextDevicePathNode(prefix);
+ path = NextDevicePathNode(path);
+ }
+ return (1);
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 21, 9:16 PM (8 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25777611
Default Alt Text
D12564.id.diff (1 KB)

Event Timeline