From 2f85e9e153a817b7c22974d80dde488e3a03a03c Mon Sep 17 00:00:00 2001 From: mrg Date: Fri, 16 Feb 2001 14:16:30 +0000 Subject: [PATCH] expand this a little further to include defines of: OFW_PCI_PHYS_HI_DEVICE() - extract PCI device from phys_hi OFW_PCI_PHYS_HI_FUNCTION() - extract PCI function from phys_hi and the definition of `struct ofw_pci_register'. --- sys/dev/ofw/ofw_pci.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/dev/ofw/ofw_pci.h b/sys/dev/ofw/ofw_pci.h index 0b519dba9b36..282aa506bde5 100644 --- a/sys/dev/ofw/ofw_pci.h +++ b/sys/dev/ofw/ofw_pci.h @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_pci.h,v 1.2 1999/05/05 08:09:34 tsubai Exp $ */ +/* $NetBSD: ofw_pci.h,v 1.3 2001/02/16 14:16:30 mrg Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -87,4 +87,20 @@ #define OFW_PCI_PHYS_HI_SPACE_MEM32 0x02000000 #define OFW_PCI_PHYS_HI_SPACE_MEM64 0x03000000 +#define OFW_PCI_PHYS_HI_DEVICE(hi) \ + (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> OFW_PCI_PHYS_HI_DEVICESHIFT) +#define OFW_PCI_PHYS_HI_FUNCTION(hi) \ + (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> OFW_PCI_PHYS_HI_FUNCTIONSHIFT) + +/* + * This has the 3 32bit cell values, plus 2 more to make up a 64-bit size. + */ +struct ofw_pci_register { + u_int32_t phys_hi; + u_int32_t phys_mid; + u_int32_t phys_lo; + u_int32_t size_hi; + u_int32_t size_lo; +}; + #endif /* _DEV_OFW_OFW_PCI_H_ */