source: bootcd/isolinux/syslinux-6.03/efi/efi.h

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#ifndef _SYSLINUX_EFI_H
2#define _SYSLINUX_EFI_H
3
4#include <syslinux/config.h>
5#include <core.h>
6#include <sys/types.h>  /* needed for off_t */
7//#include <syslinux/version.h> /* avoid redefinition of __STDC_VERSION__ */
8
9/*
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().
14 *
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.
18 */
19#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
20  #define GNU_EFI_USE_MS_ABI 1
21#endif
22
23#include <efi.h>
24#include <efilib.h>
25#include <efistdarg.h>
26
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
31
32struct efi_disk_private {
33        EFI_HANDLE dev_handle;
34        EFI_BLOCK_IO *bio;
35        EFI_DISK_IO *dio;
36};
37
38struct efi_binding {
39    EFI_SERVICE_BINDING *binding;
40    EFI_HANDLE parent;
41    EFI_HANDLE child;
42    EFI_HANDLE this;
43};
44
45extern EFI_HANDLE image_handle;
46
47struct screen_info;
48extern void setup_screen(struct screen_info *);
49
50extern void efi_write_char(uint8_t, uint8_t);
51
52enum heap;
53extern void *efi_malloc(size_t, enum heap, size_t);
54extern void *efi_realloc(void *, size_t);
55extern void efi_free(void *);
56
57extern struct efi_binding *efi_create_binding(EFI_GUID *, EFI_GUID *);
58extern void efi_destroy_binding(struct efi_binding *, EFI_GUID *);
59
60static inline EFI_STATUS
61efi_setup_event(EFI_EVENT *ev, EFI_EVENT_NOTIFY func, void *ctx)
62{
63    EFI_STATUS status;
64
65    status = uefi_call_wrapper(BS->CreateEvent, 5, EVT_NOTIFY_SIGNAL,
66                               TPL_CALLBACK, func, ctx, ev);
67    return status;
68}
69
70extern void efi_derivative(enum syslinux_filesystem fs);
71
72struct boot_params;
73typedef void (handover_func_t)(void *, EFI_SYSTEM_TABLE *,
74                               struct boot_params *, unsigned long);
75
76handover_func_t efi_handover_32;
77handover_func_t efi_handover_64;
78handover_func_t efi_handover;
79
80extern void efi_console_save(void);
81extern void efi_console_restore(void);
82
83#endif /* _SYSLINUX_EFI_H */
Note: See TracBrowser for help on using the repository browser.