Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130800
b: refs/heads/master
c: bffac3c
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Wilcox authored and Jesse Barnes committed Jan 27, 2009
1 parent 684f09e commit ac6c8c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 476e7faefc43f106a90b5c96166c59b75de19d30
refs/heads/master: bffac3c593eba1f9da3efd0199e49ea6558a40ce
13 changes: 11 additions & 2 deletions trunk/drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ static void msix_set_enable(struct pci_dev *dev, int enable)
}
}

/*
* Essentially, this is ((1 << (1 << x)) - 1), but without the
* undefinedness of a << 32.
*/
static inline __attribute_const__ u32 msi_mask(unsigned x)
{
static const u32 mask[] = { 1, 2, 4, 0xf, 0xff, 0xffff, 0xffffffff };
return mask[x];
}

static void msix_flush_writes(struct irq_desc *desc)
{
struct msi_desc *entry;
Expand Down Expand Up @@ -407,8 +417,7 @@ static int msi_capability_init(struct pci_dev *dev)

/* All MSIs are unmasked by default, Mask them all */
pci_read_config_dword(dev, base, &maskbits);
temp = (1 << multi_msi_capable(control));
temp = ((temp - 1) & ~temp);
temp = msi_mask((control & PCI_MSI_FLAGS_QMASK) >> 1);
maskbits |= temp;
pci_write_config_dword(dev, base, maskbits);
entry->msi_attrib.maskbits_mask = temp;
Expand Down

0 comments on commit ac6c8c5

Please sign in to comment.