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:
qwang12
2007-06-28 07:00:39 +00:00
parent 30d4a0c7ec
commit 3eb9473ea9
1433 changed files with 266617 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
/*++
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:
Pei.h
Abstract:
Framework PEI master include file.
This is the main include file for Framework PEI components. There should be
no defines or macros added to this file, other than the EFI version
information already in this file.
Don't add include files to the list for convenience, only add things
that are architectural. Don't add Protocols or GUID include files here
--*/
#ifndef _PEI_H_
#define _PEI_H_
//
// PEI Specification Revision information
//
#include "TianoCommon.h"
#include "PeiBind.h"
#include "PeiApi.h"
#include "EfiDebug.h"
#include "PeiDebug.h"
//
// Enable code sharing with DXE by removing ASSERT and DEBUG
//
// #define ASSERT(a)
// #define DEBUG (a)
//
#ifdef EFI_PEI_REPORT_STATUS_CODE_ON
#define PEI_REPORT_STATUS_CODE_CODE(Code) Code
#define PEI_REPORT_STATUS_CODE(PeiServices, CodeType, Value, Instance, CallerId, Data) \
(*PeiServices)->PeiReportStatusCode (PeiServices, CodeType, Value, Instance, CallerId, Data)
#else
#define PEI_REPORT_STATUS_CODE_CODE(Code)
#define PEI_REPORT_STATUS_CODE(PeiServices, CodeType, Value, Instance, CallerId, Data)
#endif
#endif

View File

@@ -0,0 +1,160 @@
/*++
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:
PeiBind.h
Abstract:
Tiano PEI core and PEIM binding macros
--*/
#ifndef _PEI_BIND_H_
#define _PEI_BIND_H_
#ifdef EFI_DEBUG
#ifdef EFI_NT_EMULATOR
#if (PI_SPECIFICATION_VERSION < 0x00010000)
#define EFI_PEI_CORE_ENTRY_POINT(InitFunction) \
UINTN \
__stdcall \
_DllMainCRTStartup ( \
UINTN Inst, \
UINTN reason_for_call, \
VOID *rserved \
) \
{ \
return 1; \
} \
\
EFI_STATUS \
__declspec( dllexport ) \
__cdecl \
InitializeDriver ( \
IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartup \
) \
{ \
return InitFunction(PeiStartup); \
}
#else
#define EFI_PEI_CORE_ENTRY_POINT(InitFunction) \
UINTN \
__stdcall \
_DllMainCRTStartup ( \
UINTN Inst, \
UINTN reason_for_call, \
VOID *rserved \
) \
{ \
return 1; \
} \
\
EFI_STATUS \
__declspec( dllexport ) \
__cdecl \
InitializeDriver ( \
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, \
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList \
) \
{ \
return InitFunction(SecCoreData, PpiList); \
}
#endif
#define EFI_PEIM_ENTRY_POINT(InitFunction) \
UINTN \
__stdcall \
_DllMainCRTStartup ( \
UINTN Inst, \
UINTN reason_for_call, \
VOID *rserved \
) \
{ \
return 1; \
} \
\
EFI_STATUS \
__declspec( dllexport ) \
__cdecl \
InitializeDriver ( \
IN EFI_FFS_FILE_HEADER *FfsHeader, \
IN EFI_PEI_SERVICES **PeiServices \
) \
{ \
return InitFunction(FfsHeader, PeiServices); \
}
#else
#define EFI_PEI_CORE_ENTRY_POINT(InitFunction)
#define EFI_PEIM_ENTRY_POINT(InitFunction)
#endif
#else
#ifdef EFI_NT_EMULATOR
#if (PI_SPECIFICATION_VERSION < 0x00010000)
#define EFI_PEI_CORE_ENTRY_POINT(InitFunction) \
EFI_STATUS \
__declspec( dllexport ) \
__cdecl \
InitializeDriver ( \
IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartup \
) \
{ \
return InitFunction(PeiStartup); \
}
#else
#define EFI_PEI_CORE_ENTRY_POINT(InitFunction) \
EFI_STATUS \
__declspec( dllexport ) \
__cdecl \
InitializeDriver ( \
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, \
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList \
) \
{ \
return InitFunction(SecCoreData, PpiList); \
}
#endif
#define EFI_PEIM_ENTRY_POINT(InitFunction) \
EFI_STATUS \
__declspec( dllexport ) \
__cdecl \
InitializeDriver ( \
IN EFI_FFS_FILE_HEADER *FfsHeader, \
IN EFI_PEI_SERVICES **PeiServices \
) \
{ \
return InitFunction(FfsHeader, PeiServices); \
}
#else
#define EFI_PEI_CORE_ENTRY_POINT(InitFunction)
#define EFI_PEIM_ENTRY_POINT(InitFunction)
#endif
#endif
#endif

View File

@@ -0,0 +1,104 @@
/*++
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:
PeiDebug.h
Abstract:
PEI Debug macros. The work needs to be done in library. The Debug
macros them selves are standard for all files, including the core.
There needs to be code linked in that produces the following macros:
PeiDebugAssert(file, linenumber, assertion string) - worker function for
ASSERT. filename and line number of where this ASSERT() is located
is passed in along with the stringized version of the assertion.
PeiDebugPrint - Worker function for debug print
_DEBUG_SET_MEM(address, length, value) - Set memory at address to value
for legnth bytes. This macro is used to initialzed uninitialized memory
or memory that is free'ed, so it will not be used by mistake.
--*/
#ifndef _PEIDEBUG_H_
#define _PEIDEBUG_H_
#ifdef EFI_DEBUG
VOID
PeiDebugAssert (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN CHAR8 *FileName,
IN INTN LineNumber,
IN CHAR8 *Description
);
VOID
PeiDebugPrint (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN UINTN ErrorLevel,
IN CHAR8 *Format,
...
);
#define _PEI_DEBUG_ASSERT(PeiST, assertion) \
PeiDebugAssert (PeiST, __FILE__, __LINE__, #assertion)
#define _PEI_DEBUG(PeiST, arg) PeiDebugPrint (PeiST, arg)
//
// Define ASSERT() macro, if assertion is FALSE trigger the ASSERT
//
#define PEI_ASSERT(PeiST, assertion) if(!(assertion)) \
_PEI_DEBUG_ASSERT(PeiST, assertion)
#define PEI_ASSERT_LOCKED(PeiST, l) if(!(l)->Lock) _PEI_DEBUG_ASSERT(PeiST, l not locked)
//
// DEBUG((DebugLevel, "format string", ...)) - if DebugLevel is active do
// the a debug print.
//
#define PEI_DEBUG(arg) PeiDebugPrint arg
#define PEI_DEBUG_CODE(code) code
#define PEI_CR(Record, TYPE, Field, Signature) \
_CR(Record, TYPE, Field)
#define _PEI_DEBUG_SET_MEM(address, length, data) SetMem(address, length, data)
#else
#define PEI_ASSERT(PeiST, a)
#define PEI_ASSERT_LOCKED(PeiST, l)
#define PEI_DEBUG(arg)
#define PEI_DEBUG_CODE(code)
#define PEI_CR(Record, TYPE, Field, Signature) \
_CR(Record, TYPE, Field)
#define _PEI_DEBUG_SET_MEM(address, length, data)
#endif
#define ASSERT_PEI_ERROR(PeiST, status) PEI_ASSERT(PeiST, !EFI_ERROR(status))
#ifdef EFI_DEBUG_CLEAR_MEMORY
#define PEI_DEBUG_SET_MEMORY(address,length) \
_PEI_DEBUG_SET_MEM(address, length, EFI_BAD_POINTER_AS_BYTE)
#else
#define PEI_DEBUG_SET_MEMORY(address,length)
#endif
#endif