]> code.delx.au - refind/commitdiff
Initial steps of purging GPLv2 code from core filesystem functions,
authorsrs5694 <srs5694@users.sourceforge.net>
Tue, 1 Jul 2014 02:37:08 +0000 (22:37 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Tue, 1 Jul 2014 02:37:08 +0000 (22:37 -0400)
since it's incompatible with the GPLv3 used by the Btrfs driver (and
maybe ext4fs).

filesystems/fsw_base.h
filesystems/fsw_efi.c
filesystems/fsw_efi.h
filesystems/fsw_efi_base.h
filesystems/fsw_efi_edk2_base.h
filesystems/fsw_strfunc.h
filesystems/scandisk.c

index 31b78dc01e15d8be6caf54777237e77e4fdea6e6..2f6dc5ff3eefe5e75c87ec2521f8d7a9872747de 100644 (file)
@@ -1,18 +1,6 @@
-/* $Id: fsw_base.h 29125 2010-05-06 09:43:05Z vboxsync $ */
-/** @file
- * fsw_base.h - Base definitions switch.
- */
-
-/*
- * Copyright (C) 2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+/**
+ * \file fsw_base.h
+ * Base definitions switch.
  */
 
 /*-
index 4c5dafd27337d82b39617ba673ab6cf640bd529e..add1bd878a48d3ef13979bff584fba202d3ca930 100644 (file)
@@ -1,23 +1,9 @@
-/* $Id: fsw_efi.c 29125 2010-05-06 09:43:05Z vboxsync $ */
-/** @file
- * fsw_efi.c - EFI host environment code.
- */
-
-/*
- * Copyright (C) 2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+/**
+ * \file fsw_efi.c
+ * EFI host environment code.
  */
 
 /*-
- * This code is based on:
- *
  * Copyright (c) 2006 Christoph Pfisterer
  *
  * Redistribution and use in source and binary forms, with or without
 #define DEBUG_LEVEL 0
 
 #ifndef FSTYPE
-#error FSTYPE must be defined!
-#endif
-
-#define DEBUG_VBFS 1
-
-#if DEBUG_VBFS==2
-#define DBG(x...)  AsciiPrint(x)
-#elif DEBUG_VBFS==1
-#define DBG(x...)  BootLog(x)
-#else
-#define DBG(x...)
+/** The file system type name to use. */
+#define FSTYPE ext2
 #endif
 
 #ifdef __MAKEWITH_GNUEFI
 
 EFI_GUID gEfiDriverBindingProtocolGuid = EFI_DRIVER_BINDING_PROTOCOL_GUID;
 EFI_GUID gEfiComponentNameProtocolGuid = EFI_COMPONENT_NAME_PROTOCOL_GUID;
-EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID;
-EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
+extern EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID;
+extern EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
 EFI_GUID gEfiFileInfoGuid = EFI_FILE_INFO_ID;
 EFI_GUID gEfiFileSystemInfoGuid = EFI_FILE_SYSTEM_INFO_ID;
 EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
-#define SimpleFileSystemProtocol FileSystemProtocol
+#define gEfiSimpleFileSystemProtocolGuid FileSystemProtocol
 #endif
 
 /** Helper macro for stringification. */
@@ -214,7 +191,6 @@ struct fsw_host_table   fsw_efi_host_table = {
 
 extern struct fsw_fstype_table   FSW_FSTYPE_TABLE_NAME(FSTYPE);
 
-//#include "OverrideFunctions-kabyl.edk2.c.include"
 
 static VOID EFIAPI fsw_efi_clear_cache(VOID) {
    int i;
@@ -302,7 +278,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
 
     // first, open DiskIO
     Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-                              &PROTO_NAME(DiskIoProtocol),
+                              &gEfiDiskIoProtocolGuid,
                               (VOID **) &DiskIo,
                               This->DriverBindingHandle,
                               ControllerHandle,
@@ -312,13 +288,13 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Supported(IN EFI_DRIVER_BINDING_PROTOCOL
 
     // we were just checking, close it again
     refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
-                      &PROTO_NAME(DiskIoProtocol),
+                      &gEfiDiskIoProtocolGuid,
                       This->DriverBindingHandle,
                       ControllerHandle);
 
     // next, check BlockIO without actually opening it
     Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-                              &PROTO_NAME(BlockIoProtocol),
+                              &gEfiBlockIoProtocolGuid,
                               NULL,
                               This->DriverBindingHandle,
                               ControllerHandle,
@@ -354,7 +330,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL  *T
 
     // open consumed protocols
     Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-                              &PROTO_NAME(BlockIoProtocol),
+                              &gEfiBlockIoProtocolGuid,
                               (VOID **) &BlockIo,
                               This->DriverBindingHandle,
                               ControllerHandle,
@@ -365,12 +341,13 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL  *T
     }
 
     Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-                              &PROTO_NAME(DiskIoProtocol),
+                              &gEfiDiskIoProtocolGuid,
                               (VOID **) &DiskIo,
                               This->DriverBindingHandle,
                               ControllerHandle,
                               EFI_OPEN_PROTOCOL_BY_DRIVER);
     if (EFI_ERROR(Status)) {
+        Print(L"Fsw ERROR: OpenProtocol(DiskIo) returned %x\n", Status);
         return Status;
     }
 
@@ -392,7 +369,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL  *T
         Volume->FileSystem.Revision     = EFI_FILE_IO_INTERFACE_REVISION;
         Volume->FileSystem.OpenVolume   = fsw_efi_FileSystem_OpenVolume;
         Status = refit_call4_wrapper(BS->InstallMultipleProtocolInterfaces, &ControllerHandle,
-                                                       &PROTO_NAME(SimpleFileSystemProtocol),
+                                                       &gEfiSimpleFileSystemProtocolGuid,
                                                        &Volume->FileSystem,
                                                        NULL);
         if (EFI_ERROR(Status)) {
@@ -407,7 +384,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Start(IN EFI_DRIVER_BINDING_PROTOCOL  *T
         FreePool(Volume);
 
         refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
-                          &PROTO_NAME(DiskIoProtocol),
+                          &gEfiDiskIoProtocolGuid,
                           This->DriverBindingHandle,
                           ControllerHandle);
     }
@@ -440,7 +417,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN  EFI_DRIVER_BINDING_PROTOCOL  *T
 
     // get the installed SimpleFileSystem interface
     Status = refit_call6_wrapper(BS->OpenProtocol, ControllerHandle,
-                              &PROTO_NAME(SimpleFileSystemProtocol),
+                              &gEfiSimpleFileSystemProtocolGuid,
                               (VOID **) &FileSystem,
                               This->DriverBindingHandle,
                               ControllerHandle,
@@ -453,7 +430,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN  EFI_DRIVER_BINDING_PROTOCOL  *T
 
     // uninstall Simple File System protocol
     Status = refit_call4_wrapper(BS->UninstallMultipleProtocolInterfaces, ControllerHandle,
-                                                     &PROTO_NAME(SimpleFileSystemProtocol), &Volume->FileSystem,
+                                                     &gEfiSimpleFileSystemProtocolGuid, &Volume->FileSystem,
                                                      NULL);
     if (EFI_ERROR(Status)) {
  //       Print(L"Fsw ERROR: UninstallMultipleProtocolInterfaces returned %x\n", Status);
@@ -470,7 +447,7 @@ EFI_STATUS EFIAPI fsw_efi_DriverBinding_Stop(IN  EFI_DRIVER_BINDING_PROTOCOL  *T
 
     // close the consumed protocols
     Status = refit_call4_wrapper(BS->CloseProtocol, ControllerHandle,
-                               &PROTO_NAME(DiskIoProtocol),
+                               &gEfiDiskIoProtocolGuid,
                                This->DriverBindingHandle,
                                ControllerHandle);
 
index f323db5cf2690a56f173fc2e0cdf787594521c66..bc9dac3c991c6b89696a7cf4dfacb34d51e4b904 100644 (file)
@@ -1,24 +1,10 @@
-/* $Id: fsw_efi.h 33540 2010-10-28 09:27:05Z vboxsync $ */
-/** @file
- * fsw_efi.h - EFI host environment header.
- */
-
-/*
- * Copyright (C) 2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
+/**
+ * \file fsw_efi.h
+ * EFI host environment header.
+*/
 
 /*-
- * This code is based on:
- *
- * Copyright (c) 2006 Christoph Pfisterer
+  * Copyright (c) 2006 Christoph Pfisterer
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -58,9 +44,6 @@
 #define CompareGuid(a, b) CompareGuid(a, b)==0
 #endif
 
-// extern CHAR8     *msgCursor;
-// extern MESSAGE_LOG_PROTOCOL *Msg;
-
 /**
  * EFI Host: Private per-volume structure.
  */
index 533be9334bb0ca58d35b283633343427edbfa0ef..37d20ed809d64e37b272fa202e895952b8a0e532 100644 (file)
@@ -59,7 +59,7 @@
 // Intel EFI Toolkit
 #include <efi.h>
 #include <efilib.h>
-#define PROTO_NAME(x) x
+//#define PROTO_NAME(x) x
 #endif
 
 #define FSW_LITTLE_ENDIAN (1)
index 27c6d58bcf02e522312b70fa0808e13223edb3a1..4552829cb430eb3dea5addef330b4a13c31cd1db 100644 (file)
@@ -76,7 +76,7 @@
 # include <Protocol/ComponentName.h>
 
 # define BS gBS
-# define PROTO_NAME(x) gEfi ## x ## Guid
+//# define PROTO_NAME(x) gEfi ## x ## Guid
 # define GUID_NAME(x) gEfi ## x ## Guid
 
 # define EFI_FILE_HANDLE_REVISION EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION
index 61cf25d8732aac2c992055d213554f89ee15b780..8bbbb26ad45bbf79349c1596d69603f9572b9e93 100644 (file)
@@ -1,20 +1,3 @@
-/* $Id: fsw_strfunc.h 29125 2010-05-06 09:43:05Z vboxsync $ */
-/** @file
- * fsw_strfunc.h
- */
-
-/*
- * Copyright (C) 2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
 /* fsw_strfunc.h generated by mk_fsw_strfunc.py */
 
 static int fsw_streq_ISO88591_UTF8(void *s1data, void *s2data, int len)
@@ -43,7 +26,7 @@ static int fsw_streq_ISO88591_UTF8(void *s1data, void *s2data, int len)
     return 1;
 }
 
-#ifndef HOST_EFI
+#ifdef __MAKEWITH_TIANO
 static int fsw_streq_ISO88591_UTF16(void *s1data, void *s2data, int len)
 {
     int i;
index b175c9ef3939cafc0fcf7194b94c743ca6540c65..6ae5cf8f14326872aae4186ed99aac964a226688 100644 (file)
@@ -9,6 +9,8 @@
 #ifdef __MAKEWITH_GNUEFI
 #include "edk2/DriverBinding.h"
 #include "edk2/ComponentName.h"
+extern EFI_GUID gEfiDiskIoProtocolGuid;
+extern EFI_GUID gEfiBlockIoProtocolGuid;
 #endif
 #include "../include/refit_call_wrapper.h"
 
@@ -82,16 +84,16 @@ static int scan_disks(int (*hook)(struct fsw_volume *, struct fsw_volume *), str
     Print(L" ");
 #endif
     DPRINT(L"Scanning disks\n");
-    Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &PROTO_NAME(DiskIoProtocol), NULL, &HandleCount, &Handles);
+    Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &gEfiDiskIoProtocolGuid, NULL, &HandleCount, &Handles);
     if (Status == EFI_NOT_FOUND)
         return -1;  // no filesystems. strange, but true...
     for (i = 0; i < HandleCount; i++) {
         EFI_DISK_IO *diskio;
         EFI_BLOCK_IO *blockio;
-        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &PROTO_NAME(DiskIoProtocol), (VOID **) &diskio);
+        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiDiskIoProtocolGuid, (VOID **) &diskio);
         if (Status != 0)
             continue;
-        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &PROTO_NAME(BlockIoProtocol), (VOID **) &blockio);
+        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiBlockIoProtocolGuid, (VOID **) &blockio);
         if (Status != 0)
             continue;
         struct fsw_volume *vol = create_dummy_volume(diskio, blockio->Media->MediaId);