1 /*++ 2 3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> 4 5 6 This program and the accompanying materials are licensed and made available under 7 8 the terms and conditions of the BSD License that accompanies this distribution. 9 10 The full text of the license may be found at 11 12 http://opensource.org/licenses/bsd-license.php. 13 14 15 16 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 17 18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 19 20 21 22 23 Module Name: 24 25 LegacyMetronome.h 26 27 Abstract: 28 29 Driver implementing the EFI 2.0 metronome protocol using the legacy PORT 61 30 timer. 31 32 --*/ 33 34 #ifndef _LEGACY_METRONOME_H 35 #define _LEGACY_METRONOME_H 36 37 // 38 // Statements that include other files 39 // 40 #include "Protocol/Metronome.h" 41 #include "Protocol/CpuIo.h" 42 #include "Library/DebugLib.h" 43 #include "Library/UefiBootServicesTableLib.h" 44 45 46 // 47 // Private definitions 48 // 49 #define TICK_PERIOD 300 50 #define REFRESH_PORT 0x61 51 #define REFRESH_ON 0x10 52 #define REFRESH_OFF 0x00 53 #define TIMER1_CONTROL_PORT 0x43 54 #define TIMER1_COUNT_PORT 0x41 55 #define LOAD_COUNTER1_LSB 0x54 56 #define COUNTER1_COUNT 0x12 57 58 // 59 // Function Prototypes 60 // 61 /** 62 Waits for the TickNumber of ticks from a known platform time source. 63 64 @param This Pointer to the protocol instance. 65 @param TickNumber Tick Number to be waited 66 67 @retval EFI_SUCCESS If number of ticks occurred. 68 @retval EFI_NOT_FOUND Could not locate CPU IO protocol 69 70 **/ 71 EFI_STATUS 72 EFIAPI 73 WaitForTick ( 74 IN EFI_METRONOME_ARCH_PROTOCOL *This, 75 IN UINT32 TickNumber 76 ); 77 78 #endif 79