X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EdkCompatibilityPkg%2FFoundation%2FLibrary%2FEdkIIGlueLib%2FLibrary%2FBaseLib%2FIpf%2FAccessGcr.s;fp=EdkCompatibilityPkg%2FFoundation%2FLibrary%2FEdkIIGlueLib%2FLibrary%2FBaseLib%2FIpf%2FAccessGcr.s;h=a4bec292e0e088662b8a5f5074ff5f6fa10ae137;hb=c7f33ca42470dc87bc41a8583f427883123d67a1;hp=0000000000000000000000000000000000000000;hpb=2c40a813fc32c5c9aa204b10b037c48f42fe6422;p=mirror_edk2.git diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGcr.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGcr.s new file mode 100644 index 0000000000..a4bec292e0 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGcr.s @@ -0,0 +1,263 @@ +/// 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: AccessGcr.s +/// +/// +/// IPF specific Global Control Registers accessing functions +/// + +//--------------------------------------------------------------------------------- +//++ +// AsmReadDcr +// +// This routine is used to Read the value of Default Control Register (DCR). +// +// Arguments : +// +// On Entry : +// +// Return Value: The current value of DCR. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmReadDcr, @function +.proc AsmReadDcr + +AsmReadDcr:: + mov r8 = cr.dcr;; + br.ret.dpnt b0;; +.endp AsmReadDcr + +//--------------------------------------------------------------------------------- +//++ +// AsmWriteDcr +// +// This routine is used to write the value to Default Control Register (DCR). +// +// Arguments : +// +// On Entry : The value need to be written to DCR +// +// Return Value: The value written to DCR. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmWriteDcr, @function +.proc AsmWriteDcr +.regstk 1, 0, 0, 0 + +AsmWriteDcr:: + mov cr.dcr = in0 + mov r8 = in0;; + srlz.i;; + srlz.d;; + br.ret.dpnt b0;; +.endp AsmWriteDcr + + +//--------------------------------------------------------------------------------- +//++ +// AsmReadItc +// +// This routine is used to Read the value of Interval Timer Counter Register (ITC). +// +// Arguments : +// +// On Entry : +// +// Return Value: The current value of ITC. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmReadItc, @function +.proc AsmReadItc + +AsmReadItc:: + mov r8 = ar.itc;; + br.ret.dpnt b0;; +.endp AsmReadItc + +//--------------------------------------------------------------------------------- +//++ +// AsmWriteItc +// +// This routine is used to write the value to Interval Timer Counter Register (ITC). +// +// Arguments : +// +// On Entry : The value need to be written to the ITC +// +// Return Value: The value written to the ITC. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmWriteItc, @function +.proc AsmWriteItc +.regstk 1, 0, 0, 0 + +AsmWriteItc:: + mov ar.itc = in0 + mov r8 = in0;; + br.ret.dpnt b0;; +.endp AsmWriteItc + + +//--------------------------------------------------------------------------------- +//++ +// AsmReadItm +// +// This routine is used to Read the value of Interval Timer Match Register (ITM). +// +// Arguments : +// +// On Entry : +// +// Return Value: The current value of ITM. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmReadItm, @function +.proc AsmReadItm + +AsmReadItm:: + mov r8 = cr.itm;; + br.ret.dpnt b0;; +.endp AsmReadItm + +//--------------------------------------------------------------------------------- +//++ +// AsmWriteItm +// +// This routine is used to write the value to Interval Timer Match Register (ITM). +// +// Arguments : +// +// On Entry : The value need to be written to ITM +// +// Return Value: The value written to ITM. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmWriteItm, @function +.proc AsmWriteItm +.regstk 1, 0, 0, 0 + +AsmWriteItm:: + mov cr.itm = in0 + mov r8 = in0;; + srlz.d; + br.ret.dpnt b0;; +.endp AsmWriteItm + + +//--------------------------------------------------------------------------------- +//++ +// AsmReadIva +// +// This routine is used to read the value of Interruption Vector Address Register (IVA). +// +// Arguments : +// +// On Entry : +// +// Return Value: The current value of IVA. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmReadIva, @function +.proc AsmReadIva + +AsmReadIva:: + mov r8 = cr.iva;; + br.ret.dpnt b0;; +.endp AsmReadIva + +//--------------------------------------------------------------------------------- +//++ +// AsmWriteIva +// +// This routine is used to write the value to Interruption Vector Address Register (IVA). +// +// Arguments : +// +// On Entry : The value need to be written to IVA +// +// Return Value: The value written to IVA. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmWriteIva, @function +.proc AsmWriteIva +.regstk 1, 0, 0, 0 + +AsmWriteIva:: + mov cr.iva = in0 + mov r8 = in0;; + br.ret.dpnt b0;; +.endp AsmWriteIva + + +//--------------------------------------------------------------------------------- +//++ +// AsmReadPta +// +// This routine is used to read the value of Page Table Address Register (PTA). +// +// Arguments : +// +// On Entry : +// +// Return Value: The current value of PTA. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmReadPta, @function +.proc AsmReadPta + +AsmReadPta:: + mov r8 = cr.pta;; + br.ret.dpnt b0;; +.endp AsmReadPta + +//--------------------------------------------------------------------------------- +//++ +// AsmWritePta +// +// This routine is used to write the value to Page Table Address Register (PTA)). +// +// Arguments : +// +// On Entry : The value need to be written to PTA +// +// Return Value: The value written to PTA. +// +//-- +//---------------------------------------------------------------------------------- +.text +.type AsmWritePta, @function +.proc AsmWritePta +.regstk 1, 0, 0, 0 + +AsmWritePta:: + mov cr.pta = in0 + mov r8 = in0;; + srlz.i;; + srlz.d;; + br.ret.dpnt b0;; +.endp AsmWritePta \ No newline at end of file