Implementation of SmBusLib class library for PEI phase.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
Module Name: DxeSmbusLib.c\r
\r
**/\r
\r
+\r
#include "InternalSmbusLib.h"\r
\r
-#include <Protocol/SmbusHc.h>\r
\r
//\r
// Globle varible to cache pointer to Smbus protocol.\r
//\r
-STATIC EFI_SMBUS_HC_PROTOCOL *mSmbus = NULL; \r
+STATIC EFI_SMBUS_HC_PROTOCOL *mSmbus = NULL;\r
\r
/**\r
The constructor function caches the pointer to Smbus protocol.\r
- \r
+\r
The constructor function locates Smbus protocol from protocol database.\r
- It will ASSERT() if that operation fails and it will always return EFI_SUCCESS. \r
+ It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
Status = gBS->LocateProtocol (&gEfiSmbusHcProtocolGuid, NULL, (VOID**) &mSmbus);\r
ASSERT_EFI_ERROR (Status);\r
ASSERT (mSmbus != NULL);\r
}\r
\r
/**\r
- Executes an SMBus operation to an SMBus controller. \r
+ Executes an SMBus operation to an SMBus controller.\r
\r
This function provides a standard way to execute Smbus script\r
as defined in the SmBus Specification. The data can either be of\r
SmbusDeviceAddress,\r
SMBUS_LIB_COMMAND (SmBusAddress),\r
SmbusOperation,\r
- SMBUS_LIB_PEC (SmBusAddress), \r
+ SMBUS_LIB_PEC (SmBusAddress),\r
&Length,\r
Buffer\r
);\r
--- /dev/null
+#/** @file\r
+# Component description file for Dxe Smbus Library.\r
+#\r
+# SMBUS Library that layers on top of the SMBUS Protocol.\r
+# Copyright (c) 2006, Intel Corporation\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+################################################################################\r
+#\r
+# Defines Section - statements that will be processed to create a Makefile.\r
+#\r
+################################################################################\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = DxeSmbusLib\r
+ FILE_GUID = 4F369FB1-31A7-423c-960E-B3EFD337894F\r
+ MODULE_TYPE = DXE_DRIVER\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = SmbusLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+ CONSTRUCTOR = SmbusLibConstructor\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+################################################################################\r
+#\r
+# Sources Section - list of files that are required for the build to succeed.\r
+#\r
+################################################################################\r
+\r
+[Sources.common]\r
+ SmbusLib.c\r
+ DxeSmbusLib.c\r
+ InternalSmbusLib.h\r
+\r
+################################################################################\r
+#\r
+# Package Dependency Section - list of Package files that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+\r
+################################################################################\r
+#\r
+# Library Class Section - list of Library Classes that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[LibraryClasses]\r
+ BaseMemoryLib\r
+ UefiBootServicesTableLib\r
+ DebugLib\r
+\r
+\r
+################################################################################\r
+#\r
+# Protocol C Name Section - list of Protocol and Protocol Notify C Names\r
+# that this module uses or produces.\r
+#\r
+################################################################################\r
+\r
+[Protocols]\r
+ gEfiSmbusHcProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
+\r
<MsaHeader>\r
<ModuleName>DxeSmbusLib</ModuleName>\r
<ModuleType>DXE_DRIVER</ModuleType>\r
- <GuidValue>07720769-A7D0-4a8d-BE41-71CC18EB3338</GuidValue>\r
+ <GuidValue>4F369FB1-31A7-423c-960E-B3EFD337894F</GuidValue>\r
<Version>1.0</Version>\r
<Abstract>Component description file for Dxe Smbus Library.</Abstract>\r
<Description>SMBUS Library that layers on top of the SMBUS Protocol.</Description>\r
</PackageDependencies>\r
<Protocols>\r
<Protocol Usage="ALWAYS_CONSUMED">\r
- <ProtocolCName>gEfiSmbusProtocolGuid</ProtocolCName>\r
+ <ProtocolCName>gEfiSmbusHcProtocolGuid</ProtocolCName>\r
</Protocol>\r
</Protocols>\r
<Externs>\r
Internal header file for Smbus library.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
**/\r
#ifndef __INTERNAL_SMBUS_LIB_H\r
#define __INTERNAL_SMBUS_LIB_H\r
\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiDxe.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Protocol/SmbusHc.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/SmbusLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+\r
#include <IndustryStandard/Smbus.h>\r
\r
#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)\r
// Declaration for internal functions\r
//\r
/**\r
- Executes an SMBus operation to an SMBus controller. \r
+ Executes an SMBus operation to an SMBus controller.\r
\r
This function provides a standard way to execute Smbus script\r
as defined in the SmBus Specification. The data can either be of\r
Implementation of SmBusLib class library for PEI phase.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
Module Name: SmbusLib.c\r
ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
\r
InternalSmBusExec (EfiSmbusReadByte, SmBusAddress, 1, &Byte, Status);\r
- \r
+\r
return Byte;\r
}\r
\r
\r
Byte = Value;\r
InternalSmBusExec (EfiSmbusWriteByte, SmBusAddress, 1, &Byte, Status);\r
- \r
+\r
return Value;\r
}\r
\r
If Status is not NULL, then the status of the executed command is returned in Status.\r
If Length in SmBusAddress is not zero, then ASSERT().\r
If any reserved bits of SmBusAddress are set, then ASSERT().\r
- \r
+\r
@param SmBusAddress Address that encodes the SMBUS Slave Address,\r
SMBUS Command, SMBUS Data Length, and PEC.\r
@param Status Return status for the executed command.\r
ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
\r
InternalSmBusExec (EfiSmbusReadWord, SmBusAddress, 2, &Word, Status);\r
- \r
+\r
return Word;\r
}\r
\r
ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
\r
InternalSmBusExec (EfiSmbusProcessCall, SmBusAddress, 2, &Value, Status);\r
- \r
+\r
return Value;\r
}\r
\r
The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.\r
Bytes are written to the SMBUS from Buffer.\r
The number of bytes written is returned, and will never return a value larger than 32-bytes.\r
- If Status is not NULL, then the status of the executed command is returned in Status. \r
+ If Status is not NULL, then the status of the executed command is returned in Status.\r
If Length in SmBusAddress is zero or greater than 32, then ASSERT().\r
If Buffer is NULL, then ASSERT().\r
If any reserved bits of SmBusAddress are set, then ASSERT().\r
HII Library implementation that uses DXE protocols and services.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name: HiiLib.c\r
\r
**/\r
\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiDxe.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/HiiLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
/**\r
This function allocates pool for an EFI_HII_PACKAGES structure\r
with enough space for the variable argument list of package pointers.\r
- The allocated structure is initialized using NumberOfPackages, Guid, \r
+ The allocated structure is initialized using NumberOfPackages, Guid,\r
and the variable length argument list of package pointers.\r
\r
@param NumberOfPackages The number of HII packages to prepare.\r
{\r
//\r
// BugBug: Need more detail on UEFI spec.\r
- // \r
+ //\r
ASSERT (FALSE);\r
- return NULL; \r
+ return NULL;\r
}\r
--- /dev/null
+#/** @file\r
+# Post code library based on report status code library\r
+#\r
+# PostCode Library for PEIMs and DXE drivers that send PostCode to ReportStatusCode\r
+# Copyright (c) 2006, Intel Corporation.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+################################################################################\r
+#\r
+# Defines Section - statements that will be processed to create a Makefile.\r
+#\r
+################################################################################\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiDxePostCodeLibReportStatusCode\r
+ FILE_GUID = e062c52d-78dc-4cc5-b246-b13497a8123c\r
+ MODULE_TYPE = PEIM\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = PostCodeLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER PEIM PEI_CORE UEFI_APPLICATION UEFI_DRIVER\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+################################################################################\r
+#\r
+# Sources Section - list of files that are required for the build to succeed.\r
+#\r
+################################################################################\r
+\r
+[Sources.common]\r
+ PostCode.c\r
+\r
+################################################################################\r
+#\r
+# Package Dependency Section - list of Package files that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+\r
+################################################################################\r
+#\r
+# Library Class Section - list of Library Classes that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[LibraryClasses]\r
+ BaseLib\r
+ PcdLib\r
+ ReportStatusCodeLib\r
+\r
+\r
+################################################################################\r
+#\r
+# Pcd FIXED_AT_BUILD - list of PCDs that this module is coded for.\r
+#\r
+################################################################################\r
+\r
+[PcdsFixedAtBuild.common]\r
+ PcdPostCodePropertyMask|gEfiMdePkgTokenSpaceGuid\r
+\r
Report Status Code Library Post Code functions for DXE Phase.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiPei.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/PostCodeLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/BaseLib.h>\r
+\r
/**\r
Converts POST code value to status code value.\r
\r
- This macro converts the post code to status code value. Bits 0..4 of PostCode \r
- are mapped to bits 16..20 of status code value, and bits 5..7 of PostCode are mapped to bits \r
- 24..26 of status code value. \r
+ This macro converts the post code to status code value. Bits 0..4 of PostCode\r
+ are mapped to bits 16..20 of status code value, and bits 5..7 of PostCode are mapped to bits\r
+ 24..26 of status code value.\r
\r
- @param PostCode POST code value. \r
+ @param PostCode POST code value.\r
\r
@return The converted status code value.\r
\r
/**\r
Sends an 32-bit value to a POST card.\r
\r
- Sends the 32-bit value specified by Value to a POST card, and returns Value. \r
- Some implementations of this library function may perform I/O operations \r
- directly to a POST card device. Other implementations may send Value to \r
- ReportStatusCode(), and the status code reporting mechanism will eventually \r
+ Sends the 32-bit value specified by Value to a POST card, and returns Value.\r
+ Some implementations of this library function may perform I/O operations\r
+ directly to a POST card device. Other implementations may send Value to\r
+ ReportStatusCode(), and the status code reporting mechanism will eventually\r
display the 32-bit value on the status reporting device.\r
- \r
- PostCode() must actively prevent recursion. If PostCode() is called while \r
- processing another any other Report Status Code Library function, then \r
+\r
+ PostCode() must actively prevent recursion. If PostCode() is called while\r
+ processing another any other Report Status Code Library function, then\r
PostCode() must return Value immediately.\r
\r
@param Value The 32-bit value to write to the POST card.\r
Sends an 32-bit value to a POST and associated ASCII string.\r
\r
Sends the 32-bit value specified by Value to a POST card, and returns Value.\r
- If Description is not NULL, then the ASCII string specified by Description is \r
- also passed to the handler that displays the POST card value. Some \r
- implementations of this library function may perform I/O operations directly \r
- to a POST card device. Other implementations may send Value to ReportStatusCode(), \r
- and the status code reporting mechanism will eventually display the 32-bit \r
- value on the status reporting device. \r
-\r
- PostCodeWithDescription()must actively prevent recursion. If \r
- PostCodeWithDescription() is called while processing another any other Report \r
- Status Code Library function, then PostCodeWithDescription() must return Value \r
+ If Description is not NULL, then the ASCII string specified by Description is\r
+ also passed to the handler that displays the POST card value. Some\r
+ implementations of this library function may perform I/O operations directly\r
+ to a POST card device. Other implementations may send Value to ReportStatusCode(),\r
+ and the status code reporting mechanism will eventually display the 32-bit\r
+ value on the status reporting device.\r
+\r
+ PostCodeWithDescription()must actively prevent recursion. If\r
+ PostCodeWithDescription() is called while processing another any other Report\r
+ Status Code Library function, then PostCodeWithDescription() must return Value\r
immediately.\r
\r
@param Value The 32-bit value to write to the POST card.\r
- @param Description Pointer to an ASCII string that is a description of the \r
- POST code value. This is an optional parameter that may \r
+ @param Description Pointer to an ASCII string that is a description of the\r
+ POST code value. This is an optional parameter that may\r
be NULL.\r
\r
@return Value\r
IN CONST CHAR8 *Description OPTIONAL\r
)\r
{\r
- if (Description == NULL) { \r
+ if (Description == NULL) {\r
REPORT_STATUS_CODE (\r
EFI_PROGRESS_CODE,\r
POST_CODE_TO_STATUS_CODE_VALUE (Value)\r
/**\r
Returns TRUE if POST Codes are enabled.\r
\r
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED \r
+ This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED\r
bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r
\r
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r
+ @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of\r
PcdPostCodeProperyMask is set.\r
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r
+ @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of\r
PcdPostCodeProperyMask is clear.\r
\r
**/\r
/**\r
Returns TRUE if POST code descriptions are enabled.\r
\r
- This function returns TRUE if the \r
- POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r
+ This function returns TRUE if the\r
+ POST_CODE_PROPERTY_POST_CODE_ENABLED bit of\r
PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r
\r
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED \r
+ @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED\r
bit of PcdPostCodeProperyMask is set.\r
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED \r
+ @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED\r
bit of PcdPostCodeProperyMask is clear.\r
\r
**/\r
mismatched byte in DestinationBuffer.\r
If Length > 0 and DestinationBuffer is NULL and Length > 0, then ASSERT().\r
If Length > 0 and SourceBuffer is NULL and Length > 0, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). \r
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().\r
\r
\r
@param DestinationBuffer Pointer to the destination buffer to compare.\r
This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns\r
DestinationBuffer. The implementation must be reentrant, and it must handle the case\r
where SourceBuffer overlaps DestinationBuffer.\r
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). \r
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().\r
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().\r
\r
@param DestinationBuffer Pointer to the destination buffer of the memory copy.\r
@param SourceBuffer Pointer to the source buffer of the memory copy.\r
\r
**/\r
\r
+#include "MemLibInternals.h"\r
+\r
/**\r
Copies a source GUID to a destination GUID.\r
\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
#ifndef __MEM_LIB_INTERNALS__\r
#define __MEM_LIB_INTERNALS__\r
\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiPei.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/PeiServicesTablePointerLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+\r
/**\r
Copy Length bytes from Source to Destination.\r
\r
--- /dev/null
+#/** @file\r
+# Component description file for Pei Memory Library\r
+#\r
+# Base Memory Library implementation that uses PEI Services\r
+# where possible for size reduction.\r
+# Copyright (c) 2006, Intel Corporation\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+################################################################################\r
+#\r
+# Defines Section - statements that will be processed to create a Makefile.\r
+#\r
+################################################################################\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiMemoryLib\r
+ FILE_GUID = 3a9759d2-53bc-4eb2-abcd-c93099419063\r
+ MODULE_TYPE = PEIM\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = BaseMemoryLib|PEIM\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+################################################################################\r
+#\r
+# Sources Section - list of files that are required for the build to succeed.\r
+#\r
+################################################################################\r
+\r
+[Sources.common]\r
+ ScanMem64Wrapper.c\r
+ ScanMem32Wrapper.c\r
+ ScanMem16Wrapper.c\r
+ ScanMem8Wrapper.c\r
+ ZeroMemWrapper.c\r
+ CompareMemWrapper.c\r
+ SetMem64Wrapper.c\r
+ SetMem32Wrapper.c\r
+ SetMem16Wrapper.c\r
+ SetMemWrapper.c\r
+ CopyMemWrapper.c\r
+ MemLibGeneric.c\r
+ MemLibGuid.c\r
+ MemLib.c\r
+ MemLibInternals.h\r
+\r
+\r
+################################################################################\r
+#\r
+# Package Dependency Section - list of Package files that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+\r
+################################################################################\r
+#\r
+# Library Class Section - list of Library Classes that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[LibraryClasses]\r
+ BaseLib\r
+ DebugLib\r
+ PeiServicesTablePointerLib\r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
If Length is not aligned on a 16-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 32-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
If Length is not aligned on a 64-bit boundary, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to scan.\r
@param Length Number of bytes in Buffer to scan.\r
}\r
ASSERT (Buffer != NULL);\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- \r
+\r
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
}\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param Buffer Memory to set.\r
@param Length Number of bytes to set.\r
Internal header file for Smbus library.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
**/\r
#ifndef __INTERNAL_SMBUS_LIB_H\r
#define __INTERNAL_SMBUS_LIB_H\r
\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiPei.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Ppi/Smbus2.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/SmbusLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/PeiServicesTablePointerLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+\r
#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)\r
#define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)\r
#define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)\r
);\r
\r
/**\r
- Executes an SMBus operation to an SMBus controller. \r
+ Executes an SMBus operation to an SMBus controller.\r
\r
This function provides a standard way to execute Smbus script\r
as defined in the SmBus Specification. The data can either be of\r
Implementation of SmBusLib class library for PEI phase.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
Module Name: PeiSmbusLib.c\r
\r
**/\r
\r
-#include <Ppi/Smbus2.h>\r
-\r
#include "InternalSmbusLib.h"\r
\r
/**\r
EFI_PEI_SMBUS2_PPI *\r
InternalGetSmbusPpi (\r
EFI_PEI_SERVICES **PeiServices\r
- ) \r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_PEI_SMBUS2_PPI *SmbusPpi;\r
}\r
\r
/**\r
- Executes an SMBus operation to an SMBus controller. \r
+ Executes an SMBus operation to an SMBus controller.\r
\r
This function provides a standard way to execute Smbus script\r
as defined in the SmBus Specification. The data can either be of\r
SmbusDeviceAddress,\r
SMBUS_LIB_COMMAND (SmBusAddress),\r
SmbusOperation,\r
- SMBUS_LIB_PEC (SmBusAddress), \r
+ SMBUS_LIB_PEC (SmBusAddress),\r
&Length,\r
Buffer\r
);\r
--- /dev/null
+#/** @file\r
+# Component description file for Pei Smbus Library.\r
+#\r
+# SMBUS library that layers on top of the SMBUS PPI.\r
+# Copyright (c) 2006 - 2007, Intel Corporation\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+################################################################################\r
+#\r
+# Defines Section - statements that will be processed to create a Makefile.\r
+#\r
+################################################################################\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiSmbusLib\r
+ FILE_GUID = 2A1E1C92-AABA-4d62-AC40-F3A4C3387356\r
+ MODULE_TYPE = PEIM\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = SmbusLib|PEIM\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+################################################################################\r
+#\r
+# Sources Section - list of files that are required for the build to succeed.\r
+#\r
+################################################################################\r
+\r
+[Sources.common]\r
+ SmbusLib.c\r
+ PeiSmbusLib.c\r
+ InternalSmbusLib.h\r
+\r
+\r
+################################################################################\r
+#\r
+# Package Dependency Section - list of Package files that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+\r
+################################################################################\r
+#\r
+# Library Class Section - list of Library Classes that are required for\r
+# this module.\r
+#\r
+################################################################################\r
+\r
+[LibraryClasses]\r
+ BaseMemoryLib\r
+ PeiServicesTablePointerLib\r
+ DebugLib\r
+\r
+\r
+################################################################################\r
+#\r
+# PPI C Name Section - list of PPI and PPI Notify C Names that this module\r
+# uses or produces.\r
+#\r
+################################################################################\r
+\r
+[Ppis]\r
+ gEfiPeiSmbus2PpiGuid # PPI ALWAYS_CONSUMED\r
+\r
<MsaHeader>\r
<ModuleName>PeiSmbusLib</ModuleName>\r
<ModuleType>PEIM</ModuleType>\r
- <GuidValue>51C4C059-67F0-4e3c-9A55-FF42A8291C8C</GuidValue>\r
+ <GuidValue>2A1E1C92-AABA-4d62-AC40-F3A4C3387356</GuidValue>\r
<Version>1.0</Version>\r
<Abstract>Component description file for Pei Smbus Library.</Abstract>\r
<Description>SMBUS library that layers on top of the SMBUS PPI.</Description>\r
</PackageDependencies>\r
<PPIs>\r
<Ppi Usage="ALWAYS_CONSUMED">\r
- <PpiCName>gEfiPeiSmbusPpiGuid</PpiCName>\r
+ <PpiCName>gEfiPeiSmbusPpi2Guid</PpiCName>\r
</Ppi>\r
</PPIs>\r
<Externs>\r
Implementation of SmBusLib class library for PEI phase.\r
\r
Copyright (c) 2006, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
Module Name: SmbusLib.c\r
\r
**/\r
\r
-#include <Ppi/Smbus2.h>\r
#include "InternalSmbusLib.h"\r
\r
/**\r
ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
\r
InternalSmBusExec (EfiSmbusReadByte, SmBusAddress, 1, &Byte, Status);\r
- \r
+\r
return Byte;\r
}\r
\r
\r
Byte = Value;\r
InternalSmBusExec (EfiSmbusWriteByte, SmBusAddress, 1, &Byte, Status);\r
- \r
+\r
return Value;\r
}\r
\r
If Status is not NULL, then the status of the executed command is returned in Status.\r
If Length in SmBusAddress is not zero, then ASSERT().\r
If any reserved bits of SmBusAddress are set, then ASSERT().\r
- \r
+\r
@param SmBusAddress Address that encodes the SMBUS Slave Address,\r
SMBUS Command, SMBUS Data Length, and PEC.\r
@param Status Return status for the executed command.\r
ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
\r
InternalSmBusExec (EfiSmbusReadWord, SmBusAddress, 2, &Word, Status);\r
- \r
+\r
return Word;\r
}\r
\r
ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
\r
InternalSmBusExec (EfiSmbusProcessCall, SmBusAddress, 2, &Value, Status);\r
- \r
+\r
return Value;\r
}\r
\r
The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.\r
Bytes are written to the SMBUS from Buffer.\r
The number of bytes written is returned, and will never return a value larger than 32-bytes.\r
- If Status is not NULL, then the status of the executed command is returned in Status. \r
+ If Status is not NULL, then the status of the executed command is returned in Status.\r
If Length in SmBusAddress is zero or greater than 32, then ASSERT().\r
If Buffer is NULL, then ASSERT().\r
If any reserved bits of SmBusAddress are set, then ASSERT().\r
${WORKSPACE}/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
${WORKSPACE}/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
${WORKSPACE}/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
-# ${WORKSPACE}/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf\r
+ ${WORKSPACE}/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf\r
+ #${WORKSPACE}/MdePkg/Library/HiiLib/HiiLib.inf\r
${WORKSPACE}/MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
+ ${WORKSPACE}/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf\r
${WORKSPACE}/MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
${WORKSPACE}/MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
+ ${WORKSPACE}/MdePkg/Library/PeiMemoryLib/PeiMemoryLib.inf\r
${WORKSPACE}/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
${WORKSPACE}/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
${WORKSPACE}/MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf\r
${WORKSPACE}/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
${WORKSPACE}/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
-# ${WORKSPACE}/MdePkg/Library/PeiSmbusLib/PeiSmbusLib.inf\r
+ ${WORKSPACE}/MdePkg/Library/PeiSmbusLibSmbus2/PeiSmbusLib.inf\r
${WORKSPACE}/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.inf\r
${WORKSPACE}/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
${WORKSPACE}/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r