summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/X64
AgeCommit message (Collapse)Author
2014-09-04MdePkg NASM Thunk16: Add missing ASM_PFX for InternalAsmThunk16Jordan Justen
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16059 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-04MdePkg NASM Thunk16: Work around NASM 2.09.04 - 2.10rc1 bugJordan Justen
Without this change, NASM 2.09.04 will hang with OVMF+CSM on both IA32 and X64. Tested on OVMF+CSM on GCC49 with NASM 2.07, 2.09.04 and 2.11. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16058 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01MdePkg BaseLib NASM Thunk16: Initialize _16GdtrBase to 0Jordan Justen
Previously we were setting it to the start of the GDT in the UEFI driver's copy of BaseLib. This address is irrelavent, since the C code will initialize it to the cooresponding address after the Thunk16 code has been placed in low memory. Additionally, initializing this was causing a link error for the XCLANG toolchain. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16025 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01MdePkg BaseLib NASM Thunk16: Remove remaining 'DB' codeJordan Justen
Convert remaining 'DB' code to assembly code by: * Move instruction immediate data labels to end of instruction * Use strict keyword to make sure immediate data size is not optimized Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16024 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01MdePkg BaseLib NASM Thunk16: Use bits 16 for 16-bit codeJordan Justen
By using 'bits 16', we can write code for 16-bit use the actual assembly syntax rather than 'DB' and sometimes writing code with seemingly incorrect operands because we know it will run correctly when the processor is running in 16-bit mode. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16023 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01MdePkg BaseLib NASM Thunk16: Use NASM local labelsJordan Justen
http://www.nasm.us/doc/nasmdoc3.html#section-3.9 A local label is a label beginning with the period, and it's actual name is prefixed by the previous non-local label. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16022 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01MdePkg BaseLib Thunk16: Replace X64 GAS Thunk16 with NASM versionJordan Justen
This is a translation of X64/Thunk16.asm to NASM. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16021 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-29Use rsp instead of esp to save 64-bit stack pointer.Elvin Li
Signed-off-by: Elvin Li <elvin.li@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14812 6f19259b-4bc3-4df7-8a09-765794883524
2013-01-07Current Thunk16.asm implementation clears reserved bits, which does not ↵li-elvin
follow IA32 SDM. Now the fix is to only clear PAE and PSE bit of CR4 for real mode. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14037 6f19259b-4bc3-4df7-8a09-765794883524
2011-12-15Fix the issue to clear the high 16-bit of EAX before use it Thunk code.lgao4
This patch updates MdePkg BaseLib, EcpPkg EdkIIGlueLib BaseLib and ThunkLib. Signed-off-by: lgao4 Reviewed-by: rsun3 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12876 6f19259b-4bc3-4df7-8a09-765794883524
2011-10-08Fix Xcode link failure. Relocations are not supported in .text sections.andrewfish
Per Rui's review of the patch _16GdtrBase is a label that is patched by C code so it does require initialization. approved-by: andrewfish reviewed-by: jljusten reviewed-by: rsun3 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12515 6f19259b-4bc3-4df7-8a09-765794883524
2011-08-02MdePkg: Fixed hang/reset in thunk code when building with GCC X64geekboy15a
Reverted changes of data areas from .long back to .space 4. This was done because the size of .long is based off of .int and may vary. Using a fixed size is required because these values are for patching code. Also note that .space will automatically initialize the data to zero. Not initializing all values to zero was causing the hang/reset. Signed-off-by: geekboy15a Reviewed-by: darylm503 Reviewed-by: jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12079 6f19259b-4bc3-4df7-8a09-765794883524
2011-07-12MdePkg: Fix X64 clang compile issues.andrewfish
Fixed issues with X64 clang, and also make StackSwitch push a zero on the new stack to prevent a stack unwind into memory that is no longer valid. signed-off-by: andrewfish reviewed-by: lgao4 reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12007 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-12Fix the issue that the high 16-bit of EAX may contain invalid data, which ↵li-elvin
cause bad stack pointer, the change will ensure the high 16-bit of EAX is cleared. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11047 6f19259b-4bc3-4df7-8a09-765794883524
2010-06-25Minor grammatical work--mostly adding periods. Items with ONLY period added ↵myronporter
did not have the heading date changed, but Items with content changes had heading copyright dates updated. Sending separately a list of files missing Doxygen @param and @return information. (PENDING) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10604 6f19259b-4bc3-4df7-8a09-765794883524
2010-06-24Minor grammatical work--mostly adding periods. Items with ONLY period added ↵myronporter
did not have the heading date changed, but Items with content changes had heading copyright dates updated. Sending separately a list of files missing Doxygen @param and @return information. (PENDING) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10596 6f19259b-4bc3-4df7-8a09-765794883524
2010-06-01Fixed issue with InternalX86ReadIdtr referencing LDT read and not IDT read ↵geekboy15a
operation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10559 6f19259b-4bc3-4df7-8a09-765794883524
2010-05-20Fix some typosqhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10521 6f19259b-4bc3-4df7-8a09-765794883524
2010-05-18Update copyright formathhtian
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10506 6f19259b-4bc3-4df7-8a09-765794883524
2010-05-181. Restore the inline C implementation of GCC assembly files that was ↵qhuang8
temporarily removed in Svn r10045. 2. Remove 139 GCC assembly files whose functionality have been covered in the inline C implementation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10503 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-23Update the copyright notice formathhtian
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10405 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-16Fixed GCC 4.4 build issue due to incorrect prefix. Now using ASM_PFX to ↵geekboy15a
correctly set the prefix. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10377 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-16Fixed GCC 4.4 build issue. Also fixed issue where upper 32-bits may be lost ↵geekboy15a
during AND operation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10376 6f19259b-4bc3-4df7-8a09-765794883524
2010-03-01Remove assumption that the transition code for transitioning from 64-bit to ↵mdkinney
32-bit mode is 64 bytes. Instead compute the size based on the implementation in the ASM file. Update logic to align new 32-bit stack on a 4 byte boundary Update logic to prevent one slot overlap between the transition code and the new stack. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10133 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-23Disable interrupt when changing IDTR register.klu2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10046 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-23Temporarily remove the C implementation of some GCC assembly files in ↵qhuang8
MdePkg. They are kept in repository and will be re-evaluate later. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10045 6f19259b-4bc3-4df7-8a09-765794883524
2010-01-27Clean up MdePkg source to correct some coding style issues, etc.qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9832 6f19259b-4bc3-4df7-8a09-765794883524
2009-12-07fix GCC build issue, mWait instruction need not the operands.eric_tian
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9526 6f19259b-4bc3-4df7-8a09-765794883524
2009-12-06Fixes for ARM build in the EdkCompatibilityPkg and a couple of Xcode fixes ↵AJFISH
for MdePkg. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9520 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-24Fix file headersmdkinney
Move stack alignment check from CPU specific files into common SwitchStack() function and add VA_END() to SwitchStack(). Fix incorrect syntax for ASM_FUNCTION_REMOVE_IF_UNREFERENCED git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9193 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-19Update to make end-of-line consistent for all source files in MdePkg. There ↵qhuang8
are no other updates besides that change. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9141 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-18Add ARM supportmdkinney
Add C inline assembly files for IA32 and X64 GCC builds. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9113 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-11Minor update source to make end-of-line consistent. qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9043 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-11Remove all unnecessary .align directives in MdePkgqhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9042 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-10For X64 BASE_LIBRARY_JUMP_BUFFER is 64-bit aligned, not 128-bit aligned, ↵gikidy
replace movdqa with movdqu. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8508 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-10Save/Restore xmm6-xmm15 in function setJump/longJump for GAS.gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8507 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-10Save/Restore xmm6-xmm15 in function setJump/longJump.gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8506 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-05 Need use 32-bit register to hold 32-bit stack address.klu2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8481 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-05 Need use 32-bit register to hold 32-bit stack address.klu2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8480 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-05Fix the bug that if code is run above 4G, AsmDisablePaging64 will be failedklu2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8479 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-05Fix the bug that if code is run above 4G, AsmDisablePaging64 will be failure.klu2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8478 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-031. Fix the bug that we should use rip relative addressing for x64 label to ↵qhuang8
prevent GNU assembly generate incorrect code. 2. Sync the bug fix of MS assembly in r8455. 3. Correct the function prototype in comments. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8456 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-03Save label "@F" to 64-bit register (r10) instead of 32-bit register (eax) in ↵qhuang8
case label @F is above 4G. Use "far retq" to load CS and 64-bit rip instead. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8455 6f19259b-4bc3-4df7-8a09-765794883524
2009-06-02Use rip relative addressing for x64 label for Thunk16.S to prevent GCC ↵qhuang8
assembly from generating 32-bit value with HIGHLOW fixup. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8444 6f19259b-4bc3-4df7-8a09-765794883524
2009-05-26Correct one minor instruction to clear the lower 4 bits of r11.qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8391 6f19259b-4bc3-4df7-8a09-765794883524
2009-05-26Fix the bug in x64 thunk code that it cannot handle the case when GDT is ↵qhuang8
loaded in above 4G table memory. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8390 6f19259b-4bc3-4df7-8a09-765794883524
2009-05-20Replace .globl with ASM_GLOBALxli24
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8346 6f19259b-4bc3-4df7-8a09-765794883524
2009-05-201. Remove .extern from GCC assembly.xli24
2. Define macro for .global/.globl in GCC assembly. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8344 6f19259b-4bc3-4df7-8a09-765794883524
2009-04-30Fix the bug that EnablePaging64() should assert() for x64 platform.qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8223 6f19259b-4bc3-4df7-8a09-765794883524
2009-04-17Save segment registers on stack in case the thunk code assembly calls CF9 ↵qhuang8
soft reset and the x64 registers get cleared. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8123 6f19259b-4bc3-4df7-8a09-765794883524