render / rpms / edk2

Forked from rpms/edk2 3 months ago
Clone

Blame basetools-arm.patch

Paolo Bonzini aedc70
diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile
Paolo Bonzini aedc70
index e0dde3e..bee0059 100644
Paolo Bonzini aedc70
--- a/BaseTools/Source/C/GNUmakefile
Paolo Bonzini aedc70
+++ b/BaseTools/Source/C/GNUmakefile
Paolo Bonzini aedc70
@@ -22,6 +22,9 @@ ifndef ARCH
Paolo Bonzini aedc70
   ifeq ($(uname_m),x86_64)
Paolo Bonzini aedc70
     ARCH=X64
Paolo Bonzini aedc70
   endif
Paolo Bonzini aedc70
+  ifeq ($(patsubst arm%,ARM,$(uname_m)),ARM)
Paolo Bonzini aedc70
+    ARCH=ARM
Paolo Bonzini aedc70
+  endif
Paolo Bonzini aedc70
   ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
Paolo Bonzini aedc70
     ARCH=IA32
Paolo Bonzini aedc70
   endif
Paolo Bonzini aedc70
diff --git a/BaseTools/Source/C/Include/Arm/ProcessorBind.h b/BaseTools/Source/C/Include/Arm/ProcessorBind.h
Paolo Bonzini aedc70
new file mode 100644
Paolo Bonzini aedc70
index 0000000..bea7e82
Paolo Bonzini aedc70
--- /dev/null
Paolo Bonzini aedc70
+++ b/BaseTools/Source/C/Include/Arm/ProcessorBind.h
Paolo Bonzini aedc70
@@ -0,0 +1,168 @@
Paolo Bonzini aedc70
+/** @file
Paolo Bonzini aedc70
+  Processor or Compiler specific defines and types for x64.
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+  This program and the accompanying materials are licensed and made available
Paolo Bonzini aedc70
+  under the terms and conditions of the BSD License which accompanies this
Paolo Bonzini aedc70
+  distribution.  The full text of the license may be found at:
Paolo Bonzini aedc70
+    http://opensource.org/licenses/bsd-license.php
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
Paolo Bonzini aedc70
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+  File Name:  ProcessorBind.h
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+**/
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#ifndef __PROCESSOR_BIND_H__
Paolo Bonzini aedc70
+#define __PROCESSOR_BIND_H__
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Define the processor type so other code can make processor based choices
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#define MDE_CPU_ARM
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Make sure we are useing the correct packing rules per EFI specification
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#ifndef __GNUC__
Paolo Bonzini aedc70
+#pragma pack()
Paolo Bonzini aedc70
+#endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#if _MSC_EXTENSIONS
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Disable warning that make it impossible to compile at /W4
Paolo Bonzini aedc70
+// This only works for Microsoft* tools
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Disabling bitfield type checking warnings.
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#pragma warning ( disable : 4214 )
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Disabling the unreferenced formal parameter warnings.
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#pragma warning ( disable : 4100 )
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Disable slightly different base types warning as CHAR8 * can not be set
Paolo Bonzini aedc70
+// to a constant string.
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#pragma warning ( disable : 4057 )
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#pragma warning ( disable : 4127 )
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
Paolo Bonzini aedc70
+  //
Paolo Bonzini aedc70
+  // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
Paolo Bonzini aedc70
+  //
Paolo Bonzini aedc70
+ 
Paolo Bonzini aedc70
+  #if _MSC_EXTENSIONS 
Paolo Bonzini aedc70
+    
Paolo Bonzini aedc70
+    //
Paolo Bonzini aedc70
+    // use Microsoft* C complier dependent interger width types 
Paolo Bonzini aedc70
+    //
Paolo Bonzini aedc70
+    typedef unsigned __int64    UINT64;
Paolo Bonzini aedc70
+    typedef __int64             INT64;
Paolo Bonzini aedc70
+    typedef unsigned __int32    UINT32;
Paolo Bonzini aedc70
+    typedef __int32             INT32;
Paolo Bonzini aedc70
+    typedef unsigned short      UINT16;
Paolo Bonzini aedc70
+    typedef unsigned short      CHAR16;
Paolo Bonzini aedc70
+    typedef short               INT16;
Paolo Bonzini aedc70
+    typedef unsigned char       BOOLEAN;
Paolo Bonzini aedc70
+    typedef unsigned char       UINT8;
Paolo Bonzini aedc70
+    typedef char                CHAR8;
Paolo Bonzini aedc70
+    typedef char                INT8;
Paolo Bonzini aedc70
+  #else
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+    //
Paolo Bonzini aedc70
+    // Assume standard IA-32 alignment. 
Paolo Bonzini aedc70
+    // BugBug: Need to check portability of long long
Paolo Bonzini aedc70
+    //
Paolo Bonzini aedc70
+    typedef unsigned long long  UINT64;
Paolo Bonzini aedc70
+    typedef long long           INT64;
Paolo Bonzini aedc70
+    typedef unsigned int        UINT32;
Paolo Bonzini aedc70
+    typedef int                 INT32;
Paolo Bonzini aedc70
+    typedef unsigned short      UINT16;
Paolo Bonzini aedc70
+    typedef unsigned short      CHAR16;
Paolo Bonzini aedc70
+    typedef short               INT16;
Paolo Bonzini aedc70
+    typedef unsigned char       BOOLEAN;
Paolo Bonzini aedc70
+    typedef unsigned char       UINT8;
Paolo Bonzini aedc70
+    typedef char                CHAR8;
Paolo Bonzini aedc70
+    typedef char                INT8;
Paolo Bonzini aedc70
+  #endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+  #define UINT8_MAX 0xff
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#else
Paolo Bonzini aedc70
+  //
Paolo Bonzini aedc70
+  // Use ANSI C 2000 stdint.h integer width declarations
Paolo Bonzini aedc70
+  //
Paolo Bonzini aedc70
+  #include "stdint.h"
Paolo Bonzini aedc70
+  typedef uint8_t   BOOLEAN;
Paolo Bonzini aedc70
+  typedef int8_t    INT8;
Paolo Bonzini aedc70
+  typedef uint8_t   UINT8;
Paolo Bonzini aedc70
+  typedef int16_t   INT16;
Paolo Bonzini aedc70
+  typedef uint16_t  UINT16;
Paolo Bonzini aedc70
+  typedef int32_t   INT32;
Paolo Bonzini aedc70
+  typedef uint32_t  UINT32;
Paolo Bonzini aedc70
+  typedef int64_t   INT64;
Paolo Bonzini aedc70
+  typedef uint64_t  UINT64;
Paolo Bonzini aedc70
+  typedef char      CHAR8;
Paolo Bonzini aedc70
+  typedef uint16_t  CHAR16;
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+typedef UINT32  UINTN;
Paolo Bonzini aedc70
+typedef INT32   INTN;
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Processor specific defines
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#define MAX_BIT     0x80000000
Paolo Bonzini aedc70
+#define MAX_2_BITS  0xC0000000
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Maximum legal IA-32 address
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#define MAX_ADDRESS   0xFFFFFFFF
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// Modifier to ensure that all protocol member functions and EFI intrinsics
Paolo Bonzini aedc70
+// use the correct C calling convention. All protocol member functions and
Paolo Bonzini aedc70
+// EFI intrinsics are required to modify their member functions with EFIAPI.
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#if _MSC_EXTENSIONS
Paolo Bonzini aedc70
+  //
Paolo Bonzini aedc70
+  // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
Paolo Bonzini aedc70
+  // 
Paolo Bonzini aedc70
+  #define EFIAPI 
Paolo Bonzini aedc70
+#endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#if __GNUC__
Paolo Bonzini aedc70
+  #define EFIAPI 
Paolo Bonzini aedc70
+#endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+// The Microsoft* C compiler can removed references to unreferenced data items
Paolo Bonzini aedc70
+//  if the /OPT:REF linker option is used. We defined a macro as this is a 
Paolo Bonzini aedc70
+//  a non standard extension
Paolo Bonzini aedc70
+//
Paolo Bonzini aedc70
+#if _MSC_EXTENSIONS
Paolo Bonzini aedc70
+  #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
Paolo Bonzini aedc70
+#else
Paolo Bonzini aedc70
+  #define GLOBAL_REMOVE_IF_UNREFERENCED
Paolo Bonzini aedc70
+#endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
+#endif
Paolo Bonzini aedc70
diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
Paolo Bonzini aedc70
index 9aa83c0..c67e86d 100644
Paolo Bonzini aedc70
--- a/BaseTools/Source/C/Makefiles/header.makefile
Paolo Bonzini aedc70
+++ b/BaseTools/Source/C/Makefiles/header.makefile
Paolo Bonzini aedc70
@@ -30,6 +30,10 @@ ifeq ($(ARCH), IA32)
Paolo Bonzini aedc70
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
Paolo Bonzini aedc70
 endif
Paolo Bonzini aedc70
 
Paolo Bonzini aedc70
+ifeq ($(ARCH), ARM)
Paolo Bonzini aedc70
+ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
Paolo Bonzini aedc70
+endif
Paolo Bonzini aedc70
+
Paolo Bonzini aedc70
 ifeq ($(ARCH), X64)
Paolo Bonzini aedc70
 ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
Paolo Bonzini aedc70
 endif