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