UefiCpuPkg/ResetVector: Remove pre-built binaries

Because it's simpler for a platform to include the ResetVector source
and having pre-built binaries add burdens of updating the pre-built
binaries. This patch removes the pre-built binaries and the script
that buids the pre-built binaries.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Ray Ni 2023-06-15 18:48:20 +08:00 committed by mergify[bot]
parent 8ef7e222ae
commit 28eb51dd54
16 changed files with 9 additions and 199 deletions

View File

@ -1,31 +0,0 @@
## @file
# Reset Vector binary
#
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = ResetVector
MODULE_UNI_FILE = ResetVector.uni
FILE_GUID = 1BA0062E-C779-4582-8566-336AE8F78F09
MODULE_TYPE = SEC
VERSION_STRING = 1.1
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64
#
[Binaries.Ia32]
RAW|IA32/ResetVector.ia32.raw|*
[Binaries.X64]
RAW|X64/PageTable2M/ResetVector.x64.raw|*
[UserExtensions.TianoCore."ExtraFiles"]
ResetVectorExtra.uni

View File

@ -1,16 +0,0 @@
// /** @file
// Reset Vector binary
//
// Reset Vector binary
//
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
// **/
#string STR_MODULE_ABSTRACT #language en-US "Reset Vector binary"
#string STR_MODULE_DESCRIPTION #language en-US "Reset Vector binary"

View File

@ -1,31 +0,0 @@
## @file
# Reset Vector binary
#
# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = ResetVector
MODULE_UNI_FILE = ResetVector.uni
FILE_GUID = 1BA0062E-C779-4582-8566-336AE8F78F09
MODULE_TYPE = SEC
VERSION_STRING = 1.1
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64
#
[Binaries.Ia32]
RAW|IA32/ResetVector.ia32.raw|*
[Binaries.X64]
RAW|X64/PageTable1G/ResetVector.x64.raw|*
[UserExtensions.TianoCore."ExtraFiles"]
ResetVectorExtra.uni

View File

@ -1,12 +0,0 @@
// /** @file
// ResetVector Localized Strings and Content
//
// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
// **/
#string STR_PROPERTIES_MODULE_NAME #language en-US "ResetVector module"

View File

@ -1,89 +0,0 @@
## @file
# Automate the process of building the various reset vector types
#
# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
import os
import subprocess
import sys
PAGE_TABLE_2M = 'PageTable2M'
PAGE_TABLE_1G = 'PageTable1G'
FILE_FORMAT = '.raw'
ALL_RAW_FORMAT = '*' + FILE_FORMAT
IA32 = 'IA32'
X64 = 'X64'
# Pre-Define a Macros for Page Table
PAGE_TABLES = {
PAGE_TABLE_2M : "PAGE_TABLE_2M",
PAGE_TABLE_1G : "PAGE_TABLE_1G"
}
def RunCommand(commandLine):
return subprocess.call(commandLine)
# Check for all raw binaries and delete them
for root, dirs, files in os.walk('Bin'):
for file in files:
if file.endswith(FILE_FORMAT):
os.remove(os.path.join(root, file))
for arch in ('ia32', 'x64'):
for debugType in (None, 'port80', 'serial'):
for pageTable in PAGE_TABLES.keys():
ret = True
if arch.lower() == X64.lower():
directory = os.path.join('Bin', X64, pageTable)
else:
directory = os.path.join('Bin', IA32)
# output raw binary name with arch type
fileName = 'ResetVector' + '.' + arch
if debugType is not None:
fileName += '.' + debugType
fileName += FILE_FORMAT
output = os.path.join(directory, fileName)
# if the directory not exists then create it
if not os.path.isdir(directory):
os.makedirs(directory)
# Prepare the command to execute the nasmb
commandLine = (
'nasm',
'-D', 'ARCH_%s' % arch.upper(),
'-D', 'DEBUG_%s' % str(debugType).upper(),
'-D', PAGE_TABLES[pageTable].upper(),
'-o', output,
'Vtf0.nasmb',
)
print(f"Command : {' '.join(commandLine)}")
try:
ret = RunCommand(commandLine)
except FileNotFoundError:
print("NASM not found")
except:
pass
if ret != 0:
print(f"something went wrong while executing {commandLine[-1]}")
sys.exit()
print('\tASM\t' + output)
commandLine = (
'python',
'Tools/FixupForRawSection.py',
output,
)
print('\tFIXUP\t' + output)
ret = RunCommand(commandLine)
if ret != 0: sys.exit(ret)

View File

@ -1,20 +0,0 @@
## @file
# Apply fixup to VTF binary image for FFS Raw section
#
# Copyright (c) 2008 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
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(b'\x90' * c)
f.write(d)
f.close()

View File

@ -46,3 +46,12 @@
[UserExtensions.TianoCore."ExtraFiles"]
ResetVectorExtra.uni
[BuildOptions]
# Different build options can be specified:
# * for different architectures:
# -DARCH_X64, -DARCH_IA32
# * for using 1G page table:
# -DPAGE_TABLE_1G
# * for different debug channels:
# -DDEBUG_SERIAL, -DDEBUG_PORT80, or not specify any debug channel