]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / UefiCpuPkg / ResetVector / Vtf0 / Tools / FixupForRawSection.py
CommitLineData
7798fb83
HT
1## @file\r
2# Apply fixup to VTF binary image for FFS Raw section\r
3#\r
6c7d6d4a 4# Copyright (c) 2008 - 2021, Intel Corporation. All rights reserved.<BR>\r
7798fb83 5#\r
0acd8697 6# SPDX-License-Identifier: BSD-2-Clause-Patent\r
7798fb83
HT
7#\r
8\r
9import sys\r
10\r
11filename = sys.argv[1]\r
12\r
eee1d2ca
JJ
13d = open(sys.argv[1], 'rb').read()\r
14c = ((len(d) + 4 + 7) & ~7) - 4\r
15if c > len(d):\r
16 c -= len(d)\r
17 f = open(sys.argv[1], 'wb')\r
6c7d6d4a 18 f.write(b'\x90' * c)\r
eee1d2ca
JJ
19 f.write(d)\r
20 f.close()\r