diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-11-08 13:34:55 -0500 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-12-24 11:36:34 -0500 |
commit | c8d5ba1891eda2aa63800f052cb5af128283d130 (patch) | |
tree | 59a18c2262607b4067739fe4dfed3c6fa8e40f14 /arch/m68k | |
parent | 7b1f62076bba10786d2118006ae68ac120cd6c56 (diff) |
m68k: set arch_gettimeoffset directly
remove m68k's mach_gettimeoffset function pointer, and instead directly
set the arch_gettimeoffset function pointer. This requires multiplying
all function results by 1000, since the removed m68k_gettimeoffset() did
this. Also, s/unsigned long/u32/ just to make the function prototypes
exactly match that of arch_gettimeoffset.
Cc: Joshua Thompson <funaho@jurai.org>
Cc: Sam Creasey <sammy@sammy.net>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/amiga/config.c | 10 | ||||
-rw-r--r-- | arch/m68k/apollo/config.c | 9 | ||||
-rw-r--r-- | arch/m68k/atari/config.c | 4 | ||||
-rw-r--r-- | arch/m68k/atari/time.c | 6 | ||||
-rw-r--r-- | arch/m68k/bvme6000/config.c | 10 | ||||
-rw-r--r-- | arch/m68k/hp300/config.c | 2 | ||||
-rw-r--r-- | arch/m68k/hp300/time.c | 4 | ||||
-rw-r--r-- | arch/m68k/hp300/time.h | 2 | ||||
-rw-r--r-- | arch/m68k/include/asm/machdep.h | 2 | ||||
-rw-r--r-- | arch/m68k/kernel/setup_mm.c | 1 | ||||
-rw-r--r-- | arch/m68k/kernel/time.c | 9 | ||||
-rw-r--r-- | arch/m68k/mac/config.c | 4 | ||||
-rw-r--r-- | arch/m68k/mac/via.c | 4 | ||||
-rw-r--r-- | arch/m68k/mvme147/config.c | 8 | ||||
-rw-r--r-- | arch/m68k/mvme16x/config.c | 8 | ||||
-rw-r--r-- | arch/m68k/q40/config.c | 8 | ||||
-rw-r--r-- | arch/m68k/sun3/config.c | 4 | ||||
-rw-r--r-- | arch/m68k/sun3/intersil.c | 4 | ||||
-rw-r--r-- | arch/m68k/sun3x/config.c | 2 | ||||
-rw-r--r-- | arch/m68k/sun3x/time.c | 2 | ||||
-rw-r--r-- | arch/m68k/sun3x/time.h | 2 |
21 files changed, 47 insertions, 58 deletions
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index ee01b7a38e58..b819390e29cd 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c | |||
@@ -95,7 +95,7 @@ static void amiga_sched_init(irq_handler_t handler); | |||
95 | static void amiga_get_model(char *model); | 95 | static void amiga_get_model(char *model); |
96 | static void amiga_get_hardware_list(struct seq_file *m); | 96 | static void amiga_get_hardware_list(struct seq_file *m); |
97 | /* amiga specific timer functions */ | 97 | /* amiga specific timer functions */ |
98 | static unsigned long amiga_gettimeoffset(void); | 98 | static u32 amiga_gettimeoffset(void); |
99 | extern void amiga_mksound(unsigned int count, unsigned int ticks); | 99 | extern void amiga_mksound(unsigned int count, unsigned int ticks); |
100 | static void amiga_reset(void); | 100 | static void amiga_reset(void); |
101 | extern void amiga_init_sound(void); | 101 | extern void amiga_init_sound(void); |
@@ -377,7 +377,7 @@ void __init config_amiga(void) | |||
377 | mach_init_IRQ = amiga_init_IRQ; | 377 | mach_init_IRQ = amiga_init_IRQ; |
378 | mach_get_model = amiga_get_model; | 378 | mach_get_model = amiga_get_model; |
379 | mach_get_hardware_list = amiga_get_hardware_list; | 379 | mach_get_hardware_list = amiga_get_hardware_list; |
380 | mach_gettimeoffset = amiga_gettimeoffset; | 380 | arch_gettimeoffset = amiga_gettimeoffset; |
381 | 381 | ||
382 | /* | 382 | /* |
383 | * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI | 383 | * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI |
@@ -482,10 +482,10 @@ static void __init amiga_sched_init(irq_handler_t timer_routine) | |||
482 | #define TICK_SIZE 10000 | 482 | #define TICK_SIZE 10000 |
483 | 483 | ||
484 | /* This is always executed with interrupts disabled. */ | 484 | /* This is always executed with interrupts disabled. */ |
485 | static unsigned long amiga_gettimeoffset(void) | 485 | static u32 amiga_gettimeoffset(void) |
486 | { | 486 | { |
487 | unsigned short hi, lo, hi2; | 487 | unsigned short hi, lo, hi2; |
488 | unsigned long ticks, offset = 0; | 488 | u32 ticks, offset = 0; |
489 | 489 | ||
490 | /* read CIA B timer A current value */ | 490 | /* read CIA B timer A current value */ |
491 | hi = ciab.tahi; | 491 | hi = ciab.tahi; |
@@ -507,7 +507,7 @@ static unsigned long amiga_gettimeoffset(void) | |||
507 | ticks = jiffy_ticks - ticks; | 507 | ticks = jiffy_ticks - ticks; |
508 | ticks = (10000 * ticks) / jiffy_ticks; | 508 | ticks = (10000 * ticks) / jiffy_ticks; |
509 | 509 | ||
510 | return ticks + offset; | 510 | return (ticks + offset) * 1000; |
511 | } | 511 | } |
512 | 512 | ||
513 | static void amiga_reset(void) __noreturn; | 513 | static void amiga_reset(void) __noreturn; |
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index f5565d6eeb8e..3ea56b90e718 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c | |||
@@ -26,7 +26,7 @@ u_long apollo_model; | |||
26 | 26 | ||
27 | extern void dn_sched_init(irq_handler_t handler); | 27 | extern void dn_sched_init(irq_handler_t handler); |
28 | extern void dn_init_IRQ(void); | 28 | extern void dn_init_IRQ(void); |
29 | extern unsigned long dn_gettimeoffset(void); | 29 | extern u32 dn_gettimeoffset(void); |
30 | extern int dn_dummy_hwclk(int, struct rtc_time *); | 30 | extern int dn_dummy_hwclk(int, struct rtc_time *); |
31 | extern int dn_dummy_set_clock_mmss(unsigned long); | 31 | extern int dn_dummy_set_clock_mmss(unsigned long); |
32 | extern void dn_dummy_reset(void); | 32 | extern void dn_dummy_reset(void); |
@@ -151,7 +151,7 @@ void __init config_apollo(void) | |||
151 | 151 | ||
152 | mach_sched_init=dn_sched_init; /* */ | 152 | mach_sched_init=dn_sched_init; /* */ |
153 | mach_init_IRQ=dn_init_IRQ; | 153 | mach_init_IRQ=dn_init_IRQ; |
154 | mach_gettimeoffset = dn_gettimeoffset; | 154 | arch_gettimeoffset = dn_gettimeoffset; |
155 | mach_max_dma_address = 0xffffffff; | 155 | mach_max_dma_address = 0xffffffff; |
156 | mach_hwclk = dn_dummy_hwclk; /* */ | 156 | mach_hwclk = dn_dummy_hwclk; /* */ |
157 | mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ | 157 | mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ |
@@ -203,10 +203,9 @@ void dn_sched_init(irq_handler_t timer_routine) | |||
203 | pr_err("Couldn't register timer interrupt\n"); | 203 | pr_err("Couldn't register timer interrupt\n"); |
204 | } | 204 | } |
205 | 205 | ||
206 | unsigned long dn_gettimeoffset(void) { | 206 | u32 dn_gettimeoffset(void) |
207 | 207 | { | |
208 | return 0xdeadbeef; | 208 | return 0xdeadbeef; |
209 | |||
210 | } | 209 | } |
211 | 210 | ||
212 | int dn_dummy_hwclk(int op, struct rtc_time *t) { | 211 | int dn_dummy_hwclk(int op, struct rtc_time *t) { |
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index d8eb32747ac5..037c11c99331 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c | |||
@@ -74,7 +74,7 @@ static void atari_heartbeat(int on); | |||
74 | 74 | ||
75 | /* atari specific timer functions (in time.c) */ | 75 | /* atari specific timer functions (in time.c) */ |
76 | extern void atari_sched_init(irq_handler_t); | 76 | extern void atari_sched_init(irq_handler_t); |
77 | extern unsigned long atari_gettimeoffset (void); | 77 | extern u32 atari_gettimeoffset(void); |
78 | extern int atari_mste_hwclk (int, struct rtc_time *); | 78 | extern int atari_mste_hwclk (int, struct rtc_time *); |
79 | extern int atari_tt_hwclk (int, struct rtc_time *); | 79 | extern int atari_tt_hwclk (int, struct rtc_time *); |
80 | extern int atari_mste_set_clock_mmss (unsigned long); | 80 | extern int atari_mste_set_clock_mmss (unsigned long); |
@@ -204,7 +204,7 @@ void __init config_atari(void) | |||
204 | mach_init_IRQ = atari_init_IRQ; | 204 | mach_init_IRQ = atari_init_IRQ; |
205 | mach_get_model = atari_get_model; | 205 | mach_get_model = atari_get_model; |
206 | mach_get_hardware_list = atari_get_hardware_list; | 206 | mach_get_hardware_list = atari_get_hardware_list; |
207 | mach_gettimeoffset = atari_gettimeoffset; | 207 | arch_gettimeoffset = atari_gettimeoffset; |
208 | mach_reset = atari_reset; | 208 | mach_reset = atari_reset; |
209 | mach_max_dma_address = 0xffffff; | 209 | mach_max_dma_address = 0xffffff; |
210 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) | 210 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) |
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index c0cc68a2c829..da8f981c36d6 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c | |||
@@ -42,9 +42,9 @@ atari_sched_init(irq_handler_t timer_routine) | |||
42 | #define TICK_SIZE 10000 | 42 | #define TICK_SIZE 10000 |
43 | 43 | ||
44 | /* This is always executed with interrupts disabled. */ | 44 | /* This is always executed with interrupts disabled. */ |
45 | unsigned long atari_gettimeoffset (void) | 45 | u32 atari_gettimeoffset(void) |
46 | { | 46 | { |
47 | unsigned long ticks, offset = 0; | 47 | u32 ticks, offset = 0; |
48 | 48 | ||
49 | /* read MFP timer C current value */ | 49 | /* read MFP timer C current value */ |
50 | ticks = st_mfp.tim_dt_c; | 50 | ticks = st_mfp.tim_dt_c; |
@@ -57,7 +57,7 @@ unsigned long atari_gettimeoffset (void) | |||
57 | ticks = INT_TICKS - ticks; | 57 | ticks = INT_TICKS - ticks; |
58 | ticks = ticks * 10000L / INT_TICKS; | 58 | ticks = ticks * 10000L / INT_TICKS; |
59 | 59 | ||
60 | return ticks + offset; | 60 | return (ticks + offset) * 1000; |
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index 0bf850a20ea2..8943aa4c18e6 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | static void bvme6000_get_model(char *model); | 39 | static void bvme6000_get_model(char *model); |
40 | extern void bvme6000_sched_init(irq_handler_t handler); | 40 | extern void bvme6000_sched_init(irq_handler_t handler); |
41 | extern unsigned long bvme6000_gettimeoffset (void); | 41 | extern u32 bvme6000_gettimeoffset(void); |
42 | extern int bvme6000_hwclk (int, struct rtc_time *); | 42 | extern int bvme6000_hwclk (int, struct rtc_time *); |
43 | extern int bvme6000_set_clock_mmss (unsigned long); | 43 | extern int bvme6000_set_clock_mmss (unsigned long); |
44 | extern void bvme6000_reset (void); | 44 | extern void bvme6000_reset (void); |
@@ -110,7 +110,7 @@ void __init config_bvme6000(void) | |||
110 | mach_max_dma_address = 0xffffffff; | 110 | mach_max_dma_address = 0xffffffff; |
111 | mach_sched_init = bvme6000_sched_init; | 111 | mach_sched_init = bvme6000_sched_init; |
112 | mach_init_IRQ = bvme6000_init_IRQ; | 112 | mach_init_IRQ = bvme6000_init_IRQ; |
113 | mach_gettimeoffset = bvme6000_gettimeoffset; | 113 | arch_gettimeoffset = bvme6000_gettimeoffset; |
114 | mach_hwclk = bvme6000_hwclk; | 114 | mach_hwclk = bvme6000_hwclk; |
115 | mach_set_clock_mmss = bvme6000_set_clock_mmss; | 115 | mach_set_clock_mmss = bvme6000_set_clock_mmss; |
116 | mach_reset = bvme6000_reset; | 116 | mach_reset = bvme6000_reset; |
@@ -216,13 +216,13 @@ void bvme6000_sched_init (irq_handler_t timer_routine) | |||
216 | * results... | 216 | * results... |
217 | */ | 217 | */ |
218 | 218 | ||
219 | unsigned long bvme6000_gettimeoffset (void) | 219 | u32 bvme6000_gettimeoffset(void) |
220 | { | 220 | { |
221 | volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; | 221 | volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; |
222 | volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE; | 222 | volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE; |
223 | unsigned char msr = rtc->msr & 0xc0; | 223 | unsigned char msr = rtc->msr & 0xc0; |
224 | unsigned char t1int, t1op; | 224 | unsigned char t1int, t1op; |
225 | unsigned long v = 800000, ov; | 225 | u32 v = 800000, ov; |
226 | 226 | ||
227 | rtc->msr = 0; /* Ensure timer registers accessible */ | 227 | rtc->msr = 0; /* Ensure timer registers accessible */ |
228 | 228 | ||
@@ -246,7 +246,7 @@ unsigned long bvme6000_gettimeoffset (void) | |||
246 | v += 10000; /* Int pending, + 10ms */ | 246 | v += 10000; /* Int pending, + 10ms */ |
247 | rtc->msr = msr; | 247 | rtc->msr = msr; |
248 | 248 | ||
249 | return v; | 249 | return v * 1000; |
250 | } | 250 | } |
251 | 251 | ||
252 | /* | 252 | /* |
diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c index bf16af1edacf..b7609f791522 100644 --- a/arch/m68k/hp300/config.c +++ b/arch/m68k/hp300/config.c | |||
@@ -251,7 +251,7 @@ void __init config_hp300(void) | |||
251 | mach_sched_init = hp300_sched_init; | 251 | mach_sched_init = hp300_sched_init; |
252 | mach_init_IRQ = hp300_init_IRQ; | 252 | mach_init_IRQ = hp300_init_IRQ; |
253 | mach_get_model = hp300_get_model; | 253 | mach_get_model = hp300_get_model; |
254 | mach_gettimeoffset = hp300_gettimeoffset; | 254 | arch_gettimeoffset = hp300_gettimeoffset; |
255 | mach_hwclk = hp300_hwclk; | 255 | mach_hwclk = hp300_hwclk; |
256 | mach_get_ss = hp300_get_ss; | 256 | mach_get_ss = hp300_get_ss; |
257 | mach_reset = hp300_reset; | 257 | mach_reset = hp300_reset; |
diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index 29a71be9fa5b..749543b425a4 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c | |||
@@ -46,7 +46,7 @@ static irqreturn_t hp300_tick(int irq, void *dev_id) | |||
46 | return vector(irq, NULL); | 46 | return vector(irq, NULL); |
47 | } | 47 | } |
48 | 48 | ||
49 | unsigned long hp300_gettimeoffset(void) | 49 | u32 hp300_gettimeoffset(void) |
50 | { | 50 | { |
51 | /* Read current timer 1 value */ | 51 | /* Read current timer 1 value */ |
52 | unsigned char lsb, msb1, msb2; | 52 | unsigned char lsb, msb1, msb2; |
@@ -59,7 +59,7 @@ unsigned long hp300_gettimeoffset(void) | |||
59 | /* A carry happened while we were reading. Read it again */ | 59 | /* A carry happened while we were reading. Read it again */ |
60 | lsb = in_8(CLOCKBASE + 7); | 60 | lsb = in_8(CLOCKBASE + 7); |
61 | ticks = INTVAL - ((msb2 << 8) | lsb); | 61 | ticks = INTVAL - ((msb2 << 8) | lsb); |
62 | return (USECS_PER_JIFFY * ticks) / INTVAL; | 62 | return ((USECS_PER_JIFFY * ticks) / INTVAL) * 1000; |
63 | } | 63 | } |
64 | 64 | ||
65 | void __init hp300_sched_init(irq_handler_t vector) | 65 | void __init hp300_sched_init(irq_handler_t vector) |
diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h index 7b98242960de..f5583ec4033d 100644 --- a/arch/m68k/hp300/time.h +++ b/arch/m68k/hp300/time.h | |||
@@ -1,2 +1,2 @@ | |||
1 | extern void hp300_sched_init(irq_handler_t vector); | 1 | extern void hp300_sched_init(irq_handler_t vector); |
2 | extern unsigned long hp300_gettimeoffset(void); | 2 | extern u32 hp300_gettimeoffset(void); |
diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machdep.h index 825c1c813196..953ca21da8ee 100644 --- a/arch/m68k/include/asm/machdep.h +++ b/arch/m68k/include/asm/machdep.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/seq_file.h> | 4 | #include <linux/seq_file.h> |
5 | #include <linux/interrupt.h> | 5 | #include <linux/interrupt.h> |
6 | #include <linux/time.h> | ||
6 | 7 | ||
7 | struct pt_regs; | 8 | struct pt_regs; |
8 | struct mktime; | 9 | struct mktime; |
@@ -16,7 +17,6 @@ extern void (*mach_init_IRQ) (void); | |||
16 | extern void (*mach_get_model) (char *model); | 17 | extern void (*mach_get_model) (char *model); |
17 | extern void (*mach_get_hardware_list) (struct seq_file *m); | 18 | extern void (*mach_get_hardware_list) (struct seq_file *m); |
18 | /* machine dependent timer functions */ | 19 | /* machine dependent timer functions */ |
19 | extern unsigned long (*mach_gettimeoffset)(void); | ||
20 | extern int (*mach_hwclk)(int, struct rtc_time*); | 20 | extern int (*mach_hwclk)(int, struct rtc_time*); |
21 | extern unsigned int (*mach_get_ss)(void); | 21 | extern unsigned int (*mach_get_ss)(void); |
22 | extern int (*mach_get_rtc_pll)(struct rtc_pll_info *); | 22 | extern int (*mach_get_rtc_pll)(struct rtc_pll_info *); |
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index d872ce4807c9..80cfbe56ea32 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c | |||
@@ -84,7 +84,6 @@ void (*mach_init_IRQ) (void) __initdata = NULL; | |||
84 | void (*mach_get_model) (char *model); | 84 | void (*mach_get_model) (char *model); |
85 | void (*mach_get_hardware_list) (struct seq_file *m); | 85 | void (*mach_get_hardware_list) (struct seq_file *m); |
86 | /* machine dependent timer functions */ | 86 | /* machine dependent timer functions */ |
87 | unsigned long (*mach_gettimeoffset) (void); | ||
88 | int (*mach_hwclk) (int, struct rtc_time*); | 87 | int (*mach_hwclk) (int, struct rtc_time*); |
89 | EXPORT_SYMBOL(mach_hwclk); | 88 | EXPORT_SYMBOL(mach_hwclk); |
90 | int (*mach_set_clock_mmss) (unsigned long); | 89 | int (*mach_set_clock_mmss) (unsigned long); |
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index c2994c8c30d5..bea6bcf8f9b8 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c | |||
@@ -82,11 +82,6 @@ void read_persistent_clock(struct timespec *ts) | |||
82 | 82 | ||
83 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | 83 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
84 | 84 | ||
85 | static u32 m68k_gettimeoffset(void) | ||
86 | { | ||
87 | return mach_gettimeoffset() * 1000; | ||
88 | } | ||
89 | |||
90 | static int __init rtc_init(void) | 85 | static int __init rtc_init(void) |
91 | { | 86 | { |
92 | struct platform_device *pdev; | 87 | struct platform_device *pdev; |
@@ -104,9 +99,5 @@ module_init(rtc_init); | |||
104 | 99 | ||
105 | void __init time_init(void) | 100 | void __init time_init(void) |
106 | { | 101 | { |
107 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
108 | arch_gettimeoffset = m68k_gettimeoffset; | ||
109 | #endif | ||
110 | |||
111 | mach_sched_init(timer_interrupt); | 102 | mach_sched_init(timer_interrupt); |
112 | } | 103 | } |
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index d9f62e0f46c0..afb95d5fb26b 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -52,7 +52,7 @@ struct mac_booter_data mac_bi_data; | |||
52 | static unsigned long mac_orig_videoaddr; | 52 | static unsigned long mac_orig_videoaddr; |
53 | 53 | ||
54 | /* Mac specific timer functions */ | 54 | /* Mac specific timer functions */ |
55 | extern unsigned long mac_gettimeoffset(void); | 55 | extern u32 mac_gettimeoffset(void); |
56 | extern int mac_hwclk(int, struct rtc_time *); | 56 | extern int mac_hwclk(int, struct rtc_time *); |
57 | extern int mac_set_clock_mmss(unsigned long); | 57 | extern int mac_set_clock_mmss(unsigned long); |
58 | extern void iop_preinit(void); | 58 | extern void iop_preinit(void); |
@@ -177,7 +177,7 @@ void __init config_mac(void) | |||
177 | mach_sched_init = mac_sched_init; | 177 | mach_sched_init = mac_sched_init; |
178 | mach_init_IRQ = mac_init_IRQ; | 178 | mach_init_IRQ = mac_init_IRQ; |
179 | mach_get_model = mac_get_model; | 179 | mach_get_model = mac_get_model; |
180 | mach_gettimeoffset = mac_gettimeoffset; | 180 | arch_gettimeoffset = mac_gettimeoffset; |
181 | mach_hwclk = mac_hwclk; | 181 | mach_hwclk = mac_hwclk; |
182 | mach_set_clock_mmss = mac_set_clock_mmss; | 182 | mach_set_clock_mmss = mac_set_clock_mmss; |
183 | mach_reset = mac_reset; | 183 | mach_reset = mac_reset; |
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 2d85662715fb..5d1458bb871b 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -327,7 +327,7 @@ void via_debug_dump(void) | |||
327 | * TBI: get time offset between scheduling timer ticks | 327 | * TBI: get time offset between scheduling timer ticks |
328 | */ | 328 | */ |
329 | 329 | ||
330 | unsigned long mac_gettimeoffset (void) | 330 | u32 mac_gettimeoffset(void) |
331 | { | 331 | { |
332 | unsigned long ticks, offset = 0; | 332 | unsigned long ticks, offset = 0; |
333 | 333 | ||
@@ -341,7 +341,7 @@ unsigned long mac_gettimeoffset (void) | |||
341 | ticks = MAC_CLOCK_TICK - ticks; | 341 | ticks = MAC_CLOCK_TICK - ticks; |
342 | ticks = ticks * 10000L / MAC_CLOCK_TICK; | 342 | ticks = ticks * 10000L / MAC_CLOCK_TICK; |
343 | 343 | ||
344 | return ticks + offset; | 344 | return (ticks + offset) * 1000; |
345 | } | 345 | } |
346 | 346 | ||
347 | /* | 347 | /* |
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index a41c09149e23..1c6262803b94 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | static void mvme147_get_model(char *model); | 38 | static void mvme147_get_model(char *model); |
39 | extern void mvme147_sched_init(irq_handler_t handler); | 39 | extern void mvme147_sched_init(irq_handler_t handler); |
40 | extern unsigned long mvme147_gettimeoffset (void); | 40 | extern u32 mvme147_gettimeoffset(void); |
41 | extern int mvme147_hwclk (int, struct rtc_time *); | 41 | extern int mvme147_hwclk (int, struct rtc_time *); |
42 | extern int mvme147_set_clock_mmss (unsigned long); | 42 | extern int mvme147_set_clock_mmss (unsigned long); |
43 | extern void mvme147_reset (void); | 43 | extern void mvme147_reset (void); |
@@ -88,7 +88,7 @@ void __init config_mvme147(void) | |||
88 | mach_max_dma_address = 0x01000000; | 88 | mach_max_dma_address = 0x01000000; |
89 | mach_sched_init = mvme147_sched_init; | 89 | mach_sched_init = mvme147_sched_init; |
90 | mach_init_IRQ = mvme147_init_IRQ; | 90 | mach_init_IRQ = mvme147_init_IRQ; |
91 | mach_gettimeoffset = mvme147_gettimeoffset; | 91 | arch_gettimeoffset = mvme147_gettimeoffset; |
92 | mach_hwclk = mvme147_hwclk; | 92 | mach_hwclk = mvme147_hwclk; |
93 | mach_set_clock_mmss = mvme147_set_clock_mmss; | 93 | mach_set_clock_mmss = mvme147_set_clock_mmss; |
94 | mach_reset = mvme147_reset; | 94 | mach_reset = mvme147_reset; |
@@ -127,7 +127,7 @@ void mvme147_sched_init (irq_handler_t timer_routine) | |||
127 | 127 | ||
128 | /* This is always executed with interrupts disabled. */ | 128 | /* This is always executed with interrupts disabled. */ |
129 | /* XXX There are race hazards in this code XXX */ | 129 | /* XXX There are race hazards in this code XXX */ |
130 | unsigned long mvme147_gettimeoffset (void) | 130 | u32 mvme147_gettimeoffset(void) |
131 | { | 131 | { |
132 | volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012; | 132 | volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012; |
133 | unsigned short n; | 133 | unsigned short n; |
@@ -137,7 +137,7 @@ unsigned long mvme147_gettimeoffset (void) | |||
137 | n = *cp; | 137 | n = *cp; |
138 | 138 | ||
139 | n -= PCC_TIMER_PRELOAD; | 139 | n -= PCC_TIMER_PRELOAD; |
140 | return (unsigned long)n * 25 / 4; | 140 | return ((unsigned long)n * 25 / 4) * 1000; |
141 | } | 141 | } |
142 | 142 | ||
143 | static int bcd2int (unsigned char b) | 143 | static int bcd2int (unsigned char b) |
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index b6d7d8a7a3dd..080a342458a1 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c | |||
@@ -43,7 +43,7 @@ static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; | |||
43 | 43 | ||
44 | static void mvme16x_get_model(char *model); | 44 | static void mvme16x_get_model(char *model); |
45 | extern void mvme16x_sched_init(irq_handler_t handler); | 45 | extern void mvme16x_sched_init(irq_handler_t handler); |
46 | extern unsigned long mvme16x_gettimeoffset (void); | 46 | extern u32 mvme16x_gettimeoffset(void); |
47 | extern int mvme16x_hwclk (int, struct rtc_time *); | 47 | extern int mvme16x_hwclk (int, struct rtc_time *); |
48 | extern int mvme16x_set_clock_mmss (unsigned long); | 48 | extern int mvme16x_set_clock_mmss (unsigned long); |
49 | extern void mvme16x_reset (void); | 49 | extern void mvme16x_reset (void); |
@@ -289,7 +289,7 @@ void __init config_mvme16x(void) | |||
289 | mach_max_dma_address = 0xffffffff; | 289 | mach_max_dma_address = 0xffffffff; |
290 | mach_sched_init = mvme16x_sched_init; | 290 | mach_sched_init = mvme16x_sched_init; |
291 | mach_init_IRQ = mvme16x_init_IRQ; | 291 | mach_init_IRQ = mvme16x_init_IRQ; |
292 | mach_gettimeoffset = mvme16x_gettimeoffset; | 292 | arch_gettimeoffset = mvme16x_gettimeoffset; |
293 | mach_hwclk = mvme16x_hwclk; | 293 | mach_hwclk = mvme16x_hwclk; |
294 | mach_set_clock_mmss = mvme16x_set_clock_mmss; | 294 | mach_set_clock_mmss = mvme16x_set_clock_mmss; |
295 | mach_reset = mvme16x_reset; | 295 | mach_reset = mvme16x_reset; |
@@ -405,9 +405,9 @@ void mvme16x_sched_init (irq_handler_t timer_routine) | |||
405 | 405 | ||
406 | 406 | ||
407 | /* This is always executed with interrupts disabled. */ | 407 | /* This is always executed with interrupts disabled. */ |
408 | unsigned long mvme16x_gettimeoffset (void) | 408 | u32 mvme16x_gettimeoffset(void) |
409 | { | 409 | { |
410 | return (*(volatile unsigned long *)0xfff42008); | 410 | return (*(volatile u32 *)0xfff42008) * 1000; |
411 | } | 411 | } |
412 | 412 | ||
413 | int bcd2int (unsigned char b) | 413 | int bcd2int (unsigned char b) |
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 1adb5b7b0d1a..658542b914fc 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c | |||
@@ -40,7 +40,7 @@ extern void q40_init_IRQ(void); | |||
40 | static void q40_get_model(char *model); | 40 | static void q40_get_model(char *model); |
41 | extern void q40_sched_init(irq_handler_t handler); | 41 | extern void q40_sched_init(irq_handler_t handler); |
42 | 42 | ||
43 | static unsigned long q40_gettimeoffset(void); | 43 | static u32 q40_gettimeoffset(void); |
44 | static int q40_hwclk(int, struct rtc_time *); | 44 | static int q40_hwclk(int, struct rtc_time *); |
45 | static unsigned int q40_get_ss(void); | 45 | static unsigned int q40_get_ss(void); |
46 | static int q40_set_clock_mmss(unsigned long); | 46 | static int q40_set_clock_mmss(unsigned long); |
@@ -170,7 +170,7 @@ void __init config_q40(void) | |||
170 | mach_sched_init = q40_sched_init; | 170 | mach_sched_init = q40_sched_init; |
171 | 171 | ||
172 | mach_init_IRQ = q40_init_IRQ; | 172 | mach_init_IRQ = q40_init_IRQ; |
173 | mach_gettimeoffset = q40_gettimeoffset; | 173 | arch_gettimeoffset = q40_gettimeoffset; |
174 | mach_hwclk = q40_hwclk; | 174 | mach_hwclk = q40_hwclk; |
175 | mach_get_ss = q40_get_ss; | 175 | mach_get_ss = q40_get_ss; |
176 | mach_get_rtc_pll = q40_get_rtc_pll; | 176 | mach_get_rtc_pll = q40_get_rtc_pll; |
@@ -204,9 +204,9 @@ int q40_parse_bootinfo(const struct bi_record *rec) | |||
204 | } | 204 | } |
205 | 205 | ||
206 | 206 | ||
207 | static unsigned long q40_gettimeoffset(void) | 207 | static u32 q40_gettimeoffset(void) |
208 | { | 208 | { |
209 | return 5000 * (ql_ticks != 0); | 209 | return 5000 * (ql_ticks != 0) * 1000; |
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 2ca25bd01a96..f59ec58083f8 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; | 37 | char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; |
38 | 38 | ||
39 | extern unsigned long sun3_gettimeoffset(void); | 39 | extern u32 sun3_gettimeoffset(void); |
40 | static void sun3_sched_init(irq_handler_t handler); | 40 | static void sun3_sched_init(irq_handler_t handler); |
41 | extern void sun3_get_model (char* model); | 41 | extern void sun3_get_model (char* model); |
42 | extern int sun3_hwclk(int set, struct rtc_time *t); | 42 | extern int sun3_hwclk(int set, struct rtc_time *t); |
@@ -141,7 +141,7 @@ void __init config_sun3(void) | |||
141 | mach_sched_init = sun3_sched_init; | 141 | mach_sched_init = sun3_sched_init; |
142 | mach_init_IRQ = sun3_init_IRQ; | 142 | mach_init_IRQ = sun3_init_IRQ; |
143 | mach_reset = sun3_reboot; | 143 | mach_reset = sun3_reboot; |
144 | mach_gettimeoffset = sun3_gettimeoffset; | 144 | arch_gettimeoffset = sun3_gettimeoffset; |
145 | mach_get_model = sun3_get_model; | 145 | mach_get_model = sun3_get_model; |
146 | mach_hwclk = sun3_hwclk; | 146 | mach_hwclk = sun3_hwclk; |
147 | mach_halt = sun3_halt; | 147 | mach_halt = sun3_halt; |
diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c index 94fe8016f1f0..889829e11f1d 100644 --- a/arch/m68k/sun3/intersil.c +++ b/arch/m68k/sun3/intersil.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) | 23 | #define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) |
24 | 24 | ||
25 | /* does this need to be implemented? */ | 25 | /* does this need to be implemented? */ |
26 | unsigned long sun3_gettimeoffset(void) | 26 | u32 sun3_gettimeoffset(void) |
27 | { | 27 | { |
28 | return 1; | 28 | return 1000; |
29 | } | 29 | } |
30 | 30 | ||
31 | 31 | ||
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index dd306c84d36d..0532d64d191e 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c | |||
@@ -48,7 +48,7 @@ void __init config_sun3x(void) | |||
48 | mach_sched_init = sun3x_sched_init; | 48 | mach_sched_init = sun3x_sched_init; |
49 | mach_init_IRQ = sun3_init_IRQ; | 49 | mach_init_IRQ = sun3_init_IRQ; |
50 | 50 | ||
51 | mach_gettimeoffset = sun3x_gettimeoffset; | 51 | arch_gettimeoffset = sun3x_gettimeoffset; |
52 | mach_reset = sun3x_reboot; | 52 | mach_reset = sun3x_reboot; |
53 | 53 | ||
54 | mach_hwclk = sun3x_hwclk; | 54 | mach_hwclk = sun3x_hwclk; |
diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c index 1d0a72480409..c8eb08add6b0 100644 --- a/arch/m68k/sun3x/time.c +++ b/arch/m68k/sun3x/time.c | |||
@@ -71,7 +71,7 @@ int sun3x_hwclk(int set, struct rtc_time *t) | |||
71 | return 0; | 71 | return 0; |
72 | } | 72 | } |
73 | /* Not much we can do here */ | 73 | /* Not much we can do here */ |
74 | unsigned long sun3x_gettimeoffset (void) | 74 | u32 sun3x_gettimeoffset(void) |
75 | { | 75 | { |
76 | return 0L; | 76 | return 0L; |
77 | } | 77 | } |
diff --git a/arch/m68k/sun3x/time.h b/arch/m68k/sun3x/time.h index 6909e1297534..a4f9126be7e2 100644 --- a/arch/m68k/sun3x/time.h +++ b/arch/m68k/sun3x/time.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define SUN3X_TIME_H | 2 | #define SUN3X_TIME_H |
3 | 3 | ||
4 | extern int sun3x_hwclk(int set, struct rtc_time *t); | 4 | extern int sun3x_hwclk(int set, struct rtc_time *t); |
5 | unsigned long sun3x_gettimeoffset (void); | 5 | u32 sun3x_gettimeoffset(void); |
6 | void sun3x_sched_init(irq_handler_t vector); | 6 | void sun3x_sched_init(irq_handler_t vector); |
7 | 7 | ||
8 | struct mostek_dt { | 8 | struct mostek_dt { |