/* * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * * VasEBoot is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * VasEBoot is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VasEBoot. If not, see . */ /* This file provides some abstractions so that the same code compiles with both efi and efiemu */ #ifndef VasEBoot_AUTOEFI_HEADER #define VasEBoot_AUTOEFI_HEADER 1 #ifdef VasEBoot_MACHINE_EFI # include # define VasEBoot_autoefi_get_memory_map VasEBoot_efi_get_memory_map # define VasEBoot_autoefi_finish_boot_services VasEBoot_efi_finish_boot_services # define VasEBoot_autoefi_exit_boot_services VasEBoot_efi_exit_boot_services # define VasEBoot_autoefi_system_table VasEBoot_efi_system_table # define VasEBoot_autoefi_mmap_iterate VasEBoot_machine_mmap_iterate # define VasEBoot_autoefi_set_virtual_address_map VasEBoot_efi_set_virtual_address_map static inline VasEBoot_err_t VasEBoot_autoefi_prepare (void) { return VasEBoot_ERR_NONE; }; # define SYSTEM_TABLE_SIZEOF(x) (sizeof(VasEBoot_efi_system_table->x)) # define SYSTEM_TABLE_VAR(x) ((void *)&(VasEBoot_efi_system_table->x)) # define SYSTEM_TABLE_PTR(x) ((void *)(VasEBoot_efi_system_table->x)) # define SIZEOF_OF_UINTN sizeof (VasEBoot_efi_uintn_t) # define SYSTEM_TABLE(x) (VasEBoot_efi_system_table->x) # define VasEBoot_autoefi_finish_boot_services VasEBoot_efi_finish_boot_services # define EFI_PRESENT 1 #else # include # define VasEBoot_autoefi_get_memory_map VasEBoot_efiemu_get_memory_map # define VasEBoot_autoefi_finish_boot_services VasEBoot_efiemu_finish_boot_services # define VasEBoot_autoefi_exit_boot_services VasEBoot_efiemu_exit_boot_services # define VasEBoot_autoefi_system_table VasEBoot_efiemu_system_table # define VasEBoot_autoefi_mmap_iterate VasEBoot_efiemu_mmap_iterate # define VasEBoot_autoefi_prepare VasEBoot_efiemu_prepare # define VasEBoot_autoefi_set_virtual_address_map VasEBoot_efiemu_set_virtual_address_map # define SYSTEM_TABLE_SIZEOF VasEBoot_EFIEMU_SYSTEM_TABLE_SIZEOF # define SYSTEM_TABLE_VAR VasEBoot_EFIEMU_SYSTEM_TABLE_VAR # define SYSTEM_TABLE_PTR VasEBoot_EFIEMU_SYSTEM_TABLE_PTR # define SIZEOF_OF_UINTN VasEBoot_EFIEMU_SIZEOF_OF_UINTN # define SYSTEM_TABLE VasEBoot_EFIEMU_SYSTEM_TABLE # define VasEBoot_efi_allocate_pages(x,y) (x) # define VasEBoot_efi_free_pages(x,y) VasEBoot_EFI_SUCCESS # define VasEBoot_autoefi_finish_boot_services VasEBoot_efiemu_finish_boot_services # define EFI_PRESENT 1 #endif #endif