blob: ace017673f9aa8d89d6ada74d79e7024d049d750 [file] [log] [blame]
Frank Vibrans2b4c8312011-02-14 18:30:54 +00001/* $NoKeywords:$ */
2/**
3 * @file
4 *
5 * AMD AGESA Input Structure Creation
6 *
7 * Contains AGESA input creation structures.
8 *
9 * @xrefitem bom "File Content Label" "Release Content"
10 * @e project: AGESA
11 * @e sub-project: Common
12 * @e \$Revision: 34897 $ @e \$Date: 2010-07-14 10:07:10 +0800 (Wed, 14 Jul 2010) $
13 *
14 */
15/*
16 *****************************************************************************
17 *
18 * Copyright (c) 2011, Advanced Micro Devices, Inc.
19 * All rights reserved.
Edward O'Callaghane963b382014-07-06 19:27:14 +100020 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000021 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions are met:
23 * * Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * * Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
Edward O'Callaghane963b382014-07-06 19:27:14 +100028 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
29 * its contributors may be used to endorse or promote products derived
Frank Vibrans2b4c8312011-02-14 18:30:54 +000030 * from this software without specific prior written permission.
Edward O'Callaghane963b382014-07-06 19:27:14 +100031 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000032 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
36 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
39 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Edward O'Callaghane963b382014-07-06 19:27:14 +100042 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000043 * ***************************************************************************
44 *
45 */
46
47#ifndef _CREATE_STRUCT_H_
48#define _CREATE_STRUCT_H_
49
50/**
51 * A constructor method.
52 *
53 * Sets inputs to valid, basic level, defaults for the specific service instance.
54 * Constructors should avoid using the header, since these routines should not
55 * do operations which may fail or require status back to the user. The constructor
56 * should always SUCCEED.
57 *
58 * @param[in] StdHeader Opaque handle to standard config header
59 * @param[in] ServiceInterface Service Interface structure to initialize.
60 *
61 * @retval AGESA_SUCCESS Constructors are not allowed to fail
62*/
63typedef AGESA_STATUS
64F_AGESA_FUNCTION (
65 IN AMD_CONFIG_PARAMS *StdHeader,
66 IN VOID *ServiceInterface
67 );
68
69/// Reference to a Method.
70typedef F_AGESA_FUNCTION *PF_AGESA_FUNCTION;
71
72/**
73 * A Destructor method.
74 *
75 * Sets inputs to valid, basic level, defaults for the specific service instance.
76 * The constructor should always SUCCEED.
77 *
78 * @param[in] StdHeader Opaque handle to standard config header.
79 * @param[in] ServiceInterface Service Interface structure to initialize.
80 *
81 * @retval AGESA_SUCCESS Constructors are not allowed to fail
82*/
83typedef AGESA_STATUS
84F_AGESA_DESTRUCTOR (
85 IN AMD_CONFIG_PARAMS *StdHeader,
86 IN VOID *ServiceInterface
87 );
88
89/// Reference to a Method.
90typedef F_AGESA_DESTRUCTOR *PF_AGESA_DESTRUCTOR;
91
92/**
93 * Provide the information needed to invoke each service constructor.
94 */
95typedef struct {
96 IN AGESA_STRUCT_NAME AgesaFunctionName; ///< Identifies the service
97 IN UINT16 CreateStructSize; ///< The service's input struct size.
98 /// Do NOT include a config params header!
99 OUT PF_AGESA_FUNCTION AgesaFunction; ///< The constructor function
100 OUT PF_AGESA_DESTRUCTOR AgesaDestructor; ///< The destructor function.
efdesign9884cbce22011-08-04 12:09:17 -0600101 IN UINT32 BufferHandle; ///< The buffer handle id for the service.
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000102} FUNCTION_PARAMS_INFO;
103
104/**
105 * All available services have their constructor info here.
106 */
107AGESA_STATUS
108AmdInitResetConstructor (
109 IN AMD_CONFIG_PARAMS *StdHeader,
110 IN AMD_RESET_PARAMS *AmdResetParams
111 );
112
113AGESA_STATUS
114AmdInitRecoveryInitializer (
115 IN AMD_CONFIG_PARAMS *StdHeader,
116 IN OUT AMD_RECOVERY_PARAMS *AmdRecoveryParamsPtr
117 );
118
119AGESA_STATUS
120AmdInitEarlyInitializer (
121 IN AMD_CONFIG_PARAMS *StdHeader,
122 IN OUT AMD_EARLY_PARAMS *EarlyParams
123 );
124
125AGESA_STATUS
126AmdInitPostInitializer (
127 IN AMD_CONFIG_PARAMS *StdHeader,
128 IN OUT AMD_POST_PARAMS *PostParamsPtr
129 );
130
131AGESA_STATUS
132AmdInitPostDestructor (
133 IN AMD_CONFIG_PARAMS *StdHeader,
134 IN AMD_POST_PARAMS *PostParamsPtr
135 );
136
137AGESA_STATUS
138AmdInitEnvInitializer (
139 IN AMD_CONFIG_PARAMS *StdHeader,
140 IN OUT AMD_ENV_PARAMS *EnvParamsPtr
141 );
142
143AGESA_STATUS
144AmdInitMidInitializer (
145 IN AMD_CONFIG_PARAMS *StdHeader,
146 IN OUT AMD_MID_PARAMS *MidParamsPtr
147 );
148
149AGESA_STATUS
150AmdInitLateInitializer (
151 IN AMD_CONFIG_PARAMS *StdHeader,
152 IN OUT AMD_LATE_PARAMS *LateParamsPtr
153 );
154
155AGESA_STATUS
156AmdInitLateDestructor (
157 IN AMD_CONFIG_PARAMS *StdHeader,
158 IN AMD_LATE_PARAMS *LateParamsPtr
159 );
160
161AGESA_STATUS
162AmdInitResumeInitializer (
163 IN AMD_CONFIG_PARAMS *StdHeader,
164 IN OUT AMD_RESUME_PARAMS *ResumeParams
165 );
166
167AGESA_STATUS
168AmdInitResumeDestructor (
169 IN AMD_CONFIG_PARAMS *StdHeader,
170 IN OUT AMD_RESUME_PARAMS *ResumeParams
171 );
172
173AGESA_STATUS
174AmdS3SaveInitializer (
175 IN OUT AMD_CONFIG_PARAMS *StdHeader,
176 IN OUT AMD_S3SAVE_PARAMS *S3SaveParams
177 );
178
179AGESA_STATUS
180AmdS3SaveDestructor (
181 IN AMD_CONFIG_PARAMS *StdHeader,
182 IN OUT AMD_S3SAVE_PARAMS *S3SaveParams
183 );
184
185AGESA_STATUS
186AmdS3LateRestoreInitializer (
187 IN AMD_CONFIG_PARAMS *StdHeader,
188 IN OUT AMD_S3LATE_PARAMS *S3LateParams
189 );
190
191AGESA_STATUS
192AmdLateRunApTaskInitializer (
193 IN AMD_CONFIG_PARAMS *StdHeader,
194 IN OUT AP_EXE_PARAMS *AmdApExeParams
195 );
196#endif // _CREATE_STRUCT_H_
197