Mercurial > hg > Members > taiki > EFITest
view bootx64.c @ 4:14b7a92d960b
delete many comment
author | taiki |
---|---|
date | Wed, 26 Mar 2014 06:38:36 +0900 |
parents | 259b5f0e03ba |
children | 3b3650b792e3 |
line wrap: on
line source
#include <efi.h> #include <efilib.h> #include "registers.h" EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) { InitializeLib(image, systab); Print(L"test start.\n"); UINTN map_size, cookie, size, version; map_size = EFI_PAGE_SIZE * 2; EFI_MEMORY_DESCRIPTOR *md; EFI_STATUS status = uefi_call_wrapper(BS->AllocatePool, 3, EfiLoaderData, map_size, &md); if (EFI_ERROR(status)) { Print(L"error 'allocate pool' %r \n", status); } status = uefi_call_wrapper(BS->GetMemoryMap, 5, &map_size, md, &cookie, &size, &version); if (EFI_ERROR(status)) { Print(L"error 'get memory map' %r \n", status); } status = uefi_call_wrapper(BS->ExitBootServices, 2, image, cookie); if (EFI_ERROR(status)) { Print(L"error 'exit boot services' %r \n", status); } asm volatile ("cli" ::); cr0_t cr0; asm volatile("mov %%cr0,%0\n\t" : "=r" (cr0)); while(1) { } cr0.pg = 0; asm volatile("mov %0, %%cr0" : : "r" (cr0)); return EFI_SUCCESS; }