mirror of https://github.com/acidanthera/audk.git
1. Simplified PalCallStatic.s's by removing unnecessary condition testings.
2. Fixed a logical error in Synchronization.c which caused InterlockedIncrement() and InterlockedDecrement() to hang. 3. Replaced the pseudo-implementation of GetInterruptState() with a real version. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@793 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e0f8d087ae
commit
a69c49fc11
|
@ -22,27 +22,27 @@
|
||||||
.type PalCallStatic, @function
|
.type PalCallStatic, @function
|
||||||
.regstk 5, 0, 0, 0
|
.regstk 5, 0, 0, 0
|
||||||
PalCallStatic::
|
PalCallStatic::
|
||||||
cmp.eq p6 = r0, in0
|
cmp.eq p15 = in0, r0
|
||||||
mov r31 = in4
|
mov r31 = in4
|
||||||
mov r8 = ip
|
mov r8 = ip
|
||||||
(p6) mov in0 = ar.k5
|
|
||||||
add r8 = (PalProcReturn - PalCallStatic), r8
|
(p15) mov in0 = ar.k5
|
||||||
mov in4 = b0
|
add r8 = (_PalProcReturn - PalCallStatic), r8
|
||||||
mov r30 = in3
|
mov r30 = in3
|
||||||
mov r29 = in2
|
|
||||||
|
mov in4 = psr
|
||||||
|
mov in3 = b0
|
||||||
mov b7 = in0
|
mov b7 = in0
|
||||||
mov in3 = psr
|
|
||||||
rsm 1 << 14 // Disable interrupts
|
rsm 1 << 14 // Disable interrupts
|
||||||
|
mov r29 = in2
|
||||||
mov r28 = in1
|
mov r28 = in1
|
||||||
mov in0 = 256
|
|
||||||
mov b0 = r8
|
mov b0 = r8
|
||||||
br.cond.sptk b7
|
br.cond.sptk.many b7
|
||||||
PalProcReturn:
|
|
||||||
mov psr.l = in3
|
_PalProcReturn:
|
||||||
cmp.eq p6 = in0, in1 // in1 == PAL_COPY_PAL?
|
mov psr.l = in4
|
||||||
(p6) cmp.eq p6 = r0, r8 // Status == Success?
|
mov b0 = in3
|
||||||
(p6) add in2 = r9, in2
|
|
||||||
(p6) mov ar.k5 = in2
|
|
||||||
mov b0 = in4
|
|
||||||
br.ret.sptk.many b0
|
br.ret.sptk.many b0
|
||||||
.endp PalCallStatic
|
.endp PalCallStatic
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
|
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
|
||||||
<MsaHeader>
|
<MsaHeader>
|
||||||
<ModuleName>BaseLib</ModuleName>
|
<ModuleName>BaseLib</ModuleName>
|
||||||
|
@ -277,6 +277,7 @@
|
||||||
<Filename SupArchList="IPF">Ipf/Synchronization.c</Filename>
|
<Filename SupArchList="IPF">Ipf/Synchronization.c</Filename>
|
||||||
<Filename SupArchList="IPF">Ipf/CpuPause.s</Filename>
|
<Filename SupArchList="IPF">Ipf/CpuPause.s</Filename>
|
||||||
<Filename SupArchList="IPF">Ipf/CpuFlushTlb.s</Filename>
|
<Filename SupArchList="IPF">Ipf/CpuFlushTlb.s</Filename>
|
||||||
|
<Filename SupArchList="IPF">Ipf/GetInterruptState.s</Filename>
|
||||||
<Filename SupArchList="EBC">Math64.c</Filename>
|
<Filename SupArchList="EBC">Math64.c</Filename>
|
||||||
<Filename SupArchList="EBC">Unaligned.c</Filename>
|
<Filename SupArchList="EBC">Unaligned.c</Filename>
|
||||||
<Filename SupArchList="EBC">Ebc/SwitchStack.c</Filename>
|
<Filename SupArchList="EBC">Ebc/SwitchStack.c</Filename>
|
||||||
|
|
|
@ -97,25 +97,6 @@ EnableInterrupts (
|
||||||
_enable ();
|
_enable ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the current CPU interrupt state.
|
|
||||||
|
|
||||||
Retrieves the current CPU interrupt state. Returns TRUE is interrupts are
|
|
||||||
currently enabled. Otherwise returns FALSE.
|
|
||||||
|
|
||||||
@retval TRUE CPU interrupts are enabled.
|
|
||||||
@retval FALSE CPU interrupts are disabled.
|
|
||||||
|
|
||||||
**/
|
|
||||||
BOOLEAN
|
|
||||||
EFIAPI
|
|
||||||
GetInterruptState (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enables CPU interrupts for the smallest window required to capture any
|
Enables CPU interrupts for the smallest window required to capture any
|
||||||
pending interrupts.
|
pending interrupts.
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
/// @file
|
||||||
|
/// Retrieve of the interrupt state of the running processor for the Itanium
|
||||||
|
/// 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: GetInterruptState.s
|
||||||
|
///
|
||||||
|
///
|
||||||
|
|
||||||
|
.auto
|
||||||
|
.text
|
||||||
|
|
||||||
|
.proc GetInterruptState
|
||||||
|
.type GetInterruptState, @function
|
||||||
|
GetInterruptState::
|
||||||
|
mov r8 = psr
|
||||||
|
dep.z r8 = r8, 14, 1
|
||||||
|
br.ret.sptk.many b0
|
||||||
|
.endp GetInterruptState
|
|
@ -22,27 +22,27 @@
|
||||||
.type PalCallStatic, @function
|
.type PalCallStatic, @function
|
||||||
.regstk 5, 0, 0, 0
|
.regstk 5, 0, 0, 0
|
||||||
PalCallStatic::
|
PalCallStatic::
|
||||||
cmp.eq p6 = r0, in0
|
cmp.eq p15 = in0, r0
|
||||||
mov r31 = in4
|
mov r31 = in4
|
||||||
mov r8 = ip
|
mov r8 = ip
|
||||||
(p6) mov in0 = ar.k5
|
|
||||||
add r8 = (PalProcReturn - PalCallStatic), r8
|
(p15) mov in0 = ar.k5
|
||||||
mov in4 = b0
|
add r8 = (_PalProcReturn - PalCallStatic), r8
|
||||||
mov r30 = in3
|
mov r30 = in3
|
||||||
mov r29 = in2
|
|
||||||
|
mov in4 = psr
|
||||||
|
mov in3 = b0
|
||||||
mov b7 = in0
|
mov b7 = in0
|
||||||
mov in3 = psr
|
|
||||||
rsm 1 << 14 // Disable interrupts
|
rsm 1 << 14 // Disable interrupts
|
||||||
|
mov r29 = in2
|
||||||
mov r28 = in1
|
mov r28 = in1
|
||||||
mov in0 = 256
|
|
||||||
mov b0 = r8
|
mov b0 = r8
|
||||||
br.cond.sptk b7
|
br.cond.sptk.many b7
|
||||||
PalProcReturn:
|
|
||||||
mov psr.l = in3
|
_PalProcReturn:
|
||||||
cmp.eq p6 = in0, in1 // in1 == PAL_COPY_PAL?
|
mov psr.l = in4
|
||||||
(p6) cmp.eq p6 = r0, r8 // Status == Success?
|
mov b0 = in3
|
||||||
(p6) add in2 = r9, in2
|
|
||||||
(p6) mov ar.k5 = in2
|
|
||||||
mov b0 = in4
|
|
||||||
br.ret.sptk.many b0
|
br.ret.sptk.many b0
|
||||||
.endp PalCallStatic
|
.endp PalCallStatic
|
||||||
|
|
|
@ -32,7 +32,7 @@ InternalSyncIncrement (
|
||||||
|
|
||||||
do {
|
do {
|
||||||
OriginalValue = *Value;
|
OriginalValue = *Value;
|
||||||
} while (OriginalValue == InternalSyncCompareExchange32 (
|
} while (OriginalValue != InternalSyncCompareExchange32 (
|
||||||
Value,
|
Value,
|
||||||
OriginalValue,
|
OriginalValue,
|
||||||
OriginalValue + 1
|
OriginalValue + 1
|
||||||
|
@ -50,7 +50,7 @@ InternalSyncDecrement (
|
||||||
|
|
||||||
do {
|
do {
|
||||||
OriginalValue = *Value;
|
OriginalValue = *Value;
|
||||||
} while (OriginalValue == InternalSyncCompareExchange32 (
|
} while (OriginalValue != InternalSyncCompareExchange32 (
|
||||||
Value,
|
Value,
|
||||||
OriginalValue,
|
OriginalValue,
|
||||||
OriginalValue - 1
|
OriginalValue - 1
|
||||||
|
|
|
@ -22,27 +22,27 @@
|
||||||
.type PalCallStatic, @function
|
.type PalCallStatic, @function
|
||||||
.regstk 5, 0, 0, 0
|
.regstk 5, 0, 0, 0
|
||||||
PalCallStatic::
|
PalCallStatic::
|
||||||
cmp.eq p6 = r0, in0
|
cmp.eq p15 = in0, r0
|
||||||
mov r31 = in4
|
mov r31 = in4
|
||||||
mov r8 = ip
|
mov r8 = ip
|
||||||
(p6) mov in0 = ar.k5
|
|
||||||
add r8 = (PalProcReturn - PalCallStatic), r8
|
(p15) mov in0 = ar.k5
|
||||||
mov in4 = b0
|
add r8 = (_PalProcReturn - PalCallStatic), r8
|
||||||
mov r30 = in3
|
mov r30 = in3
|
||||||
mov r29 = in2
|
|
||||||
|
mov in4 = psr
|
||||||
|
mov in3 = b0
|
||||||
mov b7 = in0
|
mov b7 = in0
|
||||||
mov in3 = psr
|
|
||||||
rsm 1 << 14 // Disable interrupts
|
rsm 1 << 14 // Disable interrupts
|
||||||
|
mov r29 = in2
|
||||||
mov r28 = in1
|
mov r28 = in1
|
||||||
mov in0 = 256
|
|
||||||
mov b0 = r8
|
mov b0 = r8
|
||||||
br.cond.sptk b7
|
br.cond.sptk.many b7
|
||||||
PalProcReturn:
|
|
||||||
mov psr.l = in3
|
_PalProcReturn:
|
||||||
cmp.eq p6 = in0, in1 // in1 == PAL_COPY_PAL?
|
mov psr.l = in4
|
||||||
(p6) cmp.eq p6 = r0, r8 // Status == Success?
|
mov b0 = in3
|
||||||
(p6) add in2 = r9, in2
|
|
||||||
(p6) mov ar.k5 = in2
|
|
||||||
mov b0 = in4
|
|
||||||
br.ret.sptk.many b0
|
br.ret.sptk.many b0
|
||||||
.endp PalCallStatic
|
.endp PalCallStatic
|
||||||
|
|
Loading…
Reference in New Issue