1N/A/* A couple of routines to implement a low-overhead timer for drivers */ 1N/A * This program is free software; you can redistribute it and/or 1N/A * modify it under the terms of the GNU General Public License as 1N/A * published by the Free Software Foundation; either version 2, or (at 1N/A * your option) any later version. 1N/A * Now let's take care of PPC channel 2 1N/A * Set the Gate high, program PPC channel 2 for mode 0, 1N/A * (interrupt on terminal count mode), binary count, 1N/A * load 5 * LATCH count, (LSB and MSB) to begin countdown. 1N/A * Note some implementations have a bug where the high bits byte 1N/A * of channel 2 is ignored. 1N/A /* Set up the timer gate, turn off the speaker */ 1N/A /* Set the Gate high, disable speaker */ 1N/A#
endif /* !defined(CONFIG_TSC_CURRTICKS) */ 1N/A/* Number of clock ticks to time with the rtc */ 1N/A/* ------ Calibrate the TSC ------- 1N/A * Time how long it takes to excute a loop that runs in known time. 1N/A * And find the convertion needed to get to CLOCK_TICK_RATE 1N/A /* 64-bit subtract - gcc just messes up with long longs */ 1N/A /* Error: ECPUTOOFAST */ 1N/A * The CTC wasn't reliable: we got a hit on the very first read, 1N/A * or the CPU was so fast/slow that the quotient wouldn't fit in 1N/A /* Display the CPU Mhz to easily test if the calibration was bad */ 1N/A /* Read the Time Stamp Counter */ 1N/A /* currticks = clocks / clocks_per_tick; */ 1N/A#
endif /* RTC_CURRTICKS */