Add constants for fast path resume copying
[coreboot.git] / src / vendorcode / amd / agesa / f14 / Proc / CPU / cahalt64.asm
1 ;/**
2 ; * @file
3 ; *
4 ; * Agesa pre-memory miscellaneous support, including ap halt loop.
5 ; *
6 ; * @xrefitem bom "File Content Label" "Release Content"
7 ; * @e project:      AGESA
8 ; * @e sub-project:  CPU
9 ; * @e \$Revision: 10071 $   @e \$Date: 2008-12-16 18:03:04 -0600 (Tue, 16 Dec 2008) $
10 ; */
11 ;*****************************************************************************
12
13 ;  Copyright (c) 2011, Advanced Micro Devices, Inc.
14 ;  All rights reserved.
15 ;  
16 ;  Redistribution and use in source and binary forms, with or without
17 ;  modification, are permitted provided that the following conditions are met:
18 ;      * Redistributions of source code must retain the above copyright
19 ;        notice, this list of conditions and the following disclaimer.
20 ;      * Redistributions in binary form must reproduce the above copyright
21 ;        notice, this list of conditions and the following disclaimer in the
22 ;        documentation and/or other materials provided with the distribution.
23 ;      * Neither the name of Advanced Micro Devices, Inc. nor the names of 
24 ;        its contributors may be used to endorse or promote products derived 
25 ;        from this software without specific prior written permission.
26 ;  
27 ;  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
28 ;  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29 ;  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 ;  DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
31 ;  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32 ;  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33 ;  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
34 ;  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ;  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 ;  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 ;  
38 ;*****************************************************************************
39
40  text  SEGMENT
41
42
43 ;======================================================================
44 ; ExecuteFinalHltInstruction:  Performs a hlt instruction.
45 ;
46 ;   In:
47 ;       None
48 ;
49 ;   Out:
50 ;       None
51 ;
52 ;   Destroyed:
53 ;       eax, ebx, ecx, edx, esp
54 ;
55 ;======================================================================
56 ExecuteFinalHltInstruction PROC PUBLIC
57 @@:
58     cli
59     hlt
60     jmp @B ;ExecuteHltInstruction
61 ExecuteFinalHltInstruction ENDP
62
63 ;======================================================================
64 ; ExecuteHltInstruction:  Performs a hlt instruction.
65 ;
66 ;   In:
67 ;       None
68 ;
69 ;   Out:
70 ;       None
71 ;
72 ;   Destroyed:
73 ;       eax, ebx, ecx, edx, esp
74 ;
75 ;======================================================================
76 ExecuteHltInstruction PROC PUBLIC
77     cli
78     hlt
79     ret
80 ExecuteHltInstruction ENDP
81
82 ;======================================================================
83 ; NmiHandler:  Simply performs an IRET.
84 ;
85 ;   In:
86 ;       None
87 ;
88 ;   Out:
89 ;       None
90 ;
91 ;   Destroyed:
92 ;       None
93 ;
94 ;======================================================================
95 NmiHandler PROC PUBLIC
96     iretq
97 NmiHandler ENDP
98
99 ;======================================================================
100 ; GetCsSelector:  Returns the current protected mode CS selector.
101 ;
102 ;   In:
103 ;       None
104 ;
105 ;   Out:
106 ;       None
107 ;
108 ;   Destroyed:
109 ;       None
110 ;
111 ;======================================================================
112 GetCsSelector PROC PUBLIC
113     ; This stub function is here to avoid compilation errors.
114     ; At this time, there is no need to provide a 64 bit function.
115     ret
116 GetCsSelector ENDP
117
118 ;======================================================================
119 ; SetIdtr:
120 ;
121 ;   In:
122 ;       None
123 ;
124 ;   Out:
125 ;       None
126 ;
127 ;   Destroyed:
128 ;       none
129 ;
130 ; WARNING: This routine has a mirror routine in the PREMEM segment.
131 ;   These two routines MUST be sync'd for content.
132 ;======================================================================
133 SetIdtr PROC PUBLIC
134     ; This stub function is here to avoid compilation errors.
135     ; At this time, there is no need to provide a 64 bit function.
136     ret
137 SetIdtr ENDP
138
139 ;======================================================================
140 ; ExecuteWbinvdInstruction:  Performs a wbinvd instruction.
141 ;
142 ;   In:
143 ;       None
144 ;
145 ;   Out:
146 ;       None
147 ;
148 ;   Destroyed:
149 ;       None
150 ;
151 ;======================================================================
152 ExecuteWbinvdInstruction PROC PUBLIC
153     wbinvd                        ; Write back the cache tag RAMs
154     ret
155 ExecuteWbinvdInstruction ENDP
156
157 END