PCI: Difference between revisions

Jump to navigation Jump to search
m
→‎Enabling MSI: Clean up section
[unchecked revision][unchecked revision]
m (→‎External Links: Update some links)
m (→‎Enabling MSI: Clean up section)
Line 1,108:
 
=== Enabling MSI ===
First, check that the device has a pointer to the capabilities list (Statusstatus register bit 4 set to 1).
Then, traverse the capabilities list. The low 8 bits of a capability register are the ID - 0x050x5 for MSI. The next 8 bits are the offset (in [[#Configuration Space|PCI configurationConfiguration spaceSpace]]) of the next capability.
 
The MSI capability is as folowsfollows:
{| {{wikitable}}
|-
! registerRegister !! offsetOffset !! bitsBits 31-24 !! bitsBits 23-16 !! bitsBits 15-8 !! bitsBits 7-0
|-
| capCap +00 0x0
| capCap +00 0x0
| colspan="2" | Message Control
| Next ptrpointer || Capability ID = 05
|-
| capCap +01 0x1
| capCap +04 0x4
| colspan="4" | Message Address [Low]
|-
| capCap +02 0x2
| capCap +08 0x8
| colspan="4" | [Message Address High]
|-
| capCap +02 0x2/030x3
| capCap +08 0x8/0C0xC
| colspan="2" | Reserved
| colspan="2" | Message Data
|-
| capCap +04 0x4
| capCap +10 0x10
| colspan="4" | [Mask]
|-
| capCap +05 0x5
| capCap +14 0x14
| colspan="4" | [Pending]
|}
Line 1,147:
{| {{wikitable}}
|-
! BitBits 15-9 !! Bit 8 !! Bit 7 !! BitBits 6-4 !! BitBits 3-1 !! Bit 0
|-
| Reserved
| Per-vector masking
| 64 -bit
| Multiple Message Enable
| Multiple Message Capable
Line 1,159:
The message address/data is architecture specific. On x86(-64), it is as follows:
<source lang="c">
paddr_tuint64_t arch_msi_address(uint64_t* *data, size_t vector, uint32_t processor, uint8_t edgetrigger, uint8_t deassert) {
{
*data = (vector & 0xFF) | (edgetrigger == 1 ? 0 : (1 << 15)) | (deassert == 1 ? 0 : (1 << 14));
return (0xFEE00000 | (processor << 12));
Line 1,191 ⟶ 1,190:
'''Interrupt masking'''
 
If capable, you can mask individual messages by setting the corresponding bit (1 <<x n), in the mask register.
 
If a message is pending, then the corresponding bit in the pending register is set.
 
Note that the PCI specification doesn't specify the location of these registers if the message address is 32 -bit. This is because a function that supports masking is required to implement 64 -bit addressing!
 
=== Enabling MSI-X ===
73

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu