From 18c319ae39f741101ccf0b076bb749e05344d443 Mon Sep 17 00:00:00 2001 From: bxing Date: Wed, 24 May 2006 05:33:03 +0000 Subject: 1. Updated CpuFlushTlb() according to IA-64 programmer's guide 2. Updated Thunk code to preserve EFLAGS/RFLAGS across real mode code invocation 3. Updated comments in x86Thunk.c git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@248 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s | 38 ++++++++++++++++++++---- MdePkg/Library/BaseLib/Ipf/PalCallStatic.s | 47 ++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 MdePkg/Library/BaseLib/Ipf/PalCallStatic.s (limited to 'MdePkg/Library/BaseLib/Ipf') diff --git a/MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s b/MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s index 0afd87e88b..608830496c 100644 --- a/MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s +++ b/MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s @@ -17,13 +17,41 @@ .auto .text +.global PalCallStatic +.type PalCallStatic, @function + .proc CpuFlushTlb .type CpuFlushTlb, @function CpuFlushTlb:: - mov r8 = ip - mov r9 = -1 - dep.z r10 = -1, 61, 3 - and r8 = r8, r10 - ptc.l r8, r9 + alloc loc0 = ar.pfs, 0, 2, 5, 0 + mov out0 = 0 + mov out1 = 6 + mov out2 = 0 + mov out3 = 0 + mov out4 = 0 + mov loc1 = b0 + br.call.sptk b0 = PalCallStatic + rsm 1 << 14 // Disable interrupts + mov ar.pfs = loc0 + extr.u r14 = r10, 32, 32 // r14 <- count1 + extr.u r15 = r11, 32, 32 // r15 <- stride1 + extr.u r10 = r10, 0, 32 // r10 <- count2 + mov loc0 = psr + extr.u r11 = r11, 0, 32 // r11 <- stride2 + br.cond.sptk LoopPredicate +LoopOuter: + mov ar.lc = r10 // LC <- count2 + mov ar.ec = r0 // EC <- 0 +Loop: + ptc.e r9 + add r9 = r11, r9 // r9 += stride2 + br.ctop.sptk Loop + add r9 = r15, r9 // r9 += stride1 +LoopPredicate: + cmp.ne p6, p7 = r0, r14 // count1 == 0? + add r14 = -1, r14 +(p6) br.cond.sptk LoopOuter + mov psr.l = loc0 + mov b0 = loc1 br.ret.sptk.many b0 .endp diff --git a/MdePkg/Library/BaseLib/Ipf/PalCallStatic.s b/MdePkg/Library/BaseLib/Ipf/PalCallStatic.s new file mode 100644 index 0000000000..7fa68e15f6 --- /dev/null +++ b/MdePkg/Library/BaseLib/Ipf/PalCallStatic.s @@ -0,0 +1,47 @@ +/// @file +/// Contains an implementation of CallPalProcStatic on Itanium-based +/// architecture. +/// +/// Copyright (c) 2006, Intel Corporation +/// All rights reserved. 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 full text of the license may be found at +/// http://opensource.org/licenses/bsd-license.php +/// +/// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +/// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +/// +/// Module Name: PalCallStatic.s +/// +/// + +.auto +.text + +.proc PalCallStatic +.type PalCallStatic, @function +.regstk 5, 0, 0, 0 +PalCallStatic:: + cmp.ne p6, p7 = r0, in0 + mov r31 = in4 + mov r8 = ip +(p6) mov in0 = ar.k5 + add r8 = (PalProcReturn - PalCallStatic), r8 + mov in4 = b0 + mov r30 = in3 + mov r29 = in2 + mov b7 = in0 + mov in3 = psr + rsm 1 << 14 // Disable interrupts + mov r28 = in1 + mov in0 = 256 + mov b0 = r8 + br.cond.sptk b7 +PalProcReturn: + mov psr.l = in3 + cmp.eq p6, p7 = in0, in1 // in1 == PAL_COPY_PAL? +(p6) cmp.eq p6, p7 = r0, r8 // Status == Success? +(p6) mov ar.k5 = in2 + mov b0 = in4 + br.ret.sptk.many b0 +.endp PalCallStatic -- cgit v1.2.3