1/*- 2 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 3 * Copyright (C) 1995, 1996 TooLs GmbH. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 42 unchanged lines hidden (view full) --- 51 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 52 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 53 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 54 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 55 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 */ 57 58#include <sys/cdefs.h> |
59__FBSDID("$FreeBSD: head/sys/powerpc/aim/clock.c 192067 2009-05-14 00:34:26Z nwhitehorn $"); |
60 61#include <sys/param.h> 62#include <sys/systm.h> 63#include <sys/kernel.h> 64#include <sys/bus.h> 65#include <sys/interrupt.h> 66#include <sys/pcpu.h> 67#include <sys/sysctl.h> --- 52 unchanged lines hidden (view full) --- 120 while (nticks-- > 0) 121 hardclock_cpu(TRAPF_USERMODE(frame)); 122 } 123} 124 125void 126decr_init(void) 127{ |
128 struct cpuref cpu; 129 register_t msr; |
130 |
131 /* |
132 * Check the BSP's timebase frequency. Sometimes we can't find the BSP, so fall 133 * back to the first CPU in this case. |
134 */ |
135 |
136 if (platform_smp_get_bsp(&cpu) != 0) 137 platform_smp_first_cpu(&cpu); |
138 |
139 ticks_per_sec = platform_timebase_freq(&cpu); |
140 |
141 msr = mfmsr(); 142 mtmsr(msr & ~PSL_EE); 143 144 ns_per_tick = 1000000000 / ticks_per_sec; 145 ticks_per_intr = ticks_per_sec / hz; 146 mtdec(ticks_per_intr); 147 148 mtmsr(msr); |
149} 150 151void 152decr_tc_init(void) 153{ 154 decr_timecounter.tc_frequency = ticks_per_sec; 155 tc_init(&decr_timecounter); 156} --- 49 unchanged lines hidden --- |