diff options
author | jhb <jhb@FreeBSD.org> | 2007-03-31 21:39:02 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-03-31 21:39:02 +0000 |
commit | a347b09ecaccf4979487718e2cbea615d716e7e9 (patch) | |
tree | 521d8851bfe33d6303693f35ba56d75b14d22d15 /sys/dev/pci/pcireg.h | |
parent | 31387e6228cbcc50849fb1fea471a91359be0261 (diff) | |
download | FreeBSD-src-a347b09ecaccf4979487718e2cbea615d716e7e9.zip FreeBSD-src-a347b09ecaccf4979487718e2cbea615d716e7e9.tar.gz |
Add constants for the fields in a BAR. Also, add two new macros
PCI_BAR_(IO|MEM)() that return true if the passed in value from a BAR
is for an IO or memory BAR, respectively.
Reviewed by: imp
Diffstat (limited to 'sys/dev/pci/pcireg.h')
-rw-r--r-- | sys/dev/pci/pcireg.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index fbb13c9..5fbd24e 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -118,6 +118,19 @@ #define PCIR_BARS 0x10 #define PCIR_BAR(x) (PCIR_BARS + (x) * 4) #define PCI_RID2BAR(rid) (((rid)-PCIR_BARS)/4) +#define PCI_BAR_IO(x) (((x) & PCIM_BAR_SPACE) == PCIM_BAR_IO_SPACE) +#define PCI_BAR_MEM(x) (((x) & PCIM_BAR_SPACE) == PCIM_BAR_MEM_SPACE) +#define PCIM_BAR_SPACE 0x00000001 +#define PCIM_BAR_MEM_SPACE 0 +#define PCIM_BAR_IO_SPACE 1 +#define PCIM_BAR_MEM_TYPE 0x00000006 +#define PCIM_BAR_MEM_32 0 +#define PCIM_BAR_MEM_1MB 2 /* Locate below 1MB in PCI <= 2.1 */ +#define PCIM_BAR_MEM_64 4 +#define PCIM_BAR_MEM_PREFETCH 0x00000008 +#define PCIM_BAR_MEM_BASE 0xfffffff0 +#define PCIM_BAR_IO_RESERVED 0x00000002 +#define PCIM_BAR_IO_BASE 0xfffffffc #define PCIR_CIS 0x28 #define PCIM_CIS_ASI_MASK 0x7 #define PCIM_CIS_ASI_TUPLE 0 |