efi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Western Digital Corporation or its affiliates.
  4. */
  5. #ifndef _ASM_EFI_H
  6. #define _ASM_EFI_H
  7. #include <asm/csr.h>
  8. #include <asm/io.h>
  9. #include <asm/mmu_context.h>
  10. #include <asm/ptrace.h>
  11. #include <asm/tlbflush.h>
  12. #include <asm/pgalloc.h>
  13. #ifdef CONFIG_EFI
  14. extern void efi_init(void);
  15. #else
  16. #define efi_init()
  17. #endif
  18. int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
  19. int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
  20. #define arch_efi_call_virt_setup() ({ \
  21. sync_kernel_mappings(efi_mm.pgd); \
  22. efi_virtmap_load(); \
  23. })
  24. #define arch_efi_call_virt_teardown() efi_virtmap_unload()
  25. #define ARCH_EFI_IRQ_FLAGS_MASK (SR_IE | SR_SPIE)
  26. /* Load initrd anywhere in system RAM */
  27. static inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr)
  28. {
  29. return ULONG_MAX;
  30. }
  31. #define alloc_screen_info(x...) (&screen_info)
  32. static inline void free_screen_info(struct screen_info *si)
  33. {
  34. }
  35. void efi_virtmap_load(void);
  36. void efi_virtmap_unload(void);
  37. #endif /* _ASM_EFI_H */