X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FIpf%2FSwitchStack.s;h=aaf5b152a18ec474d4aef634aaba396e0dd8dd39;hp=16358add22bbf07580afb41ce8b858e5e85ca0df;hb=bb817c56c51fabe92915fe30b168b4833cb2aed9;hpb=b48638214f30dd0d4fc0a39e94e7cd76f9043fd8 diff --git a/MdePkg/Library/BaseLib/Ipf/SwitchStack.s b/MdePkg/Library/BaseLib/Ipf/SwitchStack.s index 16358add22..aaf5b152a1 100644 --- a/MdePkg/Library/BaseLib/Ipf/SwitchStack.s +++ b/MdePkg/Library/BaseLib/Ipf/SwitchStack.s @@ -1,122 +1,50 @@ -//++ -// 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: -// -// SwitchStack.s -// -// Abstract: -// -// Contains an implementation of a stack switch for the Itanium-based architecture. -// -// -// -// Revision History: -// -//-- - - .file "SwitchStack.s" - -#include "asm.h" -#include "ia_64gen.h" - -// Define hardware RSE Configuration Register -// -// RS Configuration (RSC) bit field positions - -#define RSC_MODE 0 -#define RSC_PL 2 -#define RSC_BE 4 -// RSC bits 5-15 reserved -#define RSC_MBZ0 5 -#define RSC_MBZ0_V 0x3ff -#define RSC_LOADRS 16 -#define RSC_LOADRS_LEN 14 -// RSC bits 30-63 reserved -#define RSC_MBZ1 30 -#define RSC_MBZ1_V 0x3ffffffffULL - -// RSC modes -// Lazy -#define RSC_MODE_LY (0x0) -// Store intensive -#define RSC_MODE_SI (0x1) -// Load intensive -#define RSC_MODE_LI (0x2) -// Eager -#define RSC_MODE_EA (0x3) - -// RSC Endian bit values -#define RSC_BE_LITTLE 0 -#define RSC_BE_BIG 1 - -// RSC while in kernel: enabled, little endian, pl = 0, eager mode -#define RSC_KERNEL ((RSC_MODE_EA< +/// 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: SwitchStack.s +/// +/// + +.auto +.text + +.proc AsmSwitchStackAndBackingStore +.type AsmSwitchStackAndBackingStore, @function +.regstk 5, 0, 0, 0 +AsmSwitchStackAndBackingStore:: + mov r14 = ar.rsc + movl r2 = ~((((1 << 14) - 1) << 16) | 3) + + mov r17 = in1 + mov r18 = in2 + and r2 = r14, r2 + + mov ar.rsc = r2 + mov sp = in3 + mov r19 = in4 + + ld8.nt1 r16 = [in0], 8 + ld8.nta gp = [in0] + mov r3 = -1 + + loadrs + mov ar.bspstore = r19 + mov b7 = r16 + + alloc r2 = ar.pfs, 0, 0, 2, 0 + mov out0 = r17 + mov out1 = r18 + + mov ar.rnat = r3 + mov ar.rsc = r14 + br.call.sptk.many b0 = b7 +.endp AsmSwitchStackAndBackingStore