summaryrefslogtreecommitdiff
path: root/ReferenceCode/Chipset/SystemAgent/MemoryInit/Pei/Source/Include/MrcTypes.h
blob: e445942d781be5d29bb405d8b6620e9c0e783baf (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
/** @file

  Include the the general MRC types

@copyright
  Copyright (c) 1999 - 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 uniquely
  identified as "Intel Reference Module" 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 _MRC_TYPES_H
#define _MRC_TYPES_H

//
// Data Types
//
typedef unsigned long long  U64;
typedef unsigned long       U32;
typedef unsigned short      U16;
typedef unsigned char       U8;
typedef signed long long    S64;
typedef signed long         S32;
typedef signed short        S16;
typedef signed char         S8;
typedef unsigned char       MrcBool;

#ifndef BOOL
#undef FALSE
#undef TRUE
typedef enum {
  FALSE = (0 == 1),
  TRUE  = (1 == 1)
} BOOL;
#endif

#ifndef NULL
#define NULL  ((void *) 0)
#endif

#ifndef IN
#define IN
#endif

#ifndef OPTIONAL
#define OPTIONAL
#endif

#ifndef OUT
#define OUT
#endif

#define UNSUPPORT 0
#define SUPPORT   1

typedef enum {
  mrcSuccess,
  mrcFail,
  mrcWrongInputParameter,
  mrcCasError,
  mrcTimingError,
  mrcSenseAmpErr,
  mrcReadMPRErr,
  mrcReadLevelingError,
  mrcWriteLevelingError,
  mrcDataTimeCentering1DErr,
  mrcWriteVoltage2DError,
  mrcReadVoltage2DError,
  mrcWrError,
  mrcDimmNotSupport,
  mrcChannelNotSupport,
  mrcPiSettingError,
  mrcDqsPiSettingError,
  mrcDeviceBusy,
  mrcFrequencyChange,
  mrcReutSequenceError,
  mrcCrcError,
  mrcFrequencyError,
  mrcDimmNotExist,
  mrcColdBootRequired,
  mrcRoundTripLatencyError,
  mrcMixedDimmSystem,
  mrcAliasDetected,
  mrcRetrain
} MrcStatus;

//
// general  macros
//
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif

#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif

#ifndef ABS
#define ABS(x)  (((x) < 0) ? (-(x)) : (x))
#endif
//
//  use for ignore parames
//
// #define MRC_IGNORE_PARAM(x) ((x) = (x))
//
#if _MSC_EXTENSIONS
//
// Disable warning that make it impossible to compile at /W4
// This only works for Microsoft* tools
//
//
// Disabling bitfield type checking warnings.
//
#pragma warning (disable : 4214)
//
// Unreferenced formal parameter - We are object oriented, so we pass parameters even
//  if we don't need them.
//
#pragma warning (disable : 4100)
//
// ASSERT(FALSE) or while (TRUE) are legal constructs so supress this warning
//
#pragma warning(disable : 4127)

#endif // _MSC_EXTENSIONS
#define MRC_BIT0  0x00000001
#define MRC_BIT1  0x00000002
#define MRC_BIT2  0x00000004
#define MRC_BIT3  0x00000008
#define MRC_BIT4  0x00000010
#define MRC_BIT5  0x00000020
#define MRC_BIT6  0x00000040
#define MRC_BIT7  0x00000080
#define MRC_BIT8  0x00000100
#define MRC_BIT9  0x00000200
#define MRC_BIT10 0x00000400
#define MRC_BIT11 0x00000800
#define MRC_BIT12 0x00001000
#define MRC_BIT13 0x00002000
#define MRC_BIT14 0x00004000
#define MRC_BIT15 0x00008000
#define MRC_BIT16 0x00010000
#define MRC_BIT17 0x00020000
#define MRC_BIT18 0x00040000
#define MRC_BIT19 0x00080000
#define MRC_BIT20 0x00100000
#define MRC_BIT21 0x00200000
#define MRC_BIT22 0x00400000
#define MRC_BIT23 0x00800000
#define MRC_BIT24 0x01000000
#define MRC_BIT25 0x02000000
#define MRC_BIT26 0x04000000
#define MRC_BIT27 0x08000000
#define MRC_BIT28 0x10000000
#define MRC_BIT29 0x20000000
#define MRC_BIT30 0x40000000
#define MRC_BIT31 0x80000000

#define MRC_DEADLOOP() { volatile int __iii; __iii = 1; while (__iii); }

#ifndef ASM
#define ASM __asm
#endif

#endif