Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
826cea48
Commit
826cea48
authored
12 years ago
by
Guy Zana
Browse files
Options
Downloads
Patches
Plain Diff
Moved msix_compose() to apic_driver class
parent
a2220493
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arch/x64/apic.cc
+8
-15
8 additions, 15 deletions
arch/x64/apic.cc
arch/x64/apic.hh
+13
-0
13 additions, 0 deletions
arch/x64/apic.hh
with
21 additions
and
15 deletions
arch/x64/apic.cc
+
8
−
15
View file @
826cea48
...
...
@@ -10,12 +10,6 @@ public:
virtual
void
self_ipi
(
unsigned
vector
);
virtual
void
ipi
(
unsigned
cpu
,
unsigned
vector
);
virtual
void
eoi
();
// vector should be above 31, below 15 will fail
// dest_id is the apic id, if using an io_apic.
bool
compose_msix
(
u8
vector
,
u8
dest_id
,
u64
&
out_address
,
u32
&
out_data
);
protected:
u32
_apic_base_lo
;
u32
_apic_base_hi
;
};
apic_driver
::~
apic_driver
()
...
...
@@ -23,7 +17,7 @@ apic_driver::~apic_driver()
}
x2apic
::
x2apic
()
:
_
apic_
base_lo
(
0xfee00000
),
_apic_base_hi
(
0
)
:
apic_
driver
(
)
{
processor
::
wrmsr
(
msr
::
IA32_APIC_BASE
,
_apic_base_lo
|
(
3
<<
10
));
}
...
...
@@ -62,27 +56,26 @@ void apic_driver::set_lvt(apiclvt source, unsigned vector)
write
(
static_cast
<
apicreg
>
(
source
),
vector
);
}
bool
x2apic
::
compose_msix
(
u8
vector
,
u8
dest_id
,
u64
&
out_address
,
u32
&
out_data
)
msi_message
apic_driver
::
compose_msix
(
u8
vector
,
u8
dest_id
)
{
msi_message
msg
;
if
(
vector
<=
15
)
{
return
false
;
return
msg
;
}
u64
addr
=
msg
.
_
addr
=
(
(
u64
)
_apic_base_hi
<<
32
)
|
(
_apic_base_lo
&
0xFFF00000
)
|
(
dest_id
<<
12
);
u32
data
=
msg
.
_
data
=
(
delivery_mode
::
FIXED_DELIVERY
<<
msi_data_fields
::
MSI_DELIVERY_MODE
)
|
(
level_assertion
::
MSI_ASSSERT
<<
msi_data_fields
::
MSI_LEVEL_ASSERTION
)
|
(
trigger_mode
::
TRIGGER_MODE_EDGE
<<
msi_data_fields
::
MSI_TRIGGER_MODE
)
|
vector
;
out_address
=
addr
;
out_data
=
data
;
return
true
;
return
msg
;
}
}
This diff is collapsed.
Click to expand it.
arch/x64/apic.hh
+
13
−
0
View file @
826cea48
...
...
@@ -67,14 +67,27 @@ enum trigger_mode {
TRIGGER_MODE_LEVEL
=
1
};
struct
msi_message
{
msi_message
()
:
_addr
(
0
),
_data
(
0
)
{}
u64
_addr
;
u32
_data
;
};
class
apic_driver
{
public:
apic_driver
()
:
_apic_base_lo
(
0xfee00000
),
_apic_base_hi
(
0
)
{}
virtual
~
apic_driver
();
virtual
void
self_ipi
(
unsigned
vector
)
=
0
;
virtual
void
ipi
(
unsigned
cpu
,
unsigned
vector
)
=
0
;
virtual
void
eoi
()
=
0
;
virtual
void
write
(
apicreg
reg
,
u32
value
)
=
0
;
void
set_lvt
(
apiclvt
reg
,
unsigned
vector
);
// vector should be above 31, below 15 will fail
// dest_id is the apic id, if using an io_apic.
msi_message
compose_msix
(
u8
vector
,
u8
dest_id
);
protected
:
u32
_apic_base_lo
;
u32
_apic_base_hi
;
};
extern
apic_driver
*
apic
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment