summaryrefslogtreecommitdiff
path: root/Core/EM/AMIDebugRx/binaries/LIBS/DbgrX64Lib/AsmDbgrx64Libs.h
blob: ade7358012943e4a4e1dbd757cde1a0d2229d4c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//**                                                             **//
//**         (C)Copyright 2009, American Megatrends, Inc.        **//
//**                                                             **//
//**                     All Rights Reserved.                    **//
//**                                                             **//
//**   5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093  **//
//**                                                             **//
//**                     Phone (770)-246-8600                    **//
//**                                                             **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
// $Header: /Alaska/BIN/Modules/AMIDebugRx/binaries/LIBS/DbgrX64Lib/AsmDbgrx64Libs.h 4     3/13/12 10:52a Sudhirv $
//
// $Revision: 4 $
//
// $Date: 3/13/12 10:52a $
//*****************************************************************
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Modules/AMIDebugRx/binaries/LIBS/DbgrX64Lib/AsmDbgrx64Libs.h $
// 
// 4     3/13/12 10:52a Sudhirv
// [TAG]  		EIP60224
// [Category]  	Improvement
// [Description]  Function implement When broken in SMM, show the register
// context for 'outside' SMM.
// 
// [TAG]  		EIP80406
// [Category]  	Improvement
// [Description]  Debugger support for Dynamic pci express base token
// 
// [TAG]  		EIP81423
// [Category]  	Improvement
// [Description]  VeB Debugger - Improve the EFI tab's Handle Display
// feature
// 
// [TAG]  		EIP84201
// [Category]  	Improvement
// [Description]  AMIDebugRx\Debugger Target modules usage of the Port 80
// must be controlable
// 
// 3     9/22/10 7:09p Sudhirv
// 4.6.2_AMIDebugRx_2.01.0026_Beta Release
// 
// 2     7/17/09 7:15p Madhans
// DebugRx 1.30.0022
// 
// 3     7/16/09 3:07p Madhans
// To fix the Serial Debugger issuel and To do cleanup.
// 
// 2     7/13/09 2:44p Sudhirv
// Updated with Coding Standards
// 
// 1     7/07/09 4:46p Sudhirv
// Restructure Binaries Created
// 
// 1     5/01/09 7:48p Madhans
// AMIDebug Rx Module. Intial Checkin.
// 
// 1     4/29/09 7:51a Sudhirv
// AMI Debug Rx module created
// 
// 3     9/07/07 12:07a Madhans
// 1.07.0008 Eng Release
// 
// 7     6/13/07 3:16p Madhans
// Copyright Year updated.
// 
// 6     2/23/07 5:34p Madhans
// EnableMasterPICIRQ function added
// 
// 5     1/22/07 11:36a Madhans
// Modification made for Binary Release 1.04.0003.
// 
// 2     1/05/07 1:05p Ashrafj
// Latest version 1.04.0001 Beta
// Known issues from previous 1.04.000 Beta release has been fixed.
// 
//**********************************************************************
//*****************************************************************
//*****************************************************************

//**********************************************************************
//<AMI_FHDR_START>
//
// Name:	AsmDbgrx64Libs.h
//
// Description:	File containing the Prototypes for the library functions
//				
//
//<AMI_FHDR_END>
//**********************************************************************

#include "Efi.h"

UINT8
DbgrIoRead8 (
  IN  UINT64    Address
  )
/*++

Routine Description:
  Do a one byte IO read

Arguments:
  Address - IO address to read

Returns: 
  Data read

--*/
;
VOID
DbgrIoWrite8 (
  IN  UINT64    Address,
  IN  UINT8     Data
  )
/*++

Routine Description:
  Do a one byte IO write

Arguments:
  Address - IO address to write
  Data    - Data to write to Address

Returns: 
  NONE

--*/
;
void DbgrDisableInterrupt();
void DbgrRestoreInterrupt();

void DebugWriteChkPort(UINT8 DbgChkPoint);

UINT32 ReadPCIConfigSpace(IN UINT32	PCIAddr);
VOID	WritePCIConfigSpace(UINT32	PCIAddr,UINT32 Data);

void DisableMasterPICIRQ(UINT8 IrqBit);
void EnableMasterPICIRQ(UINT8 IrqBit);

#define DISABLE_INTx64 DbgrDisableInterrupt()
#define RESTORE_INTx64 DbgrRestoreInterrupt()

void	DisableDebugFeature(UINTN *pStoreDr7);
void	EnableDebugFeature(UINTN *pLoadDr7);

VOID	SetHWBreakpointX64_DR2(UINTN	Address);
VOID	DisableIF(VOID);
VOID	EnableIF(VOID);
void 	EnableBreakpointOnIO();
void 	DisableBreakpointOnIO();
VOID	GetIdtr(VOID *addr);

UINT8 	IoReadByte(UINT16 Port);
VOID 	IoWriteByte(UINT16 Port, UINT8 Value);
UINT32 	GetCPUInfo0(VOID);
UINT32 	GetCPUInfo4(VOID);
UINT32 	GetCPUInfo8(VOID);
UINT32 	GetVersion(VOID);
UINT32 	GetFeature(VOID);
UINT8 ReadIoAsm8(UINT16 Port);
VOID WriteIoAsm8 (UINT16 Port,UINT8 Val);
UINT16 	IoReadWord(UINT16 Port);
VOID 	IoWriteWord(UINT16 Port, UINT16 Value);
UINT32	IoReadDword(UINT16 Port);
VOID 	IoWriteDword(UINT16 Port, UINT32 Value);
VOID	SET_SOFTWAREBREAKPOINT();

// For IndirectIO Support
UINT8 	IIoReadByte(UINT16 DataPort, UINT16 IndexPort, UINT16 Port);
VOID 	IIoWriteByte(UINT16 DataPort, UINT16 IndexPort, UINT16 Port, UINT8 Value);
UINT16 	IIoReadWord(UINT16 DataPort, UINT16 IndexPort, UINT16 Port);
VOID 	IIoWriteWord(UINT16 DataPort, UINT16 IndexPort, UINT16 Port, UINT16 Value);
UINT32	IIoReadDword(UINT16 DataPort, UINT16 IndexPort, UINT16 Port);
VOID 	IIoWriteDword(UINT16 DataPort, UINT16 IndexPort, UINT16 Port, UINT32 Value);
UINT64	GetCpuTmr();

//EIP 80406 - Debugger support for Dynamic pci express base token
UINT32 IoRead32(UINT16);
VOID IoWrite32(UINT16 Port, UINT32 Value);
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//**                                                             **//
//**         (C)Copyright 2009, American Megatrends, Inc.        **//
//**                                                             **//
//**                     All Rights Reserved.                    **//
//**                                                             **//
//**   5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093  **//
//**                                                             **//
//**                     Phone (770)-246-8600                    **//
//**                                                             **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//