Skip to content

Commit c8d5ba1

Browse files
author
Stephen Warren
committed
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>
1 parent 7b1f620 commit c8d5ba1

21 files changed

Lines changed: 47 additions & 58 deletions

File tree

‎arch/m68k/amiga/config.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void amiga_sched_init(irq_handler_t handler);
9595
static void amiga_get_model(char *model);
9696
static void amiga_get_hardware_list(struct seq_file *m);
9797
/* amiga specific timer functions */
98-
static unsigned long amiga_gettimeoffset(void);
98+
static u32 amiga_gettimeoffset(void);
9999
extern void amiga_mksound(unsigned int count, unsigned int ticks);
100100
static void amiga_reset(void);
101101
extern void amiga_init_sound(void);
@@ -377,7 +377,7 @@ void __init config_amiga(void)
377377
mach_init_IRQ = amiga_init_IRQ;
378378
mach_get_model = amiga_get_model;
379379
mach_get_hardware_list = amiga_get_hardware_list;
380-
mach_gettimeoffset = amiga_gettimeoffset;
380+
arch_gettimeoffset = amiga_gettimeoffset;
381381

382382
/*
383383
* 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)
482482
#define TICK_SIZE 10000
483483

484484
/* This is always executed with interrupts disabled. */
485-
static unsigned long amiga_gettimeoffset(void)
485+
static u32 amiga_gettimeoffset(void)
486486
{
487487
unsigned short hi, lo, hi2;
488-
unsigned long ticks, offset = 0;
488+
u32 ticks, offset = 0;
489489

490490
/* read CIA B timer A current value */
491491
hi = ciab.tahi;
@@ -507,7 +507,7 @@ static unsigned long amiga_gettimeoffset(void)
507507
ticks = jiffy_ticks - ticks;
508508
ticks = (10000 * ticks) / jiffy_ticks;
509509

510-
return ticks + offset;
510+
return (ticks + offset) * 1000;
511511
}
512512

513513
static void amiga_reset(void) __noreturn;

‎arch/m68k/apollo/config.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ u_long apollo_model;
2626

2727
extern void dn_sched_init(irq_handler_t handler);
2828
extern void dn_init_IRQ(void);
29-
extern unsigned long dn_gettimeoffset(void);
29+
extern u32 dn_gettimeoffset(void);
3030
extern int dn_dummy_hwclk(int, struct rtc_time *);
3131
extern int dn_dummy_set_clock_mmss(unsigned long);
3232
extern void dn_dummy_reset(void);
@@ -151,7 +151,7 @@ void __init config_apollo(void)
151151

152152
mach_sched_init=dn_sched_init; /* */
153153
mach_init_IRQ=dn_init_IRQ;
154-
mach_gettimeoffset = dn_gettimeoffset;
154+
arch_gettimeoffset = dn_gettimeoffset;
155155
mach_max_dma_address = 0xffffffff;
156156
mach_hwclk = dn_dummy_hwclk; /* */
157157
mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */
@@ -203,10 +203,9 @@ void dn_sched_init(irq_handler_t timer_routine)
203203
pr_err("Couldn't register timer interrupt\n");
204204
}
205205

206-
unsigned long dn_gettimeoffset(void) {
207-
206+
u32 dn_gettimeoffset(void)
207+
{
208208
return 0xdeadbeef;
209-
210209
}
211210

212211
int dn_dummy_hwclk(int op, struct rtc_time *t) {

‎arch/m68k/atari/config.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void atari_heartbeat(int on);
7474

7575
/* atari specific timer functions (in time.c) */
7676
extern void atari_sched_init(irq_handler_t);
77-
extern unsigned long atari_gettimeoffset (void);
77+
extern u32 atari_gettimeoffset(void);
7878
extern int atari_mste_hwclk (int, struct rtc_time *);
7979
extern int atari_tt_hwclk (int, struct rtc_time *);
8080
extern int atari_mste_set_clock_mmss (unsigned long);
@@ -204,7 +204,7 @@ void __init config_atari(void)
204204
mach_init_IRQ = atari_init_IRQ;
205205
mach_get_model = atari_get_model;
206206
mach_get_hardware_list = atari_get_hardware_list;
207-
mach_gettimeoffset = atari_gettimeoffset;
207+
arch_gettimeoffset = atari_gettimeoffset;
208208
mach_reset = atari_reset;
209209
mach_max_dma_address = 0xffffff;
210210
#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)

‎arch/m68k/atari/time.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ atari_sched_init(irq_handler_t timer_routine)
4242
#define TICK_SIZE 10000
4343

4444
/* This is always executed with interrupts disabled. */
45-
unsigned long atari_gettimeoffset (void)
45+
u32 atari_gettimeoffset(void)
4646
{
47-
unsigned long ticks, offset = 0;
47+
u32 ticks, offset = 0;
4848

4949
/* read MFP timer C current value */
5050
ticks = st_mfp.tim_dt_c;
@@ -57,7 +57,7 @@ unsigned long atari_gettimeoffset (void)
5757
ticks = INT_TICKS - ticks;
5858
ticks = ticks * 10000L / INT_TICKS;
5959

60-
return ticks + offset;
60+
return (ticks + offset) * 1000;
6161
}
6262

6363

‎arch/m68k/bvme6000/config.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
static void bvme6000_get_model(char *model);
4040
extern void bvme6000_sched_init(irq_handler_t handler);
41-
extern unsigned long bvme6000_gettimeoffset (void);
41+
extern u32 bvme6000_gettimeoffset(void);
4242
extern int bvme6000_hwclk (int, struct rtc_time *);
4343
extern int bvme6000_set_clock_mmss (unsigned long);
4444
extern void bvme6000_reset (void);
@@ -110,7 +110,7 @@ void __init config_bvme6000(void)
110110
mach_max_dma_address = 0xffffffff;
111111
mach_sched_init = bvme6000_sched_init;
112112
mach_init_IRQ = bvme6000_init_IRQ;
113-
mach_gettimeoffset = bvme6000_gettimeoffset;
113+
arch_gettimeoffset = bvme6000_gettimeoffset;
114114
mach_hwclk = bvme6000_hwclk;
115115
mach_set_clock_mmss = bvme6000_set_clock_mmss;
116116
mach_reset = bvme6000_reset;
@@ -216,13 +216,13 @@ void bvme6000_sched_init (irq_handler_t timer_routine)
216216
* results...
217217
*/
218218

219-
unsigned long bvme6000_gettimeoffset (void)
219+
u32 bvme6000_gettimeoffset(void)
220220
{
221221
volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
222222
volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
223223
unsigned char msr = rtc->msr & 0xc0;
224224
unsigned char t1int, t1op;
225-
unsigned long v = 800000, ov;
225+
u32 v = 800000, ov;
226226

227227
rtc->msr = 0; /* Ensure timer registers accessible */
228228

@@ -246,7 +246,7 @@ unsigned long bvme6000_gettimeoffset (void)
246246
v += 10000; /* Int pending, + 10ms */
247247
rtc->msr = msr;
248248

249-
return v;
249+
return v * 1000;
250250
}
251251

252252
/*

‎arch/m68k/hp300/config.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void __init config_hp300(void)
251251
mach_sched_init = hp300_sched_init;
252252
mach_init_IRQ = hp300_init_IRQ;
253253
mach_get_model = hp300_get_model;
254-
mach_gettimeoffset = hp300_gettimeoffset;
254+
arch_gettimeoffset = hp300_gettimeoffset;
255255
mach_hwclk = hp300_hwclk;
256256
mach_get_ss = hp300_get_ss;
257257
mach_reset = hp300_reset;

‎arch/m68k/hp300/time.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static irqreturn_t hp300_tick(int irq, void *dev_id)
4646
return vector(irq, NULL);
4747
}
4848

49-
unsigned long hp300_gettimeoffset(void)
49+
u32 hp300_gettimeoffset(void)
5050
{
5151
/* Read current timer 1 value */
5252
unsigned char lsb, msb1, msb2;
@@ -59,7 +59,7 @@ unsigned long hp300_gettimeoffset(void)
5959
/* A carry happened while we were reading. Read it again */
6060
lsb = in_8(CLOCKBASE + 7);
6161
ticks = INTVAL - ((msb2 << 8) | lsb);
62-
return (USECS_PER_JIFFY * ticks) / INTVAL;
62+
return ((USECS_PER_JIFFY * ticks) / INTVAL) * 1000;
6363
}
6464

6565
void __init hp300_sched_init(irq_handler_t vector)

‎arch/m68k/hp300/time.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
extern void hp300_sched_init(irq_handler_t vector);
2-
extern unsigned long hp300_gettimeoffset(void);
2+
extern u32 hp300_gettimeoffset(void);

‎arch/m68k/include/asm/machdep.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <linux/seq_file.h>
55
#include <linux/interrupt.h>
6+
#include <linux/time.h>
67

78
struct pt_regs;
89
struct mktime;
@@ -16,7 +17,6 @@ extern void (*mach_init_IRQ) (void);
1617
extern void (*mach_get_model) (char *model);
1718
extern void (*mach_get_hardware_list) (struct seq_file *m);
1819
/* machine dependent timer functions */
19-
extern unsigned long (*mach_gettimeoffset)(void);
2020
extern int (*mach_hwclk)(int, struct rtc_time*);
2121
extern unsigned int (*mach_get_ss)(void);
2222
extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);

‎arch/m68k/kernel/setup_mm.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ void (*mach_init_IRQ) (void) __initdata = NULL;
8484
void (*mach_get_model) (char *model);
8585
void (*mach_get_hardware_list) (struct seq_file *m);
8686
/* machine dependent timer functions */
87-
unsigned long (*mach_gettimeoffset) (void);
8887
int (*mach_hwclk) (int, struct rtc_time*);
8988
EXPORT_SYMBOL(mach_hwclk);
9089
int (*mach_set_clock_mmss) (unsigned long);

0 commit comments

Comments
 (0)