Previously, we would build the page tables in Tools/FixupForRawSection.py. In order to let NASM build VTF0 from source during the EDK II build process, we need to move this into the VTF0 NASM code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15822 6f19259b-4bc3-4df7-8a09-765794883524
27 lines
807 B
Python
27 lines
807 B
Python
## @file
|
|
# Apply fixup to VTF binary image for FFS Raw section
|
|
#
|
|
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
|
|
#
|
|
# 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.
|
|
#
|
|
|
|
import sys
|
|
|
|
filename = sys.argv[1]
|
|
|
|
d = open(sys.argv[1], 'rb').read()
|
|
c = ((len(d) + 4 + 7) & ~7) - 4
|
|
if c > len(d):
|
|
c -= len(d)
|
|
f = open(sys.argv[1], 'wb')
|
|
f.write('\x90' * c)
|
|
f.write(d)
|
|
f.close()
|