Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
7edd0ce0
Commit
7edd0ce0
authored
Jul 07, 2008
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: Consolidate PIC isr clearing into a function
Signed-off-by:
Avi Kivity
<
avi@qumranet.com
>
parent
60bd83a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
arch/x86/kvm/i8259.c
arch/x86/kvm/i8259.c
+12
-6
No files found.
arch/x86/kvm/i8259.c
View file @
7edd0ce0
...
@@ -30,6 +30,11 @@
...
@@ -30,6 +30,11 @@
#include <linux/kvm_host.h>
#include <linux/kvm_host.h>
static
void
pic_clear_isr
(
struct
kvm_kpic_state
*
s
,
int
irq
)
{
s
->
isr
&=
~
(
1
<<
irq
);
}
/*
/*
* set irq level. If an edge is detected, then the IRR is set to 1
* set irq level. If an edge is detected, then the IRR is set to 1
*/
*/
...
@@ -141,11 +146,12 @@ void kvm_pic_set_irq(void *opaque, int irq, int level)
...
@@ -141,11 +146,12 @@ void kvm_pic_set_irq(void *opaque, int irq, int level)
*/
*/
static
inline
void
pic_intack
(
struct
kvm_kpic_state
*
s
,
int
irq
)
static
inline
void
pic_intack
(
struct
kvm_kpic_state
*
s
,
int
irq
)
{
{
s
->
isr
|=
1
<<
irq
;
if
(
s
->
auto_eoi
)
{
if
(
s
->
auto_eoi
)
{
if
(
s
->
rotate_on_auto_eoi
)
if
(
s
->
rotate_on_auto_eoi
)
s
->
priority_add
=
(
irq
+
1
)
&
7
;
s
->
priority_add
=
(
irq
+
1
)
&
7
;
}
else
pic_clear_isr
(
s
,
irq
);
s
->
isr
|=
(
1
<<
irq
);
}
/*
/*
* We don't clear a level sensitive interrupt here
* We don't clear a level sensitive interrupt here
*/
*/
...
@@ -243,7 +249,7 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
...
@@ -243,7 +249,7 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
priority
=
get_priority
(
s
,
s
->
isr
);
priority
=
get_priority
(
s
,
s
->
isr
);
if
(
priority
!=
8
)
{
if
(
priority
!=
8
)
{
irq
=
(
priority
+
s
->
priority_add
)
&
7
;
irq
=
(
priority
+
s
->
priority_add
)
&
7
;
s
->
isr
&=
~
(
1
<<
irq
);
pic_clear_isr
(
s
,
irq
);
if
(
cmd
==
5
)
if
(
cmd
==
5
)
s
->
priority_add
=
(
irq
+
1
)
&
7
;
s
->
priority_add
=
(
irq
+
1
)
&
7
;
pic_update_irq
(
s
->
pics_state
);
pic_update_irq
(
s
->
pics_state
);
...
@@ -251,7 +257,7 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
...
@@ -251,7 +257,7 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
break
;
break
;
case
3
:
case
3
:
irq
=
val
&
7
;
irq
=
val
&
7
;
s
->
isr
&=
~
(
1
<<
irq
);
pic_clear_isr
(
s
,
irq
);
pic_update_irq
(
s
->
pics_state
);
pic_update_irq
(
s
->
pics_state
);
break
;
break
;
case
6
:
case
6
:
...
@@ -260,8 +266,8 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
...
@@ -260,8 +266,8 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
break
;
break
;
case
7
:
case
7
:
irq
=
val
&
7
;
irq
=
val
&
7
;
s
->
isr
&=
~
(
1
<<
irq
);
s
->
priority_add
=
(
irq
+
1
)
&
7
;
s
->
priority_add
=
(
irq
+
1
)
&
7
;
pic_clear_isr
(
s
,
irq
);
pic_update_irq
(
s
->
pics_state
);
pic_update_irq
(
s
->
pics_state
);
break
;
break
;
default:
default:
...
@@ -303,7 +309,7 @@ static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
...
@@ -303,7 +309,7 @@ static u32 pic_poll_read(struct kvm_kpic_state *s, u32 addr1)
s
->
pics_state
->
pics
[
0
].
irr
&=
~
(
1
<<
2
);
s
->
pics_state
->
pics
[
0
].
irr
&=
~
(
1
<<
2
);
}
}
s
->
irr
&=
~
(
1
<<
ret
);
s
->
irr
&=
~
(
1
<<
ret
);
s
->
isr
&=
~
(
1
<<
ret
);
pic_clear_isr
(
s
,
ret
);
if
(
addr1
>>
7
||
ret
!=
2
)
if
(
addr1
>>
7
||
ret
!=
2
)
pic_update_irq
(
s
->
pics_state
);
pic_update_irq
(
s
->
pics_state
);
}
else
{
}
else
{
...
...
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