From e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Fri, 22 Jun 2007 03:21:45 +0000 Subject: Import some basic libraries instances for Mde Packages. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2704 6f19259b-4bc3-4df7-8a09-765794883524 --- .../BaseTimerLibNullTemplate.inf | 83 +++++++++++++++ .../BaseTimerLibNullTemplate.msa | 45 ++++++++ .../BaseTimerLibNullTemplate/CommonHeader.h | 32 ++++++ .../BaseTimerLibNullTemplate/TimerLibNull.c | 116 +++++++++++++++++++++ 4 files changed, 276 insertions(+) create mode 100644 MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf create mode 100644 MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.msa create mode 100644 MdePkg/Library/BaseTimerLibNullTemplate/CommonHeader.h create mode 100644 MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c (limited to 'MdePkg/Library/BaseTimerLibNullTemplate') diff --git a/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf b/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf new file mode 100644 index 0000000000..5a48211afc --- /dev/null +++ b/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf @@ -0,0 +1,83 @@ +#/** @file +# Timer library NULL template implementaton +# +# A non-functional instance of the Timer Library that can be used as a template +# for the implementation of a functional timer library instance. This library instance can +# also be used to test build DXE, Runtime, DXE SAL, and DXE SMM modules that require timer +# services as well as EBC modules that require timer services +# Copyright (c) 2007, Intel Corporation. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + +################################################################################ +# +# Defines Section - statements that will be processed to create a Makefile. +# +################################################################################ +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = BaseTimerLibNullTemplate + FILE_GUID = f4731d79-537e-4505-bd52-c03f9b1f6b89 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = TimerLib + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +################################################################################ +# +# Sources Section - list of files that are required for the build to succeed. +# +################################################################################ + +[Sources.common] + TimerLibNull.c + CommonHeader.h + + +################################################################################ +# +# Includes Section - list of Include locations that are required for +# this module. +# +################################################################################ + +[Includes] + $(WORKSPACE)/MdePkg\Include/Library + +################################################################################ +# +# Package Dependency Section - list of Package files that are required for +# this module. +# +################################################################################ + +[Packages] + MdePkg/MdePkg.dec + + +################################################################################ +# +# Library Class Section - list of Library Classes that are required for +# this module. +# +################################################################################ + +[LibraryClasses] + DebugLib + diff --git a/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.msa b/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.msa new file mode 100644 index 0000000000..6861a9faac --- /dev/null +++ b/MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.msa @@ -0,0 +1,45 @@ + + + + BaseTimerLibNullTemplate + BASE + f4731d79-537e-4505-bd52-c03f9b1f6b89 + 1.0 + Timer library NULL template implementaton + A non-functional instance of the Timer Library that can be used as a template + for the implementation of a functional timer library instance. This library instance can + also be used to test build DXE, Runtime, DXE SAL, and DXE SMM modules that require timer + services as well as EBC modules that require timer services + Copyright (c) 2007, Intel Corporation. + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 + + + IA32 X64 IPF EBC + false + BaseTimerLibNullTemplate + + + + TimerLib + + + DebugLib + + + + TimerLibNull.c + + + + + + EFI_SPECIFICATION_VERSION 0x00020000 + EDK_RELEASE_VERSION 0x00020000 + + \ No newline at end of file diff --git a/MdePkg/Library/BaseTimerLibNullTemplate/CommonHeader.h b/MdePkg/Library/BaseTimerLibNullTemplate/CommonHeader.h new file mode 100644 index 0000000000..c65882cc18 --- /dev/null +++ b/MdePkg/Library/BaseTimerLibNullTemplate/CommonHeader.h @@ -0,0 +1,32 @@ +/**@file + Common header file shared by all source files. + + This file includes package header files, library classes and protocol, PPI & GUID definitions. + + Copyright (c) 2007, Intel Corporation. + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#ifndef __COMMON_HEADER_H_ +#define __COMMON_HEADER_H_ + + +// +// The package level header files this module uses +// +#include +// +// The protocols, PPI and GUID defintions for this module +// +// +// The Library classes this module consumes +// +#include +#include + +#endif diff --git a/MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c b/MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c new file mode 100644 index 0000000000..caca0c3cc2 --- /dev/null +++ b/MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c @@ -0,0 +1,116 @@ +/** @file + A non-functional instance of the Timer Library. + + Copyright (c) 2007, Intel Corporation
+ All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + Module Name: TimerLibNull.c + +**/ + +// +// Include common header file for this module. +// +#include "CommonHeader.h" + +/** + Stalls the CPU for at least the given number of microseconds. + + Stalls the CPU for the number of microseconds specified by MicroSeconds. + + @param MicroSeconds The minimum number of microseconds to delay. + + @return MicroSeconds + +**/ +UINTN +EFIAPI +MicroSecondDelay ( + IN UINTN MicroSeconds + ) +{ + ASSERT (FALSE); + return MicroSeconds; +} + +/** + Stalls the CPU for at least the given number of nanoseconds. + + Stalls the CPU for the number of nanoseconds specified by NanoSeconds. + + @param NanoSeconds The minimum number of nanoseconds to delay. + + @return NanoSeconds + +**/ +UINTN +EFIAPI +NanoSecondDelay ( + IN UINTN NanoSeconds + ) +{ + ASSERT (FALSE); + return 0; +} + +/** + Retrieves the current value of a 64-bit free running performance counter. + + Retrieves the current value of a 64-bit free running performance counter. The + counter can either count up by 1 or count down by 1. If the physical + performance counter counts by a larger increment, then the counter values + must be translated. The properties of the counter can be retrieved from + GetPerformanceCounterProperties(). + + @return The current value of the free running performance counter. + +**/ +UINT64 +EFIAPI +GetPerformanceCounter ( + VOID + ) +{ + ASSERT (FALSE); + return 0; +} + +/** + Retrieves the 64-bit frequency in Hz and the range of performance counter + values. + + If StartValue is not NULL, then the value that the performance counter starts + with immediately after is it rolls over is returned in StartValue. If + EndValue is not NULL, then the value that the performance counter end with + immediately before it rolls over is returned in EndValue. The 64-bit + frequency of the performance counter in Hz is always returned. If StartValue + is less than EndValue, then the performance counter counts up. If StartValue + is greater than EndValue, then the performance counter counts down. For + example, a 64-bit free running counter that counts up would have a StartValue + of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter + that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0. + + @param StartValue The value the performance counter starts with when it + rolls over. + @param EndValue The value that the performance counter ends with before + it rolls over. + + @return The frequency in Hz. + +**/ +UINT64 +EFIAPI +GetPerformanceCounterProperties ( + OUT UINT64 *StartValue, OPTIONAL + OUT UINT64 *EndValue OPTIONAL + ) +{ + ASSERT (FALSE); + return 0; +} -- cgit v1.2.3