mirror of https://github.com/acidanthera/audk.git
move header files in MdeModulePkg\Core\Dxe except DxeMain.h into their corresponding sub-module directories. It is used to provide good modularity.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5949 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1046284db9
commit
ec90508b3d
|
@ -1,84 +0,0 @@
|
|||
/** @file
|
||||
Support functions for managing debug image info table when loading and unloading
|
||||
images.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __DEBUG_IMAGE_INFO_H__
|
||||
#define __DEBUG_IMAGE_INFO_H__
|
||||
|
||||
#define FOUR_MEG_ALIGNMENT 0x400000
|
||||
|
||||
#define EFI_DEBUG_TABLE_ENTRY_SIZE (sizeof (VOID *))
|
||||
|
||||
|
||||
/**
|
||||
Creates and initializes the DebugImageInfo Table. Also creates the configuration
|
||||
table and registers it into the system table.
|
||||
|
||||
Note:
|
||||
This function allocates memory, frees it, and then allocates memory at an
|
||||
address within the initial allocation. Since this function is called early
|
||||
in DXE core initialization (before drivers are dispatched), this should not
|
||||
be a problem.
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreInitializeDebugImageInfoTable (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Update the CRC32 in the Debug Table.
|
||||
Since the CRC32 service is made available by the Runtime driver, we have to
|
||||
wait for the Runtime Driver to be installed before the CRC32 can be computed.
|
||||
This function is called elsewhere by the core when the runtime architectural
|
||||
protocol is produced.
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreUpdateDebugTableCrc32 (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Adds a new DebugImageInfo structure to the DebugImageInfo Table. Re-Allocates
|
||||
the table if it's not large enough to accomidate another entry.
|
||||
|
||||
@param ImageInfoType type of debug image information
|
||||
@param LoadedImage pointer to the loaded image protocol for the image being
|
||||
loaded
|
||||
@param ImageHandle image handle for the image being loaded
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreNewDebugImageInfoEntry (
|
||||
IN UINT32 ImageInfoType,
|
||||
IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage,
|
||||
IN EFI_HANDLE ImageHandle
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Removes and frees an entry from the DebugImageInfo Table.
|
||||
|
||||
@param ImageHandle image handle for the image being unloaded
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreRemoveDebugImageInfoEntry (
|
||||
EFI_HANDLE ImageHandle
|
||||
);
|
||||
|
||||
#endif
|
|
@ -80,16 +80,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
|
||||
#include "DebugImageInfo.h"
|
||||
#include "Library.h"
|
||||
#include "FwVolBlock.h"
|
||||
#include "FwVolDriver.h"
|
||||
#include "Gcd.h"
|
||||
#include "Imem.h"
|
||||
#include "Image.h"
|
||||
#include "Event.h"
|
||||
#include "Handle.h"
|
||||
|
||||
//
|
||||
// attributes for reserved memory before it is promoted to system memory
|
||||
//
|
||||
|
@ -916,6 +906,20 @@ CoreRegisterProtocolNotify (
|
|||
);
|
||||
|
||||
|
||||
/**
|
||||
Removes all the events in the protocol database that match Event.
|
||||
|
||||
@param Event The event to search for in the protocol
|
||||
database.
|
||||
|
||||
@return EFI_SUCCESS when done searching the entire database.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CoreUnregisterProtocolNotify (
|
||||
IN EFI_EVENT Event
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Locates the requested handle(s) and returns them in Buffer.
|
||||
|
@ -2307,4 +2311,157 @@ CloseSectionStream (
|
|||
IN UINTN StreamHandleToClose
|
||||
);
|
||||
|
||||
/**
|
||||
Creates and initializes the DebugImageInfo Table. Also creates the configuration
|
||||
table and registers it into the system table.
|
||||
|
||||
Note:
|
||||
This function allocates memory, frees it, and then allocates memory at an
|
||||
address within the initial allocation. Since this function is called early
|
||||
in DXE core initialization (before drivers are dispatched), this should not
|
||||
be a problem.
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreInitializeDebugImageInfoTable (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Update the CRC32 in the Debug Table.
|
||||
Since the CRC32 service is made available by the Runtime driver, we have to
|
||||
wait for the Runtime Driver to be installed before the CRC32 can be computed.
|
||||
This function is called elsewhere by the core when the runtime architectural
|
||||
protocol is produced.
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreUpdateDebugTableCrc32 (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Adds a new DebugImageInfo structure to the DebugImageInfo Table. Re-Allocates
|
||||
the table if it's not large enough to accomidate another entry.
|
||||
|
||||
@param ImageInfoType type of debug image information
|
||||
@param LoadedImage pointer to the loaded image protocol for the image being
|
||||
loaded
|
||||
@param ImageHandle image handle for the image being loaded
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreNewDebugImageInfoEntry (
|
||||
IN UINT32 ImageInfoType,
|
||||
IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage,
|
||||
IN EFI_HANDLE ImageHandle
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Removes and frees an entry from the DebugImageInfo Table.
|
||||
|
||||
@param ImageHandle image handle for the image being unloaded
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreRemoveDebugImageInfoEntry (
|
||||
EFI_HANDLE ImageHandle
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This routine consumes FV hobs and produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.
|
||||
|
||||
@param ImageHandle The image handle.
|
||||
@param SystemTable The system table.
|
||||
|
||||
@retval EFI_SUCCESS Successfully initialized firmware volume block
|
||||
driver.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FwVolBlockDriverInit (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This routine produces a firmware volume block protocol on a given
|
||||
buffer.
|
||||
|
||||
@param BaseAddress base address of the firmware volume image
|
||||
@param Length length of the firmware volume image
|
||||
@param ParentHandle handle of parent firmware volume, if this image
|
||||
came from an FV image file in another firmware
|
||||
volume (ala capsules)
|
||||
@param FvProtocol Firmware volume block protocol produced.
|
||||
|
||||
@retval EFI_VOLUME_CORRUPTED Volume corrupted.
|
||||
@retval EFI_OUT_OF_RESOURCES No enough buffer to be allocated.
|
||||
@retval EFI_SUCCESS Successfully produced a FVB protocol on given
|
||||
buffer.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProduceFVBProtocolOnBuffer (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN EFI_HANDLE ParentHandle,
|
||||
OUT EFI_HANDLE *FvProtocol OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Raising to the task priority level of the mutual exclusion
|
||||
lock, and then acquires ownership of the lock.
|
||||
|
||||
@param Lock The lock to acquire
|
||||
|
||||
@return Lock owned
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreAcquireLock (
|
||||
IN EFI_LOCK *Lock
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Initialize a basic mutual exclusion lock. Each lock
|
||||
provides mutual exclusion access at it's task priority
|
||||
level. Since there is no-premption (at any TPL) or
|
||||
multiprocessor support, acquiring the lock only consists
|
||||
of raising to the locks TPL.
|
||||
|
||||
@param Lock The EFI_LOCK structure to initialize
|
||||
|
||||
@retval EFI_SUCCESS Lock Owned.
|
||||
@retval EFI_ACCESS_DENIED Reentrant Lock Acquisition, Lock not Owned.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CoreAcquireLockOrFail (
|
||||
IN EFI_LOCK *Lock
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Releases ownership of the mutual exclusion lock, and
|
||||
restores the previous task priority level.
|
||||
|
||||
@param Lock The lock to release
|
||||
|
||||
@return Lock unowned
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreReleaseLock (
|
||||
IN EFI_LOCK *Lock
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,19 +29,11 @@
|
|||
# VALID_ARCHITECTURES = IA32 X64 IPF
|
||||
|
||||
[Sources.common]
|
||||
Library.h
|
||||
Imem.h
|
||||
Image.h
|
||||
Handle.h
|
||||
Gcd.h
|
||||
FwVolDriver.h
|
||||
FwVolBlock.h
|
||||
Event.h
|
||||
DxeMain.h
|
||||
DebugImageInfo.h
|
||||
SectionExtraction/CoreSectionExtraction.c
|
||||
Image/ImageFile.c
|
||||
Image/Image.c
|
||||
Image/Image.h
|
||||
Misc/DebugImageInfo.c
|
||||
Misc/Stall.c
|
||||
Misc/SetWatchdogTimer.c
|
||||
|
@ -51,19 +43,25 @@
|
|||
Hand/Notify.c
|
||||
Hand/Locate.c
|
||||
Hand/Handle.c
|
||||
Hand/Handle.h
|
||||
Gcd/Gcd.c
|
||||
Gcd/Gcd.h
|
||||
Mem/Pool.c
|
||||
Mem/Page.c
|
||||
Mem/MemData.c
|
||||
Mem/Imem.h
|
||||
FwVolBlock/FwVolBlock.c
|
||||
FwVolBlock/FwVolBlock.h
|
||||
FwVol/FwVolWrite.c
|
||||
FwVol/FwVolRead.c
|
||||
FwVol/FwVolAttrib.c
|
||||
FwVol/Ffs.c
|
||||
FwVol/FwVol.c
|
||||
FwVol/FwVolDriver.h
|
||||
Event/Tpl.c
|
||||
Event/Timer.c
|
||||
Event/Event.c
|
||||
Event/Event.h
|
||||
Dispatcher/Dependency.c
|
||||
Dispatcher/Dispatcher.c
|
||||
DxeMain/DxeProtocolNotify.c
|
||||
|
|
|
@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Event.h"
|
||||
|
||||
///
|
||||
/// gEfiCurrentTpl - Current Task priority level
|
||||
|
|
|
@ -15,7 +15,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef __EVENT_H__
|
||||
#define __EVENT_H__
|
||||
|
||||
|
||||
#define VALID_TPL(a) ((a) <= TPL_HIGH_LEVEL)
|
||||
extern UINTN gEventPending;
|
||||
|
||||
|
||||
//
|
||||
// EFI_EVENT
|
||||
|
@ -25,37 +28,30 @@ typedef struct {
|
|||
UINTN Signature;
|
||||
UINT32 Type;
|
||||
UINT32 SignalCount;
|
||||
|
||||
//
|
||||
// Entry if the event is registered to be signalled
|
||||
//
|
||||
|
||||
///
|
||||
/// Entry if the event is registered to be signalled
|
||||
///
|
||||
LIST_ENTRY SignalLink;
|
||||
|
||||
//
|
||||
// Notification information for this event
|
||||
//
|
||||
|
||||
///
|
||||
/// Notification information for this event
|
||||
///
|
||||
EFI_TPL NotifyTpl;
|
||||
EFI_EVENT_NOTIFY NotifyFunction;
|
||||
VOID *NotifyContext;
|
||||
EFI_GUID EventGroup;
|
||||
LIST_ENTRY NotifyLink;
|
||||
BOOLEAN ExFlag;
|
||||
|
||||
//
|
||||
// A list of all runtime events
|
||||
//
|
||||
///
|
||||
/// A list of all runtime events
|
||||
///
|
||||
EFI_RUNTIME_EVENT_ENTRY RuntimeData;
|
||||
|
||||
//
|
||||
// Information by event type
|
||||
//
|
||||
|
||||
///
|
||||
/// Information by event type
|
||||
///
|
||||
union {
|
||||
//
|
||||
// For timer events
|
||||
//
|
||||
///
|
||||
/// For timer events
|
||||
///
|
||||
struct {
|
||||
LIST_ENTRY Link;
|
||||
UINT64 TriggerTime;
|
||||
|
@ -83,10 +79,6 @@ CoreDispatchEventNotifies (
|
|||
);
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Exported functions
|
||||
//
|
||||
/**
|
||||
Initializes timer support.
|
||||
|
||||
|
@ -96,13 +88,4 @@ CoreInitializeTimer (
|
|||
VOID
|
||||
);
|
||||
|
||||
//
|
||||
// extern data declarations
|
||||
//
|
||||
|
||||
extern EFI_LOCK gEventQueueLock;
|
||||
extern UINTN gEventPending;
|
||||
extern LIST_ENTRY gEventQueue[];
|
||||
extern LIST_ENTRY gEventSignalQueue;
|
||||
|
||||
#endif
|
|
@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Event.h"
|
||||
|
||||
//
|
||||
// Internal data
|
||||
|
|
|
@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
|
||||
#include "Event.h"
|
||||
|
||||
/**
|
||||
Set Interrupt State.
|
||||
|
|
|
@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "FwVolDriver.h"
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,8 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "FwVolDriver.h"
|
||||
|
||||
#define KEYSIZE sizeof (UINTN)
|
||||
|
||||
//
|
||||
// Protocol notify related globals
|
||||
|
@ -35,7 +35,7 @@ FV_DEVICE mFvDevice = {
|
|||
FvReadFileSection,
|
||||
FvWriteFile,
|
||||
FvGetNextFile,
|
||||
KEYSIZE,
|
||||
sizeof (UINTN),
|
||||
NULL,
|
||||
FvGetVolumeInfo,
|
||||
FvSetVolumeInfo
|
||||
|
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "FwVolDriver.h"
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -313,17 +313,6 @@ FvSetVolumeInfo (
|
|||
IN CONST VOID *Buffer
|
||||
);
|
||||
|
||||
//
|
||||
//Internal functions
|
||||
//
|
||||
typedef enum {
|
||||
EfiCheckSumUint8 = 0,
|
||||
EfiCheckSumUint16 = 1,
|
||||
EfiCheckSumUint32 = 2,
|
||||
EfiCheckSumUint64 = 3,
|
||||
EfiCheckSumMaximum = 4
|
||||
} EFI_CHECKSUM_TYPE;
|
||||
|
||||
|
||||
|
||||
/**
|
|
@ -13,9 +13,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "FwVolDriver.h"
|
||||
|
||||
/*++
|
||||
|
||||
/**
|
||||
Required Alignment Alignment Value in FFS Alignment Value in
|
||||
(bytes) Attributes Field Firmware Volume Interfaces
|
||||
1 0 0
|
||||
|
@ -29,9 +29,7 @@ Required Alignment Alignment Value in FFS Alignment Value in
|
|||
4 KB 5 12
|
||||
32 KB 6 15
|
||||
64 KB 7 16
|
||||
|
||||
--*/
|
||||
|
||||
**/
|
||||
UINT8 mFvAttributes[] = {0, 4, 7, 9, 10, 12, 15, 16};
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
|
||||
#include "FwVolDriver.h"
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "FwVolBlock.h"
|
||||
|
||||
|
||||
EFI_FW_VOL_BLOCK_DEVICE mFwVolBlock = {
|
||||
|
@ -511,9 +512,7 @@ ProduceFVBProtocolOnBuffer (
|
|||
|
||||
|
||||
/**
|
||||
This routine is the driver initialization entry point. It initializes the
|
||||
libraries, consumes FV hobs and NT_NON_MM_FV environment variable and
|
||||
produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.
|
||||
This routine consumes FV hobs and produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.
|
||||
|
||||
@param ImageHandle The image handle.
|
||||
@param SystemTable The system table.
|
||||
|
|
|
@ -19,11 +19,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
#define FVB_DEVICE_SIGNATURE EFI_SIGNATURE_32('_','F','V','B')
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINTN Base;
|
||||
UINTN Length;
|
||||
} LBA_CACHE;
|
||||
|
||||
|
||||
typedef struct {
|
||||
MEMMAP_DEVICE_PATH MemMapDevPath;
|
||||
EFI_DEVICE_PATH_PROTOCOL EndDevPath;
|
||||
|
@ -41,32 +43,11 @@ typedef struct {
|
|||
EFI_PHYSICAL_ADDRESS BaseAddress;
|
||||
} EFI_FW_VOL_BLOCK_DEVICE;
|
||||
|
||||
|
||||
#define FVB_DEVICE_FROM_THIS(a) \
|
||||
CR(a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
This routine is the driver initialization entry point. It initializes the
|
||||
libraries, consumes FV hobs and NT_NON_MM_FV environment variable and
|
||||
produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.
|
||||
|
||||
@param ImageHandle The image handle.
|
||||
@param SystemTable The system table.
|
||||
|
||||
@retval EFI_SUCCESS Successfully initialized firmware volume block
|
||||
driver.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FwVolBlockDriverInit (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Retrieves Volume attributes. No polarity translations are done.
|
||||
|
||||
|
@ -252,49 +233,5 @@ FwVolBlockGetBlockSize (
|
|||
IN OUT UINTN *NumberOfBlocks
|
||||
);
|
||||
|
||||
/**
|
||||
This routine is the driver initialization entry point. It initializes the
|
||||
libraries, consumes FV hobs and NT_NON_MM_FV environment variable and
|
||||
produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.
|
||||
|
||||
@param ImageHandle The image handle.
|
||||
@param SystemTable The system table.
|
||||
|
||||
@retval EFI_SUCCESS Successfully initialized firmware volume block
|
||||
driver.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FwVolBlockDriverInit (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This routine produces a firmware volume block protocol on a given
|
||||
buffer.
|
||||
|
||||
@param BaseAddress base address of the firmware volume image
|
||||
@param Length length of the firmware volume image
|
||||
@param ParentHandle handle of parent firmware volume, if this image
|
||||
came from an FV image file in another firmware
|
||||
volume (ala capsules)
|
||||
@param FvProtocol Firmware volume block protocol produced.
|
||||
|
||||
@retval EFI_VOLUME_CORRUPTED Volume corrupted.
|
||||
@retval EFI_OUT_OF_RESOURCES No enough buffer to be allocated.
|
||||
@retval EFI_SUCCESS Successfully produced a FVB protocol on given
|
||||
buffer.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProduceFVBProtocolOnBuffer (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN EFI_HANDLE ParentHandle,
|
||||
OUT EFI_HANDLE *FvProtocol OPTIONAL
|
||||
);
|
||||
|
||||
#endif
|
|
@ -15,6 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Gcd.h"
|
||||
|
||||
#define MINIMUM_INITIAL_MEMORY_SIZE 0x10000
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Handle.h"
|
||||
|
||||
|
||||
//
|
||||
|
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Handle.h"
|
||||
|
||||
|
||||
//
|
||||
|
|
|
@ -16,52 +16,64 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#define _HAND_H_
|
||||
|
||||
|
||||
//
|
||||
// IHANDLE - contains a list of protocol handles
|
||||
//
|
||||
|
||||
#define EFI_HANDLE_SIGNATURE EFI_SIGNATURE_32('h','n','d','l')
|
||||
|
||||
///
|
||||
/// IHANDLE - contains a list of protocol handles
|
||||
///
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
LIST_ENTRY AllHandles; // All handles list of IHANDLE
|
||||
LIST_ENTRY Protocols; // List of PROTOCOL_INTERFACE's for this handle
|
||||
UINTN LocateRequest; //
|
||||
UINT64 Key; // The Handle Database Key value when this handle was last created or modified
|
||||
/// All handles list of IHANDLE
|
||||
LIST_ENTRY AllHandles;
|
||||
/// List of PROTOCOL_INTERFACE's for this handle
|
||||
LIST_ENTRY Protocols;
|
||||
UINTN LocateRequest;
|
||||
/// The Handle Database Key value when this handle was last created or modified
|
||||
UINT64 Key;
|
||||
} IHANDLE;
|
||||
|
||||
#define ASSERT_IS_HANDLE(a) ASSERT((a)->Signature == EFI_HANDLE_SIGNATURE)
|
||||
|
||||
|
||||
//
|
||||
// PROTOCOL_ENTRY - each different protocol has 1 entry in the protocol
|
||||
// database. Each handler that supports this protocol is listed, along
|
||||
// with a list of registered notifies.
|
||||
//
|
||||
|
||||
#define PROTOCOL_ENTRY_SIGNATURE EFI_SIGNATURE_32('p','r','t','e')
|
||||
|
||||
///
|
||||
/// PROTOCOL_ENTRY - each different protocol has 1 entry in the protocol
|
||||
/// database. Each handler that supports this protocol is listed, along
|
||||
/// with a list of registered notifies.
|
||||
///
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
LIST_ENTRY AllEntries; // Link Entry inserted to mProtocolDatabase
|
||||
EFI_GUID ProtocolID; // ID of the protocol
|
||||
LIST_ENTRY Protocols; // All protocol interfaces
|
||||
LIST_ENTRY Notify; // Registerd notification handlers
|
||||
/// Link Entry inserted to mProtocolDatabase
|
||||
LIST_ENTRY AllEntries;
|
||||
/// ID of the protocol
|
||||
EFI_GUID ProtocolID;
|
||||
/// All protocol interfaces
|
||||
LIST_ENTRY Protocols;
|
||||
/// Registerd notification handlers
|
||||
LIST_ENTRY Notify;
|
||||
} PROTOCOL_ENTRY;
|
||||
|
||||
//
|
||||
// PROTOCOL_INTERFACE - each protocol installed on a handle is tracked
|
||||
// with a protocol interface structure
|
||||
//
|
||||
|
||||
#define PROTOCOL_INTERFACE_SIGNATURE EFI_SIGNATURE_32('p','i','f','c')
|
||||
|
||||
///
|
||||
/// PROTOCOL_INTERFACE - each protocol installed on a handle is tracked
|
||||
/// with a protocol interface structure
|
||||
///
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
LIST_ENTRY Link; // Link on IHANDLE.Protocols
|
||||
IHANDLE *Handle; // Back pointer
|
||||
LIST_ENTRY ByProtocol; // Link on PROTOCOL_ENTRY.Protocols
|
||||
PROTOCOL_ENTRY *Protocol; // The protocol ID
|
||||
VOID *Interface; // The interface value
|
||||
|
||||
LIST_ENTRY OpenList; // OPEN_PROTOCOL_DATA list.
|
||||
/// Link on IHANDLE.Protocols
|
||||
LIST_ENTRY Link;
|
||||
/// Back pointer
|
||||
IHANDLE *Handle;
|
||||
/// Link on PROTOCOL_ENTRY.Protocols
|
||||
LIST_ENTRY ByProtocol;
|
||||
/// The protocol ID
|
||||
PROTOCOL_ENTRY *Protocol;
|
||||
/// The interface value
|
||||
VOID *Interface;
|
||||
/// OPEN_PROTOCOL_DATA list
|
||||
LIST_ENTRY OpenList;
|
||||
UINTN OpenListCount;
|
||||
|
||||
} PROTOCOL_INTERFACE;
|
||||
|
@ -70,7 +82,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
LIST_ENTRY Link; //Link on PROTOCOL_INTERFACE.OpenList
|
||||
///Link on PROTOCOL_INTERFACE.OpenList
|
||||
LIST_ENTRY Link;
|
||||
|
||||
EFI_HANDLE AgentHandle;
|
||||
EFI_HANDLE ControllerHandle;
|
||||
|
@ -79,23 +92,22 @@ typedef struct {
|
|||
} OPEN_PROTOCOL_DATA;
|
||||
|
||||
|
||||
//
|
||||
// PROTOCOL_NOTIFY - used for each register notification for a protocol
|
||||
//
|
||||
|
||||
#define PROTOCOL_NOTIFY_SIGNATURE EFI_SIGNATURE_32('p','r','t','n')
|
||||
|
||||
///
|
||||
/// PROTOCOL_NOTIFY - used for each register notification for a protocol
|
||||
///
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
PROTOCOL_ENTRY *Protocol;
|
||||
LIST_ENTRY Link; // All notifications for this protocol
|
||||
EFI_EVENT Event; // Event to notify
|
||||
LIST_ENTRY *Position; // Last position notified
|
||||
/// All notifications for this protocol
|
||||
LIST_ENTRY Link;
|
||||
/// Event to notify
|
||||
EFI_EVENT Event;
|
||||
/// Last position notified
|
||||
LIST_ENTRY *Position;
|
||||
} PROTOCOL_NOTIFY;
|
||||
|
||||
//
|
||||
// Internal prototypes
|
||||
//
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -165,20 +177,6 @@ CoreRemoveInterfaceFromProtocol (
|
|||
);
|
||||
|
||||
|
||||
/**
|
||||
Removes all the events in the protocol database that match Event.
|
||||
|
||||
@param Event The event to search for in the protocol
|
||||
database.
|
||||
|
||||
@return EFI_SUCCESS when done searching the entire database.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CoreUnregisterProtocolNotify (
|
||||
IN EFI_EVENT Event
|
||||
);
|
||||
|
||||
/**
|
||||
Connects a controller to a driver.
|
||||
|
||||
|
@ -265,7 +263,6 @@ CoreValidateHandle (
|
|||
//
|
||||
// Externs
|
||||
//
|
||||
|
||||
extern EFI_LOCK gProtocolDatabaseLock;
|
||||
extern LIST_ENTRY gHandleList;
|
||||
extern UINT64 gHandleDatabaseKey;
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Handle.h"
|
||||
|
||||
//
|
||||
// ProtocolRequest - Last LocateHandle request ID
|
||||
|
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Handle.h"
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,10 +13,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Image.h"
|
||||
|
||||
//
|
||||
// Module Globals
|
||||
//
|
||||
|
||||
LOADED_IMAGE_PRIVATE_DATA *mCurrentImage = NULL;
|
||||
|
||||
LOAD_PE32_IMAGE_PRIVATE_DATA mLoadPe32PrivateData = {
|
||||
|
|
|
@ -16,41 +16,48 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef _IMAGE_H_
|
||||
#define _IMAGE_H_
|
||||
|
||||
|
||||
|
||||
#define LOADED_IMAGE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32('l','d','r','i')
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
EFI_HANDLE Handle; // Image handle
|
||||
UINTN Type; // Image type
|
||||
|
||||
BOOLEAN Started; // If entrypoint has been called
|
||||
|
||||
EFI_IMAGE_ENTRY_POINT EntryPoint; // The image's entry point
|
||||
EFI_LOADED_IMAGE_PROTOCOL Info; // loaded image protocol
|
||||
|
||||
EFI_PHYSICAL_ADDRESS ImageBasePage; // Location in memory
|
||||
UINTN NumberOfPages; // Number of pages
|
||||
|
||||
CHAR8 *FixupData; // Original fixup data
|
||||
|
||||
EFI_TPL Tpl; // Tpl of started image
|
||||
EFI_STATUS Status; // Status returned by started image
|
||||
|
||||
UINTN ExitDataSize; // Size of ExitData from started image
|
||||
VOID *ExitData; // Pointer to exit data from started image
|
||||
VOID *JumpBuffer; // Pointer to pool allocation for context save/retore
|
||||
BASE_LIBRARY_JUMP_BUFFER *JumpContext; // Pointer to buffer for context save/retore
|
||||
UINT16 Machine; // Machine type from PE image
|
||||
|
||||
EFI_EBC_PROTOCOL *Ebc; // EBC Protocol pointer
|
||||
|
||||
EFI_RUNTIME_IMAGE_ENTRY *RuntimeData; // Runtime image list
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath; // Pointer to Loaded Image Device Path Protocl
|
||||
|
||||
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; // PeCoffLoader ImageContext
|
||||
/// Image handle
|
||||
EFI_HANDLE Handle;
|
||||
/// Image type
|
||||
UINTN Type;
|
||||
/// If entrypoint has been called
|
||||
BOOLEAN Started;
|
||||
/// The image's entry point
|
||||
EFI_IMAGE_ENTRY_POINT EntryPoint;
|
||||
/// loaded image protocol
|
||||
EFI_LOADED_IMAGE_PROTOCOL Info;
|
||||
/// Location in memory
|
||||
EFI_PHYSICAL_ADDRESS ImageBasePage;
|
||||
/// Number of pages
|
||||
UINTN NumberOfPages;
|
||||
/// Original fixup data
|
||||
CHAR8 *FixupData;
|
||||
/// Tpl of started image
|
||||
EFI_TPL Tpl;
|
||||
/// Status returned by started image
|
||||
EFI_STATUS Status;
|
||||
/// Size of ExitData from started image
|
||||
UINTN ExitDataSize;
|
||||
/// Pointer to exit data from started image
|
||||
VOID *ExitData;
|
||||
/// Pointer to pool allocation for context save/retore
|
||||
VOID *JumpBuffer;
|
||||
/// Pointer to buffer for context save/retore
|
||||
BASE_LIBRARY_JUMP_BUFFER *JumpContext;
|
||||
/// Machine type from PE image
|
||||
UINT16 Machine;
|
||||
/// EBC Protocol pointer
|
||||
EFI_EBC_PROTOCOL *Ebc;
|
||||
/// Runtime image list
|
||||
EFI_RUNTIME_IMAGE_ENTRY *RuntimeData;
|
||||
/// Pointer to Loaded Image Device Path Protocl
|
||||
EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath;
|
||||
/// PeCoffLoader ImageContext
|
||||
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
||||
|
||||
} LOADED_IMAGE_PRIVATE_DATA;
|
||||
|
||||
|
@ -58,12 +65,12 @@ typedef struct {
|
|||
CR(a, LOADED_IMAGE_PRIVATE_DATA, Info, LOADED_IMAGE_PRIVATE_DATA_SIGNATURE)
|
||||
|
||||
|
||||
|
||||
#define LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32('l','p','e','i')
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
EFI_HANDLE Handle; // Image handle
|
||||
/// Image handle
|
||||
EFI_HANDLE Handle;
|
||||
EFI_PE32_IMAGE_PROTOCOL Pe32Image;
|
||||
} LOAD_PE32_IMAGE_PRIVATE_DATA;
|
||||
|
||||
|
@ -71,7 +78,6 @@ typedef struct {
|
|||
CR(a, LOAD_PE32_IMAGE_PRIVATE_DATA, Pe32Image, LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE)
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Private Data Types
|
||||
//
|
||||
|
@ -84,11 +90,6 @@ typedef struct {
|
|||
} IMAGE_FILE_HANDLE;
|
||||
|
||||
|
||||
//
|
||||
// Abstractions for reading image contents
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
Opens a file for (simple) reading. The simple read abstraction
|
||||
will access the file either from a memory copy, from a file
|
||||
|
@ -149,25 +150,6 @@ CoreReadImageFile (
|
|||
);
|
||||
|
||||
|
||||
/**
|
||||
A function out of date, should be removed.
|
||||
|
||||
@param ImageFileHandle Handle of the file to close
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
CoreCloseImageFile (
|
||||
IN IMAGE_FILE_HANDLE *ImageFileHandle
|
||||
);
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Exported Image functions
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
Loads an EFI image into memory and returns a handle to the image with extended parameters.
|
||||
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Image.h"
|
||||
|
||||
/**
|
||||
Search a handle to a device on a specified device path that supports a specified protocol,
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
/** @file
|
||||
Internal functions shared in DxeCore module.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _DXE_LIBRARY_H_
|
||||
#define _DXE_LIBRARY_H_
|
||||
|
||||
|
||||
/**
|
||||
Raising to the task priority level of the mutual exclusion
|
||||
lock, and then acquires ownership of the lock.
|
||||
|
||||
@param Lock The lock to acquire
|
||||
|
||||
@return Lock owned
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreAcquireLock (
|
||||
IN EFI_LOCK *Lock
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Initialize a basic mutual exclusion lock. Each lock
|
||||
provides mutual exclusion access at it's task priority
|
||||
level. Since there is no-premption (at any TPL) or
|
||||
multiprocessor support, acquiring the lock only consists
|
||||
of raising to the locks TPL.
|
||||
|
||||
@param Lock The EFI_LOCK structure to initialize
|
||||
|
||||
@retval EFI_SUCCESS Lock Owned.
|
||||
@retval EFI_ACCESS_DENIED Reentrant Lock Acquisition, Lock not Owned.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CoreAcquireLockOrFail (
|
||||
IN EFI_LOCK *Lock
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Releases ownership of the mutual exclusion lock, and
|
||||
restores the previous task priority level.
|
||||
|
||||
@param Lock The lock to release
|
||||
|
||||
@return Lock unowned
|
||||
|
||||
**/
|
||||
VOID
|
||||
CoreReleaseLock (
|
||||
IN EFI_LOCK *Lock
|
||||
);
|
||||
|
||||
|
||||
#endif
|
|
@ -16,16 +16,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#define _IMEM_H_
|
||||
|
||||
#if defined (MDE_CPU_IPF)
|
||||
//
|
||||
// For Itanium machines make the default allocations 8K aligned
|
||||
//
|
||||
///
|
||||
/// For Itanium machines make the default allocations 8K aligned
|
||||
///
|
||||
#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE * 2)
|
||||
#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE * 2)
|
||||
|
||||
#else
|
||||
//
|
||||
// For genric EFI machines make the default allocations 4K aligned
|
||||
//
|
||||
///
|
||||
/// For genric EFI machines make the default allocations 4K aligned
|
||||
///
|
||||
#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)
|
||||
#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE)
|
||||
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Imem.h"
|
||||
|
||||
#define EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
|
||||
#include "DxeMain.h"
|
||||
#include "Imem.h"
|
||||
|
||||
#define POOL_FREE_SIGNATURE EFI_SIGNATURE_32('p','f','r','0')
|
||||
typedef struct {
|
||||
|
|
|
@ -24,7 +24,9 @@ EFI_DEBUG_IMAGE_INFO_TABLE_HEADER mDebugInfoTableHeader = {
|
|||
|
||||
EFI_SYSTEM_TABLE_POINTER *mDebugTable = NULL;
|
||||
|
||||
#define FOUR_MEG_ALIGNMENT 0x400000
|
||||
|
||||
#define EFI_DEBUG_TABLE_ENTRY_SIZE (sizeof (VOID *))
|
||||
|
||||
/**
|
||||
Creates and initializes the DebugImageInfo Table. Also creates the configuration
|
||||
|
|
Loading…
Reference in New Issue