Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
cf3d7c1e
Commit
cf3d7c1e
authored
Mar 26, 2008
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: Fix sparse warnings in arch/sparc64/kernel/time.c
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
bfdf9ebc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
31 deletions
+49
-31
arch/sparc64/kernel/entry.h
arch/sparc64/kernel/entry.h
+2
-0
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/smp.c
+2
-1
arch/sparc64/kernel/time.c
arch/sparc64/kernel/time.c
+40
-26
include/asm-sparc64/timer.h
include/asm-sparc64/timer.h
+5
-4
No files found.
arch/sparc64/kernel/entry.h
View file @
cf3d7c1e
...
...
@@ -14,6 +14,8 @@ extern void __init boot_cpu_id_too_large(int cpu);
extern
unsigned
int
dcache_parity_tl1_occurred
;
extern
unsigned
int
icache_parity_tl1_occurred
;
extern
void
timer_interrupt
(
int
irq
,
struct
pt_regs
*
regs
);
extern
asmlinkage
void
syscall_trace
(
struct
pt_regs
*
regs
,
int
syscall_exit_p
);
...
...
arch/sparc64/kernel/smp.c
View file @
cf3d7c1e
/* smp.c: Sparc64 SMP support.
*
* Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net)
* Copyright (C) 1997, 2007
, 2008
David S. Miller (davem@davemloft.net)
*/
#include <linux/module.h>
...
...
@@ -30,6 +30,7 @@
#include <asm/cpudata.h>
#include <asm/hvtramp.h>
#include <asm/io.h>
#include <asm/timer.h>
#include <asm/irq.h>
#include <asm/irq_regs.h>
...
...
arch/sparc64/kernel/time.c
View file @
cf3d7c1e
/* $Id: time.c,v 1.42 2002/01/23 14:33:55 davem Exp $
* time.c: UltraSparc timer and TOD clock support.
/* time.c: UltraSparc timer and TOD clock support.
*
* Copyright (C) 1997
David S. Miller (davem@caip.rutgers.edu
)
* Copyright (C) 1997
, 2008 David S. Miller (davem@davemloft.net
)
* Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
*
* Based largely on code which is:
...
...
@@ -48,6 +47,8 @@
#include <asm/uaccess.h>
#include <asm/irq_regs.h>
#include "entry.h"
DEFINE_SPINLOCK
(
mostek_lock
);
DEFINE_SPINLOCK
(
rtc_lock
);
void
__iomem
*
mstk48t02_regs
=
NULL
;
...
...
@@ -508,6 +509,37 @@ static int __init has_low_battery(void)
return
(
data1
==
data2
);
/* Was the write blocked? */
}
static
void
__init
mostek_set_system_time
(
void
__iomem
*
mregs
)
{
unsigned
int
year
,
mon
,
day
,
hour
,
min
,
sec
;
u8
tmp
;
spin_lock_irq
(
&
mostek_lock
);
/* Traditional Mostek chip. */
tmp
=
mostek_read
(
mregs
+
MOSTEK_CREG
);
tmp
|=
MSTK_CREG_READ
;
mostek_write
(
mregs
+
MOSTEK_CREG
,
tmp
);
sec
=
MSTK_REG_SEC
(
mregs
);
min
=
MSTK_REG_MIN
(
mregs
);
hour
=
MSTK_REG_HOUR
(
mregs
);
day
=
MSTK_REG_DOM
(
mregs
);
mon
=
MSTK_REG_MONTH
(
mregs
);
year
=
MSTK_CVT_YEAR
(
MSTK_REG_YEAR
(
mregs
)
);
xtime
.
tv_sec
=
mktime
(
year
,
mon
,
day
,
hour
,
min
,
sec
);
xtime
.
tv_nsec
=
(
INITIAL_JIFFIES
%
HZ
)
*
(
NSEC_PER_SEC
/
HZ
);
set_normalized_timespec
(
&
wall_to_monotonic
,
-
xtime
.
tv_sec
,
-
xtime
.
tv_nsec
);
tmp
=
mostek_read
(
mregs
+
MOSTEK_CREG
);
tmp
&=
~
MSTK_CREG_READ
;
mostek_write
(
mregs
+
MOSTEK_CREG
,
tmp
);
spin_unlock_irq
(
&
mostek_lock
);
}
/* Probe for the real time clock chip. */
static
void
__init
set_system_time
(
void
)
{
...
...
@@ -520,7 +552,6 @@ static void __init set_system_time(void)
unsigned
long
dregs
=
0UL
;
void
__iomem
*
bregs
=
0UL
;
#endif
u8
tmp
;
if
(
!
mregs
&&
!
dregs
&&
!
bregs
)
{
prom_printf
(
"Something wrong, clock regs not mapped yet.
\n
"
);
...
...
@@ -528,20 +559,11 @@ static void __init set_system_time(void)
}
if
(
mregs
)
{
spin_lock_irq
(
&
mostek_lock
);
/* Traditional Mostek chip. */
tmp
=
mostek_read
(
mregs
+
MOSTEK_CREG
);
tmp
|=
MSTK_CREG_READ
;
mostek_write
(
mregs
+
MOSTEK_CREG
,
tmp
);
mostek_set_system_time
(
mregs
);
return
;
}
sec
=
MSTK_REG_SEC
(
mregs
);
min
=
MSTK_REG_MIN
(
mregs
);
hour
=
MSTK_REG_HOUR
(
mregs
);
day
=
MSTK_REG_DOM
(
mregs
);
mon
=
MSTK_REG_MONTH
(
mregs
);
year
=
MSTK_CVT_YEAR
(
MSTK_REG_YEAR
(
mregs
)
);
}
else
if
(
bregs
)
{
if
(
bregs
)
{
unsigned
char
val
=
readb
(
bregs
+
0x0e
);
unsigned
int
century
;
...
...
@@ -596,14 +618,6 @@ static void __init set_system_time(void)
xtime
.
tv_nsec
=
(
INITIAL_JIFFIES
%
HZ
)
*
(
NSEC_PER_SEC
/
HZ
);
set_normalized_timespec
(
&
wall_to_monotonic
,
-
xtime
.
tv_sec
,
-
xtime
.
tv_nsec
);
if
(
mregs
)
{
tmp
=
mostek_read
(
mregs
+
MOSTEK_CREG
);
tmp
&=
~
MSTK_CREG_READ
;
mostek_write
(
mregs
+
MOSTEK_CREG
,
tmp
);
spin_unlock_irq
(
&
mostek_lock
);
}
}
/* davem suggests we keep this within the 4M locked kernel image */
...
...
@@ -1027,7 +1041,7 @@ void __init time_init(void)
setup_clockevent_multiplier
(
clock
);
sparc64_clockevent
.
max_delta_ns
=
clockevent_delta2ns
(
0x7fffffffffffffff
,
&
sparc64_clockevent
);
clockevent_delta2ns
(
0x7fffffffffffffff
UL
,
&
sparc64_clockevent
);
sparc64_clockevent
.
min_delta_ns
=
clockevent_delta2ns
(
0xF
,
&
sparc64_clockevent
);
...
...
include/asm-sparc64/timer.h
View file @
cf3d7c1e
/* $Id: timer.h,v 1.3 2000/05/09 17:40:15 davem Exp $
* timer.h: System timer definitions for sun5.
/* timer.h: System timer definitions for sun5.
*
* Copyright (C) 1997
David S. Miller (davem@caip.rutgers.edu
)
* Copyright (C) 1997
, 2008 David S. Miller (davem@davemloft.net
)
*/
#ifndef _SPARC64_TIMER_H
#define _SPARC64_TIMER_H
#include <linux/types.h>
#include <linux/init.h>
struct
sparc64_tick_ops
{
unsigned
long
(
*
get_tick
)(
void
);
...
...
@@ -25,5 +24,7 @@ struct sparc64_tick_ops {
extern
struct
sparc64_tick_ops
*
tick_ops
;
extern
unsigned
long
sparc64_get_clock_tick
(
unsigned
int
cpu
);
extern
void
__devinit
setup_sparc64_timer
(
void
);
extern
void
__init
time_init
(
void
);
#endif
/* _SPARC64_TIMER_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment