Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
cf3d7c1e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cf3d7c1e
编写于
3月 26, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC64]: Fix sparse warnings in arch/sparc64/kernel/time.c
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
bfdf9ebc
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
49 addition
and
31 deletion
+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
未找到文件。
arch/sparc64/kernel/entry.h
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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 */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录