]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/ResetVector/Vtf0/Build.py
UefiCpuPkg: ResetVector Tool additional debug prints
[mirror_edk2.git] / UefiCpuPkg / ResetVector / Vtf0 / Build.py
1 ## @file
2 # Automate the process of building the various reset vector types
3 #
4 # Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
5 #
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
7 #
8
9 import glob
10 import os
11 import subprocess
12 import sys
13
14 def RunCommand(commandLine):
15 #print ' '.join(commandLine)
16 return subprocess.call(commandLine)
17
18 for filename in glob.glob(os.path.join('Bin', '*.raw')):
19 os.remove(filename)
20
21 for arch in ('ia32', 'x64'):
22 for debugType in (None, 'port80', 'serial'):
23 output = os.path.join('Bin', 'ResetVector')
24 output += '.' + arch
25 if debugType is not None:
26 output += '.' + debugType
27 output += '.raw'
28 commandLine = (
29 'nasm',
30 '-D', 'ARCH_%s' % arch.upper(),
31 '-D', 'DEBUG_%s' % str(debugType).upper(),
32 '-o', output,
33 'Vtf0.nasmb',
34 )
35 print(f"Command : {' '.join(commandLine)}")
36 ret = RunCommand(commandLine)
37 if ret != 0:
38 print(f"something went wrong while executing {commandLine[-1]}")
39 sys.exit()
40 print('\tASM\t' + output)
41
42 commandLine = (
43 'python',
44 'Tools/FixupForRawSection.py',
45 output,
46 )
47 print('\tFIXUP\t' + output)
48 ret = RunCommand(commandLine)
49 if ret != 0: sys.exit(ret)
50