Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci - Fix incorrect calculation in PCI_MSIX_CTL_TBLS...



details:   https://anonhg.NetBSD.org/src/rev/6dd5c7917e47
branches:  trunk
changeset: 329505:6dd5c7917e47
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue May 27 16:10:33 2014 +0000

description:
- Fix incorrect calculation in PCI_MSIX_CTL_TBLSIZE().
- The PCI_MSIX_CTL_TBLSIZE bit field is in N-1, so add +1.

diffstat:

 sys/dev/pci/pcireg.h |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r aa1da91ee63a -r 6dd5c7917e47 sys/dev/pci/pcireg.h
--- a/sys/dev/pci/pcireg.h      Tue May 27 15:56:18 2014 +0000
+++ b/sys/dev/pci/pcireg.h      Tue May 27 16:10:33 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcireg.h,v 1.91 2014/05/24 18:06:21 msaitoh Exp $      */
+/*     $NetBSD: pcireg.h,v 1.92 2014/05/27 16:10:33 msaitoh Exp $      */
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -944,7 +944,8 @@
 #define        PCI_MSIX_CTL_FUNCMASK   0x40000000
 #define        PCI_MSIX_CTL_TBLSIZE_MASK 0x07ff0000
 #define        PCI_MSIX_CTL_TBLSIZE_SHIFT 16
-#define        PCI_MSIX_CTL_TBLSIZE(ofs)       (((ofs) >> PCI_MSIX_CTL_TBLSIZE_SHIFT) & PCI_MSIX_CTL_TBLSIZE_MASK)
+#define        PCI_MSIX_CTL_TBLSIZE(ofs)       ((((ofs) & PCI_MSIX_CTL_TBLSIZE_MASK) \
+               >> PCI_MSIX_CTL_TBLSIZE_SHIFT) + 1)
 /*
  * 2nd DWORD is the Table Offset
  */



Home | Main Index | Thread Index | Old Index