Ard Biesheuvel | da58fb6 | 2015-09-24 13:49:52 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2015 Linaro Ltd <ard.biesheuvel@linaro.org> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #ifndef __ASM_ARM_EFI_H |
| 10 | #define __ASM_ARM_EFI_H |
| 11 | |
| 12 | #include <asm/cacheflush.h> |
| 13 | #include <asm/cachetype.h> |
| 14 | #include <asm/early_ioremap.h> |
| 15 | #include <asm/fixmap.h> |
| 16 | #include <asm/highmem.h> |
| 17 | #include <asm/mach/map.h> |
| 18 | #include <asm/mmu_context.h> |
| 19 | #include <asm/pgtable.h> |
| 20 | |
| 21 | #ifdef CONFIG_EFI |
| 22 | void efi_init(void); |
| 23 | |
| 24 | int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); |
| 25 | |
| 26 | #define efi_call_virt(f, ...) \ |
| 27 | ({ \ |
| 28 | efi_##f##_t *__f; \ |
| 29 | efi_status_t __s; \ |
| 30 | \ |
| 31 | efi_virtmap_load(); \ |
| 32 | __f = efi.systab->runtime->f; \ |
| 33 | __s = __f(__VA_ARGS__); \ |
| 34 | efi_virtmap_unload(); \ |
| 35 | __s; \ |
| 36 | }) |
| 37 | |
| 38 | #define __efi_call_virt(f, ...) \ |
| 39 | ({ \ |
| 40 | efi_##f##_t *__f; \ |
| 41 | \ |
| 42 | efi_virtmap_load(); \ |
| 43 | __f = efi.systab->runtime->f; \ |
| 44 | __f(__VA_ARGS__); \ |
| 45 | efi_virtmap_unload(); \ |
| 46 | }) |
| 47 | |
| 48 | static inline void efi_set_pgd(struct mm_struct *mm) |
| 49 | { |
| 50 | check_and_switch_context(mm, NULL); |
| 51 | } |
| 52 | |
| 53 | void efi_virtmap_load(void); |
| 54 | void efi_virtmap_unload(void); |
| 55 | |
| 56 | #else |
| 57 | #define efi_init() |
| 58 | #endif /* CONFIG_EFI */ |
| 59 | |
| 60 | #endif /* _ASM_ARM_EFI_H */ |