1 /* clock.h: Definitions for the clock/timer chips on the Sparc. 2 * 3 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 */ 5
6 /* Clock timer structures. The interrupt timer has two properties which 7 * are the counter (which is handled in do_timer in sched.c) and the limit. 8 * This limit is where the timer's counter 'wraps' around. Oddly enough, 9 * the sun4c timer when it hits the limit wraps back to 1 and not zero 10 * thus when calculating the value at which it will fire a microsecond you 11 * must adjust by one. Thanks SUN for designing such great hardware ;( 12 */ 13
14 /* Note that I am only going to use the timer that interrupts at 15 * Sparc IRQ 10. There is another one available that can fire at 16 * IRQ 14. If I can think of some creative uses for it this may 17 * change. It might make a nice kernel/user profiler etc. 18 */ 19
20 structsparc_timer_info{ 21 unsignedint cur_count10;
22 unsignedint timer_limit10;
23 unsignedint cur_count14;
24 unsignedinttimer_limit14;
25 };
26
27 structsparc_clock_info{ 28 unsignedchar hsec;
29 unsignedcharhr;
30 unsignedcharmin;
31 unsignedcharsec;
32 unsignedcharmon;
33 unsignedcharday;
34 unsignedchar yr;
35 unsignedchar wkday;
36 unsignedchar ram_hsec;
37 unsignedchar ram_hr;
38 unsignedchar ram_min;
39 unsignedchar ram_sec;
40 unsignedchar ram_mon;
41 unsignedchar ram_day;
42 unsignedchar ram_year;
43 unsignedchar ram_wkday;
44 unsignedchar intr_reg;
45 unsignedchar cmd_reg;
46 unsignedcharfoo[14];
47 };
48
49 #defineTIMER_PHYSADDR 0xf3000000
50
51 /* YUCK YUCK YUCK, grrr... */ 52 #defineTIMER_STRUCT ((structsparc_timer_info *)((structsparc_clock_info *) TIMER_VADDR))
53