efistub.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _DRIVERS_FIRMWARE_EFI_EFISTUB_H
  2. #define _DRIVERS_FIRMWARE_EFI_EFISTUB_H
  3. /* error code which can't be mistaken for valid address */
  4. #define EFI_ERROR (~0UL)
  5. /*
  6. * __init annotations should not be used in the EFI stub, since the code is
  7. * either included in the decompressor (x86, ARM) where they have no effect,
  8. * or the whole stub is __init annotated at the section level (arm64), by
  9. * renaming the sections, in which case the __init annotation will be
  10. * redundant, and will result in section names like .init.init.text, and our
  11. * linker script does not expect that.
  12. */
  13. #undef __init
  14. void efi_char16_printk(efi_system_table_t *, efi_char16_t *);
  15. efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, void *__image,
  16. void **__fh);
  17. efi_status_t efi_file_size(efi_system_table_t *sys_table_arg, void *__fh,
  18. efi_char16_t *filename_16, void **handle,
  19. u64 *file_sz);
  20. efi_status_t efi_file_read(void *handle, unsigned long *size, void *addr);
  21. efi_status_t efi_file_close(void *handle);
  22. unsigned long get_dram_base(efi_system_table_t *sys_table_arg);
  23. efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
  24. unsigned long orig_fdt_size,
  25. void *fdt, int new_fdt_size, char *cmdline_ptr,
  26. u64 initrd_addr, u64 initrd_size,
  27. efi_memory_desc_t *memory_map,
  28. unsigned long map_size, unsigned long desc_size,
  29. u32 desc_ver);
  30. efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table,
  31. void *handle,
  32. unsigned long *new_fdt_addr,
  33. unsigned long max_addr,
  34. u64 initrd_addr, u64 initrd_size,
  35. char *cmdline_ptr,
  36. unsigned long fdt_addr,
  37. unsigned long fdt_size);
  38. void *get_fdt(efi_system_table_t *sys_table, unsigned long *fdt_size);
  39. void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size,
  40. unsigned long desc_size, efi_memory_desc_t *runtime_map,
  41. int *count);
  42. efi_status_t efi_get_random_bytes(efi_system_table_t *sys_table,
  43. unsigned long size, u8 *out);
  44. efi_status_t efi_random_alloc(efi_system_table_t *sys_table_arg,
  45. unsigned long size, unsigned long align,
  46. unsigned long *addr, unsigned long random_seed);
  47. efi_status_t check_platform_features(efi_system_table_t *sys_table_arg);
  48. #endif