X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FUefi%2FUefiBaseType.h;h=572f6959358bf8d8f9d9c53f9de568848cbb32de;hp=d66d0c7f05b876dea80f0be11abc4d0c4443c7d9;hb=8992ce066e2b0f8e74a2df30639c9cc6b04dc4df;hpb=f4e8509b62c1e96fa483133ca604109005be614d diff --git a/MdePkg/Include/Uefi/UefiBaseType.h b/MdePkg/Include/Uefi/UefiBaseType.h index d66d0c7f05..572f695935 100644 --- a/MdePkg/Include/Uefi/UefiBaseType.h +++ b/MdePkg/Include/Uefi/UefiBaseType.h @@ -1,8 +1,8 @@ /** @file - Defines data types and constants introduced in UEFI. - Copyright (c) 2006 - 2008, Intel Corporation + Copyright (c) 2006 - 2008, Intel Corporation
+ Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -16,35 +16,50 @@ #ifndef __UEFI_BASETYPE_H__ #define __UEFI_BASETYPE_H__ -#include "Base.h" +#include +// +// Basic data type definitions introduced in UEFI. +// + +/// +/// 128-bit buffer containing a unique identifier value. /// -/// Basical data type definitions introduced in UEFI. -/// typedef GUID EFI_GUID; - /// /// Function return status for EFI API /// typedef RETURN_STATUS EFI_STATUS; +/// +/// A collection of related interfaces. +/// typedef VOID *EFI_HANDLE; - +/// +/// Handle to an event structure. +/// typedef VOID *EFI_EVENT; - +/// +/// Task priority level. +/// typedef UINTN EFI_TPL; - - +/// +/// Logical block address. +/// typedef UINT64 EFI_LBA; - -typedef UINT16 STRING_REF; - +/// +/// 64-bit physical memory address. +/// typedef UINT64 EFI_PHYSICAL_ADDRESS; + +/// +/// 64-bit virtual memory address. +/// typedef UINT64 EFI_VIRTUAL_ADDRESS; /// /// EFI Time Abstraction: -/// Year: 2000 - 20XX +/// Year: 1998 - 20XX /// Month: 1 - 12 /// Day: 1 - 31 /// Hour: 0 - 23 @@ -68,21 +83,31 @@ typedef struct { } EFI_TIME; -// -// Networking Definitions -// +/// +/// 4-byte buffer. An IPv4 internet protocol address. +/// typedef struct { UINT8 Addr[4]; } EFI_IPv4_ADDRESS; +/// +/// 16-byte buffer. An IPv6 internet protocol address +/// typedef struct { UINT8 Addr[16]; } EFI_IPv6_ADDRESS; +/// +/// 32-byte buffer containing a network Media Access Control address. +/// typedef struct { UINT8 Addr[32]; } EFI_MAC_ADDRESS; +/// +/// 16-byte buffer aligned on a 4-byte boundary. +/// An IPv4 or IPv6 internet protocol address. +/// typedef union { UINT32 Addr[4]; EFI_IPv4_ADDRESS v4; @@ -138,19 +163,7 @@ typedef union { #define EFI_ERROR(A) RETURN_ERROR(A) -// -// Define macros to build data structure signatures from characters. -// -#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8)) -#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16)) -#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \ - (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32)) - -/// -/// Returns the byte offset to a field within a structure -/// -#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field))) // // The EFI memory allocation functions work in units of EFI_PAGEs that are @@ -165,21 +178,72 @@ typedef union { #define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT) +/// +/// PE32+ Machine type for IA32 UEFI images +/// +#define EFI_IMAGE_MACHINE_IA32 0x014C + +/// +/// PE32+ Machine type for IA64 UEFI images +/// +#define EFI_IMAGE_MACHINE_IA64 0x0200 -#define EFI_MAX_BIT MAX_BIT -#define EFI_MAX_ADDRESS MAX_ADDRESS +/// +/// PE32+ Machine type for EBC UEFI images +/// +#define EFI_IMAGE_MACHINE_EBC 0x0EBC +/// +/// PE32+ Machine type for X64 UEFI images +/// +#define EFI_IMAGE_MACHINE_X64 0x8664 /// -/// Limited buffer size for a language code recommended by RFC3066 -/// (42 characters plus a NULL terminator) +/// PE32+ Machine type for ARM mixed ARM and Thumb/Thumb2 images /// -#define RFC_3066_ENTRY_SIZE (42 + 1) +#define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED 0x01C2 + + +#if defined (MDE_CPU_IA32) + +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ + (((Machine) == EFI_IMAGE_MACHINE_IA32) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) + +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_X64) + +#elif defined (MDE_CPU_IPF) + +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ + (((Machine) == EFI_IMAGE_MACHINE_IA64) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) + +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) + +#elif defined (MDE_CPU_X64) + +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ + (((Machine) == EFI_IMAGE_MACHINE_X64) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) + +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32) + +#elif defined (MDE_CPU_ARM) + +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ + (((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) + +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED) + +#elif defined (MDE_CPU_EBC) /// -/// The size of a 3 character ISO639 language code. +/// This is just to make sure you can cross compile with the EBC compiler. +/// It does not make sense to have a PE loader coded in EBC. /// -#define ISO_639_2_ENTRY_SIZE 3 +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC) +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) + +#else +#error Unknown Processor Type +#endif #endif