Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
HermitOS
kernel
Commits
be9f9014
Commit
be9f9014
authored
3 years ago
by
Martin Kröning
Browse files
Options
Downloads
Patches
Plain Diff
Make pci-ids optional
parent
178d4240
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
Cargo.toml
+2
-2
2 additions, 2 deletions
Cargo.toml
src/arch/x86_64/kernel/pci.rs
+6
-0
6 additions, 0 deletions
src/arch/x86_64/kernel/pci.rs
with
8 additions
and
2 deletions
Cargo.toml
+
2
−
2
View file @
be9f9014
...
...
@@ -48,10 +48,10 @@ name = "measure_startup_time"
harness
=
false
[features]
default
=
[
"pci"
,
"acpi"
,
"fsgsbase"
,
"smp"
]
default
=
[
"pci"
,
"pci-ids"
,
"acpi"
,
"fsgsbase"
,
"smp"
]
vga
=
[]
newlib
=
[]
pci
=
[
"pci-ids"
]
pci
=
[]
acpi
=
[]
smp
=
[
"include-transformed"
]
fsgsbase
=
[]
...
...
This diff is collapsed.
Click to expand it.
src/arch/x86_64/kernel/pci.rs
+
6
−
0
View file @
be9f9014
...
...
@@ -380,8 +380,10 @@ impl fmt::Display for PciBar {
impl
fmt
::
Display
for
PciAdapter
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
#[cfg(feature
=
"pci-ids"
)]
use
pci_ids
::{
Class
,
Device
,
FromId
,
Subclass
};
#[cfg(feature
=
"pci-ids"
)]
let
class_name
=
Class
::
from_id
(
self
.class_id
)
.map_or
(
"Unknown Class"
,
|
class
|
{
class
.subclasses
()
...
...
@@ -390,10 +392,14 @@ impl fmt::Display for PciAdapter {
.unwrap_or_else
(||
class
.name
())
});
#[cfg(feature
=
"pci-ids"
)]
let
(
vendor_name
,
device_name
)
=
Device
::
from_vid_pid
(
self
.vendor_id
,
self
.device_id
)
.map
(|
device
|
(
device
.vendor
()
.name
(),
device
.name
()))
.unwrap_or
((
"Unknown Vendor"
,
"Unknown Device"
));
#[cfg(not(feature
=
"pci-ids"
))]
let
(
class_name
,
vendor_name
,
device_name
)
=
(
"Unknown Class"
,
"Unknown Vendor"
,
"Unknown Device"
);
// Output detailed readable information about this device.
write!
(
f
,
...
...
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