summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5b86bbf)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2798
The services in CpuLib usually generate exceptions in a unit test
host application. Provide a Null instance that can be safely used.
This Null instance can also be used as a template for implementing
new instances of CpuLib.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
--- /dev/null
+/** @file\r
+ Null instance of CPU Library.\r
+\r
+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+/**\r
+ Places the CPU in a sleep state until an interrupt is received.\r
+\r
+ Places the CPU in a sleep state until an interrupt is received. If interrupts\r
+ are disabled prior to calling this function, then the CPU will be placed in a\r
+ sleep state indefinitely.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuSleep (\r
+ VOID\r
+ )\r
+{\r
+}\r
+\r
+/**\r
+ Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+\r
+ Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuFlushTlb (\r
+ VOID\r
+ )\r
+{\r
+}\r
--- /dev/null
+## @file\r
+# Null instance of CPU Library.\r
+#\r
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = BaseCpuLibNull\r
+ MODULE_UNI_FILE = BaseCpuLibNull.uni\r
+ FILE_GUID = 8A29AAA5-0FB7-44CC-8709-1344FE89B878\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = CpuLib\r
+\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 RISCV64\r
+#\r
+\r
+[Sources]\r
+ BaseCpuLibNull.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
--- /dev/null
+// /** @file\r
+// Null instance of CPU Library.\r
+//\r
+// Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+// SPDX-License-Identifier: BSD-2-Clause-Patent\r
+//\r
+// **/\r
+\r
+#string STR_MODULE_ABSTRACT #language en-US "Null Instance of CPU Library"\r
+\r
+#string STR_MODULE_DESCRIPTION #language en-US "Null instance of CPU Library."\r
## @file\r
# EFI/PI MdePkg Package\r
#\r
## @file\r
# EFI/PI MdePkg Package\r
#\r
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>\r
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
#\r
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
#\r
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf\r
MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf\r
MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
+ MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.inf\r
MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf\r
MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf\r
MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r