1/// @file
2///  IPF specific Global Pointer and Stack Pointer accessing functions
3///
4/// Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
5/// This program and the accompanying materials
6/// are licensed and made available under the terms and conditions of the BSD License
7/// which accompanies this distribution.  The full text of the license may be found at
8/// http://opensource.org/licenses/bsd-license.php.
9///
10/// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11/// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12///
13/// Module Name: AccessGp.s
14///
15///
16
17//---------------------------------------------------------------------------------
18//++
19// AsmReadGp
20//
21// This routine is used to read the current value of 64-bit Global Pointer (GP).
22//
23// Arguments :
24//
25// On Entry :
26//
27// Return Value: The current GP value.
28//
29//--
30//----------------------------------------------------------------------------------
31.text
32.type   AsmReadGp, @function
33.proc   AsmReadGp
34
35AsmReadGp::
36        mov             r8 = gp;;
37        br.ret.dpnt     b0;;
38.endp   AsmReadGp
39
40//---------------------------------------------------------------------------------
41//++
42// AsmWriteGp
43//
44// This routine is used to write the current value of 64-bit Global Pointer (GP).
45//
46// Arguments :
47//
48// On Entry : The value need to be written.
49//
50// Return Value: The value have been written.
51//
52//--
53//----------------------------------------------------------------------------------
54.text
55.type   AsmWriteGp, @function
56.proc   AsmWriteGp
57.regstk 1, 0, 0, 0
58
59AsmWriteGp::
60        mov             gp = in0
61        mov             r8 = in0;;
62        br.ret.dpnt     b0;;
63.endp   AsmWriteGp
64
65//---------------------------------------------------------------------------------
66//++
67// AsmReadSp
68//
69// This routine is used to read the current value of 64-bit Stack Pointer (SP).
70//
71// Arguments :
72//
73// On Entry :
74//
75// Return Value: The current SP value.
76//
77//--
78//----------------------------------------------------------------------------------
79.text
80.type   AsmReadSp, @function
81.proc   AsmReadSp
82
83AsmReadSp::
84        mov             r8 = sp;;
85        br.ret.dpnt     b0;;
86.endp   AsmReadSp
87