diff options
author | Ray Ni <ray.ni@intel.com> | 2019-06-11 16:59:11 +0800 |
---|---|---|
committer | Ray Ni <ray.ni@intel.com> | 2019-06-11 16:59:36 +0800 |
commit | 1a48fda5315433661c2f3039a30aea5916c22267 (patch) | |
tree | 696b6d3fbb955431d415761dbad6810550d245f3 /IntelFspWrapperPkg/FspWrapperSecCore/Vtf0/Tools/FixupForRawSection.py | |
parent | e8015f2facfffa31db8a06c1121647f76f1035dc (diff) | |
download | edk2-1a48fda5315433661c2f3039a30aea5916c22267.tar.gz edk2-1a48fda5315433661c2f3039a30aea5916c22267.tar.bz2 edk2-1a48fda5315433661c2f3039a30aea5916c22267.zip |
IntelFspPkg&IntelFspWrapperPkg: Remove them
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1819
Since there are V2 FSP packages (IntelFsp2Pkg, IntelFsp2WrapperPkg),
this patch removes IntelFspPkg, IntelFspWrapperPkg to remove obsolete
code in edk2 repo.
Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'IntelFspWrapperPkg/FspWrapperSecCore/Vtf0/Tools/FixupForRawSection.py')
-rw-r--r-- | IntelFspWrapperPkg/FspWrapperSecCore/Vtf0/Tools/FixupForRawSection.py | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/IntelFspWrapperPkg/FspWrapperSecCore/Vtf0/Tools/FixupForRawSection.py b/IntelFspWrapperPkg/FspWrapperSecCore/Vtf0/Tools/FixupForRawSection.py deleted file mode 100644 index 7765c22036..0000000000 --- a/IntelFspWrapperPkg/FspWrapperSecCore/Vtf0/Tools/FixupForRawSection.py +++ /dev/null @@ -1,104 +0,0 @@ -## @file
-# Apply fixup to VTF binary image for FFS Raw section
-#
-# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-import sys
-
-filename = sys.argv[1]
-
-if filename.lower().find('ia32') >= 0:
- 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()
-else:
- from struct import pack
-
- PAGE_PRESENT = 0x01
- PAGE_READ_WRITE = 0x02
- PAGE_USER_SUPERVISOR = 0x04
- PAGE_WRITE_THROUGH = 0x08
- PAGE_CACHE_DISABLE = 0x010
- PAGE_ACCESSED = 0x020
- PAGE_DIRTY = 0x040
- PAGE_PAT = 0x080
- PAGE_GLOBAL = 0x0100
- PAGE_2M_MBO = 0x080
- PAGE_2M_PAT = 0x01000
-
- def NopAlign4k(s):
- c = ((len(s) + 0xfff) & ~0xfff) - len(s)
- return ('\x90' * c) + s
-
- def PageDirectoryEntries4GbOf2MbPages(baseAddress):
-
- s = ''
- for i in range(0x800):
- i = (
- baseAddress + long(i << 21) +
- PAGE_2M_MBO +
- PAGE_CACHE_DISABLE +
- PAGE_ACCESSED +
- PAGE_DIRTY +
- PAGE_READ_WRITE +
- PAGE_PRESENT
- )
- s += pack('Q', i)
- return s
-
- def PageDirectoryPointerTable4GbOf2MbPages(pdeBase):
- s = ''
- for i in range(0x200):
- i = (
- pdeBase +
- (min(i, 3) << 12) +
- PAGE_CACHE_DISABLE +
- PAGE_ACCESSED +
- PAGE_READ_WRITE +
- PAGE_PRESENT
- )
- s += pack('Q', i)
- return s
-
- def PageMapLevel4Table4GbOf2MbPages(pdptBase):
- s = ''
- for i in range(0x200):
- i = (
- pdptBase +
- (min(i, 0) << 12) +
- PAGE_CACHE_DISABLE +
- PAGE_ACCESSED +
- PAGE_READ_WRITE +
- PAGE_PRESENT
- )
- s += pack('Q', i)
- return s
-
- def First4GbPageEntries(topAddress):
- PDE = PageDirectoryEntries4GbOf2MbPages(0L)
- pml4tBase = topAddress - 0x1000
- pdptBase = pml4tBase - 0x1000
- pdeBase = pdptBase - len(PDE)
- PDPT = PageDirectoryPointerTable4GbOf2MbPages(pdeBase)
- PML4T = PageMapLevel4Table4GbOf2MbPages(pdptBase)
- return PDE + PDPT + PML4T
-
- def AlignAndAddPageTables():
- d = open(sys.argv[1], 'rb').read()
- code = NopAlign4k(d)
- topAddress = 0x100000000 - len(code)
- d = ('\x90' * 4) + First4GbPageEntries(topAddress) + code
- f = open(sys.argv[1], 'wb')
- f.write(d)
- f.close()
-
- AlignAndAddPageTables()
-
|