mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 22:54:51 +02:00
Fix CRLF format
Signed-off-by: Tian, Hot <hot.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15162 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
af0202a4ca
commit
7798fb83de
@ -1,57 +1,57 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#*
|
#*
|
||||||
#* Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
#* Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
#* This program and the accompanying materials
|
#* This program and the accompanying materials
|
||||||
#* are licensed and made available under the terms and conditions of the BSD License
|
#* are licensed and made available under the terms and conditions of the BSD License
|
||||||
#* which accompanies this distribution. The full text of the license may be found at
|
#* which accompanies this distribution. The full text of the license may be found at
|
||||||
#* http://opensource.org/licenses/bsd-license.php
|
#* http://opensource.org/licenses/bsd-license.php
|
||||||
#*
|
#*
|
||||||
#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
#* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
#* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#*
|
#*
|
||||||
#*
|
#*
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#
|
#
|
||||||
# Initializes floating point units for requirement of UEFI specification.
|
# Initializes floating point units for requirement of UEFI specification.
|
||||||
#
|
#
|
||||||
# This function initializes floating-point control word to 0x037F (all exceptions
|
# This function initializes floating-point control word to 0x037F (all exceptions
|
||||||
# masked,double-extended-precision, round-to-nearest) and multimedia-extensions control word
|
# masked,double-extended-precision, round-to-nearest) and multimedia-extensions control word
|
||||||
# (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
|
# (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
|
||||||
# for masked underflow).
|
# for masked underflow).
|
||||||
#
|
#
|
||||||
ASM_GLOBAL ASM_PFX(InitializeFloatingPointUnits)
|
ASM_GLOBAL ASM_PFX(InitializeFloatingPointUnits)
|
||||||
ASM_PFX(InitializeFloatingPointUnits):
|
ASM_PFX(InitializeFloatingPointUnits):
|
||||||
|
|
||||||
#
|
#
|
||||||
# Initialize floating point units
|
# Initialize floating point units
|
||||||
#
|
#
|
||||||
finit
|
finit
|
||||||
|
|
||||||
#
|
#
|
||||||
# Float control word initial value:
|
# Float control word initial value:
|
||||||
# all exceptions masked, double-precision, round-to-nearest
|
# all exceptions masked, double-precision, round-to-nearest
|
||||||
#
|
#
|
||||||
pushq $0x037F
|
pushq $0x037F
|
||||||
lea (%rsp), %rax
|
lea (%rsp), %rax
|
||||||
fldcw (%rax)
|
fldcw (%rax)
|
||||||
popq %rax
|
popq %rax
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set OSFXSR bit 9 in CR4
|
# Set OSFXSR bit 9 in CR4
|
||||||
#
|
#
|
||||||
movq %cr4, %rax
|
movq %cr4, %rax
|
||||||
or $0x200, %rax
|
or $0x200, %rax
|
||||||
movq %rax, %cr4
|
movq %rax, %cr4
|
||||||
|
|
||||||
#
|
#
|
||||||
# Multimedia-extensions control word:
|
# Multimedia-extensions control word:
|
||||||
# all exceptions masked, round-to-nearest, flush to zero for masked underflow
|
# all exceptions masked, round-to-nearest, flush to zero for masked underflow
|
||||||
#
|
#
|
||||||
pushq $0x01F80
|
pushq $0x01F80
|
||||||
lea (%rsp), %rax
|
lea (%rsp), %rax
|
||||||
ldmxcsr (%rax)
|
ldmxcsr (%rax)
|
||||||
popq %rax
|
popq %rax
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -28,13 +28,13 @@ mMmxControlWord DD 01F80h
|
|||||||
.code
|
.code
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
; Initializes floating point units for requirement of UEFI specification.
|
; Initializes floating point units for requirement of UEFI specification.
|
||||||
;
|
;
|
||||||
; This function initializes floating-point control word to 0x027F (all exceptions
|
; This function initializes floating-point control word to 0x027F (all exceptions
|
||||||
; masked,double-precision, round-to-nearest) and multimedia-extensions control word
|
; masked,double-precision, round-to-nearest) and multimedia-extensions control word
|
||||||
; (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
|
; (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
|
||||||
; for masked underflow).
|
; for masked underflow).
|
||||||
;
|
;
|
||||||
InitializeFloatingPointUnits PROC PUBLIC
|
InitializeFloatingPointUnits PROC PUBLIC
|
||||||
|
|
||||||
|
@ -1,53 +1,53 @@
|
|||||||
## @file
|
## @file
|
||||||
# Automate the process of building the various reset vector types
|
# Automate the process of building the various reset vector types
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
# http://opensource.org/licenses/bsd-license.php
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
#
|
#
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def RunCommand(commandLine):
|
def RunCommand(commandLine):
|
||||||
#print ' '.join(commandLine)
|
#print ' '.join(commandLine)
|
||||||
return subprocess.call(commandLine)
|
return subprocess.call(commandLine)
|
||||||
|
|
||||||
for filename in glob.glob(os.path.join('Bin', '*.raw')):
|
for filename in glob.glob(os.path.join('Bin', '*.raw')):
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
|
|
||||||
for arch in ('ia32', 'x64'):
|
for arch in ('ia32', 'x64'):
|
||||||
for debugType in (None, 'port80', 'serial'):
|
for debugType in (None, 'port80', 'serial'):
|
||||||
output = os.path.join('Bin', 'ResetVector')
|
output = os.path.join('Bin', 'ResetVector')
|
||||||
output += '.' + arch
|
output += '.' + arch
|
||||||
if debugType is not None:
|
if debugType is not None:
|
||||||
output += '.' + debugType
|
output += '.' + debugType
|
||||||
output += '.raw'
|
output += '.raw'
|
||||||
commandLine = (
|
commandLine = (
|
||||||
'nasm',
|
'nasm',
|
||||||
'-D', 'ARCH_%s' % arch.upper(),
|
'-D', 'ARCH_%s' % arch.upper(),
|
||||||
'-D', 'DEBUG_%s' % str(debugType).upper(),
|
'-D', 'DEBUG_%s' % str(debugType).upper(),
|
||||||
'-o', output,
|
'-o', output,
|
||||||
'ResetVectorCode.asm',
|
'ResetVectorCode.asm',
|
||||||
)
|
)
|
||||||
ret = RunCommand(commandLine)
|
ret = RunCommand(commandLine)
|
||||||
print '\tASM\t' + output
|
print '\tASM\t' + output
|
||||||
if ret != 0: sys.exit(ret)
|
if ret != 0: sys.exit(ret)
|
||||||
|
|
||||||
commandLine = (
|
commandLine = (
|
||||||
'python',
|
'python',
|
||||||
'Tools/FixupForRawSection.py',
|
'Tools/FixupForRawSection.py',
|
||||||
output,
|
output,
|
||||||
)
|
)
|
||||||
print '\tFIXUP\t' + output
|
print '\tFIXUP\t' + output
|
||||||
ret = RunCommand(commandLine)
|
ret = RunCommand(commandLine)
|
||||||
if ret != 0: sys.exit(ret)
|
if ret != 0: sys.exit(ret)
|
||||||
|
|
||||||
|
@ -1,110 +1,110 @@
|
|||||||
## @file
|
## @file
|
||||||
# Apply fixup to VTF binary image for FFS Raw section
|
# Apply fixup to VTF binary image for FFS Raw section
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
# http://opensource.org/licenses/bsd-license.php
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
#
|
#
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
filename = sys.argv[1]
|
filename = sys.argv[1]
|
||||||
|
|
||||||
if filename.lower().find('ia32') >= 0:
|
if filename.lower().find('ia32') >= 0:
|
||||||
d = open(sys.argv[1], 'rb').read()
|
d = open(sys.argv[1], 'rb').read()
|
||||||
c = ((len(d) + 4 + 7) & ~7) - 4
|
c = ((len(d) + 4 + 7) & ~7) - 4
|
||||||
if c > len(d):
|
if c > len(d):
|
||||||
c -= len(d)
|
c -= len(d)
|
||||||
f = open(sys.argv[1], 'wb')
|
f = open(sys.argv[1], 'wb')
|
||||||
f.write('\x90' * c)
|
f.write('\x90' * c)
|
||||||
f.write(d)
|
f.write(d)
|
||||||
f.close()
|
f.close()
|
||||||
else:
|
else:
|
||||||
from struct import pack
|
from struct import pack
|
||||||
|
|
||||||
PAGE_PRESENT = 0x01
|
PAGE_PRESENT = 0x01
|
||||||
PAGE_READ_WRITE = 0x02
|
PAGE_READ_WRITE = 0x02
|
||||||
PAGE_USER_SUPERVISOR = 0x04
|
PAGE_USER_SUPERVISOR = 0x04
|
||||||
PAGE_WRITE_THROUGH = 0x08
|
PAGE_WRITE_THROUGH = 0x08
|
||||||
PAGE_CACHE_DISABLE = 0x010
|
PAGE_CACHE_DISABLE = 0x010
|
||||||
PAGE_ACCESSED = 0x020
|
PAGE_ACCESSED = 0x020
|
||||||
PAGE_DIRTY = 0x040
|
PAGE_DIRTY = 0x040
|
||||||
PAGE_PAT = 0x080
|
PAGE_PAT = 0x080
|
||||||
PAGE_GLOBAL = 0x0100
|
PAGE_GLOBAL = 0x0100
|
||||||
PAGE_2M_MBO = 0x080
|
PAGE_2M_MBO = 0x080
|
||||||
PAGE_2M_PAT = 0x01000
|
PAGE_2M_PAT = 0x01000
|
||||||
|
|
||||||
def NopAlign4k(s):
|
def NopAlign4k(s):
|
||||||
c = ((len(s) + 0xfff) & ~0xfff) - len(s)
|
c = ((len(s) + 0xfff) & ~0xfff) - len(s)
|
||||||
return ('\x90' * c) + s
|
return ('\x90' * c) + s
|
||||||
|
|
||||||
def PageDirectoryEntries4GbOf2MbPages(baseAddress):
|
def PageDirectoryEntries4GbOf2MbPages(baseAddress):
|
||||||
|
|
||||||
s = ''
|
s = ''
|
||||||
for i in range(0x800):
|
for i in range(0x800):
|
||||||
i = (
|
i = (
|
||||||
baseAddress + long(i << 21) +
|
baseAddress + long(i << 21) +
|
||||||
PAGE_2M_MBO +
|
PAGE_2M_MBO +
|
||||||
PAGE_CACHE_DISABLE +
|
PAGE_CACHE_DISABLE +
|
||||||
PAGE_ACCESSED +
|
PAGE_ACCESSED +
|
||||||
PAGE_DIRTY +
|
PAGE_DIRTY +
|
||||||
PAGE_READ_WRITE +
|
PAGE_READ_WRITE +
|
||||||
PAGE_PRESENT
|
PAGE_PRESENT
|
||||||
)
|
)
|
||||||
s += pack('Q', i)
|
s += pack('Q', i)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def PageDirectoryPointerTable4GbOf2MbPages(pdeBase):
|
def PageDirectoryPointerTable4GbOf2MbPages(pdeBase):
|
||||||
s = ''
|
s = ''
|
||||||
for i in range(0x200):
|
for i in range(0x200):
|
||||||
i = (
|
i = (
|
||||||
pdeBase +
|
pdeBase +
|
||||||
(min(i, 3) << 12) +
|
(min(i, 3) << 12) +
|
||||||
PAGE_CACHE_DISABLE +
|
PAGE_CACHE_DISABLE +
|
||||||
PAGE_ACCESSED +
|
PAGE_ACCESSED +
|
||||||
PAGE_READ_WRITE +
|
PAGE_READ_WRITE +
|
||||||
PAGE_PRESENT
|
PAGE_PRESENT
|
||||||
)
|
)
|
||||||
s += pack('Q', i)
|
s += pack('Q', i)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def PageMapLevel4Table4GbOf2MbPages(pdptBase):
|
def PageMapLevel4Table4GbOf2MbPages(pdptBase):
|
||||||
s = ''
|
s = ''
|
||||||
for i in range(0x200):
|
for i in range(0x200):
|
||||||
i = (
|
i = (
|
||||||
pdptBase +
|
pdptBase +
|
||||||
(min(i, 0) << 12) +
|
(min(i, 0) << 12) +
|
||||||
PAGE_CACHE_DISABLE +
|
PAGE_CACHE_DISABLE +
|
||||||
PAGE_ACCESSED +
|
PAGE_ACCESSED +
|
||||||
PAGE_READ_WRITE +
|
PAGE_READ_WRITE +
|
||||||
PAGE_PRESENT
|
PAGE_PRESENT
|
||||||
)
|
)
|
||||||
s += pack('Q', i)
|
s += pack('Q', i)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def First4GbPageEntries(topAddress):
|
def First4GbPageEntries(topAddress):
|
||||||
PDE = PageDirectoryEntries4GbOf2MbPages(0L)
|
PDE = PageDirectoryEntries4GbOf2MbPages(0L)
|
||||||
pml4tBase = topAddress - 0x1000
|
pml4tBase = topAddress - 0x1000
|
||||||
pdptBase = pml4tBase - 0x1000
|
pdptBase = pml4tBase - 0x1000
|
||||||
pdeBase = pdptBase - len(PDE)
|
pdeBase = pdptBase - len(PDE)
|
||||||
PDPT = PageDirectoryPointerTable4GbOf2MbPages(pdeBase)
|
PDPT = PageDirectoryPointerTable4GbOf2MbPages(pdeBase)
|
||||||
PML4T = PageMapLevel4Table4GbOf2MbPages(pdptBase)
|
PML4T = PageMapLevel4Table4GbOf2MbPages(pdptBase)
|
||||||
return PDE + PDPT + PML4T
|
return PDE + PDPT + PML4T
|
||||||
|
|
||||||
def AlignAndAddPageTables():
|
def AlignAndAddPageTables():
|
||||||
d = open(sys.argv[1], 'rb').read()
|
d = open(sys.argv[1], 'rb').read()
|
||||||
code = NopAlign4k(d)
|
code = NopAlign4k(d)
|
||||||
topAddress = 0x100000000 - len(code)
|
topAddress = 0x100000000 - len(code)
|
||||||
d = ('\x90' * 4) + First4GbPageEntries(topAddress) + code
|
d = ('\x90' * 4) + First4GbPageEntries(topAddress) + code
|
||||||
f = open(sys.argv[1], 'wb')
|
f = open(sys.argv[1], 'wb')
|
||||||
f.write(d)
|
f.write(d)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
AlignAndAddPageTables()
|
AlignAndAddPageTables()
|
||||||
|
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
## @file UefiCpuPkg.dec
|
## @file UefiCpuPkg.dec
|
||||||
#
|
#
|
||||||
# This Package provides UEFI compatible CPU modules and libraries.
|
# This Package provides UEFI compatible CPU modules and libraries.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials are licensed and made available under
|
# This program and the accompanying materials are licensed and made available under
|
||||||
# the terms and conditions of the BSD License which accompanies this distribution.
|
# the terms and conditions of the BSD License which accompanies this distribution.
|
||||||
# The full text of the license may be found at
|
# The full text of the license may be found at
|
||||||
# http://opensource.org/licenses/bsd-license.php
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
#
|
#
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
DEC_SPECIFICATION = 0x00010005
|
DEC_SPECIFICATION = 0x00010005
|
||||||
PACKAGE_NAME = UefiCpuPkg
|
PACKAGE_NAME = UefiCpuPkg
|
||||||
PACKAGE_GUID = 2171df9b-0d39-45aa-ac37-2de190010d23
|
PACKAGE_GUID = 2171df9b-0d39-45aa-ac37-2de190010d23
|
||||||
PACKAGE_VERSION = 0.3
|
PACKAGE_VERSION = 0.3
|
||||||
|
|
||||||
[Includes]
|
[Includes]
|
||||||
Include
|
Include
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
## @libraryclass Defines some routines that are generic for IA32 family CPU
|
## @libraryclass Defines some routines that are generic for IA32 family CPU
|
||||||
## to be UEFI specification compliant.
|
## to be UEFI specification compliant.
|
||||||
##
|
##
|
||||||
UefiCpuLib|Include/Library/UefiCpuLib.h
|
UefiCpuLib|Include/Library/UefiCpuLib.h
|
||||||
|
|
||||||
[LibraryClasses.IA32, LibraryClasses.X64]
|
[LibraryClasses.IA32, LibraryClasses.X64]
|
||||||
## @libraryclass Provides functions to manage MTRR settings on IA32 and X64 CPUs.
|
## @libraryclass Provides functions to manage MTRR settings on IA32 and X64 CPUs.
|
||||||
##
|
##
|
||||||
MtrrLib|Include/Library/MtrrLib.h
|
MtrrLib|Include/Library/MtrrLib.h
|
||||||
|
|
||||||
## @libraryclass Provides functions to manage the Local APIC on IA32 and X64 CPUs.
|
## @libraryclass Provides functions to manage the Local APIC on IA32 and X64 CPUs.
|
||||||
##
|
##
|
||||||
LocalApicLib|Include/Library/LocalApicLib.h
|
LocalApicLib|Include/Library/LocalApicLib.h
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gUefiCpuPkgTokenSpaceGuid = { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa, 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }}
|
gUefiCpuPkgTokenSpaceGuid = { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa, 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }}
|
||||||
|
|
||||||
[PcdsFixedAtBuild, PcdsPatchableInModule]
|
[PcdsFixedAtBuild, PcdsPatchableInModule]
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress|0xfee00000|UINT32|0x00000001
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress|0xfee00000|UINT32|0x00000001
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user