mirror of https://github.com/acidanthera/audk.git
Add in the 1st version of ECP.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2832 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
30d4a0c7ec
commit
3eb9473ea9
|
@ -0,0 +1,6 @@
|
|||
Notes:
|
||||
This EDK Compatibility Package is based on the EDK 1.03 release found at http://edk.tianocore.org.
|
||||
It is compatibile with EDK 1.01 with the following exception:
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
#/** @file
|
||||
# EDK Compatibility Package
|
||||
#
|
||||
# This Package provides headers and libraries that allow a EDK Module (https://edk.tianocore.org)
|
||||
# to be used in the context of EDK II environment.
|
||||
#
|
||||
# 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
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#**/
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
[Defines]
|
||||
DEC_SPECIFICATION = 0x00010005
|
||||
PACKAGE_NAME = EdkCompatibilityPkg
|
||||
PACKAGE_GUID = 98EDD7B0-2A6C-4b4a-AC72-4AAE0F95A3F8
|
||||
PACKAGE_VERSION = 0.1
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Include Section - list of Include Paths that are provided by this package.
|
||||
# Comments are used for Keywords and Module Types.
|
||||
#
|
||||
# Supported Module Types:
|
||||
# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
|
||||
#
|
||||
################################################################################
|
||||
[Includes.common]
|
||||
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class Header section - list of Library Class header files that are
|
||||
# provided by this package.
|
||||
#
|
||||
################################################################################
|
||||
[LibraryClasses.common]
|
|
@ -0,0 +1,65 @@
|
|||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2006, Intel Corporation
|
||||
# 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
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# ArchProtocolLib.inf
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# Component description file for the Architectural Protocol Library.
|
||||
#
|
||||
#--*/
|
||||
|
||||
[defines]
|
||||
BASE_NAME = ArchProtocolLib
|
||||
COMPONENT_TYPE = LIBRARY
|
||||
|
||||
[sources.common]
|
||||
Bds\Bds.c
|
||||
Bds\Bds.h
|
||||
Capsule\Capsule.c
|
||||
Capsule\Capsule.h
|
||||
Cpu\Cpu.c
|
||||
Cpu\Cpu.h
|
||||
Metronome\Metronome.c
|
||||
Metronome\Metronome.h
|
||||
MonotonicCounter\MonotonicCounter.c
|
||||
MonotonicCounter\MonotonicCounter.h
|
||||
RealTimeClock\RealTimeClock.c
|
||||
RealTimeClock\RealTimeClock.h
|
||||
Reset\Reset.c
|
||||
Reset\Reset.h
|
||||
Runtime\Runtime.c
|
||||
Runtime\Runtime.h
|
||||
Security\Security.c
|
||||
Security\Security.h
|
||||
StatusCode\StatusCode.c
|
||||
StatusCode\StatusCode.h
|
||||
Timer\Timer.c
|
||||
Timer\Timer.h
|
||||
Variable\Variable.c
|
||||
Variable\Variable.h
|
||||
VariableWrite\VariableWrite.c
|
||||
VariableWrite\VariableWrite.h
|
||||
WatchdogTimer\WatchdogTimer.c
|
||||
WatchdogTimer\WatchdogTimer.h
|
||||
|
||||
[includes.common]
|
||||
$(EDK_SOURCE)\Foundation\Efi
|
||||
$(EDK_SOURCE)\Foundation\Include
|
||||
$(EDK_SOURCE)\Foundation\Efi\Include
|
||||
$(EDK_SOURCE)\Foundation\Framework\Include
|
||||
$(EDK_SOURCE)\Foundation\Include\IndustryStandard
|
||||
$(EDK_SOURCE)\Foundation\Core\Dxe
|
||||
$(EDK_SOURCE)\Foundation\Library\Dxe\Include
|
||||
|
||||
[nmake.common]
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Bds.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Boot Device Selection Architectural Protocol GUID as defined in Tiano
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Bds)
|
||||
|
||||
EFI_GUID gEfiBdsArchProtocolGuid = EFI_BDS_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiBdsArchProtocolGuid, "BDS", "BDS Arch Protocol");
|
|
@ -0,0 +1,100 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Bds.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Boot Device Selection Architectural Protocol as defined in Tiano
|
||||
|
||||
When the DXE core is done it calls the BDS via this protocol.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_BDS_H_
|
||||
#define _ARCH_PROTOCOL_BDS_H_
|
||||
|
||||
//
|
||||
// Global ID for the BDS Architectural Protocol
|
||||
//
|
||||
#define EFI_BDS_ARCH_PROTOCOL_GUID \
|
||||
{ 0x665E3FF6, 0x46CC, 0x11d4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
|
||||
|
||||
//
|
||||
// Declare forward reference for the BDS Architectural Protocol
|
||||
//
|
||||
EFI_FORWARD_DECLARATION (EFI_BDS_ARCH_PROTOCOL);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(EFIAPI *EFI_BDS_ENTRY) (
|
||||
IN EFI_BDS_ARCH_PROTOCOL * This
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function uses policy data from the platform to determine what operating
|
||||
system or system utility should be loaded and invoked. This function call
|
||||
also optionally make the use of user input to determine the operating system
|
||||
or system utility to be loaded and invoked. When the DXE Core has dispatched
|
||||
all the drivers on the dispatch queue, this function is called. This
|
||||
function will attempt to connect the boot devices required to load and invoke
|
||||
the selected operating system or system utility. During this process,
|
||||
additional firmware volumes may be discovered that may contain addition DXE
|
||||
drivers that can be dispatched by the DXE Core. If a boot device cannot be
|
||||
fully connected, this function calls the DXE Service Dispatch() to allow the
|
||||
DXE drivers from any newly discovered firmware volumes to be dispatched.
|
||||
Then the boot device connection can be attempted again. If the same boot
|
||||
device connection operation fails twice in a row, then that boot device has
|
||||
failed, and should be skipped. This function should never return.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_BDS_ARCH_PROTOCOL instance.
|
||||
|
||||
Returns:
|
||||
|
||||
None.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Interface stucture for the BDS Architectural Protocol
|
||||
//
|
||||
typedef struct _EFI_BDS_ARCH_PROTOCOL {
|
||||
EFI_BDS_ENTRY Entry;
|
||||
} EFI_BDS_ARCH_PROTOCOL;
|
||||
|
||||
/*++
|
||||
|
||||
Protocol Description:
|
||||
The EFI_BDS_ARCH_PROTOCOL transfers control from DXE to an operating
|
||||
system or a system utility. If there are not enough drivers initialized
|
||||
when this protocol is used to access the required boot device(s), then
|
||||
this protocol should add drivers to the dispatch queue and return control
|
||||
back to the dispatcher. Once the required boot devices are available, then
|
||||
the boot device can be used to load and invoke an OS or a system utility.
|
||||
|
||||
Parameters:
|
||||
|
||||
Entry - The entry point to BDS. This call does not take any parameters,
|
||||
and the return value can be ignored. If it returns, then the
|
||||
dispatcher must be invoked again, if it never returns, then an
|
||||
operating system or a system utility have been invoked.
|
||||
|
||||
--*/
|
||||
|
||||
extern EFI_GUID gEfiBdsArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Capsule.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Capsule Architectural Protocol is used to produce the UEFI 2.0 capsule runtime services
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Capsule)
|
||||
|
||||
EFI_GUID gEfiCapsuleArchProtocolGuid = EFI_CAPSULE_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiCapsuleArchProtocolGuid, "Capsule", "Capsule Arch Protocol");
|
|
@ -0,0 +1,33 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Capsule.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Capsule Architectural Protocol is newly added to produce UEFI2.0 capsule runtime services.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_CAPSULE_ARCH_H_
|
||||
#define _ARCH_PROTOCOL_CAPSULE_ARCH_H_
|
||||
|
||||
//
|
||||
// Global ID for the Capsule Architectural Protocol
|
||||
//
|
||||
#define EFI_CAPSULE_ARCH_PROTOCOL_GUID \
|
||||
{ 0x5053697e, 0x2cbc, 0x4819, 0x90, 0xd9, 0x5, 0x80, 0xde, 0xee, 0x57, 0x54 }
|
||||
|
||||
extern EFI_GUID gEfiCapsuleArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Cpu.c
|
||||
|
||||
Abstract:
|
||||
|
||||
CPU Architectural Protocol GUID as defined in Tiano
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Cpu)
|
||||
|
||||
EFI_GUID gEfiCpuArchProtocolGuid = EFI_CPU_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiCpuArchProtocolGuid, "CPU", "CPU Arch Protocol");
|
|
@ -0,0 +1,361 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Cpu.h
|
||||
|
||||
Abstract:
|
||||
|
||||
CPU Architectural Protocol as defined in Tiano
|
||||
|
||||
This code abstracts the DXE core from processor implementation details.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_CPU_H_
|
||||
#define _ARCH_PROTOCOL_CPU_H_
|
||||
|
||||
#include EFI_PROTOCOL_DEFINITION (DebugSupport)
|
||||
|
||||
#define EFI_CPU_ARCH_PROTOCOL_GUID \
|
||||
{ 0x26baccb1, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_CPU_ARCH_PROTOCOL);
|
||||
|
||||
typedef enum {
|
||||
EfiCpuFlushTypeWriteBackInvalidate,
|
||||
EfiCpuFlushTypeWriteBack,
|
||||
EfiCpuFlushTypeInvalidate,
|
||||
EfiCpuMaxFlushType
|
||||
} EFI_CPU_FLUSH_TYPE;
|
||||
|
||||
typedef enum {
|
||||
EfiCpuInit,
|
||||
EfiCpuMaxInitType
|
||||
} EFI_CPU_INIT_TYPE;
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(*EFI_CPU_INTERRUPT_HANDLER) (
|
||||
IN EFI_EXCEPTION_TYPE InterruptType,
|
||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_FLUSH_DATA_CACHE) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This,
|
||||
IN EFI_PHYSICAL_ADDRESS Start,
|
||||
IN UINT64 Length,
|
||||
IN EFI_CPU_FLUSH_TYPE FlushType
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function flushes the range of addresses from Start to Start+Length
|
||||
from the processor's data cache. If Start is not aligned to a cache line
|
||||
boundary, then the bytes before Start to the preceding cache line boundary
|
||||
are also flushed. If Start+Length is not aligned to a cache line boundary,
|
||||
then the bytes past Start+Length to the end of the next cache line boundary
|
||||
are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be
|
||||
supported. If the data cache is fully coherent with all DMA operations, then
|
||||
this function can just return EFI_SUCCESS. If the processor does not support
|
||||
flushing a range of the data cache, then the entire data cache can be flushed.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
Start - The beginning physical address to flush from the processor's data
|
||||
cache.
|
||||
Length - The number of bytes to flush from the processor's data cache. This
|
||||
function may flush more bytes than Length specifies depending upon
|
||||
the granularity of the flush operation that the processor supports.
|
||||
FlushType - Specifies the type of flush operation to perform.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The address range from Start to Start+Length was flushed from
|
||||
the processor's data cache.
|
||||
EFI_UNSUPPORTEDT - The processor does not support the cache flush type specified
|
||||
by FlushType.
|
||||
EFI_DEVICE_ERROR - The address range from Start to Start+Length could not be flushed
|
||||
from the processor's data cache.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_ENABLE_INTERRUPT) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function enables interrupt processing by the processor.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Interrupts are enabled on the processor.
|
||||
EFI_DEVICE_ERROR - Interrupts could not be enabled on the processor.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_DISABLE_INTERRUPT) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function disables interrupt processing by the processor.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Interrupts are disabled on the processor.
|
||||
EFI_DEVICE_ERROR - Interrupts could not be disabled on the processor.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_GET_INTERRUPT_STATE) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This,
|
||||
OUT BOOLEAN *State
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function retrieves the processor's current interrupt state a returns it in
|
||||
State. If interrupts are currently enabled, then TRUE is returned. If interrupts
|
||||
are currently disabled, then FALSE is returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
State - A pointer to the processor's current interrupt state. Set to TRUE if
|
||||
interrupts are enabled and FALSE if interrupts are disabled.
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The processor's current interrupt state was returned in State.
|
||||
EFI_INVALID_PARAMETER - State is NULL.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_INIT) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This,
|
||||
IN EFI_CPU_INIT_TYPE InitType
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function generates an INIT on the processor. If this function succeeds, then the
|
||||
processor will be reset, and control will not be returned to the caller. If InitType is
|
||||
not supported by this processor, or the processor cannot programmatically generate an
|
||||
INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error
|
||||
occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
InitType - The type of processor INIT to perform.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The processor INIT was performed. This return code should never be seen.
|
||||
EFI_UNSUPPORTED - The processor INIT operation specified by InitType is not supported
|
||||
by this processor.
|
||||
EFI_DEVICE_ERROR - The processor INIT failed.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This,
|
||||
IN EFI_EXCEPTION_TYPE InterruptType,
|
||||
IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function registers and enables the handler specified by InterruptHandler for a processor
|
||||
interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
|
||||
handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
|
||||
The installed handler is called once for each processor interrupt or exception.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
InterruptType - A pointer to the processor's current interrupt state. Set to TRUE if interrupts
|
||||
are enabled and FALSE if interrupts are disabled.
|
||||
InterruptHandler - A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
|
||||
when a processor interrupt occurs. If this parameter is NULL, then the handler
|
||||
will be uninstalled.
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The handler for the processor interrupt was successfully installed or uninstalled.
|
||||
EFI_ALREADY_STARTED - InterruptHandler is not NULL, and a handler for InterruptType was
|
||||
previously installed.
|
||||
EFI_INVALID_PARAMETER - InterruptHandler is NULL, and a handler for InterruptType was not
|
||||
previously installed.
|
||||
EFI_UNSUPPORTED - The interrupt specified by InterruptType is not supported.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_GET_TIMER_VALUE) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This,
|
||||
IN UINT32 TimerIndex,
|
||||
OUT UINT64 *TimerValue,
|
||||
OUT UINT64 *TimerPeriod OPTIONAL
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function reads the processor timer specified by TimerIndex and returns it in TimerValue.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
TimerIndex - Specifies which processor timer is to be returned in TimerValue. This parameter
|
||||
must be between 0 and NumberOfTimers-1.
|
||||
TimerValue - Pointer to the returned timer value.
|
||||
TimerPeriod - A pointer to the amount of time that passes in femtoseconds for each increment
|
||||
of TimerValue.
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The processor timer value specified by TimerIndex was returned in TimerValue.
|
||||
EFI_DEVICE_ERROR - An error occurred attempting to read one of the processor's timers.
|
||||
EFI_INVALID_PARAMETER - TimerValue is NULL or TimerIndex is not valid.
|
||||
EFI_UNSUPPORTED - The processor does not have any readable timers.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES) (
|
||||
IN EFI_CPU_ARCH_PROTOCOL * This,
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function modifies the attributes for the memory region specified by BaseAddress and
|
||||
Length from their current attributes to the attributes specified by Attributes.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_CPU_ARCH_PROTOCOL instance.
|
||||
BaseAddress - The physical address that is the start address of a memory region.
|
||||
Length - The size in bytes of the memory region.
|
||||
Attributes - The bit mask of attributes to set for the memory region.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The attributes were set for the memory region.
|
||||
EFI_ACCESS_DENIED - The attributes for the memory resource range specified by
|
||||
BaseAddress and Length cannot be modified.
|
||||
EFI_INVALID_PARAMETER - Length is zero.
|
||||
EFI_OUT_OF_RESOURCES - There are not enough system resources to modify the attributes of
|
||||
the memory resource range.
|
||||
EFI_UNSUPPORTED - The processor does not support one or more bytes of the memory
|
||||
resource range specified by BaseAddress and Length.
|
||||
The bit mask of attributes is not support for the memory resource
|
||||
range specified by BaseAddress and Length.
|
||||
|
||||
--*/
|
||||
|
||||
typedef struct _EFI_CPU_ARCH_PROTOCOL {
|
||||
EFI_CPU_FLUSH_DATA_CACHE FlushDataCache;
|
||||
EFI_CPU_ENABLE_INTERRUPT EnableInterrupt;
|
||||
EFI_CPU_DISABLE_INTERRUPT DisableInterrupt;
|
||||
EFI_CPU_GET_INTERRUPT_STATE GetInterruptState;
|
||||
EFI_CPU_INIT Init;
|
||||
EFI_CPU_REGISTER_INTERRUPT_HANDLER RegisterInterruptHandler;
|
||||
EFI_CPU_GET_TIMER_VALUE GetTimerValue;
|
||||
EFI_CPU_SET_MEMORY_ATTRIBUTES SetMemoryAttributes;
|
||||
UINT32 NumberOfTimers;
|
||||
UINT32 DmaBufferAlignment;
|
||||
} EFI_CPU_ARCH_PROTOCOL;
|
||||
|
||||
/*++
|
||||
|
||||
Protocol Description:
|
||||
|
||||
The EFI_CPU_ARCH_PROTOCOL is used to abstract processor-specific functions from the DXE
|
||||
Foundation. This includes flushing caches, enabling and disabling interrupts, hooking interrupt
|
||||
vectors and exception vectors, reading internal processor timers, resetting the processor, and
|
||||
determining the processor frequency.
|
||||
|
||||
Parameters:
|
||||
|
||||
FlushDataCache - Flushes a range of the processor's data cache. If the processor does
|
||||
not contain a data cache, or the data cache is fully coherent, then this
|
||||
function can just return EFI_SUCCESS. If the processor does not support
|
||||
flushing a range of addresses from the data cache, then the entire data
|
||||
cache must be flushed.
|
||||
EnableInterrupt - Enables interrupt processing by the processor.
|
||||
DisableInterrupt - Disables interrupt processing by the processor.
|
||||
GetInterruptState - Retrieves the processor's current interrupt state.
|
||||
Init - Generates an INIT on the processor. If a processor cannot programmatically
|
||||
generate an INIT without help from external hardware, then this function
|
||||
returns EFI_UNSUPPORTED.
|
||||
RegisterInterruptHandler - Associates an interrupt service routine with one of the processor's interrupt
|
||||
vectors. This function is typically used by the EFI_TIMER_ARCH_PROTOCOL to
|
||||
hook the timer interrupt in a system. It can also be used by the debugger to
|
||||
hook exception vectors.
|
||||
GetTimerValue - Returns the value of one of the processor's internal timers.
|
||||
SetMemoryAttributes - Attempts to set the attributes of a memory region.
|
||||
NumberOfTimers - The number of timers that are available in a processor. The value in this
|
||||
field is a constant that must not be modified after the CPU Architectural
|
||||
Protocol is installed. All consumers must treat this as a read-only field.
|
||||
DmaBufferAlignment - The size, in bytes, of the alignment required for DMA buffer allocations.
|
||||
This is typically the size of the largest data cache line in the platform.
|
||||
The value in this field is a constant that must not be modified after the
|
||||
CPU Architectural Protocol is installed. All consumers must treat this as
|
||||
a read-only field.
|
||||
|
||||
--*/
|
||||
|
||||
extern EFI_GUID gEfiCpuArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Metronome.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Metronome Architectural Protocol as defined in Tiano
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Metronome)
|
||||
|
||||
EFI_GUID gEfiMetronomeArchProtocolGuid = EFI_METRONOME_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiMetronomeArchProtocolGuid, "Metronome", "Metronome Arch Protocol");
|
|
@ -0,0 +1,109 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Metronome.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Metronome Architectural Protocol as defined in DXE CIS
|
||||
|
||||
This code abstracts the DXE core to provide delay services.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_METRONOME_H_
|
||||
#define _ARCH_PROTOCOL_METRONOME_H_
|
||||
|
||||
//
|
||||
// Global ID for the Metronome Architectural Protocol
|
||||
//
|
||||
#define EFI_METRONOME_ARCH_PROTOCOL_GUID \
|
||||
{ 0x26baccb2, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
|
||||
|
||||
//
|
||||
// Declare forward reference for the Metronome Architectural Protocol
|
||||
//
|
||||
EFI_FORWARD_DECLARATION (EFI_METRONOME_ARCH_PROTOCOL);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK) (
|
||||
IN EFI_METRONOME_ARCH_PROTOCOL *This,
|
||||
IN UINT32 TickNumber
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
The WaitForTick() function waits for the number of ticks specified by
|
||||
TickNumber from a known time source in the platform. If TickNumber of
|
||||
ticks are detected, then EFI_SUCCESS is returned. The actual time passed
|
||||
between entry of this function and the first tick is between 0 and
|
||||
TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod
|
||||
time has elapsed, wait for two ticks. This function waits for a hardware
|
||||
event to determine when a tick occurs. It is possible for interrupt
|
||||
processing, or exception processing to interrupt the execution of the
|
||||
WaitForTick() function. Depending on the hardware source for the ticks, it
|
||||
is possible for a tick to be missed. This function cannot guarantee that
|
||||
ticks will not be missed. If a timeout occurs waiting for the specified
|
||||
number of ticks, then EFI_TIMEOUT is returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_METRONOME_ARCH_PROTOCOL instance.
|
||||
|
||||
TickNumber - Number of ticks to wait.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The wait for the number of ticks specified by TickNumber
|
||||
succeeded.
|
||||
|
||||
EFI_TIMEOUT - A timeout occurred waiting for the specified number of ticks.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Interface stucture for the Metronome Architectural Protocol
|
||||
//
|
||||
typedef struct _EFI_METRONOME_ARCH_PROTOCOL {
|
||||
EFI_METRONOME_WAIT_FOR_TICK WaitForTick;
|
||||
UINT32 TickPeriod;
|
||||
} EFI_METRONOME_ARCH_PROTOCOL;
|
||||
|
||||
/*++
|
||||
|
||||
Protocol Description:
|
||||
This protocol provides access to a known time source in the platform to the
|
||||
core. The core uses this known time source to produce core services that
|
||||
require calibrated delays.
|
||||
|
||||
Parameters:
|
||||
|
||||
WaitForTick - Waits for a specified number of ticks from a known time source
|
||||
in the platform. The actual time passed between entry of this
|
||||
function and the first tick is between 0 and TickPeriod 100 nS
|
||||
units. If you want to guarantee that at least TickPeriod time
|
||||
has elapsed, wait for two ticks.
|
||||
|
||||
TickPeriod - The period of platform's known time source in 100 nS units.
|
||||
This value on any platform must be at least 10 uS, and must not
|
||||
exceed 200 uS. The value in this field is a constant that must
|
||||
not be modified after the Metronome architectural protocol is
|
||||
installed. All consumers must treat this as a read-only field.
|
||||
|
||||
--*/
|
||||
|
||||
extern EFI_GUID gEfiMetronomeArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
MonotonicCounter.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Monotonic Counter Architectural Protocol GUID as defined in the DXE CIS
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION(MonotonicCounter)
|
||||
|
||||
EFI_GUID gEfiMonotonicCounterArchProtocolGuid = EFI_MONTONIC_COUNTER_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiMonotonicCounterArchProtocolGuid, "Monotonic Counter", "Monotonic Counter Arch Protocol");
|
|
@ -0,0 +1,35 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
MonotonicCounter.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Monotonic Counter Architectural Protocol as defined in DXE CIS
|
||||
|
||||
This code provides the services required to access the systems monotonic counter
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_MONTONIC_COUNTER_H_
|
||||
#define _ARCH_PROTOCOL_MONTONIC_COUNTER_H_
|
||||
|
||||
//
|
||||
// Global ID for the Monotonic Counter Architectural Protocol
|
||||
//
|
||||
#define EFI_MONTONIC_COUNTER_ARCH_PROTOCOL_GUID \
|
||||
{0x1da97072, 0xbddc, 0x4b30, 0x99, 0xf1, 0x72, 0xa0, 0xb5, 0x6f, 0xff, 0x2a}
|
||||
|
||||
extern EFI_GUID gEfiMonotonicCounterArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
RealTimeClock.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Real Time clock Architectural Protocol GUID as defined in Tiano
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (RealTimeClock)
|
||||
|
||||
EFI_GUID gEfiRealTimeClockArchProtocolGuid = EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiRealTimeClockArchProtocolGuid, "RTC", "Real Time Clock Arch Protocol");
|
|
@ -0,0 +1,43 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
RealTimeClock.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Real Time clock Architectural Protocol as defined in Tiano
|
||||
|
||||
This code abstracts time and data functions. Used to provide
|
||||
Time and date related EFI runtime services.
|
||||
|
||||
The GetTime (), SetTime (), GetWakeupTime (), and SetWakeupTime () EFI 1.0
|
||||
services are added to the EFI system table and the
|
||||
EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID protocol is registered with a NULL
|
||||
pointer.
|
||||
|
||||
No CRC of the EFI system table is required, as it is done in the DXE core.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_REAL_TIME_CLOCK_H_
|
||||
#define _ARCH_PROTOCOL_REAL_TIME_CLOCK_H_
|
||||
|
||||
//
|
||||
// Global ID for the Real Time Clock Architectural Protocol
|
||||
//
|
||||
#define EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID \
|
||||
{ 0x27CFAC87, 0x46CC, 0x11d4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
|
||||
|
||||
extern EFI_GUID gEfiRealTimeClockArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Reset.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Reset Architectural Protocol GUID as defined in Tiano
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Reset)
|
||||
|
||||
EFI_GUID gEfiResetArchProtocolGuid = EFI_RESET_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiResetArchProtocolGuid, "Reset", "Reset Arch Protocol");
|
|
@ -0,0 +1,40 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Reset.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Reset Architectural Protocol as defined in the DXE CIS
|
||||
|
||||
Used to provide ResetSystem runtime services
|
||||
|
||||
The ResetSystem () EFI 1.0 service is added to the EFI system table and the
|
||||
EFI_RESET_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.
|
||||
|
||||
No CRC of the EFI system table is required, as it is done in the DXE core.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_RESET_H_
|
||||
#define _ARCH_PROTOCOL_RESET_H_
|
||||
|
||||
//
|
||||
// Global ID for the Reset Architectural Protocol
|
||||
//
|
||||
#define EFI_RESET_ARCH_PROTOCOL_GUID \
|
||||
{ 0x27CFAC88, 0x46CC, 0x11d4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
|
||||
|
||||
extern EFI_GUID gEfiResetArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Runtime.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Runtime Architectural Protocol as defined in Tiano
|
||||
|
||||
This code is used to produce the EFI 1.0 runtime virtual switch over
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Runtime)
|
||||
|
||||
EFI_GUID gEfiRuntimeArchProtocolGuid = EFI_RUNTIME_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiRuntimeArchProtocolGuid, "Runtime", "Runtime Arch Protocol");
|
|
@ -0,0 +1,114 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Runtime.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Runtime Architectural Protocol as defined in DXE CIS.
|
||||
|
||||
|
||||
This code is used to produce the EFI runtime services that are callable
|
||||
only in physical mode.
|
||||
|
||||
This driver must add SetVirtualAddressMap () and ConvertPointer () to
|
||||
the EFI system table. This driver is not responcible for CRCing the
|
||||
EFI system table.
|
||||
|
||||
This driver will add EFI_RUNTIME_ARCH_PROTOCOL_GUID protocol with a
|
||||
pointer to the Runtime Arch Protocol instance structure. The protocol
|
||||
member functions are used by the DXE core to export information needed
|
||||
by this driver to produce the runtime transition of runtime drivers from
|
||||
physical mode calling to virtual mode calling.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_RUNTIME_H_
|
||||
#define _ARCH_PROTOCOL_RUNTIME_H_
|
||||
|
||||
#include "LinkedList.h"
|
||||
|
||||
//
|
||||
// Global ID for the Runtime Architectural Protocol
|
||||
//
|
||||
#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \
|
||||
{ 0xb7dfb4e1, 0x52f, 0x449f, 0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 }
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_RUNTIME_ARCH_PROTOCOL);
|
||||
|
||||
typedef struct _EFI_RUNTIME_IMAGE_ENTRY {
|
||||
VOID *ImageBase;
|
||||
UINT64 ImageSize;
|
||||
VOID *RelocationData;
|
||||
EFI_HANDLE Handle;
|
||||
EFI_LIST_ENTRY Link;
|
||||
} EFI_RUNTIME_IMAGE_ENTRY;
|
||||
|
||||
typedef struct _EFI_RUNTIME_EVENT_ENTRY {
|
||||
UINT32 Type;
|
||||
EFI_TPL NotifyTpl;
|
||||
EFI_EVENT_NOTIFY NotifyFunction;
|
||||
VOID *NotifyContext;
|
||||
EFI_EVENT *Event;
|
||||
EFI_LIST_ENTRY Link;
|
||||
} EFI_RUNTIME_EVENT_ENTRY;
|
||||
|
||||
//
|
||||
// Interface stucture for the Runtime Architectural Protocol
|
||||
//
|
||||
typedef struct _EFI_RUNTIME_ARCH_PROTOCOL {
|
||||
EFI_LIST_ENTRY ImageHead;
|
||||
EFI_LIST_ENTRY EventHead;
|
||||
UINTN MemoryDescriptorSize;
|
||||
UINT32 MemoryDesciptorVersion;
|
||||
UINTN MemoryMapSize;
|
||||
EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical;
|
||||
EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual;
|
||||
BOOLEAN VirtualMode;
|
||||
BOOLEAN AtRuntime;
|
||||
} EFI_RUNTIME_ARCH_PROTOCOL;
|
||||
/*++
|
||||
|
||||
Protocol Description:
|
||||
|
||||
Allows the runtime functionality of the DXE Foundation to be contained in a
|
||||
separate driver. It also provides hooks for the DXE Foundation to export
|
||||
information that is needed at runtime. As such, this protocol allows the DXE
|
||||
Foundation to manage runtime drivers and events. This protocol also implies
|
||||
that the runtime services required to transition to virtual mode,
|
||||
SetVirtualAddressMap() and ConvertPointer(), have been registered into the
|
||||
EFI Runtime Table in the EFI System Partition. This protocol must be produced
|
||||
by a runtime DXE driver and may only be consumed by the DXE Foundation.
|
||||
|
||||
Parameters:
|
||||
|
||||
ImageHead - A list of type EFI_RUNTIME_IMAGE_ENTRY.
|
||||
EventHead - A list of type EFI_RUNTIME_EVENT_ENTRY.
|
||||
MemoryDescriptorSize - Size of a memory descriptor that is return by
|
||||
GetMemoryMap().
|
||||
MemoryDescriptorVersion - Version of a memory descriptor that is return by
|
||||
GetMemoryMap().
|
||||
MemoryMapSize - Size of the memory map in bytes contained in
|
||||
MemoryMapPhysical and MemoryMapVirtual.
|
||||
MemoryMapPhysical - Pointer to a runtime buffer that contains a copy of the
|
||||
memory map returned via GetMemoryMap().
|
||||
MemoryMapVirtual - Pointer to MemoryMapPhysical that is updated to virtual mode
|
||||
after SetVirtualAddressMap().
|
||||
VirtualMode - Boolean that is TRUE if SetVirtualAddressMap() has been called.
|
||||
AtRuntime - Boolean that is TRUE if ExitBootServices () has been called.
|
||||
|
||||
--*/
|
||||
|
||||
extern EFI_GUID gEfiRuntimeArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Security.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Security Architectural Protocol GUID as defined in DXE CIS
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION(Security)
|
||||
|
||||
EFI_GUID gEfiSecurityArchProtocolGuid = EFI_SECURITY_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiSecurityArchProtocolGuid, "Security", "Security Arch Protocol");
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Security.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Security Architectural Protocol as defined in the DXE CIS
|
||||
|
||||
Used to provide Security services. Specifically, dependening upon the
|
||||
authentication state of a discovered driver in a Firmware Volume, the
|
||||
portable DXE Core Dispatcher will call into the Security Architectural
|
||||
Protocol (SAP) with the authentication state of the driver.
|
||||
|
||||
This call-out allows for OEM-specific policy decisions to be made, such
|
||||
as event logging for attested boots, locking flash in response to discovering
|
||||
an unsigned driver or failed signature check, or other exception response.
|
||||
|
||||
The SAP can also change system behavior by having the DXE core put a driver
|
||||
in the Schedule-On-Request (SOR) state. This will allow for later disposition
|
||||
of the driver by platform agent, such as Platform BDS.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_SECURITY_H_
|
||||
#define _ARCH_PROTOCOL_SECURITY_H_
|
||||
|
||||
//
|
||||
// Global ID for the Security Code Architectural Protocol
|
||||
//
|
||||
#define EFI_SECURITY_ARCH_PROTOCOL_GUID \
|
||||
{ 0xA46423E3, 0x4617, 0x49f1, 0xB9, 0xFF, 0xD1, 0xBF, 0xA9, 0x11, 0x58, 0x39 }
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_SECURITY_ARCH_PROTOCOL);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_SECURITY_FILE_AUTHENTICATION_STATE) (
|
||||
IN EFI_SECURITY_ARCH_PROTOCOL *This,
|
||||
IN UINT32 AuthenticationStatus,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *File
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
|
||||
policy from the DXE core response to an attempt to use a file that returns a
|
||||
given status for the authentication check from the section extraction protocol.
|
||||
|
||||
The possible responses in a given SAP implementation may include locking
|
||||
flash upon failure to authenticate, attestation logging for all signed drivers,
|
||||
and other exception operations. The File parameter allows for possible logging
|
||||
within the SAP of the driver.
|
||||
|
||||
If File is NULL, then EFI_INVALID_PARAMETER is returned.
|
||||
|
||||
If the file specified by File with an authentication status specified by
|
||||
AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
|
||||
|
||||
If the file specified by File with an authentication status specified by
|
||||
AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
|
||||
then EFI_ACCESS_DENIED is returned.
|
||||
|
||||
If the file specified by File with an authentication status specified by
|
||||
AuthenticationStatus is not safe for the DXE Core to use right now, but it
|
||||
might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
|
||||
returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_SECURITY_ARCH_PROTOCOL instance.
|
||||
|
||||
AuthenticationStatus - This is the authentication type returned from the Section
|
||||
Extraction protocol. See the Section Extraction Protocol
|
||||
Specification for details on this type.
|
||||
|
||||
File - This is a pointer to the device path of the file that is
|
||||
being dispatched. This will optionally be used for logging.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The file specified by File did authenticate, and the
|
||||
platform policy dictates that the DXE Core may use File.
|
||||
|
||||
EFI_INVALID_PARAMETER - Driver is NULL.
|
||||
|
||||
EFI_SECURITY_VIOLATION - The file specified by File did not authenticate, and
|
||||
the platform policy dictates that File should be placed
|
||||
in the untrusted state. A file may be promoted from
|
||||
the untrusted to the trusted state at a future time
|
||||
with a call to the Trust() DXE Service.
|
||||
|
||||
EFI_ACCESS_DENIED - The file specified by File did not authenticate, and
|
||||
the platform policy dictates that File should not be
|
||||
used for any purpose.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
//
|
||||
// Interface stucture for the Timer Architectural Protocol
|
||||
//
|
||||
typedef struct _EFI_SECURITY_ARCH_PROTOCOL {
|
||||
EFI_SECURITY_FILE_AUTHENTICATION_STATE FileAuthenticationState;
|
||||
} EFI_SECURITY_ARCH_PROTOCOL;
|
||||
/*++
|
||||
|
||||
Protocol Description:
|
||||
|
||||
The EFI_SECURITY_ARCH_PROTOCOL is used to abstract platform-specific policy
|
||||
from the DXE core. This includes locking flash upon failure to authenticate,
|
||||
attestation logging, and other exception operations.
|
||||
|
||||
The driver that produces the EFI_SECURITY_ARCH_PROTOCOL may also optionally
|
||||
install the EFI_SECURITY_POLICY_PROTOCOL_GUID onto a new handle with a NULL
|
||||
interface. The existence of this GUID in the protocol database means that
|
||||
the GUIDed Section Extraction Protocol should authenticate the contents of
|
||||
an Authentication Section. The expectation is that the GUIDed Section
|
||||
Extraction protocol will look for the existence of the EFI_SECURITY_POLICY_
|
||||
PROTOCOL_GUID in the protocol database. If it exists, then the publication
|
||||
thereof is taken as an injunction to attempt an authentication of any section
|
||||
wrapped in an Authentication Section. See the Firmware File System
|
||||
Specification for details on the GUIDed Section Extraction Protocol and
|
||||
Authentication Sections.
|
||||
|
||||
Parameters:
|
||||
|
||||
FileAuthenticationState - This service is called upon fault with respect to
|
||||
the authentication of a section of a file.
|
||||
|
||||
--*/
|
||||
|
||||
extern EFI_GUID gEfiSecurityArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
StatusCode.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Status code Architectural Protocol as defined in Tiano
|
||||
|
||||
This code abstracts Status Code reporting.
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
|
||||
|
||||
EFI_GUID gEfiStatusCodeRuntimeProtocolGuid = EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiStatusCodeRuntimeProtocolGuid, "Status Code", "Status Code Arch Protocol");
|
|
@ -0,0 +1,100 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
StatusCode.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Status code Architectural Protocol as defined in the DXE CIS
|
||||
|
||||
This code abstracts Status Code reporting.
|
||||
|
||||
The StatusCode () Tiano service is added to the EFI system table and the
|
||||
EFI_STATUS_CODE_ARCH_PROTOCOL_GUID protocol is registered with a NULL
|
||||
pointer.
|
||||
|
||||
No CRC of the EFI system table is required, as it is done in the DXE core.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __STATUS_CODE_RUNTIME_PROTOCOL_H__
|
||||
#define __STATUS_CODE_RUNTIME_PROTOCOL_H__
|
||||
|
||||
#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \
|
||||
{ 0xd2b2b828, 0x826, 0x48a7, 0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0}
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_REPORT_STATUS_CODE) (
|
||||
IN EFI_STATUS_CODE_TYPE Type,
|
||||
IN EFI_STATUS_CODE_VALUE Value,
|
||||
IN UINT32 Instance,
|
||||
IN EFI_GUID *CallerId OPTIONAL,
|
||||
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||
)
|
||||
/*++
|
||||
Routine Description:
|
||||
|
||||
Provides an interface that a software module can call to report a status code.
|
||||
|
||||
Arguments:
|
||||
|
||||
Type - Indicates the type of status code being reported.
|
||||
|
||||
Value - Describes the current status of a hardware or software entity.
|
||||
This included information about the class and subclass that is
|
||||
used to classify the entity as well as an operation.
|
||||
|
||||
Instance - The enumeration of a hardware or software entity within
|
||||
the system. Valid instance numbers start with 1.
|
||||
|
||||
CallerId - This optional parameter may be used to identify the caller.
|
||||
This parameter allows the status code driver to apply different
|
||||
rules to different callers.
|
||||
|
||||
Data - This optional parameter may be used to pass additional data.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The function completed successfully
|
||||
|
||||
EFI_DEVICE_ERROR - The function should not be completed due to a device error.
|
||||
|
||||
--*/
|
||||
;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Interface stucture for the STATUS CODE Architectural Protocol
|
||||
//
|
||||
typedef struct _EFI_STATUS_CODE_PROTOCOL {
|
||||
EFI_REPORT_STATUS_CODE ReportStatusCode;
|
||||
} EFI_STATUS_CODE_PROTOCOL;
|
||||
|
||||
/*++
|
||||
// Protocol Description:
|
||||
//
|
||||
// Provides the service required to report a status code to the platform firmware.
|
||||
// This protocol must be produced by a runtime DXE driver and may be consumed
|
||||
// only by the DXE Foundation.
|
||||
//
|
||||
// Parameter:
|
||||
//
|
||||
// ReportStatusCode - Emit a status code.
|
||||
--*/
|
||||
|
||||
|
||||
extern EFI_GUID gEfiStatusCodeRuntimeProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Timer.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Timer Architectural Protocol GUID as defined in Tiano
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Timer)
|
||||
|
||||
EFI_GUID gEfiTimerArchProtocolGuid = EFI_TIMER_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiTimerArchProtocolGuid, "Timer", "Timer Arch Protocol");
|
|
@ -0,0 +1,260 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Timer.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Timer Architectural Protocol as defined in the DXE CIS
|
||||
|
||||
This code is used to provide the timer tick for the DXE core.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_TIMER_H_
|
||||
#define _ARCH_PROTOCOL_TIMER_H_
|
||||
|
||||
//
|
||||
// Global ID for the Timer Architectural Protocol
|
||||
//
|
||||
#define EFI_TIMER_ARCH_PROTOCOL_GUID \
|
||||
{ 0x26baccb3, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
|
||||
|
||||
//
|
||||
// Declare forward reference for the Timer Architectural Protocol
|
||||
//
|
||||
EFI_FORWARD_DECLARATION (EFI_TIMER_ARCH_PROTOCOL);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(EFIAPI *EFI_TIMER_NOTIFY) (
|
||||
IN UINT64 Time
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function of this type is called when a timer interrupt fires. This
|
||||
function executes at TPL_HIGH_LEVEL. The DXE Core will register a funtion
|
||||
of tyis type to be called for the timer interrupt, so it can know how much
|
||||
time has passed. This information is used to signal timer based events.
|
||||
|
||||
Arguments:
|
||||
|
||||
Time - Time since the last timer interrupt in 100 ns units. This will
|
||||
typically be TimerPeriod, but if a timer interrupt is missed, and the
|
||||
EFI_TIMER_ARCH_PROTOCOL driver can detect missed interrupts, then Time
|
||||
will contain the actual amount of time since the last interrupt.
|
||||
|
||||
Returns:
|
||||
|
||||
None.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TIMER_REGISTER_HANDLER) (
|
||||
IN EFI_TIMER_ARCH_PROTOCOL *This,
|
||||
IN EFI_TIMER_NOTIFY NotifyFunction
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function registers the handler NotifyFunction so it is called every time
|
||||
the timer interrupt fires. It also passes the amount of time since the last
|
||||
handler call to the NotifyFunction. If NotifyFunction is NULL, then the
|
||||
handler is unregistered. If the handler is registered, then EFI_SUCCESS is
|
||||
returned. If the CPU does not support registering a timer interrupt handler,
|
||||
then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler
|
||||
when a handler is already registered, then EFI_ALREADY_STARTED is returned.
|
||||
If an attempt is made to unregister a handler when a handler is not registered,
|
||||
then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to
|
||||
register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR
|
||||
is returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_TIMER_ARCH_PROTOCOL instance.
|
||||
|
||||
NotifyFunction - The function to call when a timer interrupt fires. This
|
||||
function executes at TPL_HIGH_LEVEL. The DXE Core will
|
||||
register a handler for the timer interrupt, so it can know
|
||||
how much time has passed. This information is used to
|
||||
signal timer based events. NULL will unregister the handler.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The timer handler was registered.
|
||||
|
||||
EFI_UNSUPPORTED - The platform does not support timer interrupts.
|
||||
|
||||
EFI_ALREADY_STARTED - NotifyFunction is not NULL, and a handler is already
|
||||
registered.
|
||||
|
||||
EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not
|
||||
previously registered.
|
||||
|
||||
EFI_DEVICE_ERROR - The timer handler could not be registered.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TIMER_SET_TIMER_PERIOD) (
|
||||
IN EFI_TIMER_ARCH_PROTOCOL *This,
|
||||
IN UINT64 TimerPeriod
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function adjusts the period of timer interrupts to the value specified
|
||||
by TimerPeriod. If the timer period is updated, then the selected timer
|
||||
period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If
|
||||
the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.
|
||||
If an error occurs while attempting to update the timer period, then the
|
||||
timer hardware will be put back in its state prior to this call, and
|
||||
EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt
|
||||
is disabled. This is not the same as disabling the CPU's interrupts.
|
||||
Instead, it must either turn off the timer hardware, or it must adjust the
|
||||
interrupt controller so that a CPU interrupt is not generated when the timer
|
||||
interrupt fires.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_TIMER_ARCH_PROTOCOL instance.
|
||||
|
||||
TimerPeriod - The rate to program the timer interrupt in 100 nS units. If
|
||||
the timer hardware is not programmable, then EFI_UNSUPPORTED is
|
||||
returned. If the timer is programmable, then the timer period
|
||||
will be rounded up to the nearest timer period that is supported
|
||||
by the timer hardware. If TimerPeriod is set to 0, then the
|
||||
timer interrupts will be disabled.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The timer period was changed.
|
||||
|
||||
EFI_UNSUPPORTED - The platform cannot change the period of the timer interrupt.
|
||||
|
||||
EFI_DEVICE_ERROR - The timer period could not be changed due to a device error.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TIMER_GET_TIMER_PERIOD) (
|
||||
IN EFI_TIMER_ARCH_PROTOCOL *This,
|
||||
OUT UINT64 *TimerPeriod
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function retrieves the period of timer interrupts in 100 ns units,
|
||||
returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod
|
||||
is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is
|
||||
returned, then the timer is currently disabled.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_TIMER_ARCH_PROTOCOL instance.
|
||||
|
||||
TimerPeriod - A pointer to the timer period to retrieve in 100 ns units. If
|
||||
0 is returned, then the timer is currently disabled.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The timer period was returned in TimerPeriod.
|
||||
|
||||
EFI_INVALID_PARAMETER - TimerPeriod is NULL.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TIMER_GENERATE_SOFT_INTERRUPT) (
|
||||
IN EFI_TIMER_ARCH_PROTOCOL *This
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function generates a soft timer interrupt. If the platform does not support soft
|
||||
timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.
|
||||
If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()
|
||||
service, then a soft timer interrupt will be generated. If the timer interrupt is
|
||||
enabled when this service is called, then the registered handler will be invoked. The
|
||||
registered handler should not be able to distinguish a hardware-generated timer
|
||||
interrupt from a software-generated timer interrupt.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_TIMER_ARCH_PROTOCOL instance.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The soft timer interrupt was generated.
|
||||
|
||||
EFI_UNSUPPORTEDT - The platform does not support the generation of soft timer interrupts.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Interface stucture for the Timer Architectural Protocol
|
||||
//
|
||||
typedef struct _EFI_TIMER_ARCH_PROTOCOL {
|
||||
EFI_TIMER_REGISTER_HANDLER RegisterHandler;
|
||||
EFI_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
|
||||
EFI_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
|
||||
EFI_TIMER_GENERATE_SOFT_INTERRUPT GenerateSoftInterrupt;
|
||||
} EFI_TIMER_ARCH_PROTOCOL;
|
||||
|
||||
/*++
|
||||
|
||||
Protocol Description:
|
||||
This protocol provides the services to initialize a periodic timer
|
||||
interrupt, and to register a handler that is called each time the timer
|
||||
interrupt fires. It may also provide a service to adjust the rate of the
|
||||
periodic timer interrupt. When a timer interrupt occurs, the handler is
|
||||
passed the amount of time that has passed since the previous timer
|
||||
interrupt.
|
||||
|
||||
Parameters:
|
||||
|
||||
RegisterHandler - Registers a handler that will be called each time the
|
||||
timer interrupt fires. TimerPeriod defines the minimum
|
||||
time between timer interrupts, so TimerPeriod will also
|
||||
be the minimum time between calls to the registered
|
||||
handler.
|
||||
|
||||
SetTimerPeriod - Sets the period of the timer interrupt in 100 nS units.
|
||||
This function is optional, and may return EFI_UNSUPPORTED.
|
||||
If this function is supported, then the timer period will
|
||||
be rounded up to the nearest supported timer period.
|
||||
|
||||
GetTimerPeriod - Retrieves the period of the timer interrupt in 100 nS units.
|
||||
|
||||
GenerateSoftInterrupt -
|
||||
Generates a soft timer interrupt that simulates the firing of
|
||||
the timer interrupt. This service can be used to invoke the
|
||||
registered handler if the timer interrupt has been masked for
|
||||
a period of time.
|
||||
|
||||
--*/
|
||||
|
||||
extern EFI_GUID gEfiTimerArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Variable.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Variable Architectural Protocol as defined in Tiano
|
||||
|
||||
This code is used to produce the EFI 1.0 runtime variable services
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (Variable)
|
||||
|
||||
EFI_GUID gEfiVariableArchProtocolGuid = EFI_VARIABLE_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiVariableArchProtocolGuid, "Variable", "Variable Arch Protocol");
|
|
@ -0,0 +1,41 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Variable.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Variable Architectural Protocol as defined in the DXE CIS
|
||||
|
||||
This code is used to produce the EFI 1.0 runtime variable services
|
||||
|
||||
The GetVariable (), GetNextVariableName (), and SetVariable () EFI 1.0
|
||||
services are added to the EFI system table and the
|
||||
EFI_VARIABLE_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.
|
||||
|
||||
No CRC of the EFI system table is required, as it is done in the DXE core.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_VARIABLE_ARCH_H_
|
||||
#define _ARCH_PROTOCOL_VARIABLE_ARCH_H_
|
||||
|
||||
//
|
||||
// Global ID for the Variable Architectural Protocol
|
||||
//
|
||||
#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \
|
||||
{ 0x1e5668e2, 0x8481, 0x11d4, 0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
|
||||
|
||||
extern EFI_GUID gEfiVariableArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,30 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
VariableWrite.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Variable Write Architectural Protocol as defined in DXE CIS
|
||||
|
||||
This code is used to indicate the EFI 1.0 runtime variable services
|
||||
support writting to variables.
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (VariableWrite)
|
||||
|
||||
EFI_GUID gEfiVariableWriteArchProtocolGuid = EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiVariableWriteArchProtocolGuid, "VariableWrite", "Variable Write Arch Protocol");
|
|
@ -0,0 +1,41 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
VariableWrite.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Variable Write Architectural Protocol as defined in the DXE CIS
|
||||
|
||||
This code is used to produce the EFI 1.0 runtime variable services
|
||||
|
||||
The GetVariable (), GetNextVariableName (), and SetVariable () EFI 1.0
|
||||
services are added to the EFI system table and the
|
||||
EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.
|
||||
|
||||
No CRC of the EFI system table is required, as it is done in the DXE core.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H_
|
||||
#define _ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H_
|
||||
|
||||
//
|
||||
// Global ID for the Variable Write Architectural Protocol
|
||||
//
|
||||
#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \
|
||||
{ 0x6441f818, 0x6362, 0x4e44, 0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53 }
|
||||
|
||||
extern EFI_GUID gEfiVariableWriteArchProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
WatchdogTimer.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Watchdog Timer Architectural Protocol GUID as defined in Tiano
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (WatchdogTimer)
|
||||
|
||||
EFI_GUID gEfiWatchdogTimerArchProtocolGuid = EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiWatchdogTimerArchProtocolGuid, "Watchdog Timer", "Watchdog Timer Arch Protocol");
|
|
@ -0,0 +1,206 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
WatchdogTimer.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Watchdog Timer Architectural Protocol as defined in the DXE CIS
|
||||
|
||||
Used to provide system watchdog timer services
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARCH_PROTOCOL_WATCHDOG_TIMER_H_
|
||||
#define _ARCH_PROTOCOL_WATCHDOG_TIMER_H_
|
||||
|
||||
//
|
||||
// Global ID for the Watchdog Timer Architectural Protocol
|
||||
//
|
||||
#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \
|
||||
{ 0x665E3FF5, 0x46CC, 0x11d4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
|
||||
|
||||
//
|
||||
// Declare forward reference for the Timer Architectural Protocol
|
||||
//
|
||||
EFI_FORWARD_DECLARATION (EFI_WATCHDOG_TIMER_ARCH_PROTOCOL);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY) (
|
||||
IN UINT64 Time
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
A function of this type is called when the watchdog timer fires if a
|
||||
handler has been registered.
|
||||
|
||||
Arguments:
|
||||
|
||||
Time - The time in 100 ns units that has passed since the watchdog
|
||||
timer was armed. For the notify function to be called, this
|
||||
must be greater than TimerPeriod.
|
||||
|
||||
Returns:
|
||||
|
||||
None.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) (
|
||||
IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
|
||||
IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function registers a handler that is to be invoked when the watchdog
|
||||
timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the
|
||||
Runtime Service ResetSystem() when the watchdog timer fires. If a
|
||||
NotifyFunction is registered, then the NotifyFunction will be called before
|
||||
the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then
|
||||
the watchdog handler is unregistered. If a watchdog handler is registered,
|
||||
then EFI_SUCCESS is returned. If an attempt is made to register a handler
|
||||
when a handler is already registered, then EFI_ALREADY_STARTED is returned.
|
||||
If an attempt is made to uninstall a handler when a handler is not installed,
|
||||
then return EFI_INVALID_PARAMETER.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
|
||||
|
||||
NotifyFunction - The function to call when the watchdog timer fires. If this
|
||||
is NULL, then the handler will be unregistered.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The watchdog timer handler was registered or
|
||||
unregistered.
|
||||
|
||||
EFI_ALREADY_STARTED - NotifyFunction is not NULL, and a handler is already
|
||||
registered.
|
||||
|
||||
EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not
|
||||
previously registered.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) (
|
||||
IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
|
||||
IN UINT64 TimerPeriod
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function sets the amount of time to wait before firing the watchdog
|
||||
timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog
|
||||
timer is disabled.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
|
||||
|
||||
TimerPeriod - The amount of time in 100 nS units to wait before the watchdog
|
||||
timer is fired. If TimerPeriod is zero, then the watchdog
|
||||
timer is disabled.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The watchdog timer has been programmed to fire in Time
|
||||
100 nS units.
|
||||
|
||||
EFI_DEVICE_ERROR - A watchdog timer could not be programmed due to a device
|
||||
error.
|
||||
|
||||
--*/
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) (
|
||||
IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
|
||||
OUT UINT64 *TimerPeriod
|
||||
);
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function retrieves the amount of time the system will wait before firing
|
||||
the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS
|
||||
is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
|
||||
|
||||
TimerPeriod - A pointer to the amount of time in 100 nS units that the system
|
||||
will wait before the watchdog timer is fired. If TimerPeriod of
|
||||
zero is returned, then the watchdog timer is disabled.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The amount of time that the system will wait before
|
||||
firing the watchdog timer was returned in TimerPeriod.
|
||||
|
||||
EFI_INVALID_PARAMETER - TimerPeriod is NULL.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Interface stucture for the Watchdog Timer Architectural Protocol
|
||||
//
|
||||
typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {
|
||||
EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler;
|
||||
EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
|
||||
EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
|
||||
} EFI_WATCHDOG_TIMER_ARCH_PROTOCOL;
|
||||
|
||||
/*++
|
||||
|
||||
Protocol Description:
|
||||
This protocol provides the services required to implement the Boot Service
|
||||
SetWatchdogTimer(). It provides a service to set the amount of time to wait
|
||||
before firing the watchdog timer, and it also provides a service to register
|
||||
a handler that is invoked when the watchdog timer fires. This protocol can
|
||||
implement the watchdog timer by using the event and timer Boot Services, or
|
||||
it can make use of custom hardware. When the watchdog timer fires, control
|
||||
will be passed to a handler if one has been registered. If no handler has
|
||||
been registered, or the registered handler returns, then the system will be
|
||||
reset by calling the Runtime Service ResetSystem().
|
||||
|
||||
Parameters:
|
||||
|
||||
RegisterHandler - Registers a handler that is invoked when the watchdog
|
||||
timer fires.
|
||||
|
||||
SetTimerPeriod - Sets the amount of time in 100 ns units to wait before the
|
||||
watchdog timer is fired. If this function is supported,
|
||||
then the watchdog timer period will be rounded up to the
|
||||
nearest supported watchdog timer period.
|
||||
|
||||
GetTimerPeriod - Retrieves the amount of time in 100 ns units that the
|
||||
system will wait before the watchdog timer is fired.
|
||||
|
||||
--*/
|
||||
|
||||
extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2005, Intel Corporation
|
||||
# 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
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# CpuIA64Lib.inf
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# Component description file for the Cpu IA64 library.
|
||||
#
|
||||
#--*/
|
||||
|
||||
[defines]
|
||||
BASE_NAME = CpuIA64Lib
|
||||
COMPONENT_TYPE = LIBRARY
|
||||
|
||||
[sources.common]
|
||||
|
||||
[sources.ipf]
|
||||
Ipf\CpuIA64.s
|
||||
|
||||
[includes.common]
|
||||
$(EDK_SOURCE)\Foundation\Efi
|
||||
.
|
||||
$(EDK_SOURCE)\Foundation\Cpu\Itanium\Include
|
||||
$(EDK_SOURCE)\Foundation\include
|
||||
|
||||
[nmake.common]
|
|
@ -0,0 +1,33 @@
|
|||
//****************************************************************************
|
||||
//
|
||||
// Copyright (c) 2004, Intel Corporation
|
||||
// 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
|
||||
// http://opensource.org/licenses/bsd-license.php
|
||||
//
|
||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
// Module Name:
|
||||
//
|
||||
// CpuIA64.s
|
||||
//
|
||||
// Abstract:
|
||||
//
|
||||
// Contains basic assembly procedures to support IPF CPU.
|
||||
//
|
||||
//****************************************************************************
|
||||
|
||||
.file "CpuIA64.s"
|
||||
|
||||
#include "IpfMacro.i"
|
||||
#include "IpfDefines.h"
|
||||
|
||||
|
||||
PROCEDURE_ENTRY (EfiReadTsc)
|
||||
|
||||
mov r8 = ar.itc
|
||||
br.ret.dpnt b0;;
|
||||
|
||||
PROCEDURE_EXIT (EfiReadTsc)
|
|
@ -0,0 +1,39 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
CpuIA64.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _CPU_IA64_H
|
||||
#define _CPU_IA64_H
|
||||
|
||||
#include "Tiano.h"
|
||||
|
||||
UINT64
|
||||
EfiReadTsc (
|
||||
VOID
|
||||
)
|
||||
/*++
|
||||
Routine Description:
|
||||
Read Time stamp
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
Return the read data
|
||||
--*/
|
||||
;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,42 @@
|
|||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2005, Intel Corporation
|
||||
# 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
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# CpuIA32Lib.inf
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# Component description file for the Cpu IA32 library.
|
||||
#
|
||||
#--*/
|
||||
|
||||
[defines]
|
||||
BASE_NAME = CpuIA32Lib
|
||||
COMPONENT_TYPE = LIBRARY
|
||||
|
||||
[sources.common]
|
||||
EfiCpuVersion.c
|
||||
|
||||
[sources.ia32]
|
||||
Ia32\CpuIA32.c
|
||||
|
||||
[sources.x64]
|
||||
x64\Cpu.asm
|
||||
[includes.common]
|
||||
$(EDK_SOURCE)\Foundation\Efi
|
||||
$(EDK_SOURCE)\Foundation\Efi\Include
|
||||
$(EDK_SOURCE)\Foundation\Framework\Include
|
||||
.
|
||||
$(EDK_SOURCE)\Foundation\Cpu\Pentium\Include
|
||||
$(EDK_SOURCE)\Foundation\Include
|
||||
|
||||
[nmake.common]
|
|
@ -0,0 +1,73 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
EfiCpuVersion.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Provide cpu version extract considering extended family & model ID.
|
||||
--*/
|
||||
|
||||
#include "CpuIA32.h"
|
||||
|
||||
VOID
|
||||
EfiCpuVersion (
|
||||
IN OUT UINT16 *FamilyId, OPTIONAL
|
||||
IN OUT UINT8 *Model, OPTIONAL
|
||||
IN OUT UINT8 *SteppingId, OPTIONAL
|
||||
IN OUT UINT8 *Processor OPTIONAL
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Extract CPU detail version infomation
|
||||
|
||||
Arguments:
|
||||
FamilyId - FamilyId, including ExtendedFamilyId
|
||||
Model - Model, including ExtendedModel
|
||||
SteppingId - SteppingId
|
||||
Processor - Processor
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_CPUID_REGISTER Register;
|
||||
UINT8 TempFamilyId;
|
||||
|
||||
EfiCpuid (EFI_CPUID_VERSION_INFO, &Register);
|
||||
|
||||
if (SteppingId != NULL) {
|
||||
*SteppingId = (UINT8) (Register.RegEax & 0xF);
|
||||
}
|
||||
|
||||
if (Processor != NULL) {
|
||||
*Processor = (UINT8) ((Register.RegEax >> 12) & 0x3);
|
||||
}
|
||||
|
||||
if (Model != NULL || FamilyId != NULL) {
|
||||
TempFamilyId = (UINT8) ((Register.RegEax >> 8) & 0xF);
|
||||
|
||||
if (Model != NULL) {
|
||||
*Model = (UINT8) ((Register.RegEax >> 4) & 0xF);
|
||||
if (TempFamilyId == 0x6 || TempFamilyId == 0xF) {
|
||||
*Model |= (Register.RegEax >> 12) & 0xF0;
|
||||
}
|
||||
}
|
||||
|
||||
if (FamilyId != NULL) {
|
||||
*FamilyId = TempFamilyId;
|
||||
if (TempFamilyId == 0xF) {
|
||||
*FamilyId = *FamilyId + (UINT16) ((Register.RegEax >> 20) & 0xFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,179 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
CpuIA32.c
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#include "CpuIA32.h"
|
||||
|
||||
VOID
|
||||
EfiHalt (VOID)
|
||||
{
|
||||
__asm {
|
||||
hlt
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiWbinvd (VOID)
|
||||
{
|
||||
__asm {
|
||||
wbinvd
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiInvd (VOID)
|
||||
{
|
||||
__asm {
|
||||
invd
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiCpuid (IN UINT32 RegisterInEax,
|
||||
OUT EFI_CPUID_REGISTER *Reg OPTIONAL)
|
||||
{
|
||||
__asm {
|
||||
pushad
|
||||
|
||||
mov eax, RegisterInEax
|
||||
cpuid
|
||||
cmp Reg, 0
|
||||
je _Exit
|
||||
mov edi, DWORD PTR Reg
|
||||
|
||||
mov DWORD PTR [edi].RegEax, eax ; Reg->RegEax
|
||||
mov DWORD PTR [edi].RegEbx, ebx ; Reg->RegEbx
|
||||
mov DWORD PTR [edi].RegEcx, ecx ; Reg->RegEcx
|
||||
mov DWORD PTR [edi].RegEdx, edx ; Reg->RegEdx
|
||||
|
||||
_Exit:
|
||||
popad
|
||||
}
|
||||
}
|
||||
|
||||
UINT64
|
||||
EfiReadMsr (IN UINT32 Index)
|
||||
{
|
||||
__asm {
|
||||
mov ecx, Index
|
||||
rdmsr
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiWriteMsr (
|
||||
IN UINT32 Index,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
__asm {
|
||||
mov ecx, Index
|
||||
mov eax, DWORD PTR Value[0]
|
||||
mov edx, DWORD PTR Value[4]
|
||||
wrmsr
|
||||
}
|
||||
}
|
||||
|
||||
UINT64
|
||||
EfiReadTsc (VOID)
|
||||
{
|
||||
__asm {
|
||||
rdtsc
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiDisableCache (VOID)
|
||||
{
|
||||
__asm {
|
||||
mov eax, cr0
|
||||
bswap eax
|
||||
and al, 60h
|
||||
cmp al, 60h
|
||||
je Exit
|
||||
wbinvd
|
||||
mov eax, cr0
|
||||
or eax, 060000000h
|
||||
mov cr0, eax
|
||||
Exit:
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiEnableCache (VOID)
|
||||
{
|
||||
__asm {
|
||||
invd
|
||||
mov eax, cr0
|
||||
and eax, 09fffffffh
|
||||
mov cr0, eax
|
||||
}
|
||||
}
|
||||
|
||||
UINT32
|
||||
EfiGetEflags (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
__asm {
|
||||
pushfd
|
||||
pop eax
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiDisableInterrupts (VOID)
|
||||
{
|
||||
__asm {
|
||||
cli
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiEnableInterrupts (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
__asm {
|
||||
sti
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
EfiCpuidExt (
|
||||
IN UINT32 RegisterInEax,
|
||||
IN UINT32 CacheLevel,
|
||||
OUT EFI_CPUID_REGISTER *Regs
|
||||
)
|
||||
{
|
||||
__asm {
|
||||
pushad
|
||||
|
||||
mov eax, RegisterInEax
|
||||
mov ecx, CacheLevel
|
||||
cpuid
|
||||
mov edi, DWORD PTR Regs
|
||||
|
||||
mov DWORD PTR [edi].RegEax, eax ; Reg->RegEax
|
||||
mov DWORD PTR [edi].RegEbx, ebx ; Reg->RegEbx
|
||||
mov DWORD PTR [edi].RegEcx, ecx ; Reg->RegEcx
|
||||
mov DWORD PTR [edi].RegEdx, edx ; Reg->RegEdx
|
||||
|
||||
popad
|
||||
}
|
||||
}
|
|
@ -0,0 +1,215 @@
|
|||
TITLE Cpu.asm: Assembly code for the x64 resources
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;*
|
||||
;* Copyright (c) 2005 - 2007, Intel Corporation
|
||||
;* 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
|
||||
;* http://opensource.org/licenses/bsd-license.php
|
||||
;*
|
||||
;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
;*
|
||||
;* Module Name:
|
||||
;*
|
||||
;* Cpu.asm
|
||||
;*
|
||||
;* Abstract:
|
||||
;*
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
text SEGMENT
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiHalt (
|
||||
; VOID
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
EfiHalt PROC PUBLIC
|
||||
hlt
|
||||
ret
|
||||
EfiHalt ENDP
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiWbinvd (
|
||||
; VOID
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
EfiWbinvd PROC PUBLIC
|
||||
wbinvd
|
||||
ret
|
||||
EfiWbinvd ENDP
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiInvd (
|
||||
; VOID
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
EfiInvd PROC PUBLIC
|
||||
invd
|
||||
ret
|
||||
EfiInvd ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiCpuid (
|
||||
; IN UINT32 RegisterInEax, // rcx
|
||||
; OUT EFI_CPUID_REGISTER *Reg OPTIONAL // rdx
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
EfiCpuid PROC PUBLIC
|
||||
push rbx
|
||||
|
||||
mov r8, rdx ; r8 = *Reg
|
||||
mov rax, rcx ; RegisterInEax
|
||||
cpuid
|
||||
cmp r8, 0
|
||||
je _Exit
|
||||
mov [r8 + 0], eax ; Reg->RegEax
|
||||
mov [r8 + 4], ebx ; Reg->RegEbx
|
||||
mov [r8 + 8], ecx ; Reg->RegEcx
|
||||
mov [r8 + 12], edx ; Reg->RegEdx
|
||||
|
||||
_Exit:
|
||||
pop rbx
|
||||
ret
|
||||
EfiCpuid ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EfiReadMsr (
|
||||
; IN UINT32 Index, // rcx
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
EfiReadMsr PROC PUBLIC
|
||||
rdmsr
|
||||
sal rdx, 32 ; edx:eax -> rax
|
||||
or rax, rdx ; rax = edx:eax
|
||||
ret
|
||||
EfiReadMsr ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiWriteMsr (
|
||||
; IN UINT32 Index, // rcx
|
||||
; IN UINT64 Value // rdx
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
EfiWriteMsr PROC PUBLIC
|
||||
mov rax, rdx ; rdx = Value
|
||||
sar rdx, 32 ; convert rdx to edx upper 32-bits
|
||||
wrmsr ; wrmsr[ecx] result = edx:eax
|
||||
ret
|
||||
EfiWriteMsr ENDP
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINT64
|
||||
; EfiReadTsc (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EfiReadTsc PROC PUBLIC
|
||||
rdtsc
|
||||
shl rax, 32
|
||||
shrd rax, rdx, 32
|
||||
ret
|
||||
EfiReadTsc ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiDisableCache (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EfiDisableCache PROC PUBLIC
|
||||
; added a check to see if cache is already disabled. If it is, then skip.
|
||||
mov rax, cr0
|
||||
and rax, 060000000h
|
||||
cmp rax, 0
|
||||
jne @f
|
||||
wbinvd
|
||||
mov rax, cr0
|
||||
or rax, 060000000h
|
||||
mov cr0, rax
|
||||
@@:
|
||||
ret
|
||||
EfiDisableCache ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiEnableCache (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EfiEnableCache PROC PUBLIC
|
||||
invd
|
||||
mov rax, cr0
|
||||
and rax, 09fffffffh
|
||||
mov cr0, rax
|
||||
ret
|
||||
EfiEnableCache ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; UINTN
|
||||
; EfiGetEflags (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EfiGetEflags PROC PUBLIC
|
||||
pushfq
|
||||
pop rax
|
||||
ret
|
||||
EfiGetEflags ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiDisableInterrupts (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EfiDisableInterrupts PROC PUBLIC
|
||||
cli
|
||||
ret
|
||||
EfiDisableInterrupts ENDP
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiEnableInterrupts (
|
||||
; VOID
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EfiEnableInterrupts PROC PUBLIC
|
||||
sti
|
||||
ret
|
||||
EfiEnableInterrupts ENDP
|
||||
;------------------------------------------------------------------------------
|
||||
; VOID
|
||||
; EfiCpuidExt (
|
||||
; IN UINT32 RegisterInEax,
|
||||
; IN UINT32 CacheLevel,
|
||||
; OUT EFI_CPUID_REGISTER *Regs
|
||||
; )
|
||||
;------------------------------------------------------------------------------
|
||||
EfiCpuidExt PROC PUBLIC
|
||||
push rbx
|
||||
mov rax, rcx ; rax = RegisterInEax
|
||||
mov rcx, rdx ; rcx = CacheLevel
|
||||
|
||||
cpuid
|
||||
mov [r8 + 0 ], eax ; Reg->RegEax
|
||||
mov [r8 + 4 ], ebx ; Reg->RegEbx
|
||||
mov [r8 + 8 ], ecx ; Reg->RegEcx
|
||||
mov [r8 + 12], edx ; Reg->RegEdx
|
||||
|
||||
pop rbx
|
||||
ret
|
||||
EfiCpuidExt ENDP
|
||||
END
|
|
@ -0,0 +1,372 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
CpuIA32.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _CPU_IA32_H
|
||||
#define _CPU_IA32_H
|
||||
|
||||
#include "Tiano.h"
|
||||
|
||||
#define IA32API __cdecl
|
||||
|
||||
typedef struct {
|
||||
UINT32 RegEax;
|
||||
UINT32 RegEbx;
|
||||
UINT32 RegEcx;
|
||||
UINT32 RegEdx;
|
||||
} EFI_CPUID_REGISTER;
|
||||
|
||||
typedef struct {
|
||||
UINT32 HeaderVersion;
|
||||
UINT32 UpdateRevision;
|
||||
UINT32 Date;
|
||||
UINT32 ProcessorId;
|
||||
UINT32 Checksum;
|
||||
UINT32 LoaderRevision;
|
||||
UINT32 ProcessorFlags;
|
||||
UINT32 DataSize;
|
||||
UINT32 TotalSize;
|
||||
UINT8 Reserved[12];
|
||||
} EFI_CPU_MICROCODE_HEADER;
|
||||
|
||||
typedef struct {
|
||||
UINT32 ExtendedSignatureCount;
|
||||
UINT32 ExtendedTableChecksum;
|
||||
UINT8 Reserved[12];
|
||||
} EFI_CPU_MICROCODE_EXTENDED_TABLE_HEADER;
|
||||
|
||||
typedef struct {
|
||||
UINT32 ProcessorSignature;
|
||||
UINT32 ProcessorFlag;
|
||||
UINT32 ProcessorChecksum;
|
||||
} EFI_CPU_MICROCODE_EXTENDED_TABLE;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Stepping : 4;
|
||||
UINT32 Model : 4;
|
||||
UINT32 Family : 4;
|
||||
UINT32 Type : 2;
|
||||
UINT32 Reserved1 : 2;
|
||||
UINT32 ExtendedModel : 4;
|
||||
UINT32 ExtendedFamily : 8;
|
||||
UINT32 Reserved2 : 4;
|
||||
} EFI_CPU_VERSION;
|
||||
|
||||
#define EFI_CPUID_SIGNATURE 0x0
|
||||
#define EFI_CPUID_VERSION_INFO 0x1
|
||||
#define EFI_CPUID_CACHE_INFO 0x2
|
||||
#define EFI_CPUID_SERIAL_NUMBER 0x3
|
||||
#define EFI_CPUID_EXTENDED_FUNCTION 0x80000000
|
||||
#define EFI_CPUID_EXTENDED_CPU_SIG 0x80000001
|
||||
#define EFI_CPUID_BRAND_STRING1 0x80000002
|
||||
#define EFI_CPUID_BRAND_STRING2 0x80000003
|
||||
#define EFI_CPUID_BRAND_STRING3 0x80000004
|
||||
|
||||
#define EFI_MSR_IA32_PLATFORM_ID 0x17
|
||||
#define EFI_MSR_IA32_APIC_BASE 0x1B
|
||||
#define EFI_MSR_EBC_HARD_POWERON 0x2A
|
||||
#define EFI_MSR_EBC_SOFT_POWERON 0x2B
|
||||
#define BINIT_DRIVER_DISABLE 0x40
|
||||
#define INTERNAL_MCERR_DISABLE 0x20
|
||||
#define INITIATOR_MCERR_DISABLE 0x10
|
||||
#define EFI_MSR_EBC_FREQUENCY_ID 0x2C
|
||||
#define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79
|
||||
#define EFI_MSR_IA32_BIOS_SIGN_ID 0x8B
|
||||
#define EFI_MSR_PSB_CLOCK_STATUS 0xCD
|
||||
#define EFI_APIC_GLOBAL_ENABLE 0x800
|
||||
#define EFI_MSR_IA32_MISC_ENABLE 0x1A0
|
||||
#define LIMIT_CPUID_MAXVAL_ENABLE_BIT 0x00400000
|
||||
#define AUTOMATIC_THERMAL_CONTROL_ENABLE_BIT 0x00000008
|
||||
#define COMPATIBLE_FPU_OPCODE_ENABLE_BIT 0x00000004
|
||||
#define LOGICAL_PROCESSOR_PRIORITY_ENABLE_BIT 0x00000002
|
||||
#define FAST_STRING_ENABLE_BIT 0x00000001
|
||||
|
||||
#define EFI_CACHE_VARIABLE_MTRR_BASE 0x200
|
||||
#define EFI_CACHE_VARIABLE_MTRR_END 0x20F
|
||||
#define EFI_CACHE_IA32_MTRR_DEF_TYPE 0x2FF
|
||||
#define EFI_CACHE_MTRR_VALID 0x800
|
||||
#define EFI_CACHE_FIXED_MTRR_VALID 0x400
|
||||
#define EFI_CACHE_VALID_ADDRESS 0xFFFFFF000
|
||||
#define EFI_MSR_VALID_MASK 0xFFFFFFFFF
|
||||
#define EFI_CACHE_VALID_EXTENDED_ADDRESS 0xFFFFFFFFFF000
|
||||
#define EFI_MSR_VALID_EXTENDED_MASK 0xFFFFFFFFFFFFF
|
||||
|
||||
#define EFI_IA32_MTRR_FIX64K_00000 0x250
|
||||
#define EFI_IA32_MTRR_FIX16K_80000 0x258
|
||||
#define EFI_IA32_MTRR_FIX16K_A0000 0x259
|
||||
#define EFI_IA32_MTRR_FIX4K_C0000 0x268
|
||||
#define EFI_IA32_MTRR_FIX4K_C8000 0x269
|
||||
#define EFI_IA32_MTRR_FIX4K_D0000 0x26A
|
||||
#define EFI_IA32_MTRR_FIX4K_D8000 0x26B
|
||||
#define EFI_IA32_MTRR_FIX4K_E0000 0x26C
|
||||
#define EFI_IA32_MTRR_FIX4K_E8000 0x26D
|
||||
#define EFI_IA32_MTRR_FIX4K_F0000 0x26E
|
||||
#define EFI_IA32_MTRR_FIX4K_F8000 0x26F
|
||||
|
||||
#define EFI_IA32_MCG_CAP 0x179
|
||||
#define EFI_IA32_MCG_CTL 0x17B
|
||||
#define EFI_IA32_MC0_CTL 0x400
|
||||
#define EFI_IA32_MC0_STATUS 0x401
|
||||
|
||||
#define EFI_IA32_PERF_STATUS 0x198
|
||||
#define EFI_IA32_PERF_CTL 0x199
|
||||
|
||||
#define EFI_CACHE_UNCACHEABLE 0
|
||||
#define EFI_CACHE_WRITECOMBINING 1
|
||||
#define EFI_CACHE_WRITETHROUGH 4
|
||||
#define EFI_CACHE_WRITEPROTECTED 5
|
||||
#define EFI_CACHE_WRITEBACK 6
|
||||
|
||||
//
|
||||
// Combine f(FamilyId), m(Model), s(SteppingId) to a single 32 bit number
|
||||
//
|
||||
#define EfiMakeCpuVersion(f, m, s) \
|
||||
(((UINT32) (f) << 16) | ((UINT32) (m) << 8) | ((UINT32) (s)))
|
||||
|
||||
VOID
|
||||
IA32API
|
||||
EfiHalt (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Halt the Cpu
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiWbinvd (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Write back and invalidate the Cpu cache
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiInvd (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Invalidate the Cpu cache
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiCpuid (
|
||||
IN UINT32 RegisterInEax,
|
||||
OUT EFI_CPUID_REGISTER *Regs
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Get the Cpu info by excute the CPUID instruction
|
||||
Arguments:
|
||||
RegisterInEax: -The input value to put into register EAX
|
||||
Regs: -The Output value
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
|
||||
VOID
|
||||
IA32API
|
||||
EfiCpuidExt (
|
||||
IN UINT32 RegisterInEax,
|
||||
IN UINT32 CacheLevel,
|
||||
OUT EFI_CPUID_REGISTER *Regs
|
||||
)
|
||||
/*++
|
||||
Routine Description:
|
||||
When RegisterInEax != 4, the functionality is the same as EfiCpuid.
|
||||
When RegisterInEax == 4, the function return the deterministic cache
|
||||
parameters by excuting the CPUID instruction
|
||||
Arguments:
|
||||
RegisterInEax: - The input value to put into register EAX
|
||||
CacheLevel: - The deterministic cache level
|
||||
Regs: - The Output value
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
;
|
||||
|
||||
UINT64
|
||||
IA32API
|
||||
EfiReadMsr (
|
||||
IN UINT32 Index
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Read Cpu MSR
|
||||
Arguments:
|
||||
Index: -The index value to select the register
|
||||
|
||||
Returns:
|
||||
Return the read data
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiWriteMsr (
|
||||
IN UINT32 Index,
|
||||
IN UINT64 Value
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Write Cpu MSR
|
||||
Arguments:
|
||||
Index: -The index value to select the register
|
||||
Value: -The value to write to the selected register
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
UINT64
|
||||
IA32API
|
||||
EfiReadTsc (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Read Time stamp
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
Return the read data
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiDisableCache (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Writing back and invalidate the cache,then diable it
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiEnableCache (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Invalidate the cache,then Enable it
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
UINT32
|
||||
IA32API
|
||||
EfiGetEflags (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Get Eflags
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
Return the Eflags value
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiDisableInterrupts (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Disable Interrupts
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
VOID
|
||||
IA32API
|
||||
EfiEnableInterrupts (
|
||||
VOID
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
Routine Description:
|
||||
Enable Interrupts
|
||||
Arguments:
|
||||
None
|
||||
Returns:
|
||||
None
|
||||
--*/
|
||||
|
||||
|
||||
VOID
|
||||
IA32API
|
||||
EfiCpuVersion (
|
||||
IN UINT16 *FamilyId, OPTIONAL
|
||||
IN UINT8 *Model, OPTIONAL
|
||||
IN UINT8 *SteppingId, OPTIONAL
|
||||
IN UINT8 *Processor OPTIONAL
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Extract CPU detail version infomation
|
||||
|
||||
Arguments:
|
||||
FamilyId - FamilyId, including ExtendedFamilyId
|
||||
Model - Model, including ExtendedModel
|
||||
SteppingId - SteppingId
|
||||
Processor - Processor
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,35 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2005, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Acpi.c
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used for ACPI entries in the EFI 1.0 system table
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (Acpi)
|
||||
|
||||
EFI_GUID gEfiAcpiTableGuid = EFI_ACPI_TABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiAcpiTableGuid, "ACPI Table", "ACPI 1.0 Table GUID in EFI System Table");
|
||||
|
||||
EFI_GUID gEfiAcpi20TableGuid = EFI_ACPI_20_TABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiAcpi20TableGuid, "ACPI 2.0 Table", "ACPI 2.0 Table GUID in EFI System Table");
|
||||
|
||||
EFI_GUID gEfiAcpi30TableGuid = EFI_ACPI_30_TABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiAcpi30TableGuid, "ACPI 3.0 Table", "ACPI 3.0 Table GUID in EFI System Table");
|
|
@ -0,0 +1,44 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2005, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Acpi.h
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used for ACPI entries in the in the EFI 1.0 system table
|
||||
|
||||
These GUIDs point the ACPI tables as defined in the ACPI specifications.
|
||||
ACPI 2.0 specification defines the ACPI 2.0 GUID. EFI 1.0 defines the
|
||||
ACPI 1.0 GUID.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ACPI_GUID_H_
|
||||
#define _ACPI_GUID_H_
|
||||
|
||||
#define EFI_ACPI_TABLE_GUID \
|
||||
{ \
|
||||
0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
#define EFI_ACPI_20_TABLE_GUID \
|
||||
{ \
|
||||
0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 \
|
||||
}
|
||||
|
||||
#define EFI_ACPI_30_TABLE_GUID EFI_ACPI_20_TABLE_GUID
|
||||
|
||||
extern EFI_GUID gEfiAcpiTableGuid;
|
||||
extern EFI_GUID gEfiAcpi20TableGuid;
|
||||
extern EFI_GUID gEfiAcpi30TableGuid;
|
||||
#endif
|
|
@ -0,0 +1,28 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DebugImageInfoTable.c
|
||||
|
||||
Abstract:
|
||||
|
||||
GUID used to locate the Debug Image Info table in the EFI 1.0 system table.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (DebugImageInfoTable)
|
||||
|
||||
EFI_GUID gEfiDebugImageInfoTableGuid = EFI_DEBUG_IMAGE_INFO_TABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING
|
||||
(&gEfiDebugImageInfoTableGuid, "Debug Image Info Table", "Debug Image Info Table GUID in EFI System Table");
|
|
@ -0,0 +1,63 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DebugImageInfoTable.h
|
||||
|
||||
Abstract:
|
||||
|
||||
GUID and related data structures used with the Debug Image Info Table.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEBUG_IMAGE_INFO_GUID_H_
|
||||
#define _DEBUG_IMAGE_INFO_GUID_H_
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (LoadedImage)
|
||||
|
||||
#define EFI_DEBUG_IMAGE_INFO_TABLE_GUID \
|
||||
{ \
|
||||
0x49152e77, 0x1ada, 0x4764, 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiDebugImageInfoTableGuid;
|
||||
|
||||
#define EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS 0x01
|
||||
#define EFI_DEBUG_IMAGE_INFO_TABLE_MODIFIED 0x02
|
||||
#define EFI_DEBUG_IMAGE_INFO_INITIAL_SIZE (EFI_PAGE_SIZE / sizeof (UINTN))
|
||||
#define EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL 0x01
|
||||
|
||||
typedef struct {
|
||||
UINT64 Signature;
|
||||
EFI_PHYSICAL_ADDRESS EfiSystemTableBase;
|
||||
UINT32 Crc32;
|
||||
} EFI_SYSTEM_TABLE_POINTER;
|
||||
|
||||
typedef struct {
|
||||
UINT32 ImageInfoType;
|
||||
EFI_LOADED_IMAGE_PROTOCOL *LoadedImageProtocolInstance;
|
||||
EFI_HANDLE *ImageHandle;
|
||||
} EFI_DEBUG_IMAGE_INFO_NORMAL;
|
||||
|
||||
typedef union {
|
||||
UINT32 *ImageInfoType;
|
||||
EFI_DEBUG_IMAGE_INFO_NORMAL *NormalImage;
|
||||
} EFI_DEBUG_IMAGE_INFO;
|
||||
|
||||
typedef struct {
|
||||
volatile UINT32 UpdateStatus;
|
||||
UINT32 TableSize;
|
||||
EFI_DEBUG_IMAGE_INFO *EfiDebugImageInfoTable;
|
||||
} EFI_DEBUG_IMAGE_INFO_TABLE_HEADER;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,59 @@
|
|||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2006, Intel Corporation
|
||||
# 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
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
# Module Name:
|
||||
#
|
||||
# EfiGuidLib.inf
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# Component description file.
|
||||
#
|
||||
#--*/
|
||||
|
||||
[defines]
|
||||
BASE_NAME= EfiGuidLib
|
||||
COMPONENT_TYPE= LIBRARY
|
||||
|
||||
[includes.common]
|
||||
$(EDK_SOURCE)\Foundation\Efi
|
||||
$(EDK_SOURCE)\Foundation\Include
|
||||
$(EDK_SOURCE)\Foundation\Efi\Include
|
||||
$(EDK_SOURCE)\Foundation\Framework\Include
|
||||
$(EDK_SOURCE)\Foundation\Include\IndustryStandard
|
||||
$(EDK_SOURCE)\Foundation\Core\Dxe
|
||||
$(EDK_SOURCE)\Foundation\Include\Pei
|
||||
$(EDK_SOURCE)\Foundation\Library\Pei\Include
|
||||
|
||||
[nmake.common]
|
||||
|
||||
[sources.common]
|
||||
Acpi\Acpi.h
|
||||
Acpi\Acpi.c
|
||||
DebugImageInfoTable\DebugImageInfoTable.h
|
||||
DebugImageInfoTable\DebugImageInfoTable.c
|
||||
EventGroup\EventGroup.h
|
||||
EventGroup\EventGroup.c
|
||||
GlobalVariable\GlobalVariable.h
|
||||
GlobalVariable\GlobalVariable.c
|
||||
Gpt\Gpt.h
|
||||
Gpt\Gpt.c
|
||||
HardwareErrorVariable\HardwareErrorVariable.h
|
||||
HardwareErrorVariable\HardwareErrorVariable.c
|
||||
Mps\Mps.h
|
||||
Mps\Mps.c
|
||||
PcAnsi\PcAnsi.h
|
||||
PcAnsi\PcAnsi.c
|
||||
SmBios\SmBios.h
|
||||
SmBios\SmBios.c
|
||||
[sources.ipf]
|
||||
SalSystemTable\SalSystemTable.h
|
||||
SalSystemTable\SalSystemTable.c
|
|
@ -0,0 +1,30 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
EfiGroup.c
|
||||
|
||||
--*/
|
||||
#include "Tiano.h"
|
||||
|
||||
#include EFI_GUID_DEFINITION (EventGroup)
|
||||
|
||||
EFI_GUID gEfiEventExitBootServicesGuid = EFI_EVENT_GROUP_EXIT_BOOT_SERVICES;
|
||||
EFI_GUID gEfiEventVirtualAddressChangeGuid = EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE;
|
||||
EFI_GUID gEfiEventMemoryMapChangeGuid = EFI_EVENT_GROUP_MEMORY_MAP_CHANGE;
|
||||
EFI_GUID gEfiEventReadyToBootGuid = EFI_EVENT_GROUP_READY_TO_BOOT;
|
||||
|
||||
EFI_GUID_STRING (&gEfiEventExitBootServicesGuid, "EventExitBS", "Event Exit Boot Service GUID");
|
||||
EFI_GUID_STRING (&gEfiEventVirtualAddressChangeGuid, "EventVirtualAddrChange", "Event Virtual Addr Change GUID");
|
||||
EFI_GUID_STRING (&gEfiEventMemoryMapChangeGuid, "EventMemMapChange", "Event Memory Map Change GUID");
|
||||
EFI_GUID_STRING (&gEfiEventReadyToBootGuid, "EventReadyToBoot", "Efi Ready To Boot GUID");
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/** @file
|
||||
GUIDs for gBS->CreateEventEx Event Groups. Defined in UEFI 2.0.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name: EventGroup.h
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __EVENT_GROUP_GUID__
|
||||
#define __EVENT_GROUP_GUID__
|
||||
|
||||
|
||||
#define EFI_EVENT_GROUP_EXIT_BOOT_SERVICES \
|
||||
{ 0x27abf055, 0xb1b8, 0x4c26, { 0x80, 0x48, 0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf } }
|
||||
|
||||
extern EFI_GUID gEfiEventExitBootServicesGuid;
|
||||
|
||||
|
||||
#define EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE \
|
||||
{ 0x13fa7698, 0xc831, 0x49c7, { 0x87, 0xea, 0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96 } }
|
||||
|
||||
extern EFI_GUID gEfiEventVirtualAddressChangeGuid;
|
||||
|
||||
|
||||
#define EFI_EVENT_GROUP_MEMORY_MAP_CHANGE \
|
||||
{ 0x78bee926, 0x692f, 0x48fd, { 0x9e, 0xdb, 0x1, 0x42, 0x2e, 0xf0, 0xd7, 0xab } }
|
||||
|
||||
extern EFI_GUID gEfiEventMemoryMapChangeGuid;
|
||||
|
||||
|
||||
#define EFI_EVENT_GROUP_READY_TO_BOOT \
|
||||
{ 0x7ce88fb3, 0x4bd7, 0x4679, { 0x87, 0xa8, 0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b } }
|
||||
|
||||
extern EFI_GUID gEfiEventReadyToBootGuid;
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
GlobalVariable.c
|
||||
|
||||
Abstract:
|
||||
|
||||
GUID for EFI (NVRAM) Variables. Defined in EFI 1.0.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (GlobalVariable)
|
||||
|
||||
EFI_GUID gEfiGlobalVariableGuid = EFI_GLOBAL_VARIABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiGlobalVariableGuid, "Efi", "Efi Variable GUID")
|
|
@ -0,0 +1,32 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
GlobalVariable.h
|
||||
|
||||
Abstract:
|
||||
|
||||
GUID for EFI (NVRAM) Variables. Defined in EFI 1.0.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _GLOBAL_VARIABLE_GUID_H_
|
||||
#define _GLOBAL_VARIABLE_GUID_H_
|
||||
|
||||
#define EFI_GLOBAL_VARIABLE_GUID \
|
||||
{ \
|
||||
0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiGlobalVariableGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,38 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Gpt.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Guids used for the GPT as defined in EFI 1.0
|
||||
|
||||
GPT defines a new disk partitioning scheme and also describes
|
||||
usage of the legacy Master Boot Record (MBR) partitioning scheme.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (Gpt)
|
||||
|
||||
EFI_GUID gEfiPartTypeUnusedGuid = EFI_PART_TYPE_UNUSED_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiPartTypeUnusedGuid, "G0", "Null Partition Type GUID");
|
||||
|
||||
EFI_GUID gEfiPartTypeSystemPartGuid = EFI_PART_TYPE_EFI_SYSTEM_PART_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiPartTypeSystemPartGuid, "ESP", "EFI System Partition GUID");
|
||||
|
||||
EFI_GUID gEfiPartTypeLegacyMbrGuid = EFI_PART_TYPE_LEGACY_MBR_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiPartTypeLegacyMbrGuid, "Legacy MBR", "Legacy Master Boot Record Partition GUID");
|
|
@ -0,0 +1,47 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Gpt.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Guids used for the GPT as defined in EFI 1.0
|
||||
|
||||
GPT defines a new disk partitioning scheme and also describes
|
||||
usage of the legacy Master Boot Record (MBR) partitioning scheme.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _GPT_GUID_H_
|
||||
#define _GPT_GUID_H_
|
||||
|
||||
#define EFI_PART_TYPE_UNUSED_GUID \
|
||||
{ \
|
||||
0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
|
||||
}
|
||||
|
||||
#define EFI_PART_TYPE_EFI_SYSTEM_PART_GUID \
|
||||
{ \
|
||||
0xc12a7328, 0xf81f, 0x11d2, 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b \
|
||||
}
|
||||
|
||||
#define EFI_PART_TYPE_LEGACY_MBR_GUID \
|
||||
{ \
|
||||
0x024dee41, 0x33e7, 0x11d3, 0x9d, 0x69, 0x00, 0x08, 0xc7, 0x81, 0xf3, 0x9f \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiPartTypeUnusedGuid;
|
||||
extern EFI_GUID gEfiPartTypeSystemPartGuid;
|
||||
extern EFI_GUID gEfiPartTypeLegacyMbrGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
HardwareErrorVariable.c
|
||||
|
||||
Abstract:
|
||||
|
||||
GUID for hardware error record variables. Defined in UEFI 2.1.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (HardwareErrorVariable)
|
||||
|
||||
EFI_GUID gEfiHardwareErrorVariableGuid = EFI_HARDWARE_ERROR_VARIABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiHardwareErrorVariableGuid, "HwErr", "Hardware Error Variable GUID")
|
|
@ -0,0 +1,32 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
HardwareErrorVariable.h
|
||||
|
||||
Abstract:
|
||||
|
||||
GUID for hardware error record variables. Defined in UEFI 2.1.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _HARDWARE_ERROR_VARIABLE_GUID_H_
|
||||
#define _HARDWARE_ERROR_VARIABLE_GUID_H_
|
||||
|
||||
#define EFI_HARDWARE_ERROR_VARIABLE_GUID \
|
||||
{ \
|
||||
0x414E6BDD, 0xE47B, 0x47cc, {0xB2, 0x44, 0xBB, 0x61, 0x02, 0x0C, 0xF5, 0x16} \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiHardwareErrorVariableGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,33 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Mps.c
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used for MPS entries in the in the EFI 1.0 system table
|
||||
|
||||
These GUIDs point the MPS tables as defined in the MPS 1.4 specifications.
|
||||
|
||||
ACPI is the primary means of exporting MP information to the OS. MPS obly was
|
||||
included to support Itanium-based platform power on. So don't use it if you don't have too.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (Mps)
|
||||
|
||||
EFI_GUID gEfiMpsTableGuid = EFI_MPS_TABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiMpsTableGuid, "MPS Table", "MPS Table GUID in EFI System Table");
|
|
@ -0,0 +1,38 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Mps.h
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used for MPS entries in the in the EFI 1.0 system table
|
||||
|
||||
These GUIDs point the MPS tables as defined in the MPS 1.4 specifications.
|
||||
|
||||
ACPI is the primary means of exporting MP information to the OS. MPS obly was
|
||||
included to support Itanium-based platform power on. So don't use it if you don't have too.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _MPS_GUID_H_
|
||||
#define _MPS_GUID_H_
|
||||
|
||||
#define EFI_MPS_TABLE_GUID \
|
||||
{ \
|
||||
0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiMpsTableGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,30 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
SalSystemTable.c
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used for SAL system table entries in the in the EFI 1.0 system table.
|
||||
|
||||
SAL System Table contains Itanium-based processor centric information about
|
||||
the system.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (SalSystemTable)
|
||||
|
||||
EFI_GUID gEfiSalSystemTableGuid = EFI_SAL_SYSTEM_TABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiSalSystemTableGuid, "SAL System Table", "SAL System Table GUID in EFI System Table");
|
|
@ -0,0 +1,34 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
SalSystemTable.h
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used for SAL system table entries in the in the EFI 1.0 system table.
|
||||
|
||||
SAL System Table contains Itanium-based processor centric information about
|
||||
the system.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _SAL_SYSTEM_TABLE_GUID_H_
|
||||
|
||||
#define EFI_SAL_SYSTEM_TABLE_GUID \
|
||||
{ \
|
||||
0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiSalSystemTableGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
SmBios.c
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used to locate the SMBIOS tables in the EFI 1.0 system table.
|
||||
|
||||
This GUID in the system table is the only legal way to search for and
|
||||
locate the SMBIOS tables. Do not search the 0xF0000 segment to find SMBIOS
|
||||
tables.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_GUID_DEFINITION (Smbios)
|
||||
|
||||
EFI_GUID gEfiSmbiosTableGuid = EFI_SMBIOS_TABLE_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiSmbiosTableGuid, "SMBIOS Table", "SMBIOS Table GUID in EFI System Table");
|
|
@ -0,0 +1,70 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
SmBios.h
|
||||
|
||||
Abstract:
|
||||
|
||||
GUIDs used to locate the SMBIOS tables in the EFI 1.0 system table.
|
||||
|
||||
This GUID in the system table is the only legal way to search for and
|
||||
locate the SMBIOS tables. Do not search the 0xF0000 segment to find SMBIOS
|
||||
tables.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _SMBIOS_GUID_H_
|
||||
#define _SMBIOS_GUID_H_
|
||||
|
||||
#define EFI_SMBIOS_TABLE_GUID \
|
||||
{ \
|
||||
0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiSmbiosTableGuid;
|
||||
|
||||
//
|
||||
// Smbios Table Entry Point Structure
|
||||
//
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT8 AnchorString[4];
|
||||
UINT8 EntryPointStructureChecksum;
|
||||
UINT8 EntryPointLength;
|
||||
UINT8 MajorVersion;
|
||||
UINT8 MinorVersion;
|
||||
UINT16 MaxStructureSize;
|
||||
UINT8 EntryPointRevision;
|
||||
UINT8 FormattedArea[5];
|
||||
UINT8 IntermediateAnchorString[5];
|
||||
UINT8 IntermediateChecksum;
|
||||
UINT16 TableLength;
|
||||
UINT32 TableAddress;
|
||||
UINT16 NumberOfSmbiosStructures;
|
||||
UINT8 SmbiosBcdRevision;
|
||||
} SMBIOS_TABLE_ENTRY_POINT;
|
||||
#pragma pack()
|
||||
//
|
||||
// The Smbios structure header
|
||||
//
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
|
||||
UINT8 Type;
|
||||
UINT8 Length;
|
||||
UINT16 Handle;
|
||||
|
||||
} SMBIOS_STRUCTURE;
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
|
@ -0,0 +1,34 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
PcAnsi.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Terminal Device Path Vendor Guid. Defined in EFI 1.0.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
|
||||
#include EFI_GUID_DEFINITION (PcAnsi)
|
||||
|
||||
EFI_GUID gEfiPcAnsiGuid = EFI_PC_ANSI_GUID;
|
||||
EFI_GUID gEfiVT100Guid = EFI_VT_100_GUID;
|
||||
EFI_GUID gEfiVT100PlusGuid = EFI_VT_100_PLUS_GUID;
|
||||
EFI_GUID gEfiVTUTF8Guid = EFI_VT_UTF8_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiPcAnsiGuid, "Efi", "Efi PC ANSI Device Path Vendor GUID")
|
||||
EFI_GUID_STRING(&gEfiVT100Guid, "Efi", "Efi VT100 Device Path Vendor GUID")
|
||||
EFI_GUID_STRING(&gEfiVT100PlusGuid, "Efi", "Efi VT100Plus Device Path Vendor GUID")
|
||||
EFI_GUID_STRING(&gEfiVTUTF8Guid, "Efi", "Efi VTUTF8 Device Path Vendor GUID")
|
|
@ -0,0 +1,50 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
PcAnsi.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Terminal Device Path Vendor Guid. Defined in EFI 1.0.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _PC_ANSI_H_
|
||||
#define _PC_ANSI_H_
|
||||
|
||||
#define EFI_PC_ANSI_GUID \
|
||||
{ \
|
||||
0xe0c14753, 0xf9be, 0x11d2, 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
#define EFI_VT_100_GUID \
|
||||
{ \
|
||||
0xdfa66065, 0xb419, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
#define EFI_VT_100_PLUS_GUID \
|
||||
{ \
|
||||
0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 \
|
||||
}
|
||||
|
||||
#define EFI_VT_UTF8_GUID \
|
||||
{ \
|
||||
0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiPcAnsiGuid;
|
||||
extern EFI_GUID gEfiVT100Guid;
|
||||
extern EFI_GUID gEfiVT100PlusGuid;
|
||||
extern EFI_GUID gEfiVTUTF8Guid;
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,555 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
EfiDevicePath.h
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI Device Path definitions
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_DEVICE_PATH_H
|
||||
#define _EFI_DEVICE_PATH_H
|
||||
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
|
||||
//
|
||||
// Device Path defines and macros
|
||||
//
|
||||
#define EFI_DP_TYPE_MASK 0x7F
|
||||
#define EFI_DP_TYPE_UNPACKED 0x80
|
||||
#define END_DEVICE_PATH_TYPE 0x7f
|
||||
#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
|
||||
#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
|
||||
#define END_DEVICE_PATH_LENGTH (sizeof(EFI_DEVICE_PATH_PROTOCOL))
|
||||
|
||||
#define DP_IS_END_TYPE(a)
|
||||
#define DP_IS_END_SUBTYPE(a) ( ((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
|
||||
|
||||
#define DevicePathType(a) ( ((a)->Type) & EFI_DP_TYPE_MASK )
|
||||
#define DevicePathSubType(a) ( (a)->SubType )
|
||||
#define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) )
|
||||
#define NextDevicePathNode(a) ( (EFI_DEVICE_PATH_PROTOCOL *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a)))
|
||||
#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE )
|
||||
#define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
|
||||
#define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) )
|
||||
#define IsDevicePathUnpacked(a) ( (a)->Type & EFI_DP_TYPE_UNPACKED )
|
||||
|
||||
|
||||
#define SetDevicePathNodeLength(a,l) { \
|
||||
(a)->Length[0] = (UINT8) (l); \
|
||||
(a)->Length[1] = (UINT8) ((l) >> 8); \
|
||||
}
|
||||
|
||||
#define SetDevicePathEndNode(a) { \
|
||||
(a)->Type = END_DEVICE_PATH_TYPE; \
|
||||
(a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
|
||||
(a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL); \
|
||||
(a)->Length[1] = 0; \
|
||||
}
|
||||
|
||||
//
|
||||
// Hardware Device Paths
|
||||
//
|
||||
#define HARDWARE_DEVICE_PATH 0x01
|
||||
|
||||
#define HW_PCI_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 Function;
|
||||
UINT8 Device;
|
||||
} PCI_DEVICE_PATH;
|
||||
|
||||
#define HW_PCCARD_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 FunctionNumber;
|
||||
} PCCARD_DEVICE_PATH;
|
||||
|
||||
#define HW_MEMMAP_DP 0x03
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 MemoryType;
|
||||
EFI_PHYSICAL_ADDRESS StartingAddress;
|
||||
EFI_PHYSICAL_ADDRESS EndingAddress;
|
||||
} MEMMAP_DEVICE_PATH;
|
||||
|
||||
#define HW_VENDOR_DP 0x04
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
} VENDOR_DEVICE_PATH;
|
||||
|
||||
#define HW_CONTROLLER_DP 0x05
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Controller;
|
||||
} CONTROLLER_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// ACPI Device Paths
|
||||
//
|
||||
#define ACPI_DEVICE_PATH 0x02
|
||||
|
||||
#define ACPI_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 HID;
|
||||
UINT32 UID;
|
||||
} ACPI_HID_DEVICE_PATH;
|
||||
|
||||
#define ACPI_EXTENDED_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 HID;
|
||||
UINT32 UID;
|
||||
UINT32 CID;
|
||||
//
|
||||
// Optional variable length _HIDSTR
|
||||
// Optional variable length _UIDSTR
|
||||
//
|
||||
} ACPI_EXTENDED_HID_DEVICE_PATH;
|
||||
|
||||
#define ACPI_ADR_DP 0x03
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 ADR;
|
||||
} ACPI_ADR_DEVICE_PATH;
|
||||
|
||||
#define ACPI_ADR_DISPLAY_TYPE_OTHER 0
|
||||
#define ACPI_ADR_DISPLAY_TYPE_VGA 1
|
||||
#define ACPI_ADR_DISPLAY_TYPE_TV 2
|
||||
#define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3
|
||||
#define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4
|
||||
|
||||
#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
|
||||
((UINT32) ( (((_DeviceIdScheme) & 0x1) << 31) | \
|
||||
(((_HeadId) & 0x7) << 18) | \
|
||||
(((_NonVgaOutput) & 0x1) << 17) | \
|
||||
(((_BiosCanDetect) & 0x1) << 16) | \
|
||||
(((_VendorInfo) & 0xf) << 12) | \
|
||||
(((_Type) & 0xf) << 8) | \
|
||||
(((_Port) & 0xf) << 4) | \
|
||||
((_Index) & 0xf) ))
|
||||
|
||||
//
|
||||
// EISA ID Macro
|
||||
// EISA ID Definition 32-bits
|
||||
// bits[15:0] - three character compressed ASCII EISA ID.
|
||||
// bits[31:16] - binary number
|
||||
// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
|
||||
//
|
||||
#define PNP_EISA_ID_CONST 0x41d0
|
||||
#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
|
||||
#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
|
||||
#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
|
||||
|
||||
#define PNP_EISA_ID_MASK 0xffff
|
||||
#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
|
||||
|
||||
//
|
||||
// Messaging Device Paths
|
||||
//
|
||||
#define MESSAGING_DEVICE_PATH 0x03
|
||||
|
||||
#define MSG_ATAPI_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 PrimarySecondary;
|
||||
UINT8 SlaveMaster;
|
||||
UINT16 Lun;
|
||||
} ATAPI_DEVICE_PATH;
|
||||
|
||||
#define MSG_SCSI_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 Pun;
|
||||
UINT16 Lun;
|
||||
} SCSI_DEVICE_PATH;
|
||||
|
||||
#define MSG_FIBRECHANNEL_DP 0x03
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Reserved;
|
||||
UINT64 WWN;
|
||||
UINT64 Lun;
|
||||
} FIBRECHANNEL_DEVICE_PATH;
|
||||
|
||||
#define MSG_1394_DP 0x04
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Reserved;
|
||||
UINT64 Guid;
|
||||
} F1394_DEVICE_PATH;
|
||||
|
||||
#define MSG_USB_DP 0x05
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 ParentPortNumber;
|
||||
UINT8 InterfaceNumber;
|
||||
} USB_DEVICE_PATH;
|
||||
|
||||
#define MSG_USB_CLASS_DP 0x0f
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 VendorId;
|
||||
UINT16 ProductId;
|
||||
UINT8 DeviceClass;
|
||||
UINT8 DeviceSubClass;
|
||||
UINT8 DeviceProtocol;
|
||||
} USB_CLASS_DEVICE_PATH;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
#define MSG_USB_WWID_DP 0x10
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 InterfaceNumber;
|
||||
UINT16 VendorId;
|
||||
UINT16 ProductId;
|
||||
//
|
||||
// CHAR16 SerialNumber[];
|
||||
//
|
||||
} USB_WWID_DEVICE_PATH;
|
||||
|
||||
#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 Lun;
|
||||
} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
|
||||
#endif
|
||||
|
||||
#define MSG_SATA_DP 0x12
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 HBAPortNumber;
|
||||
UINT16 PortMultiplierPortNumber;
|
||||
UINT16 Lun;
|
||||
} SATA_DEVICE_PATH;
|
||||
|
||||
#define MSG_I2O_DP 0x06
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Tid;
|
||||
} I2O_DEVICE_PATH;
|
||||
|
||||
#define MSG_MAC_ADDR_DP 0x0b
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_MAC_ADDRESS MacAddress;
|
||||
UINT8 IfType;
|
||||
} MAC_ADDR_DEVICE_PATH;
|
||||
|
||||
#define MSG_IPv4_DP 0x0c
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_IPv4_ADDRESS LocalIpAddress;
|
||||
EFI_IPv4_ADDRESS RemoteIpAddress;
|
||||
UINT16 LocalPort;
|
||||
UINT16 RemotePort;
|
||||
UINT16 Protocol;
|
||||
BOOLEAN StaticIpAddress;
|
||||
} IPv4_DEVICE_PATH;
|
||||
|
||||
#define MSG_IPv6_DP 0x0d
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_IPv6_ADDRESS LocalIpAddress;
|
||||
EFI_IPv6_ADDRESS RemoteIpAddress;
|
||||
UINT16 LocalPort;
|
||||
UINT16 RemotePort;
|
||||
UINT16 Protocol;
|
||||
BOOLEAN StaticIpAddress;
|
||||
} IPv6_DEVICE_PATH;
|
||||
|
||||
#define MSG_INFINIBAND_DP 0x09
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 ResourceFlags;
|
||||
UINT8 PortGid[16];
|
||||
UINT64 ServiceId;
|
||||
UINT64 TargetPortId;
|
||||
UINT64 DeviceId;
|
||||
} INFINIBAND_DEVICE_PATH;
|
||||
|
||||
#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
|
||||
#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
|
||||
#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
|
||||
#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
|
||||
#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
|
||||
|
||||
#define MSG_UART_DP 0x0e
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Reserved;
|
||||
UINT64 BaudRate;
|
||||
UINT8 DataBits;
|
||||
UINT8 Parity;
|
||||
UINT8 StopBits;
|
||||
} UART_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// Use VENDOR_DEVICE_PATH struct
|
||||
//
|
||||
#define MSG_VENDOR_DP 0x0a
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_PC_ANSI \
|
||||
{ 0xe0c14753, 0xf9be, 0x11d2, 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_VT_100 \
|
||||
{ 0xdfa66065, 0xb419, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_VT_100_PLUS \
|
||||
{ 0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 }
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_VT_UTF8 \
|
||||
{ 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 }
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL \
|
||||
{ 0x37499a9d, 0x542f, 0x4c89, 0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 }
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT32 FlowControlMap;
|
||||
} UART_FLOW_CONTROL_DEVICE_PATH;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_SAS \
|
||||
{ 0xd487ddb4, 0x008b, 0x11d9, 0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d }
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT32 Reserved;
|
||||
UINT64 SasAddress;
|
||||
UINT64 Lun;
|
||||
UINT16 DeviceTopology;
|
||||
UINT16 RelativeTargetPort;
|
||||
} SAS_DEVICE_PATH;
|
||||
|
||||
#define MSG_ISCSI_DP 0x13
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 NetworkProtocol;
|
||||
UINT16 LoginOption;
|
||||
UINT64 Lun;
|
||||
UINT16 TargetPortalGroupTag;
|
||||
// CHAR8 iSCSI Target Name
|
||||
} ISCSI_DEVICE_PATH;
|
||||
|
||||
#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002
|
||||
#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008
|
||||
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000
|
||||
#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Media Device Path
|
||||
//
|
||||
#define MEDIA_DEVICE_PATH 0x04
|
||||
|
||||
#define MEDIA_HARDDRIVE_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 PartitionNumber;
|
||||
UINT64 PartitionStart;
|
||||
UINT64 PartitionSize;
|
||||
UINT8 Signature[16];
|
||||
UINT8 MBRType;
|
||||
UINT8 SignatureType;
|
||||
} HARDDRIVE_DEVICE_PATH;
|
||||
|
||||
#define MBR_TYPE_PCAT 0x01
|
||||
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
|
||||
|
||||
#define SIGNATURE_TYPE_MBR 0x01
|
||||
#define SIGNATURE_TYPE_GUID 0x02
|
||||
|
||||
#define MEDIA_CDROM_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 BootEntry;
|
||||
UINT64 PartitionStart;
|
||||
UINT64 PartitionSize;
|
||||
} CDROM_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// Use VENDOR_DEVICE_PATH struct
|
||||
//
|
||||
#define MEDIA_VENDOR_DP 0x03
|
||||
|
||||
#define MEDIA_FILEPATH_DP 0x04
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
CHAR16 PathName[1];
|
||||
} FILEPATH_DEVICE_PATH;
|
||||
|
||||
#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
|
||||
|
||||
#define MEDIA_PROTOCOL_DP 0x05
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Protocol;
|
||||
} MEDIA_PROTOCOL_DEVICE_PATH;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
|
||||
|
||||
#define MEDIA_FV_DP 0x06
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID NameGuid;
|
||||
} MEDIA_FW_VOL_DEVICE_PATH;
|
||||
|
||||
#define MEDIA_FV_FILEPATH_DP 0x07
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID NameGuid;
|
||||
} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// BBS Device Path
|
||||
//
|
||||
#define BBS_DEVICE_PATH 0x05
|
||||
#define BBS_BBS_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 DeviceType;
|
||||
UINT16 StatusFlag;
|
||||
CHAR8 String[1];
|
||||
} BBS_BBS_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// DeviceType definitions - from BBS specification
|
||||
//
|
||||
#define BBS_TYPE_FLOPPY 0x01
|
||||
#define BBS_TYPE_HARDDRIVE 0x02
|
||||
#define BBS_TYPE_CDROM 0x03
|
||||
#define BBS_TYPE_PCMCIA 0x04
|
||||
#define BBS_TYPE_USB 0x05
|
||||
#define BBS_TYPE_EMBEDDED_NETWORK 0x06
|
||||
#define BBS_TYPE_BEV 0x80
|
||||
#define BBS_TYPE_UNKNOWN 0xFF
|
||||
|
||||
#define UNKNOWN_DEVICE_GUID \
|
||||
{ 0xcf31fac5, 0xc24e, 0x11d2, 0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b }
|
||||
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH DevicePath;
|
||||
UINT8 LegacyDriveLetter;
|
||||
} UNKNOWN_DEVICE_VENDOR_DEVICE_PATH;
|
||||
|
||||
|
||||
//
|
||||
// Union of all possible Device Paths and pointers to Device Paths
|
||||
//
|
||||
|
||||
typedef union {
|
||||
EFI_DEVICE_PATH_PROTOCOL DevPath;
|
||||
PCI_DEVICE_PATH Pci;
|
||||
PCCARD_DEVICE_PATH PcCard;
|
||||
MEMMAP_DEVICE_PATH MemMap;
|
||||
VENDOR_DEVICE_PATH Vendor;
|
||||
|
||||
UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor;
|
||||
|
||||
CONTROLLER_DEVICE_PATH Controller;
|
||||
ACPI_HID_DEVICE_PATH Acpi;
|
||||
|
||||
ATAPI_DEVICE_PATH Atapi;
|
||||
SCSI_DEVICE_PATH Scsi;
|
||||
FIBRECHANNEL_DEVICE_PATH FibreChannel;
|
||||
SATA_DEVICE_PATH Sata;
|
||||
|
||||
F1394_DEVICE_PATH F1394;
|
||||
USB_DEVICE_PATH Usb;
|
||||
USB_CLASS_DEVICE_PATH UsbClass;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
USB_WWID_DEVICE_PATH UsbWwid;
|
||||
#endif
|
||||
I2O_DEVICE_PATH I2O;
|
||||
MAC_ADDR_DEVICE_PATH MacAddr;
|
||||
IPv4_DEVICE_PATH Ipv4;
|
||||
IPv6_DEVICE_PATH Ipv6;
|
||||
INFINIBAND_DEVICE_PATH InfiniBand;
|
||||
UART_DEVICE_PATH Uart;
|
||||
UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
SAS_DEVICE_PATH Sas;
|
||||
ISCSI_DEVICE_PATH Iscsi;
|
||||
#endif
|
||||
HARDDRIVE_DEVICE_PATH HardDrive;
|
||||
CDROM_DEVICE_PATH CD;
|
||||
|
||||
FILEPATH_DEVICE_PATH FilePath;
|
||||
MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
|
||||
|
||||
BBS_BBS_DEVICE_PATH Bbs;
|
||||
} EFI_DEV_PATH;
|
||||
|
||||
|
||||
|
||||
typedef union {
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevPath;
|
||||
PCI_DEVICE_PATH *Pci;
|
||||
PCCARD_DEVICE_PATH *PcCard;
|
||||
MEMMAP_DEVICE_PATH *MemMap;
|
||||
VENDOR_DEVICE_PATH *Vendor;
|
||||
|
||||
UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor;
|
||||
|
||||
CONTROLLER_DEVICE_PATH *Controller;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
|
||||
|
||||
ATAPI_DEVICE_PATH *Atapi;
|
||||
SCSI_DEVICE_PATH *Scsi;
|
||||
FIBRECHANNEL_DEVICE_PATH *FibreChannel;
|
||||
SATA_DEVICE_PATH *Sata;
|
||||
|
||||
F1394_DEVICE_PATH *F1394;
|
||||
USB_DEVICE_PATH *Usb;
|
||||
USB_CLASS_DEVICE_PATH *UsbClass;
|
||||
I2O_DEVICE_PATH *I2O;
|
||||
MAC_ADDR_DEVICE_PATH *MacAddr;
|
||||
IPv4_DEVICE_PATH *Ipv4;
|
||||
IPv6_DEVICE_PATH *Ipv6;
|
||||
INFINIBAND_DEVICE_PATH *InfiniBand;
|
||||
UART_DEVICE_PATH *Uart;
|
||||
|
||||
HARDDRIVE_DEVICE_PATH *HardDrive;
|
||||
CDROM_DEVICE_PATH *CD;
|
||||
|
||||
FILEPATH_DEVICE_PATH *FilePath;
|
||||
MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
|
||||
|
||||
BBS_BBS_DEVICE_PATH *Bbs;
|
||||
UINT8 *Raw;
|
||||
} EFI_DEV_PATH_PTR;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,67 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
EfiError.h
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI error levels and thier associated defines
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_ERROR_H_
|
||||
#define _EFI_ERROR_H_
|
||||
|
||||
//
|
||||
// Set the upper bit to indicate EFI Error.
|
||||
//
|
||||
#define EFIERR(a) (EFI_MAX_BIT | (a))
|
||||
|
||||
#define EFIWARN(a) (a)
|
||||
#define EFI_ERROR(a) (((INTN) (a)) < 0)
|
||||
|
||||
#define EFI_SUCCESS 0
|
||||
#define EFI_LOAD_ERROR EFIERR (1)
|
||||
#define EFI_INVALID_PARAMETER EFIERR (2)
|
||||
#define EFI_UNSUPPORTED EFIERR (3)
|
||||
#define EFI_BAD_BUFFER_SIZE EFIERR (4)
|
||||
#define EFI_BUFFER_TOO_SMALL EFIERR (5)
|
||||
#define EFI_NOT_READY EFIERR (6)
|
||||
#define EFI_DEVICE_ERROR EFIERR (7)
|
||||
#define EFI_WRITE_PROTECTED EFIERR (8)
|
||||
#define EFI_OUT_OF_RESOURCES EFIERR (9)
|
||||
#define EFI_VOLUME_CORRUPTED EFIERR (10)
|
||||
#define EFI_VOLUME_FULL EFIERR (11)
|
||||
#define EFI_NO_MEDIA EFIERR (12)
|
||||
#define EFI_MEDIA_CHANGED EFIERR (13)
|
||||
#define EFI_NOT_FOUND EFIERR (14)
|
||||
#define EFI_ACCESS_DENIED EFIERR (15)
|
||||
#define EFI_NO_RESPONSE EFIERR (16)
|
||||
#define EFI_NO_MAPPING EFIERR (17)
|
||||
#define EFI_TIMEOUT EFIERR (18)
|
||||
#define EFI_NOT_STARTED EFIERR (19)
|
||||
#define EFI_ALREADY_STARTED EFIERR (20)
|
||||
#define EFI_ABORTED EFIERR (21)
|
||||
#define EFI_ICMP_ERROR EFIERR (22)
|
||||
#define EFI_TFTP_ERROR EFIERR (23)
|
||||
#define EFI_PROTOCOL_ERROR EFIERR (24)
|
||||
#define EFI_INCOMPATIBLE_VERSION EFIERR (25)
|
||||
#define EFI_SECURITY_VIOLATION EFIERR (26)
|
||||
#define EFI_CRC_ERROR EFIERR (27)
|
||||
|
||||
#define EFI_WARN_UNKNOWN_GLYPH EFIWARN (1)
|
||||
#define EFI_WARN_DELETE_FAILURE EFIWARN (2)
|
||||
#define EFI_WARN_WRITE_FAILURE EFIWARN (3)
|
||||
#define EFI_WARN_BUFFER_TOO_SMALL EFIWARN (4)
|
||||
|
||||
#endif
|
|
@ -0,0 +1,661 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
EfiImage.h
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI image format for PE32+. Please note some data structures are different
|
||||
for IA-32 and Itanium-based images, look for UINTN and the #ifdef EFI_IA64
|
||||
|
||||
BugBug: Fix text - doc as defined in MSFT EFI specification
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_IMAGE_H_
|
||||
#define _EFI_IMAGE_H_
|
||||
|
||||
//
|
||||
// PE32+ Subsystem type for EFI images
|
||||
//
|
||||
#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10
|
||||
#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
|
||||
#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
|
||||
|
||||
//
|
||||
// BugBug: Need to get a real answer for this problem. This is not in the
|
||||
// PE specification.
|
||||
//
|
||||
// A SAL runtime driver does not get fixed up when a transition to
|
||||
// virtual mode is made. In all other cases it should be treated
|
||||
// like a EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER image
|
||||
//
|
||||
#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
|
||||
|
||||
//
|
||||
// PE32+ Machine type for EFI images
|
||||
//
|
||||
#define EFI_IMAGE_MACHINE_IA32 0x014c
|
||||
#define EFI_IMAGE_MACHINE_IA64 0x0200
|
||||
#define EFI_IMAGE_MACHINE_X64 0x8664
|
||||
//
|
||||
// #define EFI_IMAGE_MACHINE_FCODE 0xfc0d
|
||||
//
|
||||
#define EFI_IMAGE_MACHINE_EBC 0x0EBC
|
||||
|
||||
#define EFI_IMAGE_DOS_SIGNATURE 0x5A4D // MZ
|
||||
#define EFI_IMAGE_OS2_SIGNATURE 0x454E // NE
|
||||
#define EFI_IMAGE_OS2_SIGNATURE_LE 0x454C // LE
|
||||
#define EFI_IMAGE_NT_SIGNATURE 0x00004550 // PE00
|
||||
#define EFI_IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
|
||||
//
|
||||
// PE images can start with an optional DOS header, so if an image is run
|
||||
// under DOS it can print an error message.
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 e_magic; // Magic number
|
||||
UINT16 e_cblp; // Bytes on last page of file
|
||||
UINT16 e_cp; // Pages in file
|
||||
UINT16 e_crlc; // Relocations
|
||||
UINT16 e_cparhdr; // Size of header in paragraphs
|
||||
UINT16 e_minalloc; // Minimum extra paragraphs needed
|
||||
UINT16 e_maxalloc; // Maximum extra paragraphs needed
|
||||
UINT16 e_ss; // Initial (relative) SS value
|
||||
UINT16 e_sp; // Initial SP value
|
||||
UINT16 e_csum; // Checksum
|
||||
UINT16 e_ip; // Initial IP value
|
||||
UINT16 e_cs; // Initial (relative) CS value
|
||||
UINT16 e_lfarlc; // File address of relocation table
|
||||
UINT16 e_ovno; // Overlay number
|
||||
UINT16 e_res[4]; // Reserved words
|
||||
UINT16 e_oemid; // OEM identifier (for e_oeminfo)
|
||||
UINT16 e_oeminfo; // OEM information; e_oemid specific
|
||||
UINT16 e_res2[10]; // Reserved words
|
||||
UINT32 e_lfanew; // File address of new exe header
|
||||
} EFI_IMAGE_DOS_HEADER;
|
||||
|
||||
//
|
||||
// File header format.
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 Machine;
|
||||
UINT16 NumberOfSections;
|
||||
UINT32 TimeDateStamp;
|
||||
UINT32 PointerToSymbolTable;
|
||||
UINT32 NumberOfSymbols;
|
||||
UINT16 SizeOfOptionalHeader;
|
||||
UINT16 Characteristics;
|
||||
} EFI_IMAGE_FILE_HEADER;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_FILE_HEADER 20
|
||||
|
||||
#define EFI_IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
|
||||
#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
|
||||
#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
|
||||
#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
|
||||
#define EFI_IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
|
||||
#define EFI_IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
|
||||
#define EFI_IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
|
||||
#define EFI_IMAGE_FILE_SYSTEM 0x1000 // System File.
|
||||
#define EFI_IMAGE_FILE_DLL 0x2000 // File is a DLL.
|
||||
#define EFI_IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
|
||||
#define EFI_IMAGE_FILE_MACHINE_UNKNOWN 0
|
||||
#define EFI_IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
|
||||
#define EFI_IMAGE_FILE_MACHINE_R3000 0x162 // MIPS* little-endian, 0540 big-endian
|
||||
#define EFI_IMAGE_FILE_MACHINE_R4000 0x166 // MIPS* little-endian
|
||||
#define EFI_IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP*
|
||||
#define EFI_IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM* PowerPC Little-Endian
|
||||
#define EFI_IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
|
||||
//
|
||||
// * Other names and brands may be claimed as the property of others.
|
||||
//
|
||||
//
|
||||
// Directory format.
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 VirtualAddress;
|
||||
UINT32 Size;
|
||||
} EFI_IMAGE_DATA_DIRECTORY;
|
||||
|
||||
#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16
|
||||
|
||||
typedef struct {
|
||||
UINT16 Magic;
|
||||
UINT8 MajorLinkerVersion;
|
||||
UINT8 MinorLinkerVersion;
|
||||
UINT32 SizeOfCode;
|
||||
UINT32 SizeOfInitializedData;
|
||||
UINT32 SizeOfUninitializedData;
|
||||
UINT32 AddressOfEntryPoint;
|
||||
UINT32 BaseOfCode;
|
||||
UINT32 BaseOfData;
|
||||
UINT32 BaseOfBss;
|
||||
UINT32 GprMask;
|
||||
UINT32 CprMask[4];
|
||||
UINT32 GpValue;
|
||||
} EFI_IMAGE_ROM_OPTIONAL_HEADER;
|
||||
|
||||
#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
|
||||
#define EFI_IMAGE_SIZEOF_ROM_OPTIONAL_HEADER sizeof (EFI_IMAGE_ROM_OPTIONAL_HEADER)
|
||||
|
||||
typedef struct {
|
||||
EFI_IMAGE_FILE_HEADER FileHeader;
|
||||
EFI_IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
|
||||
} EFI_IMAGE_ROM_HEADERS;
|
||||
|
||||
//
|
||||
// ATTENTION!!! EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
|
||||
// are for use ONLY by tools. All proper EFI code MUST use
|
||||
// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
|
||||
//
|
||||
#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
|
||||
|
||||
typedef struct {
|
||||
//
|
||||
// Standard fields.
|
||||
//
|
||||
UINT16 Magic;
|
||||
UINT8 MajorLinkerVersion;
|
||||
UINT8 MinorLinkerVersion;
|
||||
UINT32 SizeOfCode;
|
||||
UINT32 SizeOfInitializedData;
|
||||
UINT32 SizeOfUninitializedData;
|
||||
UINT32 AddressOfEntryPoint;
|
||||
UINT32 BaseOfCode;
|
||||
UINT32 BaseOfData;
|
||||
//
|
||||
// NT additional fields.
|
||||
//
|
||||
UINT32 ImageBase;
|
||||
UINT32 SectionAlignment;
|
||||
UINT32 FileAlignment;
|
||||
UINT16 MajorOperatingSystemVersion;
|
||||
UINT16 MinorOperatingSystemVersion;
|
||||
UINT16 MajorImageVersion;
|
||||
UINT16 MinorImageVersion;
|
||||
UINT16 MajorSubsystemVersion;
|
||||
UINT16 MinorSubsystemVersion;
|
||||
UINT32 Win32VersionValue;
|
||||
UINT32 SizeOfImage;
|
||||
UINT32 SizeOfHeaders;
|
||||
UINT32 CheckSum;
|
||||
UINT16 Subsystem;
|
||||
UINT16 DllCharacteristics;
|
||||
UINT32 SizeOfStackReserve;
|
||||
UINT32 SizeOfStackCommit;
|
||||
UINT32 SizeOfHeapReserve;
|
||||
UINT32 SizeOfHeapCommit;
|
||||
UINT32 LoaderFlags;
|
||||
UINT32 NumberOfRvaAndSizes;
|
||||
EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
|
||||
} EFI_IMAGE_OPTIONAL_HEADER32;
|
||||
|
||||
//
|
||||
// ATTENTION!!! EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
|
||||
// are for use ONLY by tools. All proper EFI code MUST use
|
||||
// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
|
||||
//
|
||||
#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
|
||||
|
||||
typedef struct {
|
||||
//
|
||||
// Standard fields.
|
||||
//
|
||||
UINT16 Magic;
|
||||
UINT8 MajorLinkerVersion;
|
||||
UINT8 MinorLinkerVersion;
|
||||
UINT32 SizeOfCode;
|
||||
UINT32 SizeOfInitializedData;
|
||||
UINT32 SizeOfUninitializedData;
|
||||
UINT32 AddressOfEntryPoint;
|
||||
UINT32 BaseOfCode;
|
||||
//
|
||||
// NT additional fields.
|
||||
//
|
||||
UINT64 ImageBase;
|
||||
UINT32 SectionAlignment;
|
||||
UINT32 FileAlignment;
|
||||
UINT16 MajorOperatingSystemVersion;
|
||||
UINT16 MinorOperatingSystemVersion;
|
||||
UINT16 MajorImageVersion;
|
||||
UINT16 MinorImageVersion;
|
||||
UINT16 MajorSubsystemVersion;
|
||||
UINT16 MinorSubsystemVersion;
|
||||
UINT32 Win32VersionValue;
|
||||
UINT32 SizeOfImage;
|
||||
UINT32 SizeOfHeaders;
|
||||
UINT32 CheckSum;
|
||||
UINT16 Subsystem;
|
||||
UINT16 DllCharacteristics;
|
||||
UINT64 SizeOfStackReserve;
|
||||
UINT64 SizeOfStackCommit;
|
||||
UINT64 SizeOfHeapReserve;
|
||||
UINT64 SizeOfHeapCommit;
|
||||
UINT32 LoaderFlags;
|
||||
UINT32 NumberOfRvaAndSizes;
|
||||
EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
|
||||
} EFI_IMAGE_OPTIONAL_HEADER64;
|
||||
|
||||
//
|
||||
// ATTENTION!!! EFI_IMAGE_NT_HEADERS32 and EFI_IMAGE_HEADERS64 are for use ONLY
|
||||
// by tools. All proper EFI code MUST use EFI_IMAGE_NT_HEADERS ONLY!!!
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 Signature;
|
||||
EFI_IMAGE_FILE_HEADER FileHeader;
|
||||
EFI_IMAGE_OPTIONAL_HEADER32 OptionalHeader;
|
||||
} EFI_IMAGE_NT_HEADERS32;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32)
|
||||
|
||||
typedef struct {
|
||||
UINT32 Signature;
|
||||
EFI_IMAGE_FILE_HEADER FileHeader;
|
||||
EFI_IMAGE_OPTIONAL_HEADER64 OptionalHeader;
|
||||
} EFI_IMAGE_NT_HEADERS64;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64)
|
||||
|
||||
//
|
||||
// Include processor specific definition of EFI_IMAGE_OPTIONAL_HEADER so the
|
||||
// type name EFI_IMAGE_OPTIONAL_HEADER is appropriate to the build. Same for
|
||||
// EFI_IMAGE_NT_HEADERS. These definitions MUST be used by ALL EFI code.
|
||||
//
|
||||
#include "EfiPeOptionalHeader.h"
|
||||
|
||||
#define EFI_IMAGE_FIRST_SECTION(ntheader) \
|
||||
( \
|
||||
(EFI_IMAGE_SECTION_HEADER *) \
|
||||
( \
|
||||
(UINT32) ntheader + \
|
||||
FIELD_OFFSET (EFI_IMAGE_NT_HEADERS, OptionalHeader) + \
|
||||
((EFI_IMAGE_NT_HEADERS *) (ntheader))->FileHeader.SizeOfOptionalHeader \
|
||||
) \
|
||||
)
|
||||
|
||||
//
|
||||
// Subsystem Values
|
||||
//
|
||||
#define EFI_IMAGE_SUBSYSTEM_UNKNOWN 0
|
||||
#define EFI_IMAGE_SUBSYSTEM_NATIVE 1
|
||||
#define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI 2
|
||||
#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3.
|
||||
#define EFI_IMAGE_SUBSYSTEM_OS2_CUI 5
|
||||
#define EFI_IMAGE_SUBSYSTEM_POSIX_CUI 7
|
||||
|
||||
//
|
||||
// Directory Entries
|
||||
//
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT 0
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT 1
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE 2
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY 4
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC 5
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG 6
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_TLS 9
|
||||
#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
|
||||
|
||||
//
|
||||
// Section header format.
|
||||
//
|
||||
#define EFI_IMAGE_SIZEOF_SHORT_NAME 8
|
||||
|
||||
typedef struct {
|
||||
UINT8 Name[EFI_IMAGE_SIZEOF_SHORT_NAME];
|
||||
union {
|
||||
UINT32 PhysicalAddress;
|
||||
UINT32 VirtualSize;
|
||||
} Misc;
|
||||
UINT32 VirtualAddress;
|
||||
UINT32 SizeOfRawData;
|
||||
UINT32 PointerToRawData;
|
||||
UINT32 PointerToRelocations;
|
||||
UINT32 PointerToLinenumbers;
|
||||
UINT16 NumberOfRelocations;
|
||||
UINT16 NumberOfLinenumbers;
|
||||
UINT32 Characteristics;
|
||||
} EFI_IMAGE_SECTION_HEADER;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_SECTION_HEADER 40
|
||||
|
||||
#define EFI_IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
|
||||
#define EFI_IMAGE_SCN_CNT_CODE 0x00000020
|
||||
#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
|
||||
#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
|
||||
|
||||
#define EFI_IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
|
||||
#define EFI_IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information.
|
||||
#define EFI_IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image.
|
||||
#define EFI_IMAGE_SCN_LNK_COMDAT 0x00001000
|
||||
|
||||
#define EFI_IMAGE_SCN_ALIGN_1BYTES 0x00100000
|
||||
#define EFI_IMAGE_SCN_ALIGN_2BYTES 0x00200000
|
||||
#define EFI_IMAGE_SCN_ALIGN_4BYTES 0x00300000
|
||||
#define EFI_IMAGE_SCN_ALIGN_8BYTES 0x00400000
|
||||
#define EFI_IMAGE_SCN_ALIGN_16BYTES 0x00500000
|
||||
#define EFI_IMAGE_SCN_ALIGN_32BYTES 0x00600000
|
||||
#define EFI_IMAGE_SCN_ALIGN_64BYTES 0x00700000
|
||||
|
||||
#define EFI_IMAGE_SCN_MEM_DISCARDABLE 0x02000000
|
||||
#define EFI_IMAGE_SCN_MEM_NOT_CACHED 0x04000000
|
||||
#define EFI_IMAGE_SCN_MEM_NOT_PAGED 0x08000000
|
||||
#define EFI_IMAGE_SCN_MEM_SHARED 0x10000000
|
||||
#define EFI_IMAGE_SCN_MEM_EXECUTE 0x20000000
|
||||
#define EFI_IMAGE_SCN_MEM_READ 0x40000000
|
||||
#define EFI_IMAGE_SCN_MEM_WRITE 0x80000000
|
||||
|
||||
//
|
||||
// Symbol format.
|
||||
//
|
||||
#define EFI_IMAGE_SIZEOF_SYMBOL 18
|
||||
|
||||
//
|
||||
// Section values.
|
||||
//
|
||||
// Symbols have a section number of the section in which they are
|
||||
// defined. Otherwise, section numbers have the following meanings:
|
||||
//
|
||||
#define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0 // Symbol is undefined or is common.
|
||||
#define EFI_IMAGE_SYM_ABSOLUTE (UINT16) -1 // Symbol is an absolute value.
|
||||
#define EFI_IMAGE_SYM_DEBUG (UINT16) -2 // Symbol is a special debug item.
|
||||
//
|
||||
// Type (fundamental) values.
|
||||
//
|
||||
#define EFI_IMAGE_SYM_TYPE_NULL 0 // no type.
|
||||
#define EFI_IMAGE_SYM_TYPE_VOID 1 //
|
||||
#define EFI_IMAGE_SYM_TYPE_CHAR 2 // type character.
|
||||
#define EFI_IMAGE_SYM_TYPE_SHORT 3 // type short integer.
|
||||
#define EFI_IMAGE_SYM_TYPE_INT 4
|
||||
#define EFI_IMAGE_SYM_TYPE_LONG 5
|
||||
#define EFI_IMAGE_SYM_TYPE_FLOAT 6
|
||||
#define EFI_IMAGE_SYM_TYPE_DOUBLE 7
|
||||
#define EFI_IMAGE_SYM_TYPE_STRUCT 8
|
||||
#define EFI_IMAGE_SYM_TYPE_UNION 9
|
||||
#define EFI_IMAGE_SYM_TYPE_ENUM 10 // enumeration.
|
||||
#define EFI_IMAGE_SYM_TYPE_MOE 11 // member of enumeration.
|
||||
#define EFI_IMAGE_SYM_TYPE_BYTE 12
|
||||
#define EFI_IMAGE_SYM_TYPE_WORD 13
|
||||
#define EFI_IMAGE_SYM_TYPE_UINT 14
|
||||
#define EFI_IMAGE_SYM_TYPE_DWORD 15
|
||||
|
||||
//
|
||||
// Type (derived) values.
|
||||
//
|
||||
#define EFI_IMAGE_SYM_DTYPE_NULL 0 // no derived type.
|
||||
#define EFI_IMAGE_SYM_DTYPE_POINTER 1
|
||||
#define EFI_IMAGE_SYM_DTYPE_FUNCTION 2
|
||||
#define EFI_IMAGE_SYM_DTYPE_ARRAY 3
|
||||
|
||||
//
|
||||
// Storage classes.
|
||||
//
|
||||
#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION (UINT8) -1
|
||||
#define EFI_IMAGE_SYM_CLASS_NULL 0
|
||||
#define EFI_IMAGE_SYM_CLASS_AUTOMATIC 1
|
||||
#define EFI_IMAGE_SYM_CLASS_EXTERNAL 2
|
||||
#define EFI_IMAGE_SYM_CLASS_STATIC 3
|
||||
#define EFI_IMAGE_SYM_CLASS_REGISTER 4
|
||||
#define EFI_IMAGE_SYM_CLASS_EXTERNAL_DEF 5
|
||||
#define EFI_IMAGE_SYM_CLASS_LABEL 6
|
||||
#define EFI_IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
|
||||
#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
|
||||
#define EFI_IMAGE_SYM_CLASS_ARGUMENT 9
|
||||
#define EFI_IMAGE_SYM_CLASS_STRUCT_TAG 10
|
||||
#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
|
||||
#define EFI_IMAGE_SYM_CLASS_UNION_TAG 12
|
||||
#define EFI_IMAGE_SYM_CLASS_TYPE_DEFINITION 13
|
||||
#define EFI_IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
|
||||
#define EFI_IMAGE_SYM_CLASS_ENUM_TAG 15
|
||||
#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
|
||||
#define EFI_IMAGE_SYM_CLASS_REGISTER_PARAM 17
|
||||
#define EFI_IMAGE_SYM_CLASS_BIT_FIELD 18
|
||||
#define EFI_IMAGE_SYM_CLASS_BLOCK 100
|
||||
#define EFI_IMAGE_SYM_CLASS_FUNCTION 101
|
||||
#define EFI_IMAGE_SYM_CLASS_END_OF_STRUCT 102
|
||||
#define EFI_IMAGE_SYM_CLASS_FILE 103
|
||||
#define EFI_IMAGE_SYM_CLASS_SECTION 104
|
||||
#define EFI_IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
|
||||
|
||||
//
|
||||
// type packing constants
|
||||
//
|
||||
#define EFI_IMAGE_N_BTMASK 017
|
||||
#define EFI_IMAGE_N_TMASK 060
|
||||
#define EFI_IMAGE_N_TMASK1 0300
|
||||
#define EFI_IMAGE_N_TMASK2 0360
|
||||
#define EFI_IMAGE_N_BTSHFT 4
|
||||
#define EFI_IMAGE_N_TSHIFT 2
|
||||
|
||||
//
|
||||
// Communal selection types.
|
||||
//
|
||||
#define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES 1
|
||||
#define EFI_IMAGE_COMDAT_SELECT_ANY 2
|
||||
#define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE 3
|
||||
#define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH 4
|
||||
#define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
|
||||
|
||||
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
|
||||
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
|
||||
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
|
||||
|
||||
//
|
||||
// Relocation format.
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 VirtualAddress;
|
||||
UINT32 SymbolTableIndex;
|
||||
UINT16 Type;
|
||||
} EFI_IMAGE_RELOCATION;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_RELOCATION 10
|
||||
|
||||
//
|
||||
// I386 relocation types.
|
||||
//
|
||||
#define EFI_IMAGE_REL_I386_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
|
||||
#define EFI_IMAGE_REL_I386_DIR16 01 // Direct 16-bit reference to the symbols virtual address
|
||||
#define EFI_IMAGE_REL_I386_REL16 02 // PC-relative 16-bit reference to the symbols virtual address
|
||||
#define EFI_IMAGE_REL_I386_DIR32 06 // Direct 32-bit reference to the symbols virtual address
|
||||
#define EFI_IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit reference to the symbols virtual address, base not included
|
||||
#define EFI_IMAGE_REL_I386_SEG12 011 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
|
||||
#define EFI_IMAGE_REL_I386_SECTION 012
|
||||
#define EFI_IMAGE_REL_I386_SECREL 013
|
||||
#define EFI_IMAGE_REL_I386_REL32 024 // PC-relative 32-bit reference to the symbols virtual address
|
||||
//
|
||||
// Based relocation format.
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 VirtualAddress;
|
||||
UINT32 SizeOfBlock;
|
||||
} EFI_IMAGE_BASE_RELOCATION;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_BASE_RELOCATION 8
|
||||
|
||||
//
|
||||
// Based relocation types.
|
||||
//
|
||||
#define EFI_IMAGE_REL_BASED_ABSOLUTE 0
|
||||
#define EFI_IMAGE_REL_BASED_HIGH 1
|
||||
#define EFI_IMAGE_REL_BASED_LOW 2
|
||||
#define EFI_IMAGE_REL_BASED_HIGHLOW 3
|
||||
#define EFI_IMAGE_REL_BASED_HIGHADJ 4
|
||||
#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR 5
|
||||
#define EFI_IMAGE_REL_BASED_IA64_IMM64 9
|
||||
#define EFI_IMAGE_REL_BASED_DIR64 10
|
||||
|
||||
//
|
||||
// Line number format.
|
||||
//
|
||||
typedef struct {
|
||||
union {
|
||||
UINT32 SymbolTableIndex; // Symbol table index of function name if Linenumber is 0.
|
||||
UINT32 VirtualAddress; // Virtual address of line number.
|
||||
} Type;
|
||||
UINT16 Linenumber; // Line number.
|
||||
} EFI_IMAGE_LINENUMBER;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_LINENUMBER 6
|
||||
|
||||
//
|
||||
// Archive format.
|
||||
//
|
||||
#define EFI_IMAGE_ARCHIVE_START_SIZE 8
|
||||
#define EFI_IMAGE_ARCHIVE_START "!<arch>\n"
|
||||
#define EFI_IMAGE_ARCHIVE_END "`\n"
|
||||
#define EFI_IMAGE_ARCHIVE_PAD "\n"
|
||||
#define EFI_IMAGE_ARCHIVE_LINKER_MEMBER "/ "
|
||||
#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
|
||||
|
||||
typedef struct {
|
||||
UINT8 Name[16]; // File member name - `/' terminated.
|
||||
UINT8 Date[12]; // File member date - decimal.
|
||||
UINT8 UserID[6]; // File member user id - decimal.
|
||||
UINT8 GroupID[6]; // File member group id - decimal.
|
||||
UINT8 Mode[8]; // File member mode - octal.
|
||||
UINT8 Size[10]; // File member size - decimal.
|
||||
UINT8 EndHeader[2]; // String to end header.
|
||||
} EFI_IMAGE_ARCHIVE_MEMBER_HEADER;
|
||||
|
||||
#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
|
||||
|
||||
//
|
||||
// DLL support.
|
||||
//
|
||||
//
|
||||
// Export Format
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 Characteristics;
|
||||
UINT32 TimeDateStamp;
|
||||
UINT16 MajorVersion;
|
||||
UINT16 MinorVersion;
|
||||
UINT32 Name;
|
||||
UINT32 Base;
|
||||
UINT32 NumberOfFunctions;
|
||||
UINT32 NumberOfNames;
|
||||
UINT32 AddressOfFunctions;
|
||||
UINT32 AddressOfNames;
|
||||
UINT32 AddressOfNameOrdinals;
|
||||
} EFI_IMAGE_EXPORT_DIRECTORY;
|
||||
|
||||
//
|
||||
// Import Format
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 Hint;
|
||||
UINT8 Name[1];
|
||||
} EFI_IMAGE_IMPORT_BY_NAME;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
UINT32 Function;
|
||||
UINT32 Ordinal;
|
||||
EFI_IMAGE_IMPORT_BY_NAME *AddressOfData;
|
||||
} u1;
|
||||
} EFI_IMAGE_THUNK_DATA;
|
||||
|
||||
#define EFI_IMAGE_ORDINAL_FLAG 0x80000000
|
||||
#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)
|
||||
#define EFI_IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
|
||||
|
||||
typedef struct {
|
||||
UINT32 Characteristics;
|
||||
UINT32 TimeDateStamp;
|
||||
UINT32 ForwarderChain;
|
||||
UINT32 Name;
|
||||
EFI_IMAGE_THUNK_DATA *FirstThunk;
|
||||
} EFI_IMAGE_IMPORT_DESCRIPTOR;
|
||||
|
||||
//
|
||||
// Debug Format
|
||||
//
|
||||
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2
|
||||
|
||||
typedef struct {
|
||||
UINT32 Characteristics;
|
||||
UINT32 TimeDateStamp;
|
||||
UINT16 MajorVersion;
|
||||
UINT16 MinorVersion;
|
||||
UINT32 Type;
|
||||
UINT32 SizeOfData;
|
||||
UINT32 RVA;
|
||||
UINT32 FileOffset;
|
||||
} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
|
||||
|
||||
#define CODEVIEW_SIGNATURE_NB10 0x3031424E // "NB10"
|
||||
typedef struct {
|
||||
UINT32 Signature; // "NB10"
|
||||
UINT32 Unknown;
|
||||
UINT32 Unknown2;
|
||||
UINT32 Unknown3;
|
||||
//
|
||||
// Filename of .PDB goes here
|
||||
//
|
||||
} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
|
||||
|
||||
#define CODEVIEW_SIGNATURE_RSDS 0x53445352 // "RSDS"
|
||||
typedef struct {
|
||||
UINT32 Signature; // "RSDS"
|
||||
UINT32 Unknown;
|
||||
UINT32 Unknown2;
|
||||
UINT32 Unknown3;
|
||||
UINT32 Unknown4;
|
||||
UINT32 Unknown5;
|
||||
//
|
||||
// Filename of .PDB goes here
|
||||
//
|
||||
} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
|
||||
|
||||
//
|
||||
// Header format for TE images
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 Signature; // signature for TE format = "VZ"
|
||||
UINT16 Machine; // from the original file header
|
||||
UINT8 NumberOfSections; // from the original file header
|
||||
UINT8 Subsystem; // from original optional header
|
||||
UINT16 StrippedSize; // how many bytes we removed from the header
|
||||
UINT32 AddressOfEntryPoint; // offset to entry point -- from original optional header
|
||||
UINT32 BaseOfCode; // from original image -- required for ITP debug
|
||||
UINT64 ImageBase; // from original file header
|
||||
EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]; // only base relocation and debug directory
|
||||
} EFI_TE_IMAGE_HEADER;
|
||||
|
||||
#define EFI_TE_IMAGE_HEADER_SIGNATURE 0x5A56 // "VZ"
|
||||
//
|
||||
// Data directory indexes in our TE image header
|
||||
//
|
||||
#define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC 0
|
||||
#define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG 1
|
||||
|
||||
//
|
||||
// Union of PE32, PE32+, and TE headers
|
||||
//
|
||||
typedef union {
|
||||
EFI_IMAGE_NT_HEADERS32 Pe32;
|
||||
EFI_IMAGE_NT_HEADERS64 Pe32Plus;
|
||||
EFI_TE_IMAGE_HEADER Te;
|
||||
} EFI_IMAGE_OPTIONAL_HEADER_UNION;
|
||||
|
||||
typedef union {
|
||||
EFI_IMAGE_NT_HEADERS32 *Pe32;
|
||||
EFI_IMAGE_NT_HEADERS64 *Pe32Plus;
|
||||
EFI_TE_IMAGE_HEADER *Te;
|
||||
EFI_IMAGE_OPTIONAL_HEADER_UNION *Union;
|
||||
} EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,292 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
EfiTypes.h
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI defined types. Use these types when ever possible!
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_TYPES_H_
|
||||
#define _EFI_TYPES_H_
|
||||
|
||||
//
|
||||
// EFI Data Types based on ANSI C integer types in EfiBind.h
|
||||
//
|
||||
typedef uint8_t BOOLEAN;
|
||||
typedef intn_t INTN;
|
||||
typedef uintn_t UINTN;
|
||||
typedef int8_t INT8;
|
||||
typedef uint8_t UINT8;
|
||||
typedef int16_t INT16;
|
||||
typedef uint16_t UINT16;
|
||||
typedef int32_t INT32;
|
||||
typedef uint32_t UINT32;
|
||||
typedef int64_t INT64;
|
||||
typedef uint64_t UINT64;
|
||||
typedef uint8_t CHAR8;
|
||||
typedef uint16_t CHAR16;
|
||||
typedef UINT64 EFI_LBA;
|
||||
|
||||
//
|
||||
// Modifiers for EFI Data Types used to self document code.
|
||||
// Please see EFI coding convention for proper usage.
|
||||
//
|
||||
#ifndef IN
|
||||
//
|
||||
// Some other envirnments use this construct, so #ifndef to prevent
|
||||
// mulitple definition.
|
||||
//
|
||||
#define IN
|
||||
#define OUT
|
||||
#define OPTIONAL
|
||||
#endif
|
||||
#define UNALIGNED
|
||||
|
||||
//
|
||||
// Modifiers for EFI Runtime and Boot Services
|
||||
//
|
||||
#define EFI_RUNTIMESERVICE
|
||||
#define EFI_BOOTSERVICE
|
||||
|
||||
//
|
||||
// Boot Service add in EFI 1.1
|
||||
//
|
||||
#define EFI_BOOTSERVICE11
|
||||
|
||||
//
|
||||
// Modifiers to absract standard types to aid in debug of problems
|
||||
//
|
||||
#define CONST const
|
||||
#define STATIC static
|
||||
#define VOID void
|
||||
#define VOLATILE volatile
|
||||
|
||||
//
|
||||
// Modifier to ensure that all protocol member functions and EFI intrinsics
|
||||
// use the correct C calling convention. All protocol member functions and
|
||||
// EFI intrinsics are required to modify thier member functions with EFIAPI.
|
||||
//
|
||||
#define EFIAPI _EFIAPI
|
||||
|
||||
//
|
||||
// EFI Constants. They may exist in other build structures, so #ifndef them.
|
||||
//
|
||||
#ifndef TRUE
|
||||
#define TRUE ((BOOLEAN) 1 == 1)
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE ((BOOLEAN) 0 == 1)
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((VOID *) 0)
|
||||
#endif
|
||||
//
|
||||
// EFI Data Types derived from other EFI data types.
|
||||
//
|
||||
typedef UINTN EFI_STATUS;
|
||||
|
||||
typedef VOID *EFI_HANDLE;
|
||||
#define NULL_HANDLE ((VOID *) 0)
|
||||
|
||||
typedef VOID *EFI_EVENT;
|
||||
typedef UINTN EFI_TPL;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Data1;
|
||||
UINT16 Data2;
|
||||
UINT16 Data3;
|
||||
UINT8 Data4[8];
|
||||
} EFI_GUID;
|
||||
|
||||
typedef union {
|
||||
EFI_GUID Guid;
|
||||
UINT8 Raw[16];
|
||||
} EFI_GUID_UNION;
|
||||
|
||||
//
|
||||
// EFI Time Abstraction:
|
||||
// Year: 2000 - 20XX
|
||||
// Month: 1 - 12
|
||||
// Day: 1 - 31
|
||||
// Hour: 0 - 23
|
||||
// Minute: 0 - 59
|
||||
// Second: 0 - 59
|
||||
// Nanosecond: 0 - 999,999,999
|
||||
// TimeZone: -1440 to 1440 or 2047
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 Year;
|
||||
UINT8 Month;
|
||||
UINT8 Day;
|
||||
UINT8 Hour;
|
||||
UINT8 Minute;
|
||||
UINT8 Second;
|
||||
UINT8 Pad1;
|
||||
UINT32 Nanosecond;
|
||||
INT16 TimeZone;
|
||||
UINT8 Daylight;
|
||||
UINT8 Pad2;
|
||||
} EFI_TIME;
|
||||
|
||||
//
|
||||
// Bit definitions for EFI_TIME.Daylight
|
||||
//
|
||||
#define EFI_TIME_ADJUST_DAYLIGHT 0x01
|
||||
#define EFI_TIME_IN_DAYLIGHT 0x02
|
||||
|
||||
//
|
||||
// Value definition for EFI_TIME.TimeZone
|
||||
//
|
||||
#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
|
||||
|
||||
//
|
||||
// Networking
|
||||
//
|
||||
typedef struct {
|
||||
UINT8 Addr[4];
|
||||
} EFI_IPv4_ADDRESS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Addr[16];
|
||||
} EFI_IPv6_ADDRESS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Addr[32];
|
||||
} EFI_MAC_ADDRESS;
|
||||
|
||||
typedef union {
|
||||
UINT32 Addr[4];
|
||||
EFI_IPv4_ADDRESS v4;
|
||||
EFI_IPv6_ADDRESS v6;
|
||||
} EFI_IP_ADDRESS;
|
||||
|
||||
typedef enum {
|
||||
EfiReservedMemoryType,
|
||||
EfiLoaderCode,
|
||||
EfiLoaderData,
|
||||
EfiBootServicesCode,
|
||||
EfiBootServicesData,
|
||||
EfiRuntimeServicesCode,
|
||||
EfiRuntimeServicesData,
|
||||
EfiConventionalMemory,
|
||||
EfiUnusableMemory,
|
||||
EfiACPIReclaimMemory,
|
||||
EfiACPIMemoryNVS,
|
||||
EfiMemoryMappedIO,
|
||||
EfiMemoryMappedIOPortSpace,
|
||||
EfiPalCode,
|
||||
EfiMaxMemoryType
|
||||
} EFI_MEMORY_TYPE;
|
||||
|
||||
typedef enum {
|
||||
AllocateAnyPages,
|
||||
AllocateMaxAddress,
|
||||
AllocateAddress,
|
||||
MaxAllocateType
|
||||
} EFI_ALLOCATE_TYPE;
|
||||
|
||||
typedef struct {
|
||||
UINT64 Signature;
|
||||
UINT32 Revision;
|
||||
UINT32 HeaderSize;
|
||||
UINT32 CRC32;
|
||||
UINT32 Reserved;
|
||||
} EFI_TABLE_HEADER;
|
||||
|
||||
//
|
||||
// possible caching types for the memory range
|
||||
//
|
||||
#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
|
||||
|
||||
//
|
||||
// physical memory protection on range
|
||||
//
|
||||
#define EFI_MEMORY_WP 0x0000000000001000
|
||||
#define EFI_MEMORY_RP 0x0000000000002000
|
||||
#define EFI_MEMORY_XP 0x0000000000004000
|
||||
|
||||
//
|
||||
// range requires a runtime mapping
|
||||
//
|
||||
#define EFI_MEMORY_RUNTIME 0x8000000000000000
|
||||
|
||||
typedef UINT64 EFI_PHYSICAL_ADDRESS;
|
||||
typedef UINT64 EFI_VIRTUAL_ADDRESS;
|
||||
|
||||
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
|
||||
typedef struct {
|
||||
UINT32 Type;
|
||||
UINT32 Pad;
|
||||
EFI_PHYSICAL_ADDRESS PhysicalStart;
|
||||
EFI_VIRTUAL_ADDRESS VirtualStart;
|
||||
UINT64 NumberOfPages;
|
||||
UINT64 Attribute;
|
||||
} EFI_MEMORY_DESCRIPTOR;
|
||||
|
||||
//
|
||||
// The EFI memory allocation functions work in units of EFI_PAGEs that are
|
||||
// 4K. This should in no way be confused with the page size of the processor.
|
||||
// An EFI_PAGE is just the quanta of memory in EFI.
|
||||
//
|
||||
#define EFI_PAGE_SIZE 4096
|
||||
#define EFI_PAGE_MASK 0xFFF
|
||||
#define EFI_PAGE_SHIFT 12
|
||||
|
||||
#define EFI_SIZE_TO_PAGES(a) (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0))
|
||||
|
||||
#define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT)
|
||||
|
||||
//
|
||||
// ALIGN_POINTER - aligns a pointer to the lowest boundry
|
||||
//
|
||||
#define ALIGN_POINTER(p, s) ((VOID *) (p + ((s - ((UINTN) p)) & (s - 1))))
|
||||
|
||||
//
|
||||
// ALIGN_VARIABLE - aligns a variable up to the next natural boundry for int size of a processor
|
||||
//
|
||||
#define ALIGN_VARIABLE(Value, Adjustment) \
|
||||
(UINTN) Adjustment = 0; \
|
||||
if ((UINTN) Value % sizeof (UINTN)) { \
|
||||
(UINTN) Adjustment = sizeof (UINTN) - ((UINTN) Value % sizeof (UINTN)); \
|
||||
} \
|
||||
Value = (UINTN) Value + (UINTN) Adjustment
|
||||
|
||||
//
|
||||
// EFI_FIELD_OFFSET - returns the byte offset to a field within a structure
|
||||
//
|
||||
#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))
|
||||
|
||||
//
|
||||
// CONTAINING_RECORD - returns a pointer to the structure
|
||||
// from one of it's elements.
|
||||
//
|
||||
#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
|
||||
|
||||
//
|
||||
// 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))
|
||||
|
||||
#endif
|
|
@ -0,0 +1,58 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
pxe.h
|
||||
|
||||
Abstract:
|
||||
|
||||
PXE 2.1 Common Structures
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _PXE_H
|
||||
#define _PXE_H
|
||||
|
||||
//
|
||||
// Packet definitions
|
||||
//
|
||||
typedef struct {
|
||||
UINT8 BootpOpcode;
|
||||
UINT8 BootpHwType;
|
||||
UINT8 BootpHwAddrLen;
|
||||
UINT8 BootpGateHops;
|
||||
UINT32 BootpIdent;
|
||||
UINT16 BootpSeconds;
|
||||
UINT16 BootpFlags;
|
||||
UINT8 BootpCiAddr[4];
|
||||
UINT8 BootpYiAddr[4];
|
||||
UINT8 BootpSiAddr[4];
|
||||
UINT8 BootpGiAddr[4];
|
||||
UINT8 BootpHwAddr[16];
|
||||
UINT8 BootpSrvName[64];
|
||||
UINT8 BootpBootFile[128];
|
||||
UINT32 DhcpMagik;
|
||||
UINT8 DhcpOptions[56];
|
||||
} EFI_PXE_BASE_CODE_DHCPV4_PACKET;
|
||||
|
||||
typedef union {
|
||||
UINT8 Raw[1472];
|
||||
EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;
|
||||
|
||||
//
|
||||
// EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;
|
||||
//
|
||||
} EFI_PXE_BASE_CODE_PACKET;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
AcpiTable.c
|
||||
|
||||
Abstract:
|
||||
|
||||
ACPI Table Protocol from the UEFI 2.1 specification.
|
||||
|
||||
This protocol may be used to install or remove an ACPI table from a platform.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (AcpiTable)
|
||||
|
||||
EFI_GUID gEfiAcpiTableProtocolGuid = EFI_ACPI_TABLE_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiAcpiTableProtocolGuid, "UEFI ACPI Table Protocol", "UEFI ACPI Table Protocol");
|
|
@ -0,0 +1,112 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
AcpiTable.h
|
||||
|
||||
Abstract:
|
||||
|
||||
ACPI Table Protocol from the UEFI 2.1 specification.
|
||||
|
||||
This protocol may be used to install or remove an ACPI table from a platform.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __ACPI_TABLE_H__
|
||||
#define __ACPI_TABLE_H__
|
||||
|
||||
#include "Acpi.h"
|
||||
|
||||
//
|
||||
// Global ID for the Acpi Table Protocol
|
||||
//
|
||||
#define EFI_ACPI_TABLE_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xffe06bdd, 0x6107, 0x46a6, 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c \
|
||||
}
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_ACPI_TABLE_PROTOCOL);
|
||||
|
||||
#define UEFI_ACPI_TABLE_SIGNATURE EFI_SIGNATURE_32 ('U', 'E', 'F', 'I')
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
EFI_ACPI_DESCRIPTION_HEADER Header;
|
||||
EFI_GUID Identifier;
|
||||
UINT16 DataOffset;
|
||||
} EFI_ACPI_TABLE;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE) (
|
||||
IN EFI_ACPI_TABLE_PROTOCOL *This,
|
||||
IN VOID *AcpiTableBuffer,
|
||||
IN UINTN AcpiTableBufferSize,
|
||||
OUT UINTN *TableKey
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Installs an ACPI table into the RSDT/XSDT.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
AcpiTableBuffer - A pointer to a buffer containing the ACPI table to be installed.
|
||||
AcpiTableBufferSize - Specifies the size, in bytes, of the AcpiTableBuffer buffer.
|
||||
TableKey - Reurns a key to refer to the ACPI table.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The table was successfully inserted.
|
||||
EFI_INVALID_PARAMETER - Either AcpiTableBuffer is NULL, TableKey is NULL, or AcpiTableBufferSize
|
||||
and the size field embedded in the ACPI table pointed to by AcpiTableBuffer
|
||||
are not in sync.
|
||||
EFI_OUT_OF_RESOURCES - Insufficient resources exist to complete the request.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE) (
|
||||
IN EFI_ACPI_TABLE_PROTOCOL *This,
|
||||
IN UINTN TableKey
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Removes an ACPI table from the RSDT/XSDT.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
TableKey - Specifies the table to uninstall. The key was returned from InstallAcpiTable().
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The table was successfully uninstalled.
|
||||
EFI_NOT_FOUND - TableKey does not refer to a valid key for a table entry.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
//
|
||||
// Interface structure for the ACPI Table Protocol
|
||||
//
|
||||
typedef struct _EFI_ACPI_TABLE_PROTOCOL {
|
||||
EFI_ACPI_TABLE_INSTALL_ACPI_TABLE InstallAcpiTable;
|
||||
EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE UninstallAcpiTable;
|
||||
} EFI_ACPI_TABLE_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiAcpiTableProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Arp.c
|
||||
|
||||
Abstract:
|
||||
|
||||
UEFI Arp protocol.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (Arp)
|
||||
|
||||
EFI_GUID gEfiArpServiceBindingProtocolGuid = EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID;
|
||||
EFI_GUID gEfiArpProtocolGuid = EFI_ARP_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING (&gEfiArpServiceBindingProtocolGuid, "ARP Service Binding Protocol", "ARP Service Binding Protocol");
|
||||
EFI_GUID_STRING (&gEfiArpProtocolGuid, "ARP Protocol", "ARP Protocol");
|
|
@ -0,0 +1,136 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Arp.h
|
||||
|
||||
Abstract:
|
||||
|
||||
UEFI Arp protocol definition.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _ARP_H_
|
||||
#define _ARP_H_
|
||||
|
||||
#include EFI_PROTOCOL_DEFINITION (ServiceBinding)
|
||||
|
||||
#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{ 0xf44c00ee, 0x1f2c, 0x4a00, 0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 }
|
||||
|
||||
#define EFI_ARP_PROTOCOL_GUID \
|
||||
{ 0xf4b427bb, 0xba21, 0x4f16, 0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c }
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_ARP_PROTOCOL);
|
||||
|
||||
typedef struct _EFI_ARP_FIND_DATA {
|
||||
UINT32 Size;
|
||||
BOOLEAN DenyFlag;
|
||||
BOOLEAN StaticFlag;
|
||||
UINT16 HwAddressType;
|
||||
UINT16 SwAddressType;
|
||||
UINT8 HwAddressLength;
|
||||
UINT8 SwAddressLength;
|
||||
} EFI_ARP_FIND_DATA;
|
||||
|
||||
|
||||
//****************************************************
|
||||
// EFI_ARP_CONFIG_DATA
|
||||
//****************************************************
|
||||
typedef struct EFI_ARP_CONFIG_DATA {
|
||||
UINT16 SwAddressType; // Host byte order
|
||||
UINT8 SwAddressLength;
|
||||
VOID *StationAddress; // Network byte order
|
||||
UINT32 EntryTimeOut;
|
||||
UINT32 RetryCount;
|
||||
UINT32 RetryTimeOut;
|
||||
} EFI_ARP_CONFIG_DATA;
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ARP_CONFIGURE) (
|
||||
IN EFI_ARP_PROTOCOL *This,
|
||||
IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ARP_ADD) (
|
||||
IN EFI_ARP_PROTOCOL *This,
|
||||
IN BOOLEAN DenyFlag,
|
||||
IN VOID *TargetSwAddress OPTIONAL,
|
||||
IN VOID *TargetHwAddress OPTIONAL,
|
||||
IN UINT32 TimeoutValue,
|
||||
IN BOOLEAN Overwrite
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ARP_FIND) (
|
||||
IN EFI_ARP_PROTOCOL *This,
|
||||
IN BOOLEAN BySwAddress,
|
||||
IN VOID *AddressBuffer OPTIONAL,
|
||||
OUT UINT32 *EntryLength OPTIONAL,
|
||||
OUT UINT32 *EntryCount OPTIONAL,
|
||||
OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,
|
||||
IN BOOLEAN Refresh
|
||||
);
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ARP_DELETE) (
|
||||
IN EFI_ARP_PROTOCOL *This,
|
||||
IN BOOLEAN BySwAddress,
|
||||
IN VOID *AddressBuffer OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ARP_FLUSH) (
|
||||
IN EFI_ARP_PROTOCOL *This
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ARP_REQUEST) (
|
||||
IN EFI_ARP_PROTOCOL *This,
|
||||
IN VOID *TargetSwAddress OPTIONAL,
|
||||
IN EFI_EVENT ResolvedEvent OPTIONAL,
|
||||
OUT VOID *TargetHwAddress
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ARP_CANCEL) (
|
||||
IN EFI_ARP_PROTOCOL *This,
|
||||
IN VOID *TargetSwAddress OPTIONAL,
|
||||
IN EFI_EVENT ResolvedEvent OPTIONAL
|
||||
);
|
||||
|
||||
typedef struct _EFI_ARP_PROTOCOL {
|
||||
EFI_ARP_CONFIGURE Configure;
|
||||
EFI_ARP_ADD Add;
|
||||
EFI_ARP_FIND Find;
|
||||
EFI_ARP_DELETE Delete;
|
||||
EFI_ARP_FLUSH Flush;
|
||||
EFI_ARP_REQUEST Request;
|
||||
EFI_ARP_CANCEL Cancel;
|
||||
} EFI_ARP_PROTOCOL;
|
||||
|
||||
|
||||
extern EFI_GUID gEfiArpServiceBindingProtocolGuid;
|
||||
extern EFI_GUID gEfiArpProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Bis.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This file defines the Bis protocol
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (Bis)
|
||||
|
||||
EFI_GUID gEfiBisProtocolGuid = EFI_BIS_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiBisProtocolGuid, "BIS Base Protocol", "BIS Base protocol");
|
|
@ -0,0 +1,233 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Bis.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This file defines the BIS protocol.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _BIS_H_
|
||||
#define _BIS_H_
|
||||
|
||||
#include <EfiSpec.h>
|
||||
|
||||
//
|
||||
// Basic types
|
||||
//
|
||||
typedef VOID *BIS_APPLICATION_HANDLE;
|
||||
typedef UINT16 BIS_ALG_ID;
|
||||
typedef UINT32 BIS_CERT_ID;
|
||||
|
||||
//
|
||||
// EFI_BIS_DATA type.
|
||||
//
|
||||
// EFI_BIS_DATA instances obtained from BIS must be freed by calling Free( ).
|
||||
//
|
||||
typedef struct _EFI_BIS_DATA {
|
||||
UINT32 Length; // Length of Data in 8 bit bytes.
|
||||
UINT8 *Data; // 32 Bit Flat Address of data.
|
||||
} EFI_BIS_DATA;
|
||||
|
||||
//
|
||||
// EFI_BIS_VERSION type.
|
||||
//
|
||||
typedef struct _EFI_BIS_VERSION {
|
||||
UINT32 Major; // BIS Interface version number.
|
||||
UINT32 Minor; // Build number.
|
||||
} EFI_BIS_VERSION;
|
||||
|
||||
//
|
||||
// ----------------------------------------------------//
|
||||
// Use these values to initialize EFI_BIS_VERSION.Major
|
||||
// and to interpret results of Initialize.
|
||||
// ----------------------------------------------------//
|
||||
//
|
||||
#define BIS_CURRENT_VERSION_MAJOR BIS_VERSION_1
|
||||
#define BIS_VERSION_1 1
|
||||
|
||||
//
|
||||
// EFI_BIS_SIGNATURE_INFO type.
|
||||
//
|
||||
typedef struct _EFI_BIS_SIGNATURE_INFO {
|
||||
BIS_CERT_ID CertificateID; // Truncated hash of platform Boot Object
|
||||
// authorization certificate.
|
||||
//
|
||||
BIS_ALG_ID AlgorithmID; // A signature algorithm number.
|
||||
UINT16 KeyLength; // Length of alg. keys in bits.
|
||||
} EFI_BIS_SIGNATURE_INFO;
|
||||
|
||||
//
|
||||
// Currently defined values for EFI_BIS_SIGNATURE_INFO.AlgorithmID.
|
||||
// The exact numeric values come from
|
||||
// "Common Data Security Architecture (CDSA) Specification".
|
||||
//
|
||||
#define BIS_ALG_DSA (41) // CSSM_ALGID_DSA
|
||||
#define BIS_ALG_RSA_MD5 (42) // CSSM_ALGID_MD5_WITH_RSA
|
||||
// Currently defined values for EFI_BIS_SIGNATURE_INFO.CertificateId.
|
||||
//
|
||||
#define BIS_CERT_ID_DSA BIS_ALG_DSA // CSSM_ALGID_DSA
|
||||
#define BIS_CERT_ID_RSA_MD5 BIS_ALG_RSA_MD5 // CSSM_ALGID_MD5_WITH_RSA
|
||||
// The following is a mask value that gets applied to the truncated hash of a
|
||||
// platform Boot Object Authorization Certificate to create the certificateID.
|
||||
// A certificateID must not have any bits set to the value 1 other than bits in
|
||||
// this mask.
|
||||
//
|
||||
#define BIS_CERT_ID_MASK (0xFF7F7FFF)
|
||||
|
||||
//
|
||||
// Macros for dealing with the EFI_BIS_DATA object obtained
|
||||
// from BIS_GetSignatureInfo()
|
||||
// BIS_GET_SIGINFO_COUNT - tells how many EFI_BIS_SIGNATURE_INFO
|
||||
// elements are contained in a EFI_BIS_DATA struct pointed to
|
||||
// by the provided EFI_BIS_DATA*.
|
||||
//
|
||||
#define BIS_GET_SIGINFO_COUNT(BisDataPtr) ((BisDataPtr)->Length / sizeof (EFI_BIS_SIGNATURE_INFO))
|
||||
|
||||
//
|
||||
// BIS_GET_SIGINFO_ARRAY - produces a EFI_BIS_SIGNATURE_INFO*
|
||||
// from a given EFI_BIS_DATA*.
|
||||
//
|
||||
#define BIS_GET_SIGINFO_ARRAY(BisDataPtr) ((EFI_BIS_SIGNATURE_INFO *) (BisDataPtr)->Data)
|
||||
|
||||
//
|
||||
// Binary Value of "X-Intel-BIS-ParameterSet" Attribute.
|
||||
// (Value is Base64 encoded in actual signed manifest).
|
||||
// {EDD35E31-07B9-11d2-83A3-00A0C91FADCF}
|
||||
//
|
||||
#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE \
|
||||
{ \
|
||||
0xedd35e31, 0x7b9, 0x11d2, \
|
||||
{ \
|
||||
0x83, 0xa3, 0x0, 0xa0, 0xc9, 0x1f, 0xad, 0xcf \
|
||||
} \
|
||||
}
|
||||
|
||||
//
|
||||
// -----------------------------------//
|
||||
// EFI_BIS_PROTOCOL
|
||||
// -----------------------------------//
|
||||
//
|
||||
#define EFI_BIS_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x0b64aab0, 0x5429, 0x11d4, 0x98, 0x16, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf \
|
||||
}
|
||||
|
||||
typedef struct _EFI_BIS_PROTOCOL EFI_BIS_PROTOCOL;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_INITIALIZE) (
|
||||
IN EFI_BIS_PROTOCOL * This, // this
|
||||
OUT BIS_APPLICATION_HANDLE * AppHandle, // Application handle.
|
||||
IN OUT EFI_BIS_VERSION * InterfaceVersion, // ver needed/available.
|
||||
IN EFI_BIS_DATA * TargetAddress // Address of BIS platform.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_FREE) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
IN EFI_BIS_DATA * ToFree // EFI_BIS_DATA being freed.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_SHUTDOWN) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle // From Initialize( ).
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
OUT EFI_BIS_DATA **Certificate // Pointer to certificate.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_VERIFY_BOOT_OBJECT) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
IN EFI_BIS_DATA * Credentials, // Verification signed manifest.
|
||||
IN EFI_BIS_DATA * DataObject, // Boot object to verify.
|
||||
OUT BOOLEAN *IsVerified // Result of verifcation.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
OUT BOOLEAN *CheckIsRequired // Value of check flag.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
OUT EFI_BIS_DATA **UpdateToken // Value of update token.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
IN EFI_BIS_DATA * RequestCredential, // Update Request Manifest.
|
||||
OUT EFI_BIS_DATA **NewUpdateToken // Next update token.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
IN EFI_BIS_DATA * Credentials, // Verification signed manifest.
|
||||
IN EFI_BIS_DATA * DataObject, // Boot object to verify.
|
||||
IN EFI_BIS_DATA * SectionName, // Name of credential section to use.
|
||||
IN EFI_BIS_DATA * AuthorityCertificate, // Certificate for credentials.
|
||||
OUT BOOLEAN *IsVerified // Result of verifcation.
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BIS_GET_SIGNATURE_INFO) (
|
||||
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
|
||||
OUT EFI_BIS_DATA **SignatureInfo // Signature info struct.
|
||||
);
|
||||
|
||||
#define EFI_BIS_PROTOCOL_REVISION 0x00010000
|
||||
|
||||
typedef struct _EFI_BIS_PROTOCOL {
|
||||
//
|
||||
// member vars
|
||||
//
|
||||
UINT64 Revision;
|
||||
|
||||
//
|
||||
// methods
|
||||
//
|
||||
EFI_BIS_INITIALIZE Initialize;
|
||||
EFI_BIS_SHUTDOWN Shutdown;
|
||||
EFI_BIS_FREE Free;
|
||||
EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE GetBootObjectAuthorizationCertificate;
|
||||
EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG GetBootObjectAuthorizationCheckFlag;
|
||||
EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN GetBootObjectAuthorizationUpdateToken;
|
||||
EFI_BIS_GET_SIGNATURE_INFO GetSignatureInfo;
|
||||
EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION UpdateBootObjectAuthorization;
|
||||
EFI_BIS_VERIFY_BOOT_OBJECT VerifyBootObject;
|
||||
EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL VerifyObjectWithCredential;
|
||||
} EFI_BIS_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiBisProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
BlockIo.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Block IO protocol as defined in the EFI 1.0 specification.
|
||||
|
||||
The Block IO protocol is used to abstract block devices like hard drives,
|
||||
DVD-ROMs and floppy drives.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (BlockIo)
|
||||
|
||||
EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiBlockIoProtocolGuid, "BlockIo Protocol", "EFI 1.0 Block IO protocol");
|
|
@ -0,0 +1,206 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
BlockIo.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Block IO protocol as defined in the EFI 1.0 specification.
|
||||
|
||||
The Block IO protocol is used to abstract block devices like hard drives,
|
||||
DVD-ROMs and floppy drives.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __BLOCK_IO_H__
|
||||
#define __BLOCK_IO_H__
|
||||
|
||||
#define EFI_BLOCK_IO_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
|
||||
}
|
||||
|
||||
//
|
||||
// Forward reference for pure ANSI compatability
|
||||
//
|
||||
EFI_FORWARD_DECLARATION (EFI_BLOCK_IO_PROTOCOL);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BLOCK_RESET) (
|
||||
IN EFI_BLOCK_IO_PROTOCOL * This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Reset the Block Device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
ExtendedVerification - Driver may perform diagnostics on reset.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The device was reset.
|
||||
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||
not be reset.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BLOCK_READ) (
|
||||
IN EFI_BLOCK_IO_PROTOCOL * This,
|
||||
IN UINT32 MediaId,
|
||||
IN EFI_LBA Lba,
|
||||
IN UINTN BufferSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Read BufferSize bytes from Lba into Buffer.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
MediaId - Id of the media, changes every time the media is replaced.
|
||||
Lba - The starting Logical Block Address to read from
|
||||
BufferSize - Size of Buffer, must be a multiple of device block size.
|
||||
Buffer - Buffer containing read data
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The data was read correctly from the device.
|
||||
EFI_DEVICE_ERROR - The device reported an error while performing the read.
|
||||
EFI_NO_MEDIA - There is no media in the device.
|
||||
EFI_MEDIA_CHANGED - The MediaId does not matched the current device.
|
||||
EFI_BAD_BUFFER_SIZE - The Buffer was not a multiple of the block size of the
|
||||
device.
|
||||
EFI_INVALID_PARAMETER - The read request contains device addresses that are not
|
||||
valid for the device.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BLOCK_WRITE) (
|
||||
IN EFI_BLOCK_IO_PROTOCOL * This,
|
||||
IN UINT32 MediaId,
|
||||
IN EFI_LBA Lba,
|
||||
IN UINTN BufferSize,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Write BufferSize bytes from Lba into Buffer.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
MediaId - Id of the media, changes every time the media is replaced.
|
||||
Lba - The starting Logical Block Address to read from
|
||||
BufferSize - Size of Buffer, must be a multiple of device block size.
|
||||
Buffer - Buffer containing read data
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The data was written correctly to the device.
|
||||
EFI_WRITE_PROTECTED - The device can not be written to.
|
||||
EFI_DEVICE_ERROR - The device reported an error while performing the write.
|
||||
EFI_NO_MEDIA - There is no media in the device.
|
||||
EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.
|
||||
EFI_BAD_BUFFER_SIZE - The Buffer was not a multiple of the block size of the
|
||||
device.
|
||||
EFI_INVALID_PARAMETER - The write request contains a LBA that is not
|
||||
valid for the device.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BLOCK_FLUSH) (
|
||||
IN EFI_BLOCK_IO_PROTOCOL * This
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Flush the Block Device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - All outstanding data was written to the device
|
||||
EFI_DEVICE_ERROR - The device reported an error while writting back the data
|
||||
EFI_NO_MEDIA - There is no media in the device.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/*++
|
||||
|
||||
Block IO read only mode data and updated only via members of BlockIO
|
||||
|
||||
MediaId - The curent media Id. If the media changes, this value is changed.
|
||||
RemovableMedia - TRUE if the media is removable; otherwise, FALSE.
|
||||
MediaPresent - TRUE if there is a media currently present in the device;
|
||||
othersise, FALSE. THis field shows the media present status
|
||||
as of the most recent ReadBlocks() or WriteBlocks() call.
|
||||
LogicalPartition - TRUE if LBA 0 is the first block of a partition; otherwise
|
||||
FALSE. For media with only one partition this would be TRUE.
|
||||
ReadOnly - TRUE if the media is marked read-only otherwise, FALSE. This
|
||||
field shows the read-only status as of the most recent
|
||||
WriteBlocks () call.
|
||||
WriteCaching - TRUE if the WriteBlock () function caches write data.
|
||||
BlockSize - The intrinsic block size of the device. If the media changes, then
|
||||
this field is updated.
|
||||
IoAlign - Supplies the alignment requirement for any buffer to read or write
|
||||
block(s).
|
||||
LastBlock - The last logical block address on the device. If the media changes,
|
||||
then this field is updated.
|
||||
|
||||
--*/
|
||||
typedef struct {
|
||||
UINT32 MediaId;
|
||||
BOOLEAN RemovableMedia;
|
||||
BOOLEAN MediaPresent;
|
||||
|
||||
BOOLEAN LogicalPartition;
|
||||
BOOLEAN ReadOnly;
|
||||
BOOLEAN WriteCaching;
|
||||
|
||||
UINT32 BlockSize;
|
||||
UINT32 IoAlign;
|
||||
|
||||
EFI_LBA LastBlock;
|
||||
} EFI_BLOCK_IO_MEDIA;
|
||||
|
||||
#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
|
||||
|
||||
typedef struct _EFI_BLOCK_IO_PROTOCOL {
|
||||
UINT64 Revision;
|
||||
|
||||
EFI_BLOCK_IO_MEDIA *Media;
|
||||
|
||||
EFI_BLOCK_RESET Reset;
|
||||
EFI_BLOCK_READ ReadBlocks;
|
||||
EFI_BLOCK_WRITE WriteBlocks;
|
||||
EFI_BLOCK_FLUSH FlushBlocks;
|
||||
|
||||
} EFI_BLOCK_IO_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiBlockIoProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
BusSpecificDriverOverride.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Bus Specific Driver Override protocol as defined in the EFI 1.1 specification.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (BusSpecificDriverOverride)
|
||||
|
||||
EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING
|
||||
(
|
||||
&gEfiBusSpecificDriverOverrideProtocolGuid, "Bus Specific Driver Override Protocol",
|
||||
"EFI 1.1 Bus Specific Driver Override Protocol"
|
||||
);
|
|
@ -0,0 +1,54 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
BusSpecificDriverOverride.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Bus Specific Driver Override protocol as defined in the EFI 1.1 specification.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_
|
||||
#define _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_
|
||||
|
||||
//
|
||||
// Global ID for the Bus Specific Driver Override Protocol
|
||||
//
|
||||
#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x3bc1b285, 0x8a15, 0x4a82, 0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65 \
|
||||
}
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL);
|
||||
|
||||
//
|
||||
// Prototypes for the Bus Specific Driver Override Protocol
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) (
|
||||
IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL * This,
|
||||
IN OUT EFI_HANDLE * DriverImageHandle
|
||||
);
|
||||
|
||||
//
|
||||
// Interface structure for the Bus Specific Driver Override Protocol
|
||||
//
|
||||
typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {
|
||||
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
|
||||
} EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
ComponentName.c
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI Component Name Protocol
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (ComponentName)
|
||||
|
||||
EFI_GUID gEfiComponentNameProtocolGuid = EFI_COMPONENT_NAME_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiComponentNameProtocolGuid, "Component Name Protocol", "EFI 1.1 Component Name Protocol");
|
|
@ -0,0 +1,137 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
ComponentName.h
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI Component Name Protocol
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_COMPONENT_NAME_H_
|
||||
#define _EFI_COMPONENT_NAME_H_
|
||||
|
||||
//
|
||||
// Global ID for the Component Name Protocol
|
||||
//
|
||||
#define EFI_COMPONENT_NAME_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x107a772c, 0xd5e1, 0x11d4, 0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_COMPONENT_NAME_PROTOCOL);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL * This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||
This is the language of the driver name that that the caller
|
||||
is requesting, and it must match one of the languages specified
|
||||
in SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer.
|
||||
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||
is the name of the driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the Driver specified by This
|
||||
and the language specified by Language was returned
|
||||
in DriverName.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - DriverName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL * This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language specified
|
||||
by Language from the point of view of the driver specified
|
||||
by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
|
||||
EFI_INVALID_PARAMETER - Language is NULL.
|
||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently managing
|
||||
the controller specified by ControllerHandle and
|
||||
ChildHandle.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Interface structure for the Component Name Protocol
|
||||
//
|
||||
typedef struct _EFI_COMPONENT_NAME_PROTOCOL {
|
||||
EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
|
||||
EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
|
||||
CHAR8 *SupportedLanguages;
|
||||
} EFI_COMPONENT_NAME_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiComponentNameProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
ComponentName.c
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI Component Name Protocol
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (ComponentName2)
|
||||
|
||||
EFI_GUID gEfiComponentName2ProtocolGuid = EFI_COMPONENT_NAME2_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiComponentName2ProtocolGuid, "Component Name2 Protocol", "EFI 2.0 Component Name2 Protocol");
|
|
@ -0,0 +1,136 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
ComponentName.h
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI Component Name Protocol
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_COMPONENT_NAME2_H_
|
||||
#define _EFI_COMPONENT_NAME2_H_
|
||||
|
||||
//
|
||||
// Global ID for the Component Name Protocol
|
||||
//
|
||||
|
||||
#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x6a7a5cff, 0xe8d9, 0x4f70, 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 \
|
||||
}
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_COMPONENT_NAME2_PROTOCOL);
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME) (
|
||||
IN EFI_COMPONENT_NAME2_PROTOCOL * This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||
This is the language of the driver name that that the caller
|
||||
is requesting, and it must match one of the languages specified
|
||||
in SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer.
|
||||
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||
is the name of the driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the Driver specified by This
|
||||
and the language specified by Language was returned
|
||||
in DriverName.
|
||||
EFI_INVALID_PARAMETER - Language is NULL or DriverName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) (
|
||||
IN EFI_COMPONENT_NAME2_PROTOCOL * This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
ChildHandle - The handle of the child controller to retrieve the name
|
||||
of. This is an optional parameter that may be NULL. It
|
||||
will be NULL for device drivers. It will also be NULL
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language specified
|
||||
by Language from the point of view of the driver specified
|
||||
by This.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||
language specified by Language for the driver
|
||||
specified by This was returned in DriverName.
|
||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE; ChildHandle
|
||||
is not NULL and it is not a valid EFI_HANDLE;Language
|
||||
is NULL;ControllerName is NULL.
|
||||
EFI_UNSUPPORTED - The driver specified by This is not currently managing
|
||||
the controller specified by ControllerHandle and
|
||||
ChildHandle;The driver specified by This does not support the
|
||||
language specified by Language.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Interface structure for the Component Name Protocol
|
||||
//
|
||||
typedef struct _EFI_COMPONENT_NAME2_PROTOCOL {
|
||||
EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName;
|
||||
EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName;
|
||||
CHAR8 *SupportedLanguages;
|
||||
} EFI_COMPONENT_NAME2_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiComponentName2ProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DebugPort.c
|
||||
|
||||
Abstract:
|
||||
|
||||
DebugPort protocol as defined in the EFI 1.1 specification.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DebugPort)
|
||||
|
||||
EFI_GUID gEfiDebugPortProtocolGuid = EFI_DEBUGPORT_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDebugPortProtocolGuid, "DebugPort Protocol", "EFI 1.1 DebugPort Protocol");
|
|
@ -0,0 +1,98 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DebugPort.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEBUG_PORT_H_
|
||||
#define _DEBUG_PORT_H_
|
||||
|
||||
#include "EfiApi.h"
|
||||
|
||||
//
|
||||
// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
|
||||
//
|
||||
#define EFI_DEBUGPORT_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xEBA4E8D2, 0x3858, 0x41EC, 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiDebugPortProtocolGuid;
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_DEBUGPORT_PROTOCOL);
|
||||
|
||||
//
|
||||
// DebugPort member functions
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DEBUGPORT_RESET) (
|
||||
IN EFI_DEBUGPORT_PROTOCOL * This
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DEBUGPORT_WRITE) (
|
||||
IN EFI_DEBUGPORT_PROTOCOL * This,
|
||||
IN UINT32 Timeout,
|
||||
IN OUT UINTN *BufferSize,
|
||||
IN VOID *Buffer
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DEBUGPORT_READ) (
|
||||
IN EFI_DEBUGPORT_PROTOCOL * This,
|
||||
IN UINT32 Timeout,
|
||||
IN OUT UINTN *BufferSize,
|
||||
OUT VOID *Buffer
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DEBUGPORT_POLL) (
|
||||
IN EFI_DEBUGPORT_PROTOCOL * This
|
||||
);
|
||||
|
||||
//
|
||||
// DebugPort protocol definition
|
||||
//
|
||||
typedef struct _EFI_DEBUGPORT_PROTOCOL {
|
||||
EFI_DEBUGPORT_RESET Reset;
|
||||
EFI_DEBUGPORT_WRITE Write;
|
||||
EFI_DEBUGPORT_READ Read;
|
||||
EFI_DEBUGPORT_POLL Poll;
|
||||
} EFI_DEBUGPORT_PROTOCOL;
|
||||
|
||||
//
|
||||
// DEBUGPORT variable definitions...
|
||||
//
|
||||
#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
|
||||
#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
|
||||
#define gEfiDebugPortVariableGuid gEfiDebugPortProtocolGuid
|
||||
|
||||
//
|
||||
// DebugPort device path definitions...
|
||||
//
|
||||
#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
|
||||
#define gEfiDebugPortDevicePathGuid gEfiDebugPortProtocolGuid
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
} DEBUGPORT_DEVICE_PATH;
|
||||
|
||||
#endif /* _DEBUG_PORT_H_ */
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DebugSupport.c
|
||||
|
||||
Abstract:
|
||||
|
||||
DebugSupport protocol as defined in the EFI 1.1 specification.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DebugSupport)
|
||||
|
||||
EFI_GUID gEfiDebugSupportProtocolGuid = EFI_DEBUG_SUPPORT_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDebugSupportProtocolGuid, "DebugSupport Protocol", "EFI 1.1 DebugSupport Protocol");
|
|
@ -0,0 +1,594 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DebugSupport.h
|
||||
|
||||
Abstract:
|
||||
|
||||
DebugSupport protocol and supporting definitions as defined in the EFI 1.1
|
||||
specification.
|
||||
|
||||
The DebugSupport protocol is used by source level debuggers to abstract the
|
||||
processor and handle context save and restore operations.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEBUG_SUPPORT_H_
|
||||
#define _DEBUG_SUPPORT_H_
|
||||
|
||||
#include "EfiApi.h"
|
||||
#include "EfiImage.h"
|
||||
//
|
||||
// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}
|
||||
//
|
||||
#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x2755590C, 0x6F3C, 0x42FA, 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 \
|
||||
}
|
||||
|
||||
//
|
||||
// Debug Support definitions
|
||||
//
|
||||
typedef INTN EFI_EXCEPTION_TYPE;
|
||||
|
||||
//
|
||||
// IA-32 processor exception types
|
||||
//
|
||||
#define EXCEPT_IA32_DIVIDE_ERROR 0
|
||||
#define EXCEPT_IA32_DEBUG 1
|
||||
#define EXCEPT_IA32_NMI 2
|
||||
#define EXCEPT_IA32_BREAKPOINT 3
|
||||
#define EXCEPT_IA32_OVERFLOW 4
|
||||
#define EXCEPT_IA32_BOUND 5
|
||||
#define EXCEPT_IA32_INVALID_OPCODE 6
|
||||
#define EXCEPT_IA32_DOUBLE_FAULT 8
|
||||
#define EXCEPT_IA32_INVALID_TSS 10
|
||||
#define EXCEPT_IA32_SEG_NOT_PRESENT 11
|
||||
#define EXCEPT_IA32_STACK_FAULT 12
|
||||
#define EXCEPT_IA32_GP_FAULT 13
|
||||
#define EXCEPT_IA32_PAGE_FAULT 14
|
||||
#define EXCEPT_IA32_FP_ERROR 16
|
||||
#define EXCEPT_IA32_ALIGNMENT_CHECK 17
|
||||
#define EXCEPT_IA32_MACHINE_CHECK 18
|
||||
#define EXCEPT_IA32_SIMD 19
|
||||
|
||||
//
|
||||
// IA-32 processor context definition
|
||||
//
|
||||
//
|
||||
// FXSAVE_STATE
|
||||
// FP / MMX / XMM registers (see fxrstor instruction definition)
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 Fcw;
|
||||
UINT16 Fsw;
|
||||
UINT16 Ftw;
|
||||
UINT16 Opcode;
|
||||
UINT32 Eip;
|
||||
UINT16 Cs;
|
||||
UINT16 Reserved1;
|
||||
UINT32 DataOffset;
|
||||
UINT16 Ds;
|
||||
UINT8 Reserved2[10];
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
UINT8 St0Mm0[10], Reserved3[6];
|
||||
UINT8 St1Mm1[10], Reserved4[6];
|
||||
UINT8 St2Mm2[10], Reserved5[6];
|
||||
UINT8 St3Mm3[10], Reserved6[6];
|
||||
UINT8 St4Mm4[10], Reserved7[6];
|
||||
UINT8 St5Mm5[10], Reserved8[6];
|
||||
UINT8 St6Mm6[10], Reserved9[6];
|
||||
UINT8 St7Mm7[10], Reserved10[6];
|
||||
UINT8 Xmm0[16];
|
||||
UINT8 Xmm1[16];
|
||||
UINT8 Xmm2[16];
|
||||
UINT8 Xmm3[16];
|
||||
UINT8 Xmm4[16];
|
||||
UINT8 Xmm5[16];
|
||||
UINT8 Xmm6[16];
|
||||
UINT8 Xmm7[16];
|
||||
UINT8 Reserved11[14 * 16];
|
||||
} EFI_FX_SAVE_STATE_IA32;
|
||||
#else
|
||||
UINT8 St0Mm0[10], Reserved3[6];
|
||||
UINT8 St0Mm1[10], Reserved4[6];
|
||||
UINT8 St0Mm2[10], Reserved5[6];
|
||||
UINT8 St0Mm3[10], Reserved6[6];
|
||||
UINT8 St0Mm4[10], Reserved7[6];
|
||||
UINT8 St0Mm5[10], Reserved8[6];
|
||||
UINT8 St0Mm6[10], Reserved9[6];
|
||||
UINT8 St0Mm7[10], Reserved10[6];
|
||||
UINT8 Reserved11[22 * 16];
|
||||
} EFI_FX_SAVE_STATE;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
UINT32 ExceptionData;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
EFI_FX_SAVE_STATE_IA32 FxSaveState;
|
||||
#else
|
||||
EFI_FX_SAVE_STATE FxSaveState;
|
||||
#endif
|
||||
UINT32 Dr0;
|
||||
UINT32 Dr1;
|
||||
UINT32 Dr2;
|
||||
UINT32 Dr3;
|
||||
UINT32 Dr6;
|
||||
UINT32 Dr7;
|
||||
UINT32 Cr0;
|
||||
UINT32 Cr1; /* Reserved */
|
||||
UINT32 Cr2;
|
||||
UINT32 Cr3;
|
||||
UINT32 Cr4;
|
||||
UINT32 Eflags;
|
||||
UINT32 Ldtr;
|
||||
UINT32 Tr;
|
||||
UINT32 Gdtr[2];
|
||||
UINT32 Idtr[2];
|
||||
UINT32 Eip;
|
||||
UINT32 Gs;
|
||||
UINT32 Fs;
|
||||
UINT32 Es;
|
||||
UINT32 Ds;
|
||||
UINT32 Cs;
|
||||
UINT32 Ss;
|
||||
UINT32 Edi;
|
||||
UINT32 Esi;
|
||||
UINT32 Ebp;
|
||||
UINT32 Esp;
|
||||
UINT32 Ebx;
|
||||
UINT32 Edx;
|
||||
UINT32 Ecx;
|
||||
UINT32 Eax;
|
||||
} EFI_SYSTEM_CONTEXT_IA32;
|
||||
|
||||
//
|
||||
// X64 processor exception types
|
||||
//
|
||||
#define EXCEPT_X64_DIVIDE_ERROR 0
|
||||
#define EXCEPT_X64_DEBUG 1
|
||||
#define EXCEPT_X64_NMI 2
|
||||
#define EXCEPT_X64_BREAKPOINT 3
|
||||
#define EXCEPT_X64_OVERFLOW 4
|
||||
#define EXCEPT_X64_BOUND 5
|
||||
#define EXCEPT_X64_INVALID_OPCODE 6
|
||||
#define EXCEPT_X64_DOUBLE_FAULT 8
|
||||
#define EXCEPT_X64_INVALID_TSS 10
|
||||
#define EXCEPT_X64_SEG_NOT_PRESENT 11
|
||||
#define EXCEPT_X64_STACK_FAULT 12
|
||||
#define EXCEPT_X64_GP_FAULT 13
|
||||
#define EXCEPT_X64_PAGE_FAULT 14
|
||||
#define EXCEPT_X64_FP_ERROR 16
|
||||
#define EXCEPT_X64_ALIGNMENT_CHECK 17
|
||||
#define EXCEPT_X64_MACHINE_CHECK 18
|
||||
#define EXCEPT_X64_SIMD 19
|
||||
|
||||
//
|
||||
// X64 processor context definition
|
||||
//
|
||||
// FXSAVE_STATE
|
||||
// FP / MMX / XMM registers (see fxrstor instruction definition)
|
||||
//
|
||||
typedef struct {
|
||||
UINT16 Fcw;
|
||||
UINT16 Fsw;
|
||||
UINT16 Ftw;
|
||||
UINT16 Opcode;
|
||||
UINT64 Rip;
|
||||
UINT64 DataOffset;
|
||||
UINT8 Reserved1[8];
|
||||
UINT8 St0Mm0[10], Reserved2[6];
|
||||
UINT8 St1Mm1[10], Reserved3[6];
|
||||
UINT8 St2Mm2[10], Reserved4[6];
|
||||
UINT8 St3Mm3[10], Reserved5[6];
|
||||
UINT8 St4Mm4[10], Reserved6[6];
|
||||
UINT8 St5Mm5[10], Reserved7[6];
|
||||
UINT8 St6Mm6[10], Reserved8[6];
|
||||
UINT8 St7Mm7[10], Reserved9[6];
|
||||
UINT8 Xmm0[16];
|
||||
UINT8 Xmm1[16];
|
||||
UINT8 Xmm2[16];
|
||||
UINT8 Xmm3[16];
|
||||
UINT8 Xmm4[16];
|
||||
UINT8 Xmm5[16];
|
||||
UINT8 Xmm6[16];
|
||||
UINT8 Xmm7[16];
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
//
|
||||
// NOTE: UEFI 2.0 spec definition as follows. It should be updated
|
||||
// after spec update.
|
||||
//
|
||||
UINT8 Reserved11[14 * 16];
|
||||
#else
|
||||
UINT8 Xmm8[16];
|
||||
UINT8 Xmm9[16];
|
||||
UINT8 Xmm10[16];
|
||||
UINT8 Xmm11[16];
|
||||
UINT8 Xmm12[16];
|
||||
UINT8 Xmm13[16];
|
||||
UINT8 Xmm14[16];
|
||||
UINT8 Xmm15[16];
|
||||
UINT8 Reserved10[6 * 16];
|
||||
#endif
|
||||
} EFI_FX_SAVE_STATE_X64;
|
||||
|
||||
typedef struct {
|
||||
UINT64 ExceptionData;
|
||||
EFI_FX_SAVE_STATE_X64 FxSaveState;
|
||||
UINT64 Dr0;
|
||||
UINT64 Dr1;
|
||||
UINT64 Dr2;
|
||||
UINT64 Dr3;
|
||||
UINT64 Dr6;
|
||||
UINT64 Dr7;
|
||||
UINT64 Cr0;
|
||||
UINT64 Cr1; /* Reserved */
|
||||
UINT64 Cr2;
|
||||
UINT64 Cr3;
|
||||
UINT64 Cr4;
|
||||
UINT64 Cr8;
|
||||
UINT64 Rflags;
|
||||
UINT64 Ldtr;
|
||||
UINT64 Tr;
|
||||
UINT64 Gdtr[2];
|
||||
UINT64 Idtr[2];
|
||||
UINT64 Rip;
|
||||
UINT64 Gs;
|
||||
UINT64 Fs;
|
||||
UINT64 Es;
|
||||
UINT64 Ds;
|
||||
UINT64 Cs;
|
||||
UINT64 Ss;
|
||||
UINT64 Rdi;
|
||||
UINT64 Rsi;
|
||||
UINT64 Rbp;
|
||||
UINT64 Rsp;
|
||||
UINT64 Rbx;
|
||||
UINT64 Rdx;
|
||||
UINT64 Rcx;
|
||||
UINT64 Rax;
|
||||
UINT64 R8;
|
||||
UINT64 R9;
|
||||
UINT64 R10;
|
||||
UINT64 R11;
|
||||
UINT64 R12;
|
||||
UINT64 R13;
|
||||
UINT64 R14;
|
||||
UINT64 R15;
|
||||
} EFI_SYSTEM_CONTEXT_X64;
|
||||
|
||||
//
|
||||
// IPF processor exception types
|
||||
//
|
||||
#define EXCEPT_IPF_VHTP_TRANSLATION 0
|
||||
#define EXCEPT_IPF_INSTRUCTION_TLB 1
|
||||
#define EXCEPT_IPF_DATA_TLB 2
|
||||
#define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3
|
||||
#define EXCEPT_IPF_ALT_DATA_TLB 4
|
||||
#define EXCEPT_IPF_DATA_NESTED_TLB 5
|
||||
#define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6
|
||||
#define EXCEPT_IPF_DATA_KEY_MISSED 7
|
||||
#define EXCEPT_IPF_DIRTY_BIT 8
|
||||
#define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9
|
||||
#define EXCEPT_IPF_DATA_ACCESS_BIT 10
|
||||
#define EXCEPT_IPF_BREAKPOINT 11
|
||||
#define EXCEPT_IPF_EXTERNAL_INTERRUPT 12
|
||||
//
|
||||
// 13 - 19 reserved
|
||||
//
|
||||
#define EXCEPT_IPF_PAGE_NOT_PRESENT 20
|
||||
#define EXCEPT_IPF_KEY_PERMISSION 21
|
||||
#define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22
|
||||
#define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23
|
||||
#define EXCEPT_IPF_GENERAL_EXCEPTION 24
|
||||
#define EXCEPT_IPF_DISABLED_FP_REGISTER 25
|
||||
#define EXCEPT_IPF_NAT_CONSUMPTION 26
|
||||
#define EXCEPT_IPF_SPECULATION 27
|
||||
//
|
||||
// 28 reserved
|
||||
//
|
||||
#define EXCEPT_IPF_DEBUG 29
|
||||
#define EXCEPT_IPF_UNALIGNED_REFERENCE 30
|
||||
#define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31
|
||||
#define EXCEPT_IPF_FP_FAULT 32
|
||||
#define EXCEPT_IPF_FP_TRAP 33
|
||||
#define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34
|
||||
#define EXCEPT_IPF_TAKEN_BRANCH 35
|
||||
#define EXCEPT_IPF_SINGLE_STEP 36
|
||||
//
|
||||
// 37 - 44 reserved
|
||||
//
|
||||
#define EXCEPT_IPF_IA32_EXCEPTION 45
|
||||
#define EXCEPT_IPF_IA32_INTERCEPT 46
|
||||
#define EXCEPT_IPF_IA32_INTERRUPT 47
|
||||
|
||||
//
|
||||
// IPF processor context definition
|
||||
//
|
||||
typedef struct {
|
||||
//
|
||||
// The first reserved field is necessary to preserve alignment for the correct
|
||||
// bits in UNAT and to insure F2 is 16 byte aligned..
|
||||
//
|
||||
UINT64 Reserved;
|
||||
UINT64 R1;
|
||||
UINT64 R2;
|
||||
UINT64 R3;
|
||||
UINT64 R4;
|
||||
UINT64 R5;
|
||||
UINT64 R6;
|
||||
UINT64 R7;
|
||||
UINT64 R8;
|
||||
UINT64 R9;
|
||||
UINT64 R10;
|
||||
UINT64 R11;
|
||||
UINT64 R12;
|
||||
UINT64 R13;
|
||||
UINT64 R14;
|
||||
UINT64 R15;
|
||||
UINT64 R16;
|
||||
UINT64 R17;
|
||||
UINT64 R18;
|
||||
UINT64 R19;
|
||||
UINT64 R20;
|
||||
UINT64 R21;
|
||||
UINT64 R22;
|
||||
UINT64 R23;
|
||||
UINT64 R24;
|
||||
UINT64 R25;
|
||||
UINT64 R26;
|
||||
UINT64 R27;
|
||||
UINT64 R28;
|
||||
UINT64 R29;
|
||||
UINT64 R30;
|
||||
UINT64 R31;
|
||||
|
||||
UINT64 F2[2];
|
||||
UINT64 F3[2];
|
||||
UINT64 F4[2];
|
||||
UINT64 F5[2];
|
||||
UINT64 F6[2];
|
||||
UINT64 F7[2];
|
||||
UINT64 F8[2];
|
||||
UINT64 F9[2];
|
||||
UINT64 F10[2];
|
||||
UINT64 F11[2];
|
||||
UINT64 F12[2];
|
||||
UINT64 F13[2];
|
||||
UINT64 F14[2];
|
||||
UINT64 F15[2];
|
||||
UINT64 F16[2];
|
||||
UINT64 F17[2];
|
||||
UINT64 F18[2];
|
||||
UINT64 F19[2];
|
||||
UINT64 F20[2];
|
||||
UINT64 F21[2];
|
||||
UINT64 F22[2];
|
||||
UINT64 F23[2];
|
||||
UINT64 F24[2];
|
||||
UINT64 F25[2];
|
||||
UINT64 F26[2];
|
||||
UINT64 F27[2];
|
||||
UINT64 F28[2];
|
||||
UINT64 F29[2];
|
||||
UINT64 F30[2];
|
||||
UINT64 F31[2];
|
||||
|
||||
UINT64 Pr;
|
||||
|
||||
UINT64 B0;
|
||||
UINT64 B1;
|
||||
UINT64 B2;
|
||||
UINT64 B3;
|
||||
UINT64 B4;
|
||||
UINT64 B5;
|
||||
UINT64 B6;
|
||||
UINT64 B7;
|
||||
|
||||
//
|
||||
// application registers
|
||||
//
|
||||
UINT64 ArRsc;
|
||||
UINT64 ArBsp;
|
||||
UINT64 ArBspstore;
|
||||
UINT64 ArRnat;
|
||||
|
||||
UINT64 ArFcr;
|
||||
|
||||
UINT64 ArEflag;
|
||||
UINT64 ArCsd;
|
||||
UINT64 ArSsd;
|
||||
UINT64 ArCflg;
|
||||
UINT64 ArFsr;
|
||||
UINT64 ArFir;
|
||||
UINT64 ArFdr;
|
||||
|
||||
UINT64 ArCcv;
|
||||
|
||||
UINT64 ArUnat;
|
||||
|
||||
UINT64 ArFpsr;
|
||||
|
||||
UINT64 ArPfs;
|
||||
UINT64 ArLc;
|
||||
UINT64 ArEc;
|
||||
|
||||
//
|
||||
// control registers
|
||||
//
|
||||
UINT64 CrDcr;
|
||||
UINT64 CrItm;
|
||||
UINT64 CrIva;
|
||||
UINT64 CrPta;
|
||||
UINT64 CrIpsr;
|
||||
UINT64 CrIsr;
|
||||
UINT64 CrIip;
|
||||
UINT64 CrIfa;
|
||||
UINT64 CrItir;
|
||||
UINT64 CrIipa;
|
||||
UINT64 CrIfs;
|
||||
UINT64 CrIim;
|
||||
UINT64 CrIha;
|
||||
|
||||
//
|
||||
// debug registers
|
||||
//
|
||||
UINT64 Dbr0;
|
||||
UINT64 Dbr1;
|
||||
UINT64 Dbr2;
|
||||
UINT64 Dbr3;
|
||||
UINT64 Dbr4;
|
||||
UINT64 Dbr5;
|
||||
UINT64 Dbr6;
|
||||
UINT64 Dbr7;
|
||||
|
||||
UINT64 Ibr0;
|
||||
UINT64 Ibr1;
|
||||
UINT64 Ibr2;
|
||||
UINT64 Ibr3;
|
||||
UINT64 Ibr4;
|
||||
UINT64 Ibr5;
|
||||
UINT64 Ibr6;
|
||||
UINT64 Ibr7;
|
||||
|
||||
//
|
||||
// virtual registers - nat bits for R1-R31
|
||||
//
|
||||
UINT64 IntNat;
|
||||
|
||||
} EFI_SYSTEM_CONTEXT_IPF;
|
||||
|
||||
//
|
||||
// EBC processor exception types
|
||||
//
|
||||
#define EXCEPT_EBC_UNDEFINED 0
|
||||
#define EXCEPT_EBC_DIVIDE_ERROR 1
|
||||
#define EXCEPT_EBC_DEBUG 2
|
||||
#define EXCEPT_EBC_BREAKPOINT 3
|
||||
#define EXCEPT_EBC_OVERFLOW 4
|
||||
#define EXCEPT_EBC_INVALID_OPCODE 5 // opcode out of range
|
||||
#define EXCEPT_EBC_STACK_FAULT 6
|
||||
#define EXCEPT_EBC_ALIGNMENT_CHECK 7
|
||||
#define EXCEPT_EBC_INSTRUCTION_ENCODING 8 // malformed instruction
|
||||
#define EXCEPT_EBC_BAD_BREAK 9 // BREAK 0 or undefined BREAK
|
||||
#define EXCEPT_EBC_STEP 10 // to support debug stepping
|
||||
//
|
||||
// For coding convenience, define the maximum valid EBC exception.
|
||||
//
|
||||
#define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP
|
||||
|
||||
//
|
||||
// EBC processor context definition
|
||||
//
|
||||
typedef struct {
|
||||
UINT64 R0;
|
||||
UINT64 R1;
|
||||
UINT64 R2;
|
||||
UINT64 R3;
|
||||
UINT64 R4;
|
||||
UINT64 R5;
|
||||
UINT64 R6;
|
||||
UINT64 R7;
|
||||
UINT64 Flags;
|
||||
UINT64 ControlFlags;
|
||||
UINT64 Ip;
|
||||
} EFI_SYSTEM_CONTEXT_EBC;
|
||||
|
||||
//
|
||||
// Universal EFI_SYSTEM_CONTEXT definition
|
||||
//
|
||||
typedef union {
|
||||
EFI_SYSTEM_CONTEXT_EBC *SystemContextEbc;
|
||||
EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;
|
||||
EFI_SYSTEM_CONTEXT_X64 *SystemContextX64;
|
||||
EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf;
|
||||
} EFI_SYSTEM_CONTEXT;
|
||||
|
||||
//
|
||||
// DebugSupport callback function prototypes
|
||||
//
|
||||
typedef
|
||||
VOID
|
||||
(*EFI_EXCEPTION_CALLBACK) (
|
||||
IN EFI_EXCEPTION_TYPE ExceptionType,
|
||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||
);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(*EFI_PERIODIC_CALLBACK) (
|
||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||
);
|
||||
|
||||
//
|
||||
// Machine type definition
|
||||
//
|
||||
typedef enum {
|
||||
IsaIa32 = EFI_IMAGE_MACHINE_IA32,
|
||||
IsaX64 = EFI_IMAGE_MACHINE_X64,
|
||||
IsaIpf = EFI_IMAGE_MACHINE_IA64,
|
||||
IsaEbc = EFI_IMAGE_MACHINE_EBC
|
||||
} EFI_INSTRUCTION_SET_ARCHITECTURE;
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_DEBUG_SUPPORT_PROTOCOL);
|
||||
|
||||
//
|
||||
// DebugSupport member function definitions
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX) (
|
||||
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
|
||||
OUT UINTN *MaxProcessorIndex
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK) (
|
||||
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
|
||||
IN UINTN ProcessorIndex,
|
||||
IN EFI_PERIODIC_CALLBACK PeriodicCallback
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK) (
|
||||
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
|
||||
IN UINTN ProcessorIndex,
|
||||
IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
|
||||
IN EFI_EXCEPTION_TYPE ExceptionType
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE) (
|
||||
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
|
||||
IN UINTN ProcessorIndex,
|
||||
IN VOID *Start,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
//
|
||||
// DebugSupport protocol definition
|
||||
//
|
||||
typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL {
|
||||
EFI_INSTRUCTION_SET_ARCHITECTURE Isa;
|
||||
EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex;
|
||||
EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;
|
||||
EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback;
|
||||
EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache;
|
||||
} EFI_DEBUG_SUPPORT_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiDebugSupportProtocolGuid;
|
||||
|
||||
#endif /* _DEBUG_SUPPORT_H_ */
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Decompress.c
|
||||
|
||||
Abstract:
|
||||
|
||||
The GUID for the EFI Decompress Protocol
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (Decompress)
|
||||
|
||||
EFI_GUID gEfiDecompressProtocolGuid = EFI_DECOMPRESS_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDecompressProtocolGuid, "Decompress", "Decompression Protocol");
|
|
@ -0,0 +1,140 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Decompress.h
|
||||
|
||||
Abstract:
|
||||
|
||||
The Decompress Protocol Interface
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DECOMPRESS_H_
|
||||
#define _DECOMPRESS_H_
|
||||
|
||||
#define EFI_DECOMPRESS_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xd8117cfe, 0x94a6, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
}
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_DECOMPRESS_PROTOCOL);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DECOMPRESS_GET_INFO) (
|
||||
IN EFI_DECOMPRESS_PROTOCOL * This,
|
||||
IN VOID *Source,
|
||||
IN UINT32 SourceSize,
|
||||
OUT UINT32 *DestinationSize,
|
||||
OUT UINT32 *ScratchSize
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
The GetInfo() function retrieves the size of the uncompressed buffer
|
||||
and the temporary scratch buffer required to decompress the buffer
|
||||
specified by Source and SourceSize. If the size of the uncompressed
|
||||
buffer or the size of the scratch buffer cannot be determined from
|
||||
the compressed data specified by Source and SourceData, then
|
||||
EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed
|
||||
buffer is returned in DestinationSize, the size of the scratch buffer is
|
||||
returned in ScratchSize, and EFI_SUCCESS is returned.
|
||||
|
||||
The GetInfo() function does not have scratch buffer available to perform
|
||||
a thorough checking of the validity of the source data. It just retrieves
|
||||
the 'Original Size' field from the beginning bytes of the source data and
|
||||
output it as DestinationSize. And ScratchSize is specific to the decompression
|
||||
implementation.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SourceSize - The size, in bytes, of source buffer.
|
||||
DestinationSize - A pointer to the size, in bytes, of the uncompressed buffer
|
||||
that will be generated when the compressed buffer specified
|
||||
by Source and SourceSize is decompressed.
|
||||
ScratchSize - A pointer to the size, in bytes, of the scratch buffer that
|
||||
is required to decompress the compressed buffer specified by
|
||||
Source and SourceSize.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The size of the uncompressed data was returned in DestinationSize
|
||||
and the size of the scratch buffer was returned in ScratchSize.
|
||||
EFI_INVALID_PARAMETER - The size of the uncompressed data or the size of the scratch
|
||||
buffer cannot be determined from the compressed data specified by
|
||||
Source and SourceData.
|
||||
|
||||
--*/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DECOMPRESS_DECOMPRESS) (
|
||||
IN EFI_DECOMPRESS_PROTOCOL * This,
|
||||
IN VOID *Source,
|
||||
IN UINT32 SourceSize,
|
||||
IN OUT VOID *Destination,
|
||||
IN UINT32 DestinationSize,
|
||||
IN OUT VOID *Scratch,
|
||||
IN UINT32 ScratchSize
|
||||
);
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
The Decompress() function extracts decompressed data to its original form.
|
||||
|
||||
This protocol is designed so that the decompression algorithm can be
|
||||
implemented without using any memory services. As a result, the
|
||||
Decompress() function is not allowed to call AllocatePool() or
|
||||
AllocatePages() in its implementation. It is the caller's responsibility
|
||||
to allocate and free the Destination and Scratch buffers.
|
||||
|
||||
If the compressed source data specified by Source and SourceSize is
|
||||
sucessfully decompressed into Destination, then EFI_SUCCESS is returned.
|
||||
If the compressed source data specified by Source and SourceSize is not in
|
||||
a valid compressed data format, then EFI_INVALID_PARAMETER is returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - The protocol instance pointer
|
||||
Source - The source buffer containing the compressed data.
|
||||
SourceSize - The size of source data.
|
||||
Destination - On output, the destination buffer that contains
|
||||
the uncompressed data.
|
||||
DestinationSize - The size of destination buffer. The size of destination
|
||||
buffer needed is obtained from GetInfo().
|
||||
Scratch - A temporary scratch buffer that is used to perform the
|
||||
decompression.
|
||||
ScratchSize - The size of scratch buffer. The size of scratch buffer needed
|
||||
is obtained from GetInfo().
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Decompression completed successfully, and the uncompressed
|
||||
buffer is returned in Destination.
|
||||
EFI_INVALID_PARAMETER
|
||||
- The source buffer specified by Source and SourceSize is
|
||||
corrupted (not in a valid compressed format).
|
||||
|
||||
--*/
|
||||
typedef struct _EFI_DECOMPRESS_PROTOCOL {
|
||||
EFI_DECOMPRESS_GET_INFO GetInfo;
|
||||
EFI_DECOMPRESS_DECOMPRESS Decompress;
|
||||
} EFI_DECOMPRESS_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiDecompressProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DeviceIo.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Device IO protocol as defined in the EFI 1.0 specification.
|
||||
|
||||
Device IO is used to abstract hardware access to devices. It includes
|
||||
memory mapped IO, IO, PCI Config space, and DMA.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DeviceIo)
|
||||
|
||||
EFI_GUID gEfiDeviceIoProtocolGuid = EFI_DEVICE_IO_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDeviceIoProtocolGuid, "DeviceIo Protocol", "EFI 1.0 Device IO Protocol");
|
|
@ -0,0 +1,132 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DeviceIo.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Device IO protocol as defined in the EFI 1.0 specification.
|
||||
|
||||
Device IO is used to abstract hardware access to devices. It includes
|
||||
memory mapped IO, IO, PCI Config space, and DMA.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEVICE_IO_H_
|
||||
#define _DEVICE_IO_H_
|
||||
|
||||
#define EFI_DEVICE_IO_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
|
||||
}
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_DEVICE_IO_PROTOCOL);
|
||||
|
||||
typedef enum {
|
||||
IO_UINT8,
|
||||
IO_UINT16,
|
||||
IO_UINT32,
|
||||
IO_UINT64,
|
||||
MMIO_COPY_UINT8,
|
||||
MMIO_COPY_UINT16,
|
||||
MMIO_COPY_UINT32,
|
||||
MMIO_COPY_UINT64
|
||||
} EFI_IO_WIDTH;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DEVICE_IO) (
|
||||
IN EFI_DEVICE_IO_PROTOCOL * This,
|
||||
IN EFI_IO_WIDTH Width,
|
||||
IN UINT64 Address,
|
||||
IN UINTN Count,
|
||||
IN OUT VOID *Buffer
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_IO Read;
|
||||
EFI_DEVICE_IO Write;
|
||||
} EFI_IO_ACCESS;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_PCI_DEVICE_PATH) (
|
||||
IN EFI_DEVICE_IO_PROTOCOL * This,
|
||||
IN UINT64 Address,
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath
|
||||
);
|
||||
|
||||
typedef enum {
|
||||
EfiBusMasterRead,
|
||||
EfiBusMasterWrite,
|
||||
EfiBusMasterCommonBuffer
|
||||
} EFI_IO_OPERATION_TYPE;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IO_MAP) (
|
||||
IN EFI_DEVICE_IO_PROTOCOL * This,
|
||||
IN EFI_IO_OPERATION_TYPE Operation,
|
||||
IN EFI_PHYSICAL_ADDRESS * HostAddress,
|
||||
IN OUT UINTN *NumberOfBytes,
|
||||
OUT EFI_PHYSICAL_ADDRESS * DeviceAddress,
|
||||
OUT VOID **Mapping
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IO_UNMAP) (
|
||||
IN EFI_DEVICE_IO_PROTOCOL * This,
|
||||
IN VOID *Mapping
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
|
||||
IN EFI_DEVICE_IO_PROTOCOL * This,
|
||||
IN EFI_ALLOCATE_TYPE Type,
|
||||
IN EFI_MEMORY_TYPE MemoryType,
|
||||
IN UINTN Pages,
|
||||
IN OUT EFI_PHYSICAL_ADDRESS * HostAddress
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IO_FLUSH) (
|
||||
IN EFI_DEVICE_IO_PROTOCOL * This
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IO_FREE_BUFFER) (
|
||||
IN EFI_DEVICE_IO_PROTOCOL * This,
|
||||
IN UINTN Pages,
|
||||
IN EFI_PHYSICAL_ADDRESS HostAddress
|
||||
);
|
||||
|
||||
typedef struct _EFI_DEVICE_IO_PROTOCOL {
|
||||
EFI_IO_ACCESS Mem;
|
||||
EFI_IO_ACCESS Io;
|
||||
EFI_IO_ACCESS Pci;
|
||||
EFI_IO_MAP Map;
|
||||
EFI_PCI_DEVICE_PATH PciDevicePath;
|
||||
EFI_IO_UNMAP Unmap;
|
||||
EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
|
||||
EFI_IO_FLUSH Flush;
|
||||
EFI_IO_FREE_BUFFER FreeBuffer;
|
||||
} EFI_DEVICE_IO_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiDeviceIoProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,32 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePath.c
|
||||
|
||||
Abstract:
|
||||
|
||||
The device path protocol as defined in EFI 1.0.
|
||||
|
||||
The device path represents a programatic path to a device. It's the view
|
||||
from a software point of view. It also must persist from boot to boot, so
|
||||
it can not contain things like PCI bus numbers that change from boot to boot.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DevicePath)
|
||||
|
||||
EFI_GUID gEfiDevicePathProtocolGuid = EFI_DEVICE_PATH_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDevicePathProtocolGuid, "Device Path Protocol", "EFI 1.0 Device Path protocol");
|
|
@ -0,0 +1,67 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePath.h
|
||||
|
||||
Abstract:
|
||||
|
||||
The device path protocol as defined in EFI 1.0.
|
||||
|
||||
The device path represents a programatic path to a device. It's the view
|
||||
from a software point of view. It also must persist from boot to boot, so
|
||||
it can not contain things like PCI bus numbers that change from boot to boot.
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEVICE_PATH_H_
|
||||
#define _DEVICE_PATH_H_
|
||||
|
||||
//
|
||||
// Device Path protocol
|
||||
//
|
||||
#define EFI_DEVICE_PATH_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
|
||||
}
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 SubType;
|
||||
UINT8 Length[2];
|
||||
} EFI_DEVICE_PATH_PROTOCOL;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#define EFI_END_ENTIRE_DEVICE_PATH 0xff
|
||||
#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
|
||||
#define EFI_END_INSTANCE_DEVICE_PATH 0x01
|
||||
#define EFI_END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL))
|
||||
|
||||
#define EfiDevicePathNodeLength(a) (((a)->Length[0]) | ((a)->Length[1] << 8))
|
||||
#define EfiNextDevicePathNode(a) ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))
|
||||
|
||||
#define EfiDevicePathType(a) (((a)->Type) & 0x7f)
|
||||
#define EfiIsDevicePathEndType(a) (EfiDevicePathType (a) == 0x7f)
|
||||
|
||||
#define EfiIsDevicePathEndSubType(a) ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)
|
||||
#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)
|
||||
|
||||
#define EfiIsDevicePathEnd(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))
|
||||
#define EfiIsDevicePathEndInstance(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))
|
||||
|
||||
extern EFI_GUID gEfiDevicePathProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePathFromText.c
|
||||
|
||||
Abstract:
|
||||
|
||||
DevicePathFromText protocol as defined in the UEFI 2.0 specification.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DevicePathFromText)
|
||||
|
||||
EFI_GUID gEfiDevicePathFromTextProtocolGuid = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDevicePathFromTextProtocolGuid, "Device Path From Text Protocol", "UEFI 2.0 Device Path From Text Protocol");
|
|
@ -0,0 +1,82 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePathFromText.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEVICE_PATH_FROM_TEXT_PROTOCOL_H_
|
||||
#define _DEVICE_PATH_FROM_TEXT_PROTOCOL_H_
|
||||
|
||||
//
|
||||
// Device Path From Text protocol
|
||||
//
|
||||
#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x5c99a21, 0xc70f, 0x4ad2, 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e \
|
||||
}
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (
|
||||
IN CONST CHAR16 *TextDeviceNode
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert text to the binary representation of a device node.
|
||||
|
||||
Arguments:
|
||||
TextDeviceNode - TextDeviceNode points to the text representation of a device
|
||||
node. Conversion starts with the first character and continues
|
||||
until the first non-device node character.
|
||||
|
||||
Returns:
|
||||
A pointer - Pointer to the EFI device node.
|
||||
NULL - if TextDeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) (
|
||||
IN CONST CHAR16 *TextDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert text to the binary representation of a device path.
|
||||
|
||||
Arguments:
|
||||
TextDevicePath - TextDevicePath points to the text representation of a device
|
||||
path. Conversion starts with the first character and continues
|
||||
until the first non-device node character.
|
||||
|
||||
Returns:
|
||||
A pointer - Pointer to the allocated device path.
|
||||
NULL - if TextDeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertTextToDeviceNode;
|
||||
EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertTextToDevicePath;
|
||||
} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePathToText.c
|
||||
|
||||
Abstract:
|
||||
|
||||
DevicePathToText protocol as defined in the UEFI 2.0 specification.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DevicePathToText)
|
||||
|
||||
EFI_GUID gEfiDevicePathToTextProtocolGuid = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDevicePathToTextProtocolGuid, "Device Path To Text Protocol", "UEFI 2.0 Device Path To Text protocol");
|
|
@ -0,0 +1,95 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePathToText.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#ifndef _DEVICE_PATH_TO_TEXT_PROTOCOL_H_
|
||||
#define _DEVICE_PATH_TO_TEXT_PROTOCOL_H_
|
||||
|
||||
//
|
||||
// Device Path To Text protocol
|
||||
//
|
||||
#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x8b843e20, 0x8132, 0x4852, 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c \
|
||||
}
|
||||
|
||||
typedef
|
||||
CHAR16*
|
||||
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
|
||||
IN BOOLEAN DisplayOnly,
|
||||
IN BOOLEAN AllowShortcuts
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert a device node to its text representation.
|
||||
|
||||
Arguments:
|
||||
DeviceNode - Points to the device node to be converted.
|
||||
DisplayOnly - If DisplayOnly is TRUE, then the shorter text representation
|
||||
of the display node is used, where applicable. If DisplayOnly
|
||||
is FALSE, then the longer text representation of the display node
|
||||
is used.
|
||||
AllowShortcuts - If AllowShortcuts is TRUE, then the shortcut forms of text
|
||||
representation for a device node can be used, where applicable.
|
||||
|
||||
Returns:
|
||||
A pointer - a pointer to the allocated text representation of the device node.
|
||||
NULL - if DeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
CHAR16*
|
||||
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN BOOLEAN DisplayOnly,
|
||||
IN BOOLEAN AllowShortcuts
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert a device path to its text representation.
|
||||
|
||||
Arguments:
|
||||
DeviceNode - Points to the device path to be converted.
|
||||
DisplayOnly - If DisplayOnly is TRUE, then the shorter text representation
|
||||
of the display node is used, where applicable. If DisplayOnly
|
||||
is FALSE, then the longer text representation of the display node
|
||||
is used.
|
||||
AllowShortcuts - If AllowShortcuts is TRUE, then the shortcut forms of text
|
||||
representation for a device node can be used, where applicable.
|
||||
|
||||
Returns:
|
||||
A pointer - a pointer to the allocated text representation of the device path.
|
||||
NULL - if DeviceNode is NULL or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
|
||||
EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
|
||||
} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiDevicePathToTextProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePathUtilities.c
|
||||
|
||||
Abstract:
|
||||
|
||||
DevicePathUtilities protocol as defined in the UEFI 2.0 specification.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DevicePathUtilities)
|
||||
|
||||
EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDevicePathUtilitiesProtocolGuid, "Device Path Utilities Protocol", "UEFI 2.0 Device Path Utilities protocol");
|
|
@ -0,0 +1,225 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DevicePathUtilities.h
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DEVICE_PATH_UTILITIES_PROTOCOL_H_
|
||||
#define _DEVICE_PATH_UTILITIES_PROTOCOL_H_
|
||||
|
||||
//
|
||||
// Device Path Utilities protocol
|
||||
//
|
||||
#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x379be4e, 0xd706, 0x437d, 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 \
|
||||
}
|
||||
|
||||
typedef
|
||||
UINTN
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Returns the size of the device path, in bytes.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the start of the EFI device path.
|
||||
|
||||
Returns:
|
||||
Size - Size of the specified device path, in bytes, including the end-of-path tag.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Create a duplicate of the specified path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the source EFI device path.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the duplicate device path.
|
||||
NULL - Insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Create a new path by appending the second device path to the first.
|
||||
|
||||
Arguments:
|
||||
Src1 - Points to the first device path. If NULL, then it is ignored.
|
||||
Src2 - Points to the second device path. If NULL, then it is ignored.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device path.
|
||||
NULL - Memory could not be allocated
|
||||
or either DevicePath or DeviceNode is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a new path by appending the device node to the device path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path.
|
||||
DeviceNode - Points to the device node.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the allocated device node.
|
||||
NULL - Memory could not be allocated
|
||||
or either DevicePath or DeviceNode is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a new path by appending the specified device path instance to the specified device path.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path. If NULL, then ignored.
|
||||
DevicePathInstance - Points to the device path instance.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device path
|
||||
NULL - Memory could not be allocated or DevicePathInstance is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE) (
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
|
||||
OUT UINTN *DevicePathInstanceSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a copy of the current device path instance and returns a pointer to the next device path instance.
|
||||
|
||||
Arguments:
|
||||
DevicePathInstance - On input, this holds the pointer to the current device path
|
||||
instance. On output, this holds the pointer to the next
|
||||
device path instance or NULL if there are no more device
|
||||
path instances in the device path.
|
||||
DevicePathInstanceSize - On output, this holds the size of the device path instance,
|
||||
in bytes or zero, if DevicePathInstance is zero.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the copy of the current device path instance.
|
||||
NULL - DevicePathInstace was NULL on entry or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
BOOLEAN
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE) (
|
||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Returns whether a device path is multi-instance.
|
||||
|
||||
Arguments:
|
||||
DevicePath - Points to the device path. If NULL, then ignored.
|
||||
|
||||
Returns:
|
||||
TRUE - The device path has more than one instance
|
||||
FALSE - The device path is empty or contains only a single instance.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_DEVICE_PATH_PROTOCOL*
|
||||
(EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE) (
|
||||
IN UINT8 NodeType,
|
||||
IN UINT8 NodeSubType,
|
||||
IN UINT16 NodeLength
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Creates a device node
|
||||
|
||||
Arguments:
|
||||
NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for
|
||||
the new device node.
|
||||
NodeSubType - NodeSubType is the device node sub-type
|
||||
EFI_DEVICE_PATH.SubType) for the new device node.
|
||||
NodeLength - NodeLength is the length of the device node
|
||||
(EFI_DEVICE_PATH.Length) for the new device node.
|
||||
|
||||
Returns:
|
||||
Pointer - A pointer to the newly created device node.
|
||||
NULL - NodeLength is less than
|
||||
the size of the header or there was insufficient memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
|
||||
EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath;
|
||||
EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath;
|
||||
EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode;
|
||||
EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance;
|
||||
EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance;
|
||||
EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance;
|
||||
EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode;
|
||||
} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,41 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Dhcp4.c
|
||||
|
||||
Abstract:
|
||||
|
||||
UEFI Dynamic Host Configuration Protocol 4.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (Dhcp4)
|
||||
|
||||
EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid
|
||||
= EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID gEfiDhcp4ProtocolGuid
|
||||
= EFI_DHCP4_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING (
|
||||
&gEfiDhcp4ServiceBindingProtocolGuid,
|
||||
"DHCP4 Service Binding Protocol",
|
||||
"DHCP4 Service Binding Protocol"
|
||||
);
|
||||
|
||||
EFI_GUID_STRING (
|
||||
&gEfiDhcp4ProtocolGuid,
|
||||
"DHCP4 Protocol",
|
||||
"DHCP4 Protocol"
|
||||
);
|
|
@ -0,0 +1,237 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
Dhcp4.h
|
||||
|
||||
Abstract:
|
||||
|
||||
UEFI Dynamic Host Configuration Protocol 4 Definition
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _DHCP4_H_
|
||||
#define _DHCP4_H_
|
||||
|
||||
#include EFI_PROTOCOL_DEFINITION (ServiceBinding)
|
||||
#include EFI_PROTOCOL_DEFINITION (Udp4)
|
||||
|
||||
//GUID definitions
|
||||
#define EFI_DHCP4_PROTOCOL_GUID \
|
||||
{0x8a219718, 0x4ef5, 0x4761, 0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56}
|
||||
|
||||
#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{0x9d9a39d8, 0xbd42, 0x4a73, 0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80}
|
||||
|
||||
extern EFI_GUID gEfiDhcp4ProtocolGuid;
|
||||
extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_DHCP4_PROTOCOL);
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT8 OpCode;
|
||||
UINT8 Length;
|
||||
UINT8 Data[1];
|
||||
} EFI_DHCP4_PACKET_OPTION;
|
||||
|
||||
typedef struct{
|
||||
UINT8 OpCode;
|
||||
UINT8 HwType;
|
||||
UINT8 HwAddrLen;
|
||||
UINT8 Hops;
|
||||
UINT32 Xid;
|
||||
UINT16 Seconds;
|
||||
UINT16 Reserved;
|
||||
EFI_IPv4_ADDRESS ClientAddr;
|
||||
EFI_IPv4_ADDRESS YourAddr;
|
||||
EFI_IPv4_ADDRESS ServerAddr;
|
||||
EFI_IPv4_ADDRESS GwAddr;
|
||||
UINT8 ClientHwAddr[16];
|
||||
CHAR8 ServerName[64];
|
||||
CHAR8 BootFileName[128];
|
||||
}EFI_DHCP4_HEADER;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Size;
|
||||
UINT32 Length;
|
||||
struct {
|
||||
EFI_DHCP4_HEADER Header;
|
||||
UINT32 Magik;
|
||||
UINT8 Option[1];
|
||||
} Dhcp4;
|
||||
} EFI_DHCP4_PACKET;
|
||||
#pragma pack()
|
||||
|
||||
typedef enum {
|
||||
Dhcp4Stopped = 0x0,
|
||||
Dhcp4Init = 0x1,
|
||||
Dhcp4Selecting = 0x2,
|
||||
Dhcp4Requesting = 0x3,
|
||||
Dhcp4Bound = 0x4,
|
||||
Dhcp4Renewing = 0x5,
|
||||
Dhcp4Rebinding = 0x6,
|
||||
Dhcp4InitReboot = 0x7,
|
||||
Dhcp4Rebooting = 0x8
|
||||
} EFI_DHCP4_STATE;
|
||||
|
||||
typedef enum{
|
||||
Dhcp4SendDiscover = 0x01,
|
||||
Dhcp4RcvdOffer = 0x02,
|
||||
Dhcp4SelectOffer = 0x03,
|
||||
Dhcp4SendRequest = 0x05,
|
||||
Dhcp4RcvdAck = 0x06,
|
||||
Dhcp4RcvdNak = 0x07,
|
||||
Dhcp4SendDecline = 0x08,
|
||||
Dhcp4BoundCompleted = 0x09,
|
||||
Dhcp4EnterRenewing = 0x0a,
|
||||
Dhcp4EnterRebinding = 0x0b,
|
||||
Dhcp4AddressLost = 0x0c,
|
||||
Dhcp4Fail = 0x0d
|
||||
} EFI_DHCP4_EVENT;
|
||||
|
||||
typedef EFI_STATUS (*EFI_DHCP4_CALLBACK)(
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
IN VOID *Context,
|
||||
IN EFI_DHCP4_STATE CurrentState,
|
||||
IN EFI_DHCP4_EVENT Dhcp4Event,
|
||||
IN EFI_DHCP4_PACKET *Packet OPTIONAL,
|
||||
OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
UINT32 DiscoverTryCount;
|
||||
UINT32 *DiscoverTimeout;
|
||||
UINT32 RequestTryCount;
|
||||
UINT32 *RequestTimeout;
|
||||
EFI_IPv4_ADDRESS ClientAddress;
|
||||
EFI_DHCP4_CALLBACK Dhcp4Callback;
|
||||
VOID *CallbackContext;
|
||||
UINT32 OptionCount;
|
||||
EFI_DHCP4_PACKET_OPTION **OptionList;
|
||||
}EFI_DHCP4_CONFIG_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_DHCP4_STATE State;
|
||||
EFI_DHCP4_CONFIG_DATA ConfigData;
|
||||
EFI_IPv4_ADDRESS ClientAddress;
|
||||
EFI_MAC_ADDRESS ClientMacAddress;
|
||||
EFI_IPv4_ADDRESS ServerAddress;
|
||||
EFI_IPv4_ADDRESS RouterAddress;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
UINT32 LeaseTime;
|
||||
EFI_DHCP4_PACKET *ReplyPacket;
|
||||
} EFI_DHCP4_MODE_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv4_ADDRESS ListenAddress;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
UINT16 ListenPort;
|
||||
} EFI_DHCP4_LISTEN_POINT;
|
||||
|
||||
typedef struct {
|
||||
OUT EFI_STATUS Status;
|
||||
IN EFI_EVENT CompletionEvent;
|
||||
IN EFI_IPv4_ADDRESS RemoteAddress;
|
||||
IN UINT16 RemotePort;
|
||||
IN EFI_IPv4_ADDRESS GatewayAddress;
|
||||
IN UINT32 ListenPointCount;
|
||||
IN EFI_DHCP4_LISTEN_POINT *ListenPoints;
|
||||
IN UINT32 TimeoutValue;
|
||||
IN EFI_DHCP4_PACKET *Packet;
|
||||
OUT UINT32 ResponseCount;
|
||||
OUT EFI_DHCP4_PACKET *ResponseList;
|
||||
}EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_CONFIGURE) (
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
typedef EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_START) (
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
IN EFI_EVENT CompletionEvent OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_RENEW) (
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
IN BOOLEAN RebindRequest,
|
||||
IN EFI_EVENT CompletionEvent OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_RELEASE) (
|
||||
IN EFI_DHCP4_PROTOCOL *This
|
||||
);
|
||||
|
||||
typedef EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_STOP) (
|
||||
IN EFI_DHCP4_PROTOCOL *This
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_BUILD) (
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
IN EFI_DHCP4_PACKET *SeedPacket,
|
||||
IN UINT32 DeleteCount,
|
||||
IN UINT8 *DeleteList OPTIONAL,
|
||||
IN UINT32 AppendCount,
|
||||
IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL,
|
||||
OUT EFI_DHCP4_PACKET **NewPacket
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE) (
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token
|
||||
);
|
||||
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DHCP4_PARSE) (
|
||||
IN EFI_DHCP4_PROTOCOL *This,
|
||||
IN EFI_DHCP4_PACKET *Packet,
|
||||
IN OUT UINT32 *OptionCount,
|
||||
OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL
|
||||
);
|
||||
|
||||
typedef struct _EFI_DHCP4_PROTOCOL {
|
||||
EFI_DHCP4_GET_MODE_DATA GetModeData;
|
||||
EFI_DHCP4_CONFIGURE Configure;
|
||||
EFI_DHCP4_START Start;
|
||||
EFI_DHCP4_RENEW RenewRebind;
|
||||
EFI_DHCP4_RELEASE Release;
|
||||
EFI_DHCP4_STOP Stop;
|
||||
EFI_DHCP4_BUILD Build;
|
||||
EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive;
|
||||
EFI_DHCP4_PARSE Parse;
|
||||
} EFI_DHCP4_PROTOCOL;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DiskIo.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Disk IO protocol as defined in the EFI 1.0 specification.
|
||||
|
||||
The Disk IO protocol is used to convert block oriented devices into byte
|
||||
oriented devices. The Disk IO protocol is intended to layer on top of the
|
||||
Block IO protocol.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DiskIo)
|
||||
|
||||
EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiDiskIoProtocolGuid, "DiskIo Protocol", "EFI 1.0 Disk IO Protocol");
|
|
@ -0,0 +1,111 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
DiskIo.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Disk IO protocol as defined in the EFI 1.0 specification.
|
||||
|
||||
The Disk IO protocol is used to convert block oriented devices into byte
|
||||
oriented devices. The Disk IO protocol is intended to layer on top of the
|
||||
Block IO protocol.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __DISK_IO_H__
|
||||
#define __DISK_IO_H__
|
||||
|
||||
#define EFI_DISK_IO_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
|
||||
}
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_DISK_IO_PROTOCOL);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DISK_READ) (
|
||||
IN EFI_DISK_IO_PROTOCOL * This,
|
||||
IN UINT32 MediaId,
|
||||
IN UINT64 Offset,
|
||||
IN UINTN BufferSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Read BufferSize bytes from Offset into Buffer.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
MediaId - Id of the media, changes every time the media is replaced.
|
||||
Offset - The starting byte offset to read from
|
||||
BufferSize - Size of Buffer
|
||||
Buffer - Buffer containing read data
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The data was read correctly from the device.
|
||||
EFI_DEVICE_ERROR - The device reported an error while performing the read.
|
||||
EFI_NO_MEDIA - There is no media in the device.
|
||||
EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.
|
||||
EFI_INVALID_PARAMETER - The read request contains device addresses that are not
|
||||
valid for the device.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_DISK_WRITE) (
|
||||
IN EFI_DISK_IO_PROTOCOL * This,
|
||||
IN UINT32 MediaId,
|
||||
IN UINT64 Offset,
|
||||
IN UINTN BufferSize,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Read BufferSize bytes from Offset into Buffer.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
MediaId - Id of the media, changes every time the media is replaced.
|
||||
Offset - The starting byte offset to read from
|
||||
BufferSize - Size of Buffer
|
||||
Buffer - Buffer containing read data
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The data was written correctly to the device.
|
||||
EFI_WRITE_PROTECTED - The device can not be written to.
|
||||
EFI_DEVICE_ERROR - The device reported an error while performing the write.
|
||||
EFI_NO_MEDIA - There is no media in the device.
|
||||
EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.
|
||||
EFI_INVALID_PARAMETER - The write request contains device addresses that are not
|
||||
valid for the device.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000
|
||||
|
||||
typedef struct _EFI_DISK_IO_PROTOCOL {
|
||||
UINT64 Revision;
|
||||
EFI_DISK_READ ReadDisk;
|
||||
EFI_DISK_WRITE WriteDisk;
|
||||
} EFI_DISK_IO_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiDiskIoProtocolGuid;
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue