3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Prototypes and defines for routines and classes used by the
23 #ifndef _VFR_SERVICES_H_
24 #define _VFR_SERVICES_H_
26 class VfrOpcodeHandler
35 Constructor for the VFR opcode handling class.
51 Destructor for the VFR opcode handler. Free up memory allocated
52 while parsing the VFR script.
69 This function is invoked at the end of parsing. Its purpose
70 is to write out all the IFR bytes that were queued up while
89 This function is invoked by the parser when a new IFR
90 opcode should be emitted.
93 OpcodeByte - the IFR opcode
94 LineNum - the line number from the source file that resulted
95 in the opcode being emitted.
110 This function is invoked by the parser when it determines
111 that more raw IFR bytes should be emitted to the output stream.
112 Here we just queue them up into an output buffer.
115 ByteVal - the raw byte to emit to the output IFR stream
116 KeyByte - a value that can be used for debug.
130 This function is invoked by the parser when a variable is referenced in the
131 VFR. Save the variable store (and set a flag) so that we can later determine
132 if we need to emit a varstore-select or varstore-select-pair opcode.
135 VarStoreId - ID of the variable store referenced in the VFR
143 SetSecondaryVarStoreId (
149 This function is invoked by the parser when a secondary variable is
150 referenced in the VFR. Save the variable store (and set a flag) so
151 that we can later determine if we need to emit a varstore-select or
152 varstore-pair opcode.
155 VarStoreId - ID of the variable store referenced in the VFR
172 This function is invoked to flush the internal IFR buffer.
191 This internal function is used to add actual IFR bytes to
192 the output stream. Most other functions queue up the bytes
193 in an internal buffer. Once they come here, there's no
198 ByteVal - value to write to output
199 KeyByte - key value tied to the byte -- useful for debug
200 LineNum - line number from source file the byte resulted from
204 1 - failed due to memory allocation failure
212 IFR_BYTE
*mLastIfrByte
;
213 UINT32 mQueuedByteCount
;
214 UINT32 mBytesWritten
;
215 UINT32 mQueuedLineNum
;
216 UINT8 mQueuedBytes
[MAX_QUEUE_COUNT
];
217 UINT8 mQueuedKeyBytes
[MAX_QUEUE_COUNT
];
218 UINT8 mQueuedOpcodeByte
;
219 UINT32 mQueuedOpcodeByteValid
;
220 UINT16 mPrimaryVarStoreId
;
221 UINT8 mPrimaryVarStoreIdSet
;
222 UINT16 mSecondaryVarStoreId
;
223 UINT8 mSecondaryVarStoreIdSet
;
224 UINT16 mDefaultVarStoreId
;
227 #endif // #ifndef _VFR_SERVICES_H_