Deleted Added
full compact
i80321_timer.c (160343) i80321_timer.c (166901)
1/* $NetBSD: i80321_timer.c,v 1.7 2003/07/27 04:52:28 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38/*
39 * Timer/clock support for the Intel i80321 I/O processor.
40 */
41
42#include <sys/cdefs.h>
1/* $NetBSD: i80321_timer.c,v 1.7 2003/07/27 04:52:28 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 *

--- 26 unchanged lines hidden (view full) ---

35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38/*
39 * Timer/clock support for the Intel i80321 I/O processor.
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/arm/xscale/i80321/i80321_timer.c 160343 2006-07-14 13:37:47Z cognet $");
43__FBSDID("$FreeBSD: head/sys/arm/xscale/i80321/i80321_timer.c 166901 2007-02-23 12:19:07Z piso $");
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/module.h>
49#include <sys/time.h>
50#include <sys/bus.h>
51#include <sys/resource.h>

--- 76 unchanged lines hidden (view full) ---

128 "itimer",
129 i80321_timer_methods,
130 sizeof(struct i80321_timer_softc),
131};
132static devclass_t i80321_timer_devclass;
133
134DRIVER_MODULE(itimer, iq, i80321_timer_driver, i80321_timer_devclass, 0, 0);
135
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/module.h>
49#include <sys/time.h>
50#include <sys/bus.h>
51#include <sys/resource.h>

--- 76 unchanged lines hidden (view full) ---

128 "itimer",
129 i80321_timer_methods,
130 sizeof(struct i80321_timer_softc),
131};
132static devclass_t i80321_timer_devclass;
133
134DRIVER_MODULE(itimer, iq, i80321_timer_driver, i80321_timer_devclass, 0, 0);
135
136void clockhandler(void *);
136int clockhandler(void *);
137
138
139static __inline uint32_t
140tmr1_read(void)
141{
142 uint32_t rv;
143
144 __asm __volatile("mrc p6, 0, %0, c1, c1, 0"

--- 186 unchanged lines hidden (view full) ---

331
332 oldirqstate = disable_interrupts(I32_bit);
333
334 irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, ICU_INT_TMR0,
335 ICU_INT_TMR0, 1, RF_ACTIVE);
336 if (!irq)
337 panic("Unable to setup the clock irq handler.\n");
338 else
137
138
139static __inline uint32_t
140tmr1_read(void)
141{
142 uint32_t rv;
143
144 __asm __volatile("mrc p6, 0, %0, c1, c1, 0"

--- 186 unchanged lines hidden (view full) ---

331
332 oldirqstate = disable_interrupts(I32_bit);
333
334 irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, ICU_INT_TMR0,
335 ICU_INT_TMR0, 1, RF_ACTIVE);
336 if (!irq)
337 panic("Unable to setup the clock irq handler.\n");
338 else
339 bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST,
340 clockhandler, NULL, &ihl);
339 bus_setup_intr(dev, irq, INTR_TYPE_CLK, clockhandler, NULL,
340 NULL, &ihl);
341 tmr0_write(0); /* stop timer */
342 tisr_write(TISR_TMR0); /* clear interrupt */
343
344 counts_per_hz = COUNTS_PER_SEC / hz;
345
346 trr0_write(counts_per_hz); /* reload value */
347 tcr0_write(counts_per_hz); /* current value */
348 tmr0_write(TMRx_ENABLE|TMRx_RELOAD|TMRx_CSEL_CORE);

--- 47 unchanged lines hidden (view full) ---

396 }
397}
398
399/*
400 * clockhandler:
401 *
402 * Handle the hardclock interrupt.
403 */
341 tmr0_write(0); /* stop timer */
342 tisr_write(TISR_TMR0); /* clear interrupt */
343
344 counts_per_hz = COUNTS_PER_SEC / hz;
345
346 trr0_write(counts_per_hz); /* reload value */
347 tcr0_write(counts_per_hz); /* current value */
348 tmr0_write(TMRx_ENABLE|TMRx_RELOAD|TMRx_CSEL_CORE);

--- 47 unchanged lines hidden (view full) ---

396 }
397}
398
399/*
400 * clockhandler:
401 *
402 * Handle the hardclock interrupt.
403 */
404void
404int
405clockhandler(void *arg)
406{
407 struct trapframe *frame = arg;
408
409 ticked++;
410 tisr_write(TISR_TMR0);
411 hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
412
413 if (i80321_hardclock_hook != NULL)
414 (*i80321_hardclock_hook)();
405clockhandler(void *arg)
406{
407 struct trapframe *frame = arg;
408
409 ticked++;
410 tisr_write(TISR_TMR0);
411 hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
412
413 if (i80321_hardclock_hook != NULL)
414 (*i80321_hardclock_hook)();
415 return;
415 return (FILTER_HANDLED);
416}
417
418void
419cpu_startprofclock(void)
420{
421}
422
423void
424cpu_stopprofclock(void)
425{
426
427}
416}
417
418void
419cpu_startprofclock(void)
420{
421}
422
423void
424cpu_stopprofclock(void)
425{
426
427}