aboutsummaryrefslogtreecommitdiff
path: root/include/skiboot.h
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2019-08-09 14:12:18 +1000
committerOliver O'Halloran <oohall@gmail.com>2019-08-16 15:51:55 +1000
commitdf15dcfc8acc83591889fa3b33100734a6b6bdb7 (patch)
treeb509dfc81f1b0bd02a46aba513c49260865b6998 /include/skiboot.h
parent4acb8fe7960acbf13545ccafac691fe95047c714 (diff)
downloadskiboot-df15dcfc8acc83591889fa3b33100734a6b6bdb7.zip
skiboot-df15dcfc8acc83591889fa3b33100734a6b6bdb7.tar.gz
skiboot-df15dcfc8acc83591889fa3b33100734a6b6bdb7.tar.bz2
pci: Use a macro for accessing PCI BDF Bus Number
Currently when the Bus Number bits of a BDF are needed the bit operations to get it are free coded. There are many places where the Bus Number is used, so make a macro to use instead of free coding it everytime. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'include/skiboot.h')
-rw-r--r--include/skiboot.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/skiboot.h b/include/skiboot.h
index e554325..4db265f 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -137,6 +137,9 @@ static inline bool is_pow2(unsigned long val)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
+/* PCI Geographical Addressing */
+#define PCI_BUS_NUM(bdfn) (((bdfn) >> 8) & 0xff)
+
/* Clean the stray high bit which the FSP inserts: we only have 52 bits real */
static inline u64 cleanup_addr(u64 addr)
{