summaryrefslogtreecommitdiff
path: root/ReferenceCode/Haswell/CpuInit/Dxe/x64/CpuLib.h
blob: 14699c13414c5b26d70e0dae0907e1a4fdc8eda4 (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
/** @file
  Library functions that can be called in both PEI and DXE phase

@copyright
  Copyright (c) 2004 - 2012 Intel Corporation. All rights reserved
  This software and associated documentation (if any) is furnished
  under a license and may only be used or copied in accordance
  with the terms of the license. Except as permitted by such
  license, no part of this software or documentation may be
  reproduced, stored in a retrieval system, or transmitted in any
  form or by any means without the express written consent of
  Intel Corporation.

  This file contains an 'Intel Peripheral Driver' and is
  licensed for Intel CPUs and chipsets under the terms of your
  license agreement with Intel or your vendor.  This file may
  be modified by the user, subject to additional terms of the
  license agreement
**/
#ifndef _CPU_LIB_H_
#define _CPU_LIB_H_

#if 0
UINTN
CpuReadCr0 (
  VOID
  )
/**
@brief
  Get CR0 value

  @param[in] None

  @retval CR0 value
**/
;

VOID
CpuWriteCr0 (
  UINTN   Value
  )
/**
@brief
  Write CR0 register

  @param[in] Value - Value that will be written into CR0 register
**/
;

UINTN
CpuReadCr3 (
  VOID
  )
/**
@brief
  Get CR3 register value

  @param[in] None

  @retval CR3 register value
**/
;

VOID
CpuWriteCr3 (
  UINTN   Value
  )
/**
@brief
  Write CR3 register

  @param[in] Value - Value that will be written to CR3 register
**/
;

UINTN
CpuSetPower2 (
  IN  UINTN   Input
  )
/**
@brief
  Calculate the power 2 value from the Input value

  @param[in] Input - The number that will be calculated

  @retval Power 2 value after calculated
**/
;

UINT64
CpuReadTsc (
  VOID
  )
/**
@brief
  Read CPU TSC value

  @param[in] None

  @retval TSC value
**/
;

VOID
CpuBreak (
  VOID
  )
/**
@brief
  Break by INT3

  @param[in] None
**/
;

VOID
CpuInitSelectors (
  VOID
  )
/**
@brief
  Initialize selectors by calling INT 68

  @param[in] None
**/
;

#endif

UINT16
CpuCodeSegment (
  VOID
  )
/**
@brief
  Return code segment address - CS

  @param[in] None

  @retval Code segment address
**/
;

VOID
CpuLoadGlobalDescriptorTable (
  VOID  *Table16ByteAligned
  )
/**
@brief
  Get current GDT descriptor

  @param[in] Table16ByteAligned  - the table buffer that will store current GDT table descriptor
**/
;

VOID
CpuLoadInterruptDescriptorTable (
  VOID  *Table16ByteAligned
  )
/**
@brief
  Get current IDT descriptor

  @param[in] Table16ByteAligned  - the table buffer that will store current GDT table descriptor
**/
;

#endif