Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
1da1180c
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1da1180c
编写于
11月 26, 2008
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sh: Split out the idle loop for reuse between _32/_64 variants.
Signed-off-by:
N
Paul Mundt
<
lethal@linux-sh.org
>
上级
eb67cf14
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
83 addition
and
123 deletion
+83
-123
arch/sh/kernel/Makefile_32
arch/sh/kernel/Makefile_32
+1
-1
arch/sh/kernel/Makefile_64
arch/sh/kernel/Makefile_64
+1
-1
arch/sh/kernel/idle.c
arch/sh/kernel/idle.c
+81
-0
arch/sh/kernel/process_32.c
arch/sh/kernel/process_32.c
+0
-61
arch/sh/kernel/process_64.c
arch/sh/kernel/process_64.c
+0
-60
未找到文件。
arch/sh/kernel/Makefile_32
浏览文件 @
1da1180c
...
@@ -9,7 +9,7 @@ ifdef CONFIG_FUNCTION_TRACER
...
@@ -9,7 +9,7 @@ ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg
endif
endif
obj-y := debugtraps.o disassemble.o i
o.o io_generic.o irq.o
\
obj-y := debugtraps.o disassemble.o i
dle.o io.o io_generic.o irq.o
\
machvec.o process_32.o ptrace_32.o setup.o signal_32.o \
machvec.o process_32.o ptrace_32.o setup.o signal_32.o \
sys_sh.o sys_sh32.o syscalls_32.o time_32.o topology.o \
sys_sh.o sys_sh32.o syscalls_32.o time_32.o topology.o \
traps.o traps_32.o
traps.o traps_32.o
...
...
arch/sh/kernel/Makefile_64
浏览文件 @
1da1180c
extra-y := head_64.o init_task.o vmlinux.lds
extra-y := head_64.o init_task.o vmlinux.lds
obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process_64.o \
obj-y := debugtraps.o i
dle.o i
o.o io_generic.o irq.o machvec.o process_64.o \
ptrace_64.o setup.o signal_64.o sys_sh.o sys_sh64.o \
ptrace_64.o setup.o signal_64.o sys_sh.o sys_sh64.o \
syscalls_64.o time_64.o topology.o traps.o traps_64.o
syscalls_64.o time_64.o topology.o traps.o traps_64.o
...
...
arch/sh/kernel/idle.c
0 → 100644
浏览文件 @
1da1180c
/*
* The idle loop for all SuperH platforms.
*
* Copyright (C) 2002 - 2008 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/pm.h>
#include <linux/tick.h>
#include <linux/preempt.h>
#include <linux/thread_info.h>
#include <linux/irqflags.h>
#include <asm/pgalloc.h>
#include <asm/system.h>
#include <asm/atomic.h>
static
int
hlt_counter
;
void
(
*
pm_idle
)(
void
);
void
(
*
pm_power_off
)(
void
);
EXPORT_SYMBOL
(
pm_power_off
);
static
int
__init
nohlt_setup
(
char
*
__unused
)
{
hlt_counter
=
1
;
return
1
;
}
__setup
(
"nohlt"
,
nohlt_setup
);
static
int
__init
hlt_setup
(
char
*
__unused
)
{
hlt_counter
=
0
;
return
1
;
}
__setup
(
"hlt"
,
hlt_setup
);
static
void
default_idle
(
void
)
{
if
(
!
hlt_counter
)
{
clear_thread_flag
(
TIF_POLLING_NRFLAG
);
smp_mb__after_clear_bit
();
set_bl_bit
();
stop_critical_timings
();
while
(
!
need_resched
())
cpu_sleep
();
start_critical_timings
();
clear_bl_bit
();
set_thread_flag
(
TIF_POLLING_NRFLAG
);
}
else
while
(
!
need_resched
())
cpu_relax
();
}
void
cpu_idle
(
void
)
{
set_thread_flag
(
TIF_POLLING_NRFLAG
);
/* endless idle loop with no priority at all */
while
(
1
)
{
void
(
*
idle
)(
void
)
=
pm_idle
;
if
(
!
idle
)
idle
=
default_idle
;
tick_nohz_stop_sched_tick
(
1
);
while
(
!
need_resched
())
idle
();
tick_nohz_restart_sched_tick
();
preempt_enable_no_resched
();
schedule
();
preempt_disable
();
check_pgt_cache
();
}
}
arch/sh/kernel/process_32.c
浏览文件 @
1da1180c
...
@@ -32,69 +32,8 @@
...
@@ -32,69 +32,8 @@
#include <asm/fpu.h>
#include <asm/fpu.h>
#include <asm/syscalls.h>
#include <asm/syscalls.h>
static
int
hlt_counter
;
int
ubc_usercnt
=
0
;
int
ubc_usercnt
=
0
;
void
(
*
pm_idle
)(
void
);
void
(
*
pm_power_off
)(
void
);
EXPORT_SYMBOL
(
pm_power_off
);
static
int
__init
nohlt_setup
(
char
*
__unused
)
{
hlt_counter
=
1
;
return
1
;
}
__setup
(
"nohlt"
,
nohlt_setup
);
static
int
__init
hlt_setup
(
char
*
__unused
)
{
hlt_counter
=
0
;
return
1
;
}
__setup
(
"hlt"
,
hlt_setup
);
static
void
default_idle
(
void
)
{
if
(
!
hlt_counter
)
{
clear_thread_flag
(
TIF_POLLING_NRFLAG
);
smp_mb__after_clear_bit
();
set_bl_bit
();
stop_critical_timings
();
while
(
!
need_resched
())
cpu_sleep
();
start_critical_timings
();
clear_bl_bit
();
set_thread_flag
(
TIF_POLLING_NRFLAG
);
}
else
while
(
!
need_resched
())
cpu_relax
();
}
void
cpu_idle
(
void
)
{
set_thread_flag
(
TIF_POLLING_NRFLAG
);
/* endless idle loop with no priority at all */
while
(
1
)
{
void
(
*
idle
)(
void
)
=
pm_idle
;
if
(
!
idle
)
idle
=
default_idle
;
tick_nohz_stop_sched_tick
(
1
);
while
(
!
need_resched
())
idle
();
tick_nohz_restart_sched_tick
();
preempt_enable_no_resched
();
schedule
();
preempt_disable
();
check_pgt_cache
();
}
}
void
machine_restart
(
char
*
__unused
)
void
machine_restart
(
char
*
__unused
)
{
{
/* SR.BL=1 and invoke address error to let CPU reset (manual reset) */
/* SR.BL=1 and invoke address error to let CPU reset (manual reset) */
...
...
arch/sh/kernel/process_64.c
浏览文件 @
1da1180c
...
@@ -33,56 +33,6 @@
...
@@ -33,56 +33,6 @@
struct
task_struct
*
last_task_used_math
=
NULL
;
struct
task_struct
*
last_task_used_math
=
NULL
;
static
int
hlt_counter
=
1
;
#define HARD_IDLE_TIMEOUT (HZ / 3)
static
int
__init
nohlt_setup
(
char
*
__unused
)
{
hlt_counter
=
1
;
return
1
;
}
static
int
__init
hlt_setup
(
char
*
__unused
)
{
hlt_counter
=
0
;
return
1
;
}
__setup
(
"nohlt"
,
nohlt_setup
);
__setup
(
"hlt"
,
hlt_setup
);
static
inline
void
hlt
(
void
)
{
__asm__
__volatile__
(
"sleep"
:
:
:
"memory"
);
}
/*
* The idle loop on a uniprocessor SH..
*/
void
cpu_idle
(
void
)
{
/* endless idle loop with no priority at all */
while
(
1
)
{
if
(
hlt_counter
)
{
while
(
!
need_resched
())
cpu_relax
();
}
else
{
local_irq_disable
();
while
(
!
need_resched
())
{
local_irq_enable
();
hlt
();
local_irq_disable
();
}
local_irq_enable
();
}
preempt_enable_no_resched
();
schedule
();
preempt_disable
();
}
}
void
machine_restart
(
char
*
__unused
)
void
machine_restart
(
char
*
__unused
)
{
{
extern
void
phys_stext
(
void
);
extern
void
phys_stext
(
void
);
...
@@ -97,13 +47,6 @@ void machine_halt(void)
...
@@ -97,13 +47,6 @@ void machine_halt(void)
void
machine_power_off
(
void
)
void
machine_power_off
(
void
)
{
{
#if 0
/* Disable watchdog timer */
ctrl_outl(0xa5000000, WTCSR);
/* Configure deep standby on sleep */
ctrl_outl(0x03, STBCR);
#endif
__asm__
__volatile__
(
__asm__
__volatile__
(
"sleep
\n\t
"
"sleep
\n\t
"
"synci
\n\t
"
"synci
\n\t
"
...
@@ -113,9 +56,6 @@ void machine_power_off(void)
...
@@ -113,9 +56,6 @@ void machine_power_off(void)
panic
(
"Unexpected wakeup!
\n
"
);
panic
(
"Unexpected wakeup!
\n
"
);
}
}
void
(
*
pm_power_off
)(
void
)
=
machine_power_off
;
EXPORT_SYMBOL
(
pm_power_off
);
void
show_regs
(
struct
pt_regs
*
regs
)
void
show_regs
(
struct
pt_regs
*
regs
)
{
{
unsigned
long
long
ah
,
al
,
bh
,
bl
,
ch
,
cl
;
unsigned
long
long
ah
,
al
,
bh
,
bl
,
ch
,
cl
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录