diff boot/bootx64.c @ 20:5e184d4c01b8

test uefi call wrapper now
author taiki
date Sun, 10 Feb 2013 00:15:05 +0900
parents 2fbe46f63d4c
children e3accb15b1bb
line wrap: on
line diff
--- a/boot/bootx64.c	Fri Feb 08 19:12:05 2013 +0900
+++ b/boot/bootx64.c	Sun Feb 10 00:15:05 2013 +0900
@@ -8,6 +8,13 @@
 #include "bootx64.h"
 #include "mach-o/mach_o.h"
 
+extern EFI_STATUS open(fs_t *fs, EFI_FILE_HANDLE *fd, CHAR16 *name); 
+extern EFI_STATUS close(fs_t *fs, EFI_FILE_HANDLE *fd);
+extern EFI_STATUS read(fs_t *fs, EFI_FILE_HANDLE *fd, VOID *buf, UINTN *size);
+extern EFI_STATUS seek(fs_t *fs, EFI_FILE_HANDLE *fd, UINTN newpos);
+extern EFI_STATUS load(fs_t *fs, EFI_FILE_HANDLE *fd, CHAR16 *kname);
+extern EFI_STATUS config_fs(fs_t *fs,EFI_HANDLE boot_handle, dev_tab_t *boot_dev);
+
 static inline void
 start_kernel()
 {
@@ -24,10 +31,11 @@
     CHAR16 *kname = L"kernel";
     Print(L"Boot start. %s\n", kname);
 
-    uefi_call_wrapper(BS->SetWatchdogTimer, 4, 0, 0x0, 0, NULL);
+    EFI_STATUS status = uefi_call_wrapper(BS->SetWatchdogTimer, 4, 0, 0x0, 0, NULL);
+    if (EFI_ERROR(status)) return status;
     Print(L"Set watchdog timer.\n");
 
-    EFI_STATUS status = uefi_call_wrapper(BS->HandleProtocol, 3, image, &LoadedImageProtocol, (VOID **) &info);
+    status = uefi_call_wrapper(BS->HandleProtocol, 3, image, &LoadedImageProtocol, (VOID **) &info);
     if (EFI_ERROR(status)) {
         Print(L"Load error.\n");
         return EFI_LOAD_ERROR;
@@ -35,7 +43,7 @@
 
     fs_t fs;
     dev_tab_t boot_dev;
-    status = config_fs(info->DeviceHandle, &fs, &boot_dev);
+    status = config_fs(&fs, info->DeviceHandle ,&boot_dev);
 
     EFI_FILE_HANDLE fd;
     open(&fs, &fd, kname);