1 #ifndef _SYSLINUX_EFI_H
2 #define _SYSLINUX_EFI_H
4 #include <syslinux/config.h>
6 #include <sys/types.h> /* needed for off_t */
7 //#include <syslinux/version.h> /* avoid redefinition of __STDC_VERSION__ */
10 * gnu-efi >= 3.0s enables GNU_EFI_USE_MS_ABI by default, which means
11 * that we must also enable it if supported by the compiler. Note that
12 * failing to enable GNU_EFI_USE_MS_ABI if gnu-efi was compiled with
13 * it on will result in undefined references to uefi_call_wrapper().
15 * The reason we don't attempt to check the version of gnu-efi we're
16 * building against is because there's no harm in turning it on for
17 * older versions - it will just be ignored.
19 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
20 #define GNU_EFI_USE_MS_ABI 1
25 #include <efistdarg.h>
27 /* Delay for 100 ms */
28 #define EFI_NOMAP_PRINT_DELAY 100
29 /* We should keep EFI_NOMAP_PRINT_COUNT at 10 to limit flooding the console */
30 #define EFI_NOMAP_PRINT_COUNT 10
32 struct efi_disk_private
{
33 EFI_HANDLE dev_handle
;
39 EFI_SERVICE_BINDING
*binding
;
45 extern EFI_HANDLE image_handle
;
48 extern void setup_screen(struct screen_info
*);
50 extern void efi_write_char(uint8_t, uint8_t);
53 extern void *efi_malloc(size_t, enum heap
, size_t);
54 extern void *efi_realloc(void *, size_t);
55 extern void efi_free(void *);
57 extern struct efi_binding
*efi_create_binding(EFI_GUID
*, EFI_GUID
*);
58 extern void efi_destroy_binding(struct efi_binding
*, EFI_GUID
*);
60 static inline EFI_STATUS
61 efi_setup_event(EFI_EVENT
*ev
, EFI_EVENT_NOTIFY func
, void *ctx
)
65 status
= uefi_call_wrapper(BS
->CreateEvent
, 5, EVT_NOTIFY_SIGNAL
,
66 TPL_CALLBACK
, func
, ctx
, ev
);
70 extern void efi_derivative(enum syslinux_filesystem fs
);
73 typedef void (handover_func_t
)(void *, EFI_SYSTEM_TABLE
*,
74 struct boot_params
*, unsigned long);
76 handover_func_t efi_handover_32
;
77 handover_func_t efi_handover_64
;
78 handover_func_t efi_handover
;
80 extern void efi_console_save(void);
81 extern void efi_console_restore(void);
83 #endif /* _SYSLINUX_EFI_H */