QEMU/KVM Firmware Configuration access\r
\r
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (C) 2013, Red Hat, Inc.\r
+\r
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
Returns a boolean indicating if the firmware configuration interface\r
is available or not.\r
\r
+ This function may change fw_cfg state.\r
+\r
@retval TRUE The interface is available\r
@retval FALSE The interface is not available\r
\r
OUT FIRMWARE_CONFIG_ITEM *Item,\r
OUT UINTN *Size\r
);\r
+\r
+\r
+/**\r
+ Returns a boolean indicating if the firmware configuration interface is\r
+ available for library-internal purposes.\r
+\r
+ This function never changes fw_cfg state.\r
+\r
+ @retval TRUE The interface is available internally.\r
+ @retval FALSE The interface is not available internally.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+InternalQemuFwCfgIsAvailable (\r
+ VOID\r
+ );\r
+\r
#endif\r
\r
/** @file\r
\r
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (C) 2013, Red Hat, Inc.\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Returns a boolean indicating if the firmware configuration interface\r
is available or not.\r
\r
+ This function may change fw_cfg state.\r
+\r
@retval TRUE The interface is available\r
@retval FALSE The interface is not available\r
\r
VOID\r
)\r
{\r
- return mQemuFwCfgSupported;\r
+ return InternalQemuFwCfgIsAvailable ();\r
}\r
\r
\r
IN VOID *Buffer\r
)\r
{\r
- if (mQemuFwCfgSupported) {\r
+ if (InternalQemuFwCfgIsAvailable ()) {\r
InternalQemuFwCfgReadBytes (Size, Buffer);\r
} else {\r
ZeroMem (Buffer, Size);\r
IN VOID *Buffer\r
)\r
{\r
- if (mQemuFwCfgSupported) {\r
+ if (InternalQemuFwCfgIsAvailable ()) {\r
IoWriteFifo8 (0x511, Size, Buffer);\r
}\r
}\r
UINT32 Count;\r
UINT32 Idx;\r
\r
- if (!mQemuFwCfgSupported) {\r
+ if (!InternalQemuFwCfgIsAvailable ()) {\r
return RETURN_UNSUPPORTED;\r
}\r
\r
\r
return RETURN_NOT_FOUND;\r
}\r
+\r
+\r
+/**\r
+ Returns a boolean indicating if the firmware configuration interface is\r
+ available for library-internal purposes.\r
+\r
+ This function never changes fw_cfg state.\r
+\r
+ @retval TRUE The interface is available internally.\r
+ @retval FALSE The interface is not available internally.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+InternalQemuFwCfgIsAvailable (\r
+ VOID\r
+ )\r
+{\r
+ return mQemuFwCfgSupported;\r
+}\r