Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
5619c280
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5619c280
编写于
7月 25, 2009
作者:
T
Thomas Gleixner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
x86: Convert i8259_lock to raw_spinlock
Signed-off-by:
N
Thomas Gleixner
<
tglx@linutronix.de
>
上级
ced5b697
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
23 deletion
+23
-23
arch/x86/include/asm/i8259.h
arch/x86/include/asm/i8259.h
+1
-1
arch/x86/kernel/apic/io_apic.c
arch/x86/kernel/apic/io_apic.c
+2
-2
arch/x86/kernel/i8259.c
arch/x86/kernel/i8259.c
+15
-15
arch/x86/kernel/time.c
arch/x86/kernel/time.c
+2
-2
arch/x86/kernel/visws_quirks.c
arch/x86/kernel/visws_quirks.c
+3
-3
未找到文件。
arch/x86/include/asm/i8259.h
浏览文件 @
5619c280
...
@@ -24,7 +24,7 @@ extern unsigned int cached_irq_mask;
...
@@ -24,7 +24,7 @@ extern unsigned int cached_irq_mask;
#define SLAVE_ICW4_DEFAULT 0x01
#define SLAVE_ICW4_DEFAULT 0x01
#define PIC_ICW4_AEOI 2
#define PIC_ICW4_AEOI 2
extern
spinlock_t
i8259A_lock
;
extern
raw_
spinlock_t
i8259A_lock
;
extern
void
init_8259A
(
int
auto_eoi
);
extern
void
init_8259A
(
int
auto_eoi
);
extern
void
enable_8259A_irq
(
unsigned
int
irq
);
extern
void
enable_8259A_irq
(
unsigned
int
irq
);
...
...
arch/x86/kernel/apic/io_apic.c
浏览文件 @
5619c280
...
@@ -1830,7 +1830,7 @@ __apicdebuginit(void) print_PIC(void)
...
@@ -1830,7 +1830,7 @@ __apicdebuginit(void) print_PIC(void)
printk
(
KERN_DEBUG
"
\n
printing PIC contents
\n
"
);
printk
(
KERN_DEBUG
"
\n
printing PIC contents
\n
"
);
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
v
=
inb
(
0xa1
)
<<
8
|
inb
(
0x21
);
v
=
inb
(
0xa1
)
<<
8
|
inb
(
0x21
);
printk
(
KERN_DEBUG
"... PIC IMR: %04x
\n
"
,
v
);
printk
(
KERN_DEBUG
"... PIC IMR: %04x
\n
"
,
v
);
...
@@ -1844,7 +1844,7 @@ __apicdebuginit(void) print_PIC(void)
...
@@ -1844,7 +1844,7 @@ __apicdebuginit(void) print_PIC(void)
outb
(
0x0a
,
0xa0
);
outb
(
0x0a
,
0xa0
);
outb
(
0x0a
,
0x20
);
outb
(
0x0a
,
0x20
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
printk
(
KERN_DEBUG
"... PIC ISR: %04x
\n
"
,
v
);
printk
(
KERN_DEBUG
"... PIC ISR: %04x
\n
"
,
v
);
...
...
arch/x86/kernel/i8259.c
浏览文件 @
5619c280
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
*/
*/
static
int
i8259A_auto_eoi
;
static
int
i8259A_auto_eoi
;
DEFINE_SPINLOCK
(
i8259A_lock
);
DEFINE_
RAW_
SPINLOCK
(
i8259A_lock
);
static
void
mask_and_ack_8259A
(
unsigned
int
);
static
void
mask_and_ack_8259A
(
unsigned
int
);
struct
irq_chip
i8259A_chip
=
{
struct
irq_chip
i8259A_chip
=
{
...
@@ -68,13 +68,13 @@ void disable_8259A_irq(unsigned int irq)
...
@@ -68,13 +68,13 @@ void disable_8259A_irq(unsigned int irq)
unsigned
int
mask
=
1
<<
irq
;
unsigned
int
mask
=
1
<<
irq
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
cached_irq_mask
|=
mask
;
cached_irq_mask
|=
mask
;
if
(
irq
&
8
)
if
(
irq
&
8
)
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
else
else
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
}
void
enable_8259A_irq
(
unsigned
int
irq
)
void
enable_8259A_irq
(
unsigned
int
irq
)
...
@@ -82,13 +82,13 @@ void enable_8259A_irq(unsigned int irq)
...
@@ -82,13 +82,13 @@ void enable_8259A_irq(unsigned int irq)
unsigned
int
mask
=
~
(
1
<<
irq
);
unsigned
int
mask
=
~
(
1
<<
irq
);
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
cached_irq_mask
&=
mask
;
cached_irq_mask
&=
mask
;
if
(
irq
&
8
)
if
(
irq
&
8
)
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
else
else
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
}
int
i8259A_irq_pending
(
unsigned
int
irq
)
int
i8259A_irq_pending
(
unsigned
int
irq
)
...
@@ -97,12 +97,12 @@ int i8259A_irq_pending(unsigned int irq)
...
@@ -97,12 +97,12 @@ int i8259A_irq_pending(unsigned int irq)
unsigned
long
flags
;
unsigned
long
flags
;
int
ret
;
int
ret
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
if
(
irq
<
8
)
if
(
irq
<
8
)
ret
=
inb
(
PIC_MASTER_CMD
)
&
mask
;
ret
=
inb
(
PIC_MASTER_CMD
)
&
mask
;
else
else
ret
=
inb
(
PIC_SLAVE_CMD
)
&
(
mask
>>
8
);
ret
=
inb
(
PIC_SLAVE_CMD
)
&
(
mask
>>
8
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
return
ret
;
return
ret
;
}
}
...
@@ -150,7 +150,7 @@ static void mask_and_ack_8259A(unsigned int irq)
...
@@ -150,7 +150,7 @@ static void mask_and_ack_8259A(unsigned int irq)
unsigned
int
irqmask
=
1
<<
irq
;
unsigned
int
irqmask
=
1
<<
irq
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
/*
/*
* Lightweight spurious IRQ detection. We do not want
* Lightweight spurious IRQ detection. We do not want
* to overdo spurious IRQ handling - it's usually a sign
* to overdo spurious IRQ handling - it's usually a sign
...
@@ -183,7 +183,7 @@ static void mask_and_ack_8259A(unsigned int irq)
...
@@ -183,7 +183,7 @@ static void mask_and_ack_8259A(unsigned int irq)
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
outb
(
0x60
+
irq
,
PIC_MASTER_CMD
);
/* 'Specific EOI to master */
outb
(
0x60
+
irq
,
PIC_MASTER_CMD
);
/* 'Specific EOI to master */
}
}
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
return
;
return
;
spurious_8259A_irq:
spurious_8259A_irq:
...
@@ -285,24 +285,24 @@ void mask_8259A(void)
...
@@ -285,24 +285,24 @@ void mask_8259A(void)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
outb
(
0xff
,
PIC_MASTER_IMR
);
/* mask all of 8259A-1 */
outb
(
0xff
,
PIC_MASTER_IMR
);
/* mask all of 8259A-1 */
outb
(
0xff
,
PIC_SLAVE_IMR
);
/* mask all of 8259A-2 */
outb
(
0xff
,
PIC_SLAVE_IMR
);
/* mask all of 8259A-2 */
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
}
void
unmask_8259A
(
void
)
void
unmask_8259A
(
void
)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
/* restore master IRQ mask */
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
/* restore master IRQ mask */
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
/* restore slave IRQ mask */
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
/* restore slave IRQ mask */
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
}
void
init_8259A
(
int
auto_eoi
)
void
init_8259A
(
int
auto_eoi
)
...
@@ -311,7 +311,7 @@ void init_8259A(int auto_eoi)
...
@@ -311,7 +311,7 @@ void init_8259A(int auto_eoi)
i8259A_auto_eoi
=
auto_eoi
;
i8259A_auto_eoi
=
auto_eoi
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
outb
(
0xff
,
PIC_MASTER_IMR
);
/* mask all of 8259A-1 */
outb
(
0xff
,
PIC_MASTER_IMR
);
/* mask all of 8259A-1 */
outb
(
0xff
,
PIC_SLAVE_IMR
);
/* mask all of 8259A-2 */
outb
(
0xff
,
PIC_SLAVE_IMR
);
/* mask all of 8259A-2 */
...
@@ -356,5 +356,5 @@ void init_8259A(int auto_eoi)
...
@@ -356,5 +356,5 @@ void init_8259A(int auto_eoi)
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
/* restore master IRQ mask */
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
/* restore master IRQ mask */
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
/* restore slave IRQ mask */
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
/* restore slave IRQ mask */
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
}
arch/x86/kernel/time.c
浏览文件 @
5619c280
...
@@ -70,11 +70,11 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
...
@@ -70,11 +70,11 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
* manually to deassert NMI lines for the watchdog if run
* manually to deassert NMI lines for the watchdog if run
* on an 82489DX-based system.
* on an 82489DX-based system.
*/
*/
spin_lock
(
&
i8259A_lock
);
raw_
spin_lock
(
&
i8259A_lock
);
outb
(
0x0c
,
PIC_MASTER_OCW3
);
outb
(
0x0c
,
PIC_MASTER_OCW3
);
/* Ack the IRQ; AEOI will end it automatically. */
/* Ack the IRQ; AEOI will end it automatically. */
inb
(
PIC_MASTER_POLL
);
inb
(
PIC_MASTER_POLL
);
spin_unlock
(
&
i8259A_lock
);
raw_
spin_unlock
(
&
i8259A_lock
);
}
}
global_clock_event
->
event_handler
(
global_clock_event
);
global_clock_event
->
event_handler
(
global_clock_event
);
...
...
arch/x86/kernel/visws_quirks.c
浏览文件 @
5619c280
...
@@ -559,7 +559,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
...
@@ -559,7 +559,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
struct
irq_desc
*
desc
;
struct
irq_desc
*
desc
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
raw_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
/* Find out what's interrupting in the PIIX4 master 8259 */
/* Find out what's interrupting in the PIIX4 master 8259 */
outb
(
0x0c
,
0x20
);
/* OCW3 Poll command */
outb
(
0x0c
,
0x20
);
/* OCW3 Poll command */
...
@@ -596,7 +596,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
...
@@ -596,7 +596,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
outb
(
0x60
+
realirq
,
0x20
);
outb
(
0x60
+
realirq
,
0x20
);
}
}
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
desc
=
irq_to_desc
(
realirq
);
desc
=
irq_to_desc
(
realirq
);
...
@@ -614,7 +614,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
...
@@ -614,7 +614,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
return
IRQ_HANDLED
;
return
IRQ_HANDLED
;
out_unlock:
out_unlock:
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
raw_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
return
IRQ_NONE
;
return
IRQ_NONE
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录