Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
fe691021
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fe691021
编写于
2月 07, 2006
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
上级
f30ac319
7d4d6154
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
123 addition
and
88 deletion
+123
-88
Documentation/powerpc/booting-without-of.txt
Documentation/powerpc/booting-without-of.txt
+8
-0
arch/powerpc/kernel/fpu.S
arch/powerpc/kernel/fpu.S
+1
-1
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_64.S
+3
-2
arch/powerpc/kernel/iommu.c
arch/powerpc/kernel/iommu.c
+6
-3
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/prom.c
+35
-3
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/prom_init.c
+4
-0
arch/powerpc/kernel/prom_parse.c
arch/powerpc/kernel/prom_parse.c
+3
-1
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/rtas.c
+6
-6
arch/powerpc/kernel/rtas_flash.c
arch/powerpc/kernel/rtas_flash.c
+1
-2
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/setup_64.c
+3
-0
arch/powerpc/kernel/smp.c
arch/powerpc/kernel/smp.c
+3
-0
arch/powerpc/kernel/time.c
arch/powerpc/kernel/time.c
+4
-4
arch/powerpc/kernel/udbg_16550.c
arch/powerpc/kernel/udbg_16550.c
+1
-1
arch/powerpc/mm/lmb.c
arch/powerpc/mm/lmb.c
+4
-0
arch/powerpc/mm/mem.c
arch/powerpc/mm/mem.c
+2
-12
arch/powerpc/platforms/cell/Makefile
arch/powerpc/platforms/cell/Makefile
+1
-1
arch/powerpc/platforms/chrp/chrp.h
arch/powerpc/platforms/chrp/chrp.h
+0
-1
arch/powerpc/platforms/chrp/pci.c
arch/powerpc/platforms/chrp/pci.c
+2
-0
arch/powerpc/platforms/chrp/setup.c
arch/powerpc/platforms/chrp/setup.c
+1
-1
arch/powerpc/platforms/chrp/time.c
arch/powerpc/platforms/chrp/time.c
+0
-21
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/platforms/pseries/setup.c
+1
-1
arch/ppc/kernel/head_8xx.S
arch/ppc/kernel/head_8xx.S
+5
-2
drivers/macintosh/windfarm_core.c
drivers/macintosh/windfarm_core.c
+27
-26
include/asm-powerpc/prom.h
include/asm-powerpc/prom.h
+2
-0
未找到文件。
Documentation/powerpc/booting-without-of.txt
浏览文件 @
fe691021
...
...
@@ -880,6 +880,10 @@ address which can extend beyond that limit.
- device_type : Should be "soc"
- ranges : Should be defined as specified in 1) to describe the
translation of SOC addresses for memory mapped SOC registers.
- bus-frequency: Contains the bus frequency for the SOC node.
Typically, the value of this field is filled in by the boot
loader.
Recommended properties:
...
...
@@ -919,6 +923,7 @@ SOC.
device_type = "soc";
ranges = <00000000 e0000000 00100000>
reg = <e0000000 00003000>;
bus-frequency = <0>;
}
...
...
@@ -1170,6 +1175,8 @@ platforms are moved over to use the flattened-device-tree model.
mdio@24520 {
reg = <24520 20>;
device_type = "mdio";
compatible = "gianfar";
ethernet-phy@0 {
......
...
...
@@ -1317,6 +1324,7 @@ not necessary as they are usually the same as the root node.
device_type = "soc";
ranges = <00000000 e0000000 00100000>
reg = <e0000000 00003000>;
bus-frequency = <0>;
mdio@24520 {
reg = <24520 20>;
...
...
arch/powerpc/kernel/fpu.S
浏览文件 @
fe691021
...
...
@@ -66,7 +66,7 @@ _GLOBAL(load_up_fpu)
#else
ld
r4
,
PACACURRENT
(
r13
)
addi
r5
,
r4
,
THREAD
/*
Get
THREAD
*/
l
d
r4
,
THREAD_FPEXC_MODE
(
r5
)
l
wz
r4
,
THREAD_FPEXC_MODE
(
r5
)
ori
r12
,
r12
,
MSR_FP
or
r12
,
r12
,
r4
std
r12
,
_MSR
(
r1
)
...
...
arch/powerpc/kernel/head_64.S
浏览文件 @
fe691021
...
...
@@ -749,11 +749,12 @@ iSeries_secondary_smp_loop:
.
globl
decrementer_iSeries_masked
decrementer_iSeries_masked
:
/
*
We
may
not
have
a
valid
TOC
pointer
in
here
.
*/
li
r11
,
1
ld
r12
,
PACALPPACAPTR
(
r13
)
stb
r11
,
LPPACADECRINT
(
r12
)
LOAD_REG_
ADDRBASE
(
r12
,
tb_ticks_per_jiffy
)
lwz
r12
,
ADDROFF
(
tb_ticks_per_jiffy
)
(
r12
)
LOAD_REG_
IMMEDIATE
(
r12
,
tb_ticks_per_jiffy
)
lwz
r12
,
0
(
r12
)
mtspr
SPRN_DEC
,
r12
/
*
fall
through
*/
...
...
arch/powerpc/kernel/iommu.c
浏览文件 @
fe691021
...
...
@@ -334,9 +334,6 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
spin_unlock_irqrestore
(
&
(
tbl
->
it_lock
),
flags
);
/* Make sure updates are seen by hardware */
mb
();
DBG
(
"mapped %d elements:
\n
"
,
outcount
);
/* For the sake of iommu_unmap_sg, we clear out the length in the
...
...
@@ -347,6 +344,10 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
outs
->
dma_address
=
DMA_ERROR_CODE
;
outs
->
dma_length
=
0
;
}
/* Make sure updates are seen by hardware */
mb
();
return
outcount
;
failure:
...
...
@@ -358,6 +359,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
npages
=
(
PAGE_ALIGN
(
s
->
dma_address
+
s
->
dma_length
)
-
vaddr
)
>>
PAGE_SHIFT
;
__iommu_free
(
tbl
,
vaddr
,
npages
);
s
->
dma_address
=
DMA_ERROR_CODE
;
s
->
dma_length
=
0
;
}
}
spin_unlock_irqrestore
(
&
(
tbl
->
it_lock
),
flags
);
...
...
arch/powerpc/kernel/prom.c
浏览文件 @
fe691021
...
...
@@ -491,7 +491,12 @@ void __init finish_device_tree(void)
size
=
16
;
finish_node
(
allnodes
,
&
size
,
1
);
size
-=
16
;
end
=
start
=
(
unsigned
long
)
__va
(
lmb_alloc
(
size
,
128
));
if
(
0
==
size
)
end
=
start
=
0
;
else
end
=
start
=
(
unsigned
long
)
__va
(
lmb_alloc
(
size
,
128
));
finish_node
(
allnodes
,
&
end
,
0
);
BUG_ON
(
end
!=
start
+
size
);
...
...
@@ -1398,8 +1403,8 @@ struct device_node *of_find_node_by_name(struct device_node *from,
read_lock
(
&
devtree_lock
);
np
=
from
?
from
->
allnext
:
allnodes
;
for
(;
np
!=
0
;
np
=
np
->
allnext
)
if
(
np
->
name
!=
0
&&
strcasecmp
(
np
->
name
,
name
)
==
0
for
(;
np
!=
NULL
;
np
=
np
->
allnext
)
if
(
np
->
name
!=
NULL
&&
strcasecmp
(
np
->
name
,
name
)
==
0
&&
of_node_get
(
np
))
break
;
if
(
from
)
...
...
@@ -1917,3 +1922,30 @@ int prom_update_property(struct device_node *np,
return
0
;
}
#ifdef CONFIG_KEXEC
/* We may have allocated the flat device tree inside the crash kernel region
* in prom_init. If so we need to move it out into regular memory. */
void
kdump_move_device_tree
(
void
)
{
unsigned
long
start
,
end
;
struct
boot_param_header
*
new
;
start
=
__pa
((
unsigned
long
)
initial_boot_params
);
end
=
start
+
initial_boot_params
->
totalsize
;
if
(
end
<
crashk_res
.
start
||
start
>
crashk_res
.
end
)
return
;
new
=
(
struct
boot_param_header
*
)
__va
(
lmb_alloc
(
initial_boot_params
->
totalsize
,
PAGE_SIZE
));
memcpy
(
new
,
initial_boot_params
,
initial_boot_params
->
totalsize
);
initial_boot_params
=
new
;
DBG
(
"Flat device tree blob moved to %p
\n
"
,
initial_boot_params
);
/* XXX should we unreserve the old DT? */
}
#endif
/* CONFIG_KEXEC */
arch/powerpc/kernel/prom_init.c
浏览文件 @
fe691021
...
...
@@ -2098,6 +2098,10 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
*/
prom_init_stdout
();
/* Bail if this is a kdump kernel. */
if
(
PHYSICAL_START
>
0
)
prom_panic
(
"Error: You can't boot a kdump kernel from OF!
\n
"
);
/*
* Check for an initrd
*/
...
...
arch/powerpc/kernel/prom_parse.c
浏览文件 @
fe691021
...
...
@@ -465,8 +465,10 @@ u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
if
(
parent
==
NULL
)
return
NULL
;
bus
=
of_match_bus
(
parent
);
if
(
strcmp
(
bus
->
name
,
"pci"
))
if
(
strcmp
(
bus
->
name
,
"pci"
))
{
of_node_put
(
parent
);
return
NULL
;
}
bus
->
count_cells
(
dev
,
&
na
,
&
ns
);
of_node_put
(
parent
);
if
(
!
OF_CHECK_COUNTS
(
na
,
ns
))
...
...
arch/powerpc/kernel/rtas.c
浏览文件 @
fe691021
...
...
@@ -22,6 +22,7 @@
#include <asm/prom.h>
#include <asm/rtas.h>
#include <asm/hvcall.h>
#include <asm/semaphore.h>
#include <asm/machdep.h>
#include <asm/page.h>
...
...
@@ -565,6 +566,7 @@ static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE;
#ifdef CONFIG_PPC_PSERIES
static
void
rtas_percpu_suspend_me
(
void
*
info
)
{
int
i
;
long
rc
;
long
flags
;
struct
rtas_suspend_me_data
*
data
=
...
...
@@ -587,18 +589,16 @@ static void rtas_percpu_suspend_me(void *info)
if
(
rc
==
H_Continue
)
{
data
->
waiting
=
0
;
rtas_call
(
ibm_suspend_me_token
,
0
,
1
,
data
->
args
->
args
);
data
->
args
->
args
[
data
->
args
->
nargs
]
=
rtas_call
(
ibm_suspend_me_token
,
0
,
1
,
NULL
);
for_each_cpu
(
i
)
plpar_hcall_norets
(
H_PROD
,
i
);
}
else
{
data
->
waiting
=
-
EBUSY
;
printk
(
KERN_ERR
"Error on H_Join hypervisor call
\n
"
);
}
out:
/* before we restore interrupts, make sure we don't
* generate a spurious soft lockup errors
*/
touch_softlockup_watchdog
();
local_irq_restore
(
flags
);
return
;
}
...
...
arch/powerpc/kernel/rtas_flash.c
浏览文件 @
fe691021
...
...
@@ -672,8 +672,7 @@ static void rtas_flash_firmware(int reboot_type)
static
void
remove_flash_pde
(
struct
proc_dir_entry
*
dp
)
{
if
(
dp
)
{
if
(
dp
->
data
!=
NULL
)
kfree
(
dp
->
data
);
kfree
(
dp
->
data
);
dp
->
owner
=
NULL
;
remove_proc_entry
(
dp
->
name
,
dp
->
parent
);
}
...
...
arch/powerpc/kernel/setup_64.c
浏览文件 @
fe691021
...
...
@@ -398,6 +398,9 @@ void __init setup_system(void)
{
DBG
(
" -> setup_system()
\n
"
);
#ifdef CONFIG_KEXEC
kdump_move_device_tree
();
#endif
/*
* Unflatten the device-tree passed by prom_init or kexec
*/
...
...
arch/powerpc/kernel/smp.c
浏览文件 @
fe691021
...
...
@@ -540,6 +540,9 @@ int __devinit start_secondary(void *unused)
if
(
smp_ops
->
take_timebase
)
smp_ops
->
take_timebase
();
if
(
system_state
>
SYSTEM_BOOTING
)
per_cpu
(
last_jiffy
,
cpu
)
=
get_tb
();
spin_lock
(
&
call_lock
);
cpu_set
(
cpu
,
cpu_online_map
);
spin_unlock
(
&
call_lock
);
...
...
arch/powerpc/kernel/time.c
浏览文件 @
fe691021
...
...
@@ -612,10 +612,10 @@ void __init generic_calibrate_decr(void)
ppc_tb_freq
=
DEFAULT_TB_FREQ
;
/* hardcoded default */
node_found
=
0
;
if
(
cpu
!=
0
)
{
if
(
cpu
)
{
fp
=
(
unsigned
int
*
)
get_property
(
cpu
,
"timebase-frequency"
,
NULL
);
if
(
fp
!=
0
)
{
if
(
fp
)
{
node_found
=
1
;
ppc_tb_freq
=
*
fp
;
}
...
...
@@ -626,10 +626,10 @@ void __init generic_calibrate_decr(void)
ppc_proc_freq
=
DEFAULT_PROC_FREQ
;
node_found
=
0
;
if
(
cpu
!=
0
)
{
if
(
cpu
)
{
fp
=
(
unsigned
int
*
)
get_property
(
cpu
,
"clock-frequency"
,
NULL
);
if
(
fp
!=
0
)
{
if
(
fp
)
{
node_found
=
1
;
ppc_proc_freq
=
*
fp
;
}
...
...
arch/powerpc/kernel/udbg_16550.c
浏览文件 @
fe691021
...
...
@@ -144,7 +144,7 @@ unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
}
#ifdef CONFIG_PPC_MAPLE
void
udbg_maple_real_putc
(
unsigned
char
c
)
void
udbg_maple_real_putc
(
char
c
)
{
if
(
udbg_comport
)
{
while
((
real_readb
(
&
udbg_comport
->
lsr
)
&
LSR_THRE
)
==
0
)
...
...
arch/powerpc/mm/lmb.c
浏览文件 @
fe691021
...
...
@@ -197,6 +197,8 @@ long __init lmb_reserve(unsigned long base, unsigned long size)
{
struct
lmb_region
*
_rgn
=
&
(
lmb
.
reserved
);
BUG_ON
(
0
==
size
);
return
lmb_add_region
(
_rgn
,
base
,
size
);
}
...
...
@@ -227,6 +229,8 @@ unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align,
long
i
,
j
;
unsigned
long
base
=
0
;
BUG_ON
(
0
==
size
);
#ifdef CONFIG_PPC32
/* On 32-bit, make sure we allocate lowmem */
if
(
max_addr
==
LMB_ALLOC_ANYWHERE
)
...
...
arch/powerpc/mm/mem.c
浏览文件 @
fe691021
...
...
@@ -435,17 +435,12 @@ void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
{
clear_page
(
page
);
if
(
cpu_has_feature
(
CPU_FTR_COHERENT_ICACHE
))
return
;
/*
* We shouldnt have to do this, but some versions of glibc
* require it (ld.so assumes zero filled pages are icache clean)
* - Anton
*/
/* avoid an atomic op if possible */
if
(
test_bit
(
PG_arch_1
,
&
pg
->
flags
))
clear_bit
(
PG_arch_1
,
&
pg
->
flags
);
flush_dcache_page
(
pg
);
}
EXPORT_SYMBOL
(
clear_user_page
);
...
...
@@ -469,12 +464,7 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
return;
#endif
if
(
cpu_has_feature
(
CPU_FTR_COHERENT_ICACHE
))
return
;
/* avoid an atomic op if possible */
if
(
test_bit
(
PG_arch_1
,
&
pg
->
flags
))
clear_bit
(
PG_arch_1
,
&
pg
->
flags
);
flush_dcache_page
(
pg
);
}
void
flush_icache_user_range
(
struct
vm_area_struct
*
vma
,
struct
page
*
page
,
...
...
arch/powerpc/platforms/cell/Makefile
浏览文件 @
fe691021
...
...
@@ -2,7 +2,7 @@ obj-y += interrupt.o iommu.o setup.o spider-pic.o
obj-y
+=
pervasive.o
obj-$(CONFIG_SMP)
+=
smp.o
obj-$(CONFIG_SPU_FS)
+=
spu
fs/ spu-base.o
obj-$(CONFIG_SPU_FS)
+=
spu
-base.o spufs/
spu-base-y
+=
spu_base.o spu_priv1.o
...
...
arch/powerpc/platforms/chrp/chrp.h
浏览文件 @
fe691021
...
...
@@ -5,7 +5,6 @@
extern
void
chrp_nvram_init
(
void
);
extern
void
chrp_get_rtc_time
(
struct
rtc_time
*
);
extern
int
chrp_set_rtc_time
(
struct
rtc_time
*
);
extern
void
chrp_calibrate_decr
(
void
);
extern
long
chrp_time_init
(
void
);
extern
void
chrp_find_bridges
(
void
);
...
...
arch/powerpc/platforms/chrp/pci.c
浏览文件 @
fe691021
...
...
@@ -204,9 +204,11 @@ static void __init setup_peg2(struct pci_controller *hose, struct device_node *d
struct
device_node
*
root
=
find_path_device
(
"/"
);
struct
device_node
*
rtas
;
of_node_get
(
root
);
rtas
=
of_find_node_by_name
(
root
,
"rtas"
);
if
(
rtas
)
{
hose
->
ops
=
&
rtas_pci_ops
;
of_node_put
(
rtas
);
}
else
{
printk
(
"RTAS supporting Pegasos OF not found, please upgrade"
" your firmware
\n
"
);
...
...
arch/powerpc/platforms/chrp/setup.c
浏览文件 @
fe691021
...
...
@@ -506,7 +506,7 @@ void __init chrp_init(void)
ppc_md
.
halt
=
rtas_halt
;
ppc_md
.
time_init
=
chrp_time_init
;
ppc_md
.
calibrate_decr
=
chrp
_calibrate_decr
;
ppc_md
.
calibrate_decr
=
generic
_calibrate_decr
;
/* this may get overridden with rtas routines later... */
ppc_md
.
set_rtc_time
=
chrp_set_rtc_time
;
...
...
arch/powerpc/platforms/chrp/time.c
浏览文件 @
fe691021
...
...
@@ -167,24 +167,3 @@ void chrp_get_rtc_time(struct rtc_time *tm)
tm
->
tm_mon
=
mon
;
tm
->
tm_year
=
year
;
}
void
__init
chrp_calibrate_decr
(
void
)
{
struct
device_node
*
cpu
;
unsigned
int
freq
,
*
fp
;
/*
* The cpu node should have a timebase-frequency property
* to tell us the rate at which the decrementer counts.
*/
freq
=
16666000
;
/* hardcoded default */
cpu
=
find_type_devices
(
"cpu"
);
if
(
cpu
!=
0
)
{
fp
=
(
unsigned
int
*
)
get_property
(
cpu
,
"timebase-frequency"
,
NULL
);
if
(
fp
!=
0
)
freq
=
*
fp
;
}
ppc_tb_freq
=
freq
;
}
arch/powerpc/platforms/pseries/setup.c
浏览文件 @
fe691021
...
...
@@ -585,7 +585,7 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
static
void
pseries_kexec_cpu_down
(
int
crash_shutdown
,
int
secondary
)
{
/* Don't risk a hypervisor call if we're crashing */
if
(
!
crash_shutdown
)
{
if
(
firmware_has_feature
(
FW_FEATURE_SPLPAR
)
&&
!
crash_shutdown
)
{
unsigned
long
vpa
=
__pa
(
get_lppaca
());
if
(
unregister_vpa
(
hard_smp_processor_id
(),
vpa
))
{
...
...
arch/ppc/kernel/head_8xx.S
浏览文件 @
fe691021
...
...
@@ -810,13 +810,16 @@ initial_mmu:
mtspr
SPRN_MD_TWC
,
r9
li
r11
,
MI_BOOTINIT
/*
Create
RPN
for
address
0
*/
addis
r11
,
r11
,
0x0080
/*
Add
8
M
*/
mtspr
SPRN_MD_RPN
,
r8
mtspr
SPRN_MD_RPN
,
r11
addi
r10
,
r10
,
0x0100
mtspr
SPRN_MD_CTR
,
r10
addis
r8
,
r8
,
0x0080
/*
Add
8
M
*/
mtspr
SPRN_MD_EPN
,
r8
mtspr
SPRN_MD_TWC
,
r9
addis
r11
,
r11
,
0x0080
/*
Add
8
M
*/
mtspr
SPRN_MD_RPN
,
r
8
mtspr
SPRN_MD_RPN
,
r
11
#endif
/
*
Since
the
cache
is
enabled
according
to
the
information
we
...
...
drivers/macintosh/windfarm_core.c
浏览文件 @
fe691021
...
...
@@ -33,6 +33,7 @@
#include <linux/reboot.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include "windfarm.h"
...
...
@@ -48,7 +49,7 @@
static
LIST_HEAD
(
wf_controls
);
static
LIST_HEAD
(
wf_sensors
);
static
DE
CLAR
E_MUTEX
(
wf_lock
);
static
DE
FIN
E_MUTEX
(
wf_lock
);
static
struct
notifier_block
*
wf_client_list
;
static
int
wf_client_count
;
static
unsigned
int
wf_overtemp
;
...
...
@@ -160,12 +161,12 @@ int wf_register_control(struct wf_control *new_ct)
{
struct
wf_control
*
ct
;
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
list_for_each_entry
(
ct
,
&
wf_controls
,
link
)
{
if
(
!
strcmp
(
ct
->
name
,
new_ct
->
name
))
{
printk
(
KERN_WARNING
"windfarm: trying to register"
" duplicate control %s
\n
"
,
ct
->
name
);
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
-
EEXIST
;
}
}
...
...
@@ -175,7 +176,7 @@ int wf_register_control(struct wf_control *new_ct)
DBG
(
"wf: Registered control %s
\n
"
,
new_ct
->
name
);
wf_notify
(
WF_EVENT_NEW_CONTROL
,
new_ct
);
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
0
;
}
...
...
@@ -183,9 +184,9 @@ EXPORT_SYMBOL_GPL(wf_register_control);
void
wf_unregister_control
(
struct
wf_control
*
ct
)
{
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
list_del
(
&
ct
->
link
);
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
DBG
(
"wf: Unregistered control %s
\n
"
,
ct
->
name
);
...
...
@@ -197,16 +198,16 @@ struct wf_control * wf_find_control(const char *name)
{
struct
wf_control
*
ct
;
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
list_for_each_entry
(
ct
,
&
wf_controls
,
link
)
{
if
(
!
strcmp
(
ct
->
name
,
name
))
{
if
(
wf_get_control
(
ct
))
ct
=
NULL
;
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
ct
;
}
}
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
NULL
;
}
EXPORT_SYMBOL_GPL
(
wf_find_control
);
...
...
@@ -250,12 +251,12 @@ int wf_register_sensor(struct wf_sensor *new_sr)
{
struct
wf_sensor
*
sr
;
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
list_for_each_entry
(
sr
,
&
wf_sensors
,
link
)
{
if
(
!
strcmp
(
sr
->
name
,
new_sr
->
name
))
{
printk
(
KERN_WARNING
"windfarm: trying to register"
" duplicate sensor %s
\n
"
,
sr
->
name
);
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
-
EEXIST
;
}
}
...
...
@@ -265,7 +266,7 @@ int wf_register_sensor(struct wf_sensor *new_sr)
DBG
(
"wf: Registered sensor %s
\n
"
,
new_sr
->
name
);
wf_notify
(
WF_EVENT_NEW_SENSOR
,
new_sr
);
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
0
;
}
...
...
@@ -273,9 +274,9 @@ EXPORT_SYMBOL_GPL(wf_register_sensor);
void
wf_unregister_sensor
(
struct
wf_sensor
*
sr
)
{
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
list_del
(
&
sr
->
link
);
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
DBG
(
"wf: Unregistered sensor %s
\n
"
,
sr
->
name
);
...
...
@@ -287,16 +288,16 @@ struct wf_sensor * wf_find_sensor(const char *name)
{
struct
wf_sensor
*
sr
;
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
list_for_each_entry
(
sr
,
&
wf_sensors
,
link
)
{
if
(
!
strcmp
(
sr
->
name
,
name
))
{
if
(
wf_get_sensor
(
sr
))
sr
=
NULL
;
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
sr
;
}
}
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
NULL
;
}
EXPORT_SYMBOL_GPL
(
wf_find_sensor
);
...
...
@@ -329,7 +330,7 @@ int wf_register_client(struct notifier_block *nb)
struct
wf_control
*
ct
;
struct
wf_sensor
*
sr
;
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
rc
=
notifier_chain_register
(
&
wf_client_list
,
nb
);
if
(
rc
!=
0
)
goto
bail
;
...
...
@@ -341,19 +342,19 @@ int wf_register_client(struct notifier_block *nb)
if
(
wf_client_count
==
1
)
wf_start_thread
();
bail:
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
rc
;
}
EXPORT_SYMBOL_GPL
(
wf_register_client
);
int
wf_unregister_client
(
struct
notifier_block
*
nb
)
{
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
notifier_chain_unregister
(
&
wf_client_list
,
nb
);
wf_client_count
++
;
if
(
wf_client_count
==
0
)
wf_stop_thread
();
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
0
;
}
...
...
@@ -361,23 +362,23 @@ EXPORT_SYMBOL_GPL(wf_unregister_client);
void
wf_set_overtemp
(
void
)
{
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
wf_overtemp
++
;
if
(
wf_overtemp
==
1
)
{
printk
(
KERN_WARNING
"windfarm: Overtemp condition detected !
\n
"
);
wf_overtemp_counter
=
0
;
wf_notify
(
WF_EVENT_OVERTEMP
,
NULL
);
}
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
}
EXPORT_SYMBOL_GPL
(
wf_set_overtemp
);
void
wf_clear_overtemp
(
void
)
{
down
(
&
wf_lock
);
mutex_lock
(
&
wf_lock
);
WARN_ON
(
wf_overtemp
==
0
);
if
(
wf_overtemp
==
0
)
{
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
return
;
}
wf_overtemp
--
;
...
...
@@ -385,7 +386,7 @@ void wf_clear_overtemp(void)
printk
(
KERN_WARNING
"windfarm: Overtemp condition cleared !
\n
"
);
wf_notify
(
WF_EVENT_NORMALTEMP
,
NULL
);
}
up
(
&
wf_lock
);
mutex_unlock
(
&
wf_lock
);
}
EXPORT_SYMBOL_GPL
(
wf_clear_overtemp
);
...
...
include/asm-powerpc/prom.h
浏览文件 @
fe691021
...
...
@@ -222,5 +222,7 @@ extern int of_address_to_resource(struct device_node *dev, int index,
extern
int
of_pci_address_to_resource
(
struct
device_node
*
dev
,
int
bar
,
struct
resource
*
r
);
extern
void
kdump_move_device_tree
(
void
);
#endif
/* __KERNEL__ */
#endif
/* _POWERPC_PROM_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录