]> code.delx.au - refind/commitdiff
Cleanup include files in filesystem directory, prepare to run tests
authorStefan Agner <stefan@agner.ch>
Tue, 11 Dec 2012 15:36:34 +0000 (16:36 +0100)
committerStefan Agner <stefan@agner.ch>
Tue, 11 Dec 2012 18:21:28 +0000 (19:21 +0100)
filesystems/Make.tiano
filesystems/fsw_base.h
filesystems/fsw_core.h
filesystems/fsw_efi.c
filesystems/fsw_efi_base.h
filesystems/fsw_efi_edk2_base.h [moved from filesystems/VBoxFswParam.h with 57% similarity]
filesystems/fsw_efi_lib.c
filesystems/hfs_format.h

index 9eea2216c440c031124718683b27502b07ee41c2..f709b3e1d7757a14f696466907e92265efe6aa54 100644 (file)
@@ -62,7 +62,7 @@ BUILDME          = $(DRIVERNAME)_$(FILENAME_CODE).efi
 
 OPTIMFLAGS      = -fno-strict-aliasing -mno-red-zone -Wno-address -Os
 DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
-CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h
+CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h -DHOST_EFI_EDK2
 
 prefix          = /usr/bin/
 CC              = $(prefix)gcc
index 0d5e7baf7bf3c1dc875738b5452db58b131bfa99..3405f574b265c873e00691e1ae378f8e2b4f4041 100644 (file)
 
 #ifndef _FSW_BASE_H_
 #define _FSW_BASE_H_
-//#define HOST_EFI 1
-#define VBOX
 
-#ifdef VBOX
-#include "VBoxFswParam.h"
+#ifdef HOST_EFI_EDK2
+#define HOST_EFI
 #endif
 
-//#include <Protocol/MsgLog.h> 
-
 #ifndef FSW_DEBUG_LEVEL
 /**
  * Global debugging level. Can be set locally for the scope of a single
index 4464cbd80545c24978d4fd50fb21232d2b40da38..db26fc7e35c4f1a65b6fc544c702a1e5d4bb5484 100644 (file)
@@ -58,7 +58,7 @@
 
 
 /** Maximum size for a path, specifically symlink target paths. */
-#ifndef VBOX
+#ifndef HOST_EFI_EDK2
 #define FSW_PATH_MAX (4096)
 #else
 /* Too big allocations are handled with alloca() */
index 1193684f3dd6a2bb2e49d2997415905f27dc68ec..7df71aa740371174225f44d436decf246a3f4ce5 100644 (file)
 #define DEBUG_LEVEL 0
 
 #ifndef FSTYPE
-#ifdef VBOX
 #error FSTYPE must be defined!
-#else
-#define FSTYPE ext2
-#endif
 #endif
 
 #define DEBUG_VBFS 1
@@ -192,7 +188,8 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE         ImageHandle,
 {
     EFI_STATUS  Status;
 
-#ifndef VBOX
+#ifndef HOST_EFI_EDK2
+    // Not available in EDK2 toolkit
     InitializeLib(ImageHandle, SystemTable);
 #endif
 
index 7c7af7507ebdd034f3ffe22e99d90e0d86a0b6f5..533be9334bb0ca58d35b283633343427edbfa0ef 100644 (file)
 #ifndef _FSW_EFI_BASE_H_
 #define _FSW_EFI_BASE_H_
 
-#ifndef VBOX
+// If its EDK2 EFI Toolkit
+#ifdef HOST_EFI_EDK2
+#include "fsw_efi_edk2_base.h"
+#else
+// Intel EFI Toolkit
 #include <efi.h>
 #include <efilib.h>
 #define PROTO_NAME(x) x
similarity index 57%
rename from filesystems/VBoxFswParam.h
rename to filesystems/fsw_efi_edk2_base.h
index 0c44f8904097b2acce27a635df086eb8b596df94..a144a60f684975d6d6b5c275cef466100498e5b4 100644 (file)
@@ -1,8 +1,34 @@
-/* $Id: VBoxFswParam.h 29125 2010-05-06 09:43:05Z vboxsync $ */
-/** @file
- * VBoxFswParam.h
+/*
+ * Copyright (c) 2012 Stefan Agner
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *  * Neither the name of Christoph Pfisterer nor the names of the
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
 /*
  * Copyright (C) 2010 Oracle Corporation
  *
@@ -15,8 +41,8 @@
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
 
-#ifndef VBOXFSPARAM_H
-#define VBOXFSPARAM_H
+#ifndef _FSW_EFI_EDK2_BASE_H_
+#define _FSW_EFI_EDK2_BASE_H_
 /*
  * Here is common declarations for EDK<->EDK2 compatibility
  */
@@ -62,8 +88,8 @@
 //                      );
 
 //#define CompareGuid(x, y) CompareGuidEdk1((x),(y))
-# define HOST_EFI 1
 //# define FSW_DEBUG_LEVEL 3
 
 int fsw_streq_ISO88591_UTF16(void *s1data, void *s2data, int len);
+
 #endif
index 956e9ee40debed2d1cbabbe7cac65d8dc0239464..93a7ff1fa607110d7aa4cce6d5cd32182e3719e1 100644 (file)
@@ -140,7 +140,6 @@ VOID fsw_efi_strcpy(CHAR16 *Dest, struct fsw_string *src)
     }
 }
 
-#ifdef VBOX
 int fsw_streq_ISO88591_UTF16(void *s1data, void *s2data, int len)
 {
     int i;
@@ -157,6 +156,5 @@ int fsw_streq_ISO88591_UTF16(void *s1data, void *s2data, int len)
 
     return 1;
 }
-#endif
 
 // EOF
index 9b800e919925193feace5b9c41a77fef7ea587ee..0512dfa3c69243975c39ea369699898f8120593b 100644 (file)
@@ -47,7 +47,8 @@
 #ifndef __HFS_FORMAT__
 #define __HFS_FORMAT__
 
-#if !defined(VBOX) && !defined(HOST_POSIX)
+#if !defined(HOST_EFI_EDK2) && !defined(HOST_POSIX)
+// Only available on Mac? and Intel EFI Toolkit?
 #include <sys/types.h>
 #include <sys/appleapiopts.h>
 #endif