2001-06-09 16:49:51 +00:00
|
|
|
/* $FreeBSD$ */
|
|
|
|
#ifndef _EFI_DEF_H
|
|
|
|
#define _EFI_DEF_H
|
|
|
|
|
|
|
|
/*++
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
|
|
|
|
This software and associated documentation (if any) is furnished
|
|
|
|
under a license and may only be used or copied in accordance
|
|
|
|
with the terms of the license. Except as permitted by such
|
|
|
|
license, no part of this software or documentation may be
|
|
|
|
reproduced, stored in a retrieval system, or transmitted in any
|
|
|
|
form or by any means without the express written consent of
|
|
|
|
Intel Corporation.
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
Module Name:
|
|
|
|
|
|
|
|
efidef.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
EFI definitions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Revision History
|
|
|
|
|
|
|
|
--*/
|
|
|
|
|
|
|
|
typedef UINT16 CHAR16;
|
|
|
|
typedef UINT8 CHAR8;
|
2015-02-20 01:40:55 +00:00
|
|
|
#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine */
|
2001-06-09 16:49:51 +00:00
|
|
|
typedef UINT8 BOOLEAN;
|
2015-02-20 01:40:55 +00:00
|
|
|
#endif
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE ((BOOLEAN) 1)
|
|
|
|
#define FALSE ((BOOLEAN) 0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NULL
|
|
|
|
#define NULL ((VOID *) 0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef UINTN EFI_STATUS;
|
|
|
|
typedef UINT64 EFI_LBA;
|
|
|
|
typedef UINTN EFI_TPL;
|
|
|
|
typedef VOID *EFI_HANDLE;
|
|
|
|
typedef VOID *EFI_EVENT;
|
|
|
|
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//
|
|
|
|
// Prototype argument decoration for EFI parameters to indicate
|
|
|
|
// their direction
|
|
|
|
//
|
|
|
|
// IN - argument is passed into the function
|
|
|
|
// OUT - argument (pointer) is returned from the function
|
|
|
|
// OPTIONAL - argument is optional
|
|
|
|
//
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
#ifndef IN
|
|
|
|
#define IN
|
|
|
|
#define OUT
|
|
|
|
#define OPTIONAL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//
|
|
|
|
// A GUID
|
|
|
|
//
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT32 Data1;
|
|
|
|
UINT16 Data2;
|
|
|
|
UINT16 Data3;
|
|
|
|
UINT8 Data4[8];
|
|
|
|
} EFI_GUID;
|
|
|
|
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//
|
|
|
|
// Time
|
|
|
|
//
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2006-11-02 02:42:48 +00:00
|
|
|
UINT16 Year; // 1998 - 20XX
|
|
|
|
UINT8 Month; // 1 - 12
|
|
|
|
UINT8 Day; // 1 - 31
|
|
|
|
UINT8 Hour; // 0 - 23
|
|
|
|
UINT8 Minute; // 0 - 59
|
|
|
|
UINT8 Second; // 0 - 59
|
|
|
|
UINT8 Pad1;
|
|
|
|
UINT32 Nanosecond; // 0 - 999,999,999
|
|
|
|
INT16 TimeZone; // -1440 to 1440 or 2047
|
|
|
|
UINT8 Daylight;
|
|
|
|
UINT8 Pad2;
|
2001-06-09 16:49:51 +00:00
|
|
|
} EFI_TIME;
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
// Bit definitions for EFI_TIME.Daylight
|
2001-06-09 16:49:51 +00:00
|
|
|
#define EFI_TIME_ADJUST_DAYLIGHT 0x01
|
|
|
|
#define EFI_TIME_IN_DAYLIGHT 0x02
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
// Value definition for EFI_TIME.TimeZone
|
2001-06-09 16:49:51 +00:00
|
|
|
#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//
|
|
|
|
// Networking
|
|
|
|
//
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT8 Addr[4];
|
|
|
|
} EFI_IPv4_ADDRESS;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT8 Addr[16];
|
|
|
|
} EFI_IPv6_ADDRESS;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT8 Addr[32];
|
|
|
|
} EFI_MAC_ADDRESS;
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//
|
|
|
|
// Memory
|
|
|
|
//
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
typedef UINT64 EFI_PHYSICAL_ADDRESS;
|
|
|
|
typedef UINT64 EFI_VIRTUAL_ADDRESS;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
AllocateAnyPages,
|
|
|
|
AllocateMaxAddress,
|
|
|
|
AllocateAddress,
|
|
|
|
MaxAllocateType
|
|
|
|
} EFI_ALLOCATE_TYPE;
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//Preseve the attr on any range supplied.
|
|
|
|
//ConventialMemory must have WB,SR,SW when supplied.
|
|
|
|
//When allocating from ConventialMemory always make it WB,SR,SW
|
|
|
|
//When returning to ConventialMemory always make it WB,SR,SW
|
|
|
|
//When getting the memory map, or on RT for runtime types
|
|
|
|
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
EfiReservedMemoryType,
|
|
|
|
EfiLoaderCode,
|
|
|
|
EfiLoaderData,
|
|
|
|
EfiBootServicesCode,
|
|
|
|
EfiBootServicesData,
|
|
|
|
EfiRuntimeServicesCode,
|
|
|
|
EfiRuntimeServicesData,
|
|
|
|
EfiConventionalMemory,
|
|
|
|
EfiUnusableMemory,
|
|
|
|
EfiACPIReclaimMemory,
|
|
|
|
EfiACPIMemoryNVS,
|
|
|
|
EfiMemoryMappedIO,
|
|
|
|
EfiMemoryMappedIOPortSpace,
|
|
|
|
EfiPalCode,
|
|
|
|
EfiMaxMemoryType
|
|
|
|
} EFI_MEMORY_TYPE;
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
// possible caching types for the memory range
|
2001-06-09 16:49:51 +00:00
|
|
|
#define EFI_MEMORY_UC 0x0000000000000001
|
|
|
|
#define EFI_MEMORY_WC 0x0000000000000002
|
|
|
|
#define EFI_MEMORY_WT 0x0000000000000004
|
|
|
|
#define EFI_MEMORY_WB 0x0000000000000008
|
|
|
|
#define EFI_MEMORY_UCE 0x0000000000000010
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
// physical memory protection on range
|
2001-06-09 16:49:51 +00:00
|
|
|
#define EFI_MEMORY_WP 0x0000000000001000
|
|
|
|
#define EFI_MEMORY_RP 0x0000000000002000
|
|
|
|
#define EFI_MEMORY_XP 0x0000000000004000
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
// range requires a runtime mapping
|
2001-06-09 16:49:51 +00:00
|
|
|
#define EFI_MEMORY_RUNTIME 0x8000000000000000
|
|
|
|
|
|
|
|
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
|
|
|
|
typedef struct {
|
2006-11-02 02:42:48 +00:00
|
|
|
UINT32 Type; // Field size is 32 bits followed by 32 bit pad
|
|
|
|
EFI_PHYSICAL_ADDRESS PhysicalStart; // Field size is 64 bits
|
|
|
|
EFI_VIRTUAL_ADDRESS VirtualStart; // Field size is 64 bits
|
|
|
|
UINT64 NumberOfPages; // Field size is 64 bits
|
|
|
|
UINT64 Attribute; // Field size is 64 bits
|
2001-06-09 16:49:51 +00:00
|
|
|
} EFI_MEMORY_DESCRIPTOR;
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//
|
|
|
|
// International Language
|
|
|
|
//
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
typedef UINT8 ISO_639_2;
|
|
|
|
#define ISO_639_2_ENTRY_SIZE 3
|
|
|
|
|
2006-11-02 02:42:48 +00:00
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
2001-06-09 16:49:51 +00:00
|
|
|
#define EFI_PAGE_SIZE 4096
|
|
|
|
#define EFI_PAGE_MASK 0xFFF
|
|
|
|
#define EFI_PAGE_SHIFT 12
|
|
|
|
|
|
|
|
#define EFI_SIZE_TO_PAGES(a) \
|
2006-11-02 02:42:48 +00:00
|
|
|
( ((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0) )
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
#endif
|