PATCH: display MSI-X table and pba offsets from "pciconf -c"

看板FB_current作者時間12年前 (2013/04/27 13:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
Hi, The following patch teaches pciconf(8) to display the table and pba offsets when it displays the MSI-X capability. The new output format will look like: cap 11[70] = MSI-X supports 10 messages in map 0x1c[0x0][0x2000] enabled OR cap 11[70] = MSI-X supports 10 messages in maps 0x10[0x0] and 0x14[0x1000] enabled Any objections to committing the patch? best Neel Index: usr.sbin/pciconf/cap.c =================================================================== --- cap.c (revision 246087) +++ cap.c (working copy) @@ -449,22 +449,30 @@ static void cap_msix(int fd, struct pci_conf *p, uint8_t ptr) { - uint32_t val; + uint32_t val, table_offset, pba_offset; uint16_t ctrl; int msgnum, table_bar, pba_bar; ctrl = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_CTRL, 2); msgnum = (ctrl & PCIM_MSIXCTRL_TABLE_SIZE) + 1; + val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_TABLE, 4); table_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); + table_offset = val & ~PCIM_MSIX_BIR_MASK; + val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_PBA, 4); - pba_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); + pba_bar = PCIR_BAR(val & PCIM_MSIX_BIR_MASK); + pba_offset = val & ~PCIM_MSIX_BIR_MASK; + printf("MSI-X supports %d message%s ", msgnum, (msgnum == 1) ? "" : "s"); - if (table_bar == pba_bar) - printf("in map 0x%x", table_bar); - else - printf("in maps 0x%x and 0x%x", table_bar, pba_bar); + if (table_bar == pba_bar) { + printf("in map 0x%x[0x%x][0x%x]", + table_bar, table_offset, pba_offset); + } else { + printf("in maps 0x%x[0x%x] and 0x%x[0x%x]", + table_bar, table_offset, pba_bar, pba_offset); + } if (ctrl & PCIM_MSIXCTRL_MSIX_ENABLE) printf(" enabled"); } _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1HUrkzsv (FB_current)
文章代碼(AID): #1HUrkzsv (FB_current)