From 3e5b4527437d7b2e23c7cd4a38bc999f8a525711 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Fri, 16 May 2008 09:45:09 +0000 Subject: [PATCH] 1) Update comments. 2) Remove reference to ">>" as it cause the generated code to link with other libraries. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5214 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.c | 24 ++++++++++++------- .../Fv2ToFvThunk/Fv2ToFvThunk.inf | 11 +++++++-- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.c b/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.c index da2ada6899..5a89866b0d 100644 --- a/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.c +++ b/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.c @@ -1,4 +1,13 @@ -/*++ +/** +Module produce FV2 on top of FV. + +UEFI PI specification supersedes Inte's Framework Specification. +EFI_FIRMWARE_VOLUME_PROTOCOL defined in Intel Framework Pkg is replaced by +EFI_FIRMWARE_VOLUME2_PROTOCOL in MdePkg. +This module produces FV2 on top of FV. This module is used on platform when both of +these two conditions are true: +1) Framework module producing FV is present +2) And the rest of modules on the platform consume FV2 Copyright (c) 2006 - 2008 Intel Corporation.
All rights reserved. This program and the accompanying materials @@ -10,13 +19,7 @@ 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: - FvToFv2Thunk.c - -Abstract: - - DXE driver - ---*/ +**/ #include #include @@ -933,11 +936,14 @@ Fv2SetVolumeAttributes ( FIRMWARE_VOLUME2_PRIVATE_DATA *Private; EFI_FIRMWARE_VOLUME_PROTOCOL *FirmwareVolume; FRAMEWORK_EFI_FV_ATTRIBUTES FrameworkFvAttributes; + UINTN Shift; Private = FIRMWARE_VOLUME2_PRIVATE_DATA_FROM_THIS (This); FirmwareVolume = Private->FirmwareVolume; - FrameworkFvAttributes = (*FvAttributes & 0x1ff) | ((UINTN)EFI_FV_ALIGNMENT_2 << ((*FvAttributes & EFI_FV2_ALIGNMENT) >> 16)); + FrameworkFvAttributes = (*FvAttributes & 0x1ff); + Shift = (UINTN) RShiftU64(*FvAttributes & EFI_FV2_ALIGNMENT, 16); + FrameworkFvAttributes = FrameworkFvAttributes | LShiftU64 (EFI_FV_ALIGNMENT_2, Shift); return FirmwareVolume->SetVolumeAttributes ( FirmwareVolume, diff --git a/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.inf b/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.inf index b7a3862605..c023df78e5 100644 --- a/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.inf +++ b/EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.inf @@ -1,7 +1,14 @@ #/** @file -# Component description file for PeiVariable module. +# Module produce FV2 on top of FV. +# +# UEFI PI specification supersedes Inte's Framework Specification. +# EFI_FIRMWARE_VOLUME_PROTOCOL defined in Intel Framework Pkg is replaced by +# EFI_FIRMWARE_VOLUME2_PROTOCOL in MdePkg. +# This module produces FV2 on top of FV. This module is used on platform when both of +# these two conditions are true: +# 1) Framework module producing FV is present +# 2) And the rest of modules on the platform consume FV2 # -# PEIM to provide the Variable functionality. # Copyright (c) 2006 - 2007, Intel Corporation # # All rights reserved. This program and the accompanying materials