80 lines
2.9 KiB
C
80 lines
2.9 KiB
C
/** @file
|
|
HPET timer definitions for HECI driver
|
|
|
|
@copyright
|
|
INTEL CONFIDENTIAL
|
|
Copyright 2006 - 2020 Intel Corporation.
|
|
|
|
The source code contained or described herein and all documents related to the
|
|
source code ("Material") are owned by Intel Corporation or its suppliers or
|
|
licensors. Title to the Material remains with Intel Corporation or its suppliers
|
|
and licensors. The Material may contain trade secrets and proprietary and
|
|
confidential information of Intel Corporation and its suppliers and licensors,
|
|
and is protected by worldwide copyright and trade secret laws and treaty
|
|
provisions. No part of the Material may be used, copied, reproduced, modified,
|
|
published, uploaded, posted, transmitted, distributed, or disclosed in any way
|
|
without Intel's prior express written permission.
|
|
|
|
No license under any patent, copyright, trade secret or other intellectual
|
|
property right is granted to or conferred upon you by disclosure or delivery
|
|
of the Materials, either expressly, by implication, inducement, estoppel or
|
|
otherwise. Any license under such intellectual property rights must be
|
|
express and approved by Intel in writing.
|
|
|
|
Unless otherwise agreed by Intel in writing, you may not remove or alter
|
|
this notice or any other notice embedded in Materials by Intel or
|
|
Intel's suppliers or licensors in any way.
|
|
|
|
This file contains an 'Intel Peripheral Driver' and is uniquely identified as
|
|
"Intel Reference Module" and is licensed for Intel CPUs and chipsets under
|
|
the terms of your license agreement with Intel or your vendor. This file may
|
|
be modified by the user, subject to additional terms of the license agreement.
|
|
|
|
@par Specification Reference:
|
|
**/
|
|
#ifndef _HECI_HPET_H
|
|
#define _HECI_HPET_H
|
|
|
|
//
|
|
// HPET Information
|
|
//
|
|
#define HPET_GEN_CONFIG 0x10
|
|
#define HPET_MAIN_COUNTER 0xF0
|
|
|
|
#define HPET_START 0x1
|
|
#define HPET_TICKS_PER_MICRO 24 ///< 41.6 ns tick so 24 ticks per microsecond ish
|
|
|
|
/**
|
|
Used for calculating timeouts
|
|
|
|
@param[in] Start Snapshot of the HPET timer
|
|
@param[in] End Calculated time when timeout period will be done
|
|
@param[in] Time Timeout period in microseconds
|
|
|
|
**/
|
|
VOID
|
|
SmmHeciStartTimer (
|
|
OUT UINT32 *Start,
|
|
OUT UINT32 *End,
|
|
IN UINT32 Time
|
|
);
|
|
|
|
/**
|
|
Used to determine if a timeout has occured.
|
|
|
|
@param[in] Start Snapshot of the HPET timer when the timeout period started.
|
|
@param[in] End Calculated time when timeout period will be done.
|
|
@param[in] HpetTimer The value of High Precision Event Timer
|
|
|
|
@retval TRUE Timeout occured.
|
|
@retval FALSE Timeout has not occured yet.
|
|
**/
|
|
BOOLEAN
|
|
IsHeciTimeout (
|
|
IN UINT32 Start,
|
|
IN UINT32 End
|
|
);
|
|
|
|
#endif // _HECI_HPET_H
|
|
|