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
85d1791b
Commit
85d1791b
authored
12 years ago
by
Dor Laor
Browse files
Options
Downloads
Patches
Plain Diff
Add pci_{read|write|_word functions and some PCI definitions
parent
04edef3a
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
drivers/pci.cc
+13
-0
13 additions, 0 deletions
drivers/pci.cc
drivers/pci.hh
+8
-1
8 additions, 1 deletion
drivers/pci.hh
with
21 additions
and
1 deletion
drivers/pci.cc
+
13
−
0
View file @
85d1791b
...
@@ -15,6 +15,12 @@ u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset)
...
@@ -15,6 +15,12 @@ u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset)
return
inl
(
PCI_CONFIG_DATA
);
return
inl
(
PCI_CONFIG_DATA
);
}
}
u16
read_pci_config_word
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
)
{
prepare_pci_config_access
(
bus
,
slot
,
func
,
offset
);
return
inw
(
PCI_CONFIG_DATA
);
}
u8
read_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
)
u8
read_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
)
{
{
prepare_pci_config_access
(
bus
,
slot
,
func
,
offset
);
prepare_pci_config_access
(
bus
,
slot
,
func
,
offset
);
...
@@ -27,6 +33,13 @@ void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val)
...
@@ -27,6 +33,13 @@ void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val)
outl
(
val
,
PCI_CONFIG_DATA
);
outl
(
val
,
PCI_CONFIG_DATA
);
}
}
void
write_pci_config_word
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u16
val
)
{
prepare_pci_config_access
(
bus
,
slot
,
func
,
offset
);
outw
(
val
,
PCI_CONFIG_DATA
);
}
void
write_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u8
val
)
void
write_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u8
val
)
{
{
prepare_pci_config_access
(
bus
,
slot
,
func
,
offset
);
prepare_pci_config_access
(
bus
,
slot
,
func
,
offset
);
...
...
This diff is collapsed.
Click to expand it.
drivers/pci.hh
+
8
−
1
View file @
85d1791b
...
@@ -21,15 +21,22 @@ using processor::outl;
...
@@ -21,15 +21,22 @@ using processor::outl;
PCI_SLOT_OFFSET
=
11
,
PCI_SLOT_OFFSET
=
11
,
PCI_FUNC_OFFSET
=
8
,
PCI_FUNC_OFFSET
=
8
,
PCI_CONFIG_ADDRESS_ENABLE
=
0x80000000
,
PCI_CONFIG_ADDRESS_ENABLE
=
0x80000000
,
PCI_COMMAND_OFFSET
=
0x4
,
PCI_STATUS_OFFSET
=
0x6
,
PCI_CLASS_REVISION
=
0x8
,
PCI_CLASS_REVISION
=
0x8
,
PCI_CLASS_OFFSET
=
0xb
,
PCI_SUBCLASS_OFFSET
=
0xa
,
PCI_HEADER_TYPE
=
0xe
,
PCI_HEADER_TYPE
=
0xe
,
PCI_SUBSYSTEM_ID
=
0x40
,
PCI_SUBSYSTEM_VID
=
0x42
,
PCI_HEADER_MULTI_FUNC
=
0x80
,
PCI_HEADER_MULTI_FUNC
=
0x80
,
};
};
u32
read_pci_config
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
);
u32
read_pci_config
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
);
u16
read_pci_config_word
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
);
u8
read_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
);
u8
read_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
);
void
write_pci_config
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u32
val
);
void
write_pci_config
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u32
val
);
void
write_pci_config_word
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u16
val
);
void
write_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u8
val
);
void
write_pci_config_byte
(
u8
bus
,
u8
slot
,
u8
func
,
u8
offset
,
u8
val
);
void
pci_device_print
(
u8
bus
,
u8
slot
,
u8
func
);
void
pci_device_print
(
u8
bus
,
u8
slot
,
u8
func
);
void
pci_devices_print
(
void
);
void
pci_devices_print
(
void
);
...
...
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