blob: 8bffc3ff3acf794c0b3c046d89017067eeb10617 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Russell King4baa9922008-08-02 10:55:55 +01002 * arch/arm/include/asm/mach/time.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Copyright (C) 2004 MontaVista Software, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_ARM_MACH_TIME_H
11#define __ASM_ARM_MACH_TIME_H
12
13#include <linux/sysdev.h>
14
15/*
16 * This is our kernel timer structure.
17 *
18 * - init
19 * Initialise the kernels jiffy timer source, claim interrupt
20 * using setup_irq. This is called early on during initialisation
21 * while interrupts are still disabled on the local CPU.
22 * - suspend
23 * Suspend the kernel jiffy timer source, if necessary. This
24 * is called with interrupts disabled, after all normal devices
25 * have been suspended. If no action is required, set this to
26 * NULL.
27 * - resume
28 * Resume the kernel jiffy timer source, if necessary. This
29 * is called with interrupts disabled before any normal devices
30 * are resumed. If no action is required, set this to NULL.
31 * - offset
32 * Return the timer offset in microseconds since the last timer
33 * interrupt. Note: this must take account of any unprocessed
34 * timer interrupt which may be pending.
35 */
36struct sys_timer {
37 struct sys_device dev;
38 void (*init)(void);
39 void (*suspend)(void);
40 void (*resume)(void);
Kevin Hilman746140c2006-09-22 00:16:30 +010041#ifndef CONFIG_GENERIC_TIME
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 unsigned long (*offset)(void);
Kevin Hilman746140c2006-09-22 00:16:30 +010043#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070044};
45
Linus Torvalds1da177e2005-04-16 15:20:36 -070046extern struct sys_timer *system_timer;
Linus Torvalds0cd61b62006-10-06 10:53:39 -070047extern void timer_tick(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#endif