]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/boot/efi/util.h
Merge pull request #21981 from medhefgo/boot-cleanup
[thirdparty/systemd.git] / src / boot / efi / util.h
index b40f05eaef09b3d4554a4b6bf4838bfb93dc8ec6..58ca44443da656b0c0d049a96236e2b373af1615 100644 (file)
@@ -73,7 +73,7 @@ CHAR16 *xstra_to_str(const CHAR8 *stra);
 
 EFI_STATUS file_read(EFI_FILE_HANDLE dir, const CHAR16 *name, UINTN off, UINTN size, CHAR8 **content, UINTN *content_size);
 
-static inline void FreePoolp(void *p) {
+static inline void free_poolp(void *p) {
         void *q = *(void**) p;
 
         if (!q)
@@ -82,9 +82,9 @@ static inline void FreePoolp(void *p) {
         FreePool(q);
 }
 
-#define _cleanup_freepool_ _cleanup_(FreePoolp)
+#define _cleanup_freepool_ _cleanup_(free_poolp)
 
-static inline void FileHandleClosep(EFI_FILE_HANDLE *handle) {
+static inline void file_handle_closep(EFI_FILE_HANDLE *handle) {
         if (!*handle)
                 return;
 
@@ -159,3 +159,13 @@ static inline void *PHYSICAL_ADDRESS_TO_POINTER(EFI_PHYSICAL_ADDRESS addr) {
 }
 
 UINT64 get_os_indications_supported(void);
+
+#ifdef EFI_DEBUG
+void debug_break(void);
+extern UINT8 _text, _data;
+/* Report the relocated position of text and data sections so that a debugger
+ * can attach to us. See debug-sd-boot.sh for how this can be done. */
+#  define debug_hook(identity) Print(identity L"@0x%x,0x%x\n", &_text, &_data)
+#else
+#  define debug_hook(identity)
+#endif