+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2004, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- VfrServices.h\r
-\r
-Abstract:\r
-\r
- Prototypes and defines for routines and classes used by the\r
- EFI VFR compiler.\r
- \r
---*/\r
-\r
-#ifndef _VFR_SERVICES_H_\r
-#define _VFR_SERVICES_H_\r
-\r
-class VfrOpcodeHandler\r
-{\r
-public:\r
- VfrOpcodeHandler (\r
- VOID\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- Constructor for the VFR opcode handling class.\r
- \r
-Arguments:\r
- None\r
-\r
-Returns:\r
- None\r
-\r
---*/\r
- ;\r
- ~VfrOpcodeHandler (\r
- VOID\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- Destructor for the VFR opcode handler. Free up memory allocated\r
- while parsing the VFR script.\r
- \r
-Arguments:\r
- None\r
-\r
-Returns:\r
- None\r
-\r
---*/\r
- ;\r
- void\r
- WriteIfrBytes (\r
- VOID\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- This function is invoked at the end of parsing. Its purpose\r
- is to write out all the IFR bytes that were queued up while\r
- parsing.\r
- \r
-Arguments:\r
- None\r
-\r
-Returns:\r
- None\r
-\r
---*/\r
- ;\r
- int\r
- AddOpcodeByte (\r
- UINT8 OpcodeByte,\r
- UINT32 LineNum\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- This function is invoked by the parser when a new IFR\r
- opcode should be emitted.\r
- \r
-Arguments:\r
- OpcodeByte - the IFR opcode\r
- LineNum - the line number from the source file that resulted\r
- in the opcode being emitted.\r
-\r
-Returns:\r
- 0 always\r
-\r
---*/\r
- ;\r
- void\r
- AddByte (\r
- UINT8 ByteVal,\r
- UINT8 KeyByte\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- This function is invoked by the parser when it determines\r
- that more raw IFR bytes should be emitted to the output stream.\r
- Here we just queue them up into an output buffer.\r
- \r
-Arguments:\r
- ByteVal - the raw byte to emit to the output IFR stream\r
- KeyByte - a value that can be used for debug. \r
-\r
-Returns:\r
- None\r
-\r
---*/\r
- ;\r
- void\r
- SetVarStoreId (\r
- UINT16 VarStoreId\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- This function is invoked by the parser when a variable is referenced in the \r
- VFR. Save the variable store (and set a flag) so that we can later determine \r
- if we need to emit a varstore-select or varstore-select-pair opcode.\r
- \r
-Arguments:\r
- VarStoreId - ID of the variable store referenced in the VFR\r
-\r
-Returns:\r
- None\r
-\r
---*/\r
- ;\r
- void\r
- SetSecondaryVarStoreId (\r
- UINT16 VarStoreId\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- This function is invoked by the parser when a secondary variable is \r
- referenced in the VFR. Save the variable store (and set a flag) so \r
- that we can later determine if we need to emit a varstore-select or \r
- varstore-pair opcode.\r
- \r
-Arguments:\r
- VarStoreId - ID of the variable store referenced in the VFR\r
-\r
-Returns:\r
- None\r
-\r
---*/\r
- ;\r
-\r
-/* */\r
-private:\r
- int\r
- FlushQueue (\r
- VOID\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- This function is invoked to flush the internal IFR buffer.\r
- \r
-Arguments:\r
- None\r
-\r
-Returns:\r
- 0 always\r
-\r
---*/\r
- ;\r
- int\r
- IAddByte (\r
- UINT8 ByteVal,\r
- UINT8 KeyByte,\r
- UINT32 LineNum\r
- )\r
- /*++\r
-\r
-Routine Description:\r
- This internal function is used to add actual IFR bytes to\r
- the output stream. Most other functions queue up the bytes\r
- in an internal buffer. Once they come here, there's no\r
- going back.\r
-\r
- \r
-Arguments:\r
- ByteVal - value to write to output \r
- KeyByte - key value tied to the byte -- useful for debug\r
- LineNum - line number from source file the byte resulted from\r
-\r
-Returns:\r
- 0 - if successful\r
- 1 - failed due to memory allocation failure\r
-\r
---*/\r
- ;\r
-\r
-/* */\r
-private:\r
- IFR_BYTE *mIfrBytes;\r
- IFR_BYTE *mLastIfrByte;\r
- UINT32 mQueuedByteCount;\r
- UINT32 mBytesWritten;\r
- UINT32 mQueuedLineNum;\r
- UINT8 mQueuedBytes[MAX_QUEUE_COUNT];\r
- UINT8 mQueuedKeyBytes[MAX_QUEUE_COUNT];\r
- UINT8 mQueuedOpcodeByte;\r
- UINT32 mQueuedOpcodeByteValid;\r
- UINT16 mPrimaryVarStoreId;\r
- UINT8 mPrimaryVarStoreIdSet;\r
- UINT16 mSecondaryVarStoreId;\r
- UINT8 mSecondaryVarStoreIdSet;\r
- UINT16 mDefaultVarStoreId;\r
-};\r
-\r
-#endif // #ifndef _VFR_SERVICES_H_\r