xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH 3/3] consolidate MSI-X related definitions
Date: Mon, 12 Jul 2010 10:41:09 +0100	[thread overview]
Message-ID: <4C3AFF55020000780000AB6C@vpn.id2.novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3164 bytes --]

Eliminate redundant ones, fix names (where so far inappropriately
referring to capability structure fields the don't really relate to),
use symbolic names instead of raw numbers, and remove an unusable one.

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/include/asm-x86/msi.h	2009-10-29 12:24:49.000000000 +0100
+++ 2010-06-15/xen/include/asm-x86/msi.h	2010-07-09 15:10:00.000000000 +0200
@@ -119,14 +119,6 @@ int msi_free_irq(struct msi_desc *entry)
 
 extern const struct hw_interrupt_type pci_msi_type;
 
-/*
- * MSI-X Address Register
- */
-#define PCI_MSIX_FLAGS_QSIZE		0x7FF
-#define PCI_MSIX_FLAGS_ENABLE		(1 << 15)
-#define PCI_MSIX_FLAGS_BIRMASK		(7 << 0)
-#define PCI_MSIX_FLAGS_BITMASK		(1 << 0)
-
 #define PCI_MSIX_ENTRY_SIZE			16
 #define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
 #define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
@@ -151,15 +143,14 @@ extern const struct hw_interrupt_type pc
 	control |= PCI_MSI_FLAGS_ENABLE
 
 #define msix_control_reg(base)		(base + PCI_MSIX_FLAGS)
-#define msix_table_offset_reg(base)	(base + 0x04)
-#define msix_pba_offset_reg(base)	(base + 0x08)
+#define msix_table_offset_reg(base)	(base + PCI_MSIX_TABLE)
+#define msix_pba_offset_reg(base)	(base + PCI_MSIX_PBA)
 #define msix_enable(control)	 	control |= PCI_MSIX_FLAGS_ENABLE
 #define msix_disable(control)	 	control &= ~PCI_MSIX_FLAGS_ENABLE
 #define msix_table_size(control) 	((control & PCI_MSIX_FLAGS_QSIZE)+1)
 #define multi_msix_capable		msix_table_size
-#define msix_unmask(address)	 	(address & ~PCI_MSIX_FLAGS_BITMASK)
-#define msix_mask(address)		(address | PCI_MSIX_FLAGS_BITMASK)
-#define msix_is_pending(address) 	(address & PCI_MSIX_FLAGS_PENDMASK)
+#define msix_unmask(address)	 	(address & ~PCI_MSIX_VECTOR_BITMASK)
+#define msix_mask(address)		(address | PCI_MSIX_VECTOR_BITMASK)
 
 /*
  * MSI Defined Data Structures
--- 2010-06-15.orig/xen/include/xen/pci_regs.h	2009-11-23 11:23:30.000000000 +0100
+++ 2010-06-15/xen/include/xen/pci_regs.h	2010-07-09 15:08:08.000000000 +0200
@@ -301,8 +301,11 @@
 #define  PCI_MSIX_FLAGS_QSIZE	0x7FF
 #define  PCI_MSIX_FLAGS_ENABLE	(1 << 15)
 #define  PCI_MSIX_FLAGS_MASKALL	(1 << 14)
-#define PCI_MSIX_FLAGS_BIRMASK	(7 << 0)
-#define PCI_MSIX_FLAGS_BITMASK	(1 << 0)
+#define PCI_MSIX_TABLE		4
+#define PCI_MSIX_PBA		8
+#define  PCI_MSIX_BIRMASK	(7 << 0)
+
+#define PCI_MSIX_VECTOR_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */
 
--- 2010-06-15.orig/xen/arch/x86/msi.c	2010-07-09 15:05:17.000000000 +0200
+++ 2010-06-15/xen/arch/x86/msi.c	2010-07-09 15:12:26.000000000 +0200
@@ -560,8 +559,8 @@ static int msix_capability_init(struct p
 
     /* Request & Map MSI-X table region */
     table_offset = pci_conf_read32(bus, slot, func, msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
-    table_offset &= ~PCI_MSIX_FLAGS_BIRMASK;
+    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
+    table_offset &= ~PCI_MSIX_BIRMASK;
     entry_offset = msi->entry_nr * PCI_MSIX_ENTRY_SIZE;
 
     table_paddr = msi->table_base + table_offset;




[-- Attachment #2: msix-single-defs.patch --]
[-- Type: text/plain, Size: 3158 bytes --]

Eliminate redundant ones, fix names (where so far inappropriately
referring to capability structure fields the don't really relate to),
use symbolic names instead of raw numbers, and remove an unusable one.

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/include/asm-x86/msi.h	2009-10-29 12:24:49.000000000 +0100
+++ 2010-06-15/xen/include/asm-x86/msi.h	2010-07-09 15:10:00.000000000 +0200
@@ -119,14 +119,6 @@ int msi_free_irq(struct msi_desc *entry)
 
 extern const struct hw_interrupt_type pci_msi_type;
 
-/*
- * MSI-X Address Register
- */
-#define PCI_MSIX_FLAGS_QSIZE		0x7FF
-#define PCI_MSIX_FLAGS_ENABLE		(1 << 15)
-#define PCI_MSIX_FLAGS_BIRMASK		(7 << 0)
-#define PCI_MSIX_FLAGS_BITMASK		(1 << 0)
-
 #define PCI_MSIX_ENTRY_SIZE			16
 #define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
 #define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
@@ -151,15 +143,14 @@ extern const struct hw_interrupt_type pc
 	control |= PCI_MSI_FLAGS_ENABLE
 
 #define msix_control_reg(base)		(base + PCI_MSIX_FLAGS)
-#define msix_table_offset_reg(base)	(base + 0x04)
-#define msix_pba_offset_reg(base)	(base + 0x08)
+#define msix_table_offset_reg(base)	(base + PCI_MSIX_TABLE)
+#define msix_pba_offset_reg(base)	(base + PCI_MSIX_PBA)
 #define msix_enable(control)	 	control |= PCI_MSIX_FLAGS_ENABLE
 #define msix_disable(control)	 	control &= ~PCI_MSIX_FLAGS_ENABLE
 #define msix_table_size(control) 	((control & PCI_MSIX_FLAGS_QSIZE)+1)
 #define multi_msix_capable		msix_table_size
-#define msix_unmask(address)	 	(address & ~PCI_MSIX_FLAGS_BITMASK)
-#define msix_mask(address)		(address | PCI_MSIX_FLAGS_BITMASK)
-#define msix_is_pending(address) 	(address & PCI_MSIX_FLAGS_PENDMASK)
+#define msix_unmask(address)	 	(address & ~PCI_MSIX_VECTOR_BITMASK)
+#define msix_mask(address)		(address | PCI_MSIX_VECTOR_BITMASK)
 
 /*
  * MSI Defined Data Structures
--- 2010-06-15.orig/xen/include/xen/pci_regs.h	2009-11-23 11:23:30.000000000 +0100
+++ 2010-06-15/xen/include/xen/pci_regs.h	2010-07-09 15:08:08.000000000 +0200
@@ -301,8 +301,11 @@
 #define  PCI_MSIX_FLAGS_QSIZE	0x7FF
 #define  PCI_MSIX_FLAGS_ENABLE	(1 << 15)
 #define  PCI_MSIX_FLAGS_MASKALL	(1 << 14)
-#define PCI_MSIX_FLAGS_BIRMASK	(7 << 0)
-#define PCI_MSIX_FLAGS_BITMASK	(1 << 0)
+#define PCI_MSIX_TABLE		4
+#define PCI_MSIX_PBA		8
+#define  PCI_MSIX_BIRMASK	(7 << 0)
+
+#define PCI_MSIX_VECTOR_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */
 
--- 2010-06-15.orig/xen/arch/x86/msi.c	2010-07-09 15:05:17.000000000 +0200
+++ 2010-06-15/xen/arch/x86/msi.c	2010-07-09 15:12:26.000000000 +0200
@@ -560,8 +559,8 @@ static int msix_capability_init(struct p
 
     /* Request & Map MSI-X table region */
     table_offset = pci_conf_read32(bus, slot, func, msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
-    table_offset &= ~PCI_MSIX_FLAGS_BIRMASK;
+    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
+    table_offset &= ~PCI_MSIX_BIRMASK;
     entry_offset = msi->entry_nr * PCI_MSIX_ENTRY_SIZE;
 
     table_paddr = msi->table_base + table_offset;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2010-07-12  9:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C3AFF55020000780000AB6C@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).