diff options
author | dfr <dfr@FreeBSD.org> | 1998-10-06 14:18:40 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-10-06 14:18:40 +0000 |
commit | 685a5b889f6d81b2b242340f505aceacc862b28e (patch) | |
tree | b7a83790377c30fcb1ccae004877f46dc78bea77 /sys/pci/pci_compat.c | |
parent | 5c811970f93597f910f75c2df6a06a262c02984f (diff) | |
download | FreeBSD-src-685a5b889f6d81b2b242340f505aceacc862b28e.zip FreeBSD-src-685a5b889f6d81b2b242340f505aceacc862b28e.tar.gz |
Add functions for accessing dense and bwx memory for pci devices. These
routines are necessary to allow the use of certain types of hardware on
the alpha, particularly a Myrinet card.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
Diffstat (limited to 'sys/pci/pci_compat.c')
-rw-r--r-- | sys/pci/pci_compat.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/sys/pci/pci_compat.c b/sys/pci/pci_compat.c index ebec37a..c082318 100644 --- a/sys/pci/pci_compat.c +++ b/sys/pci/pci_compat.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pci_compat.c,v 1.10 1998/09/06 22:41:42 tegge Exp $ + * $Id: pci_compat.c,v 1.11 1998/09/15 08:21:09 gibbs Exp $ * */ @@ -165,6 +165,49 @@ int pci_map_mem(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa) return (0); } +int +pci_map_dense(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa) +{ + vm_offset_t dense; + int retval = 0; + + if(pci_map_mem(cfg, reg, va, pa)){ +#ifdef __alpha__ + if(dense = pci_cvt_to_dense(*pa)){ + *pa = dense; + *va = ALPHA_PHYS_TO_K0SEG(*pa); + return (1); + } +#endif +#ifdef __i386__ + return(1); +#endif + } + return (0); +} + +int +pci_map_bwx(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa) +{ + vm_offset_t bwx; + int retval = 0; + + if(pci_map_mem(cfg, reg, va, pa)){ +#ifdef __alpha__ + if(bwx = pci_cvt_to_bwx(*pa)){ + *pa = bwx; + *va = ALPHA_PHYS_TO_K0SEG(*pa); + return (1); + } +#endif +#ifdef __i386__ + return(1); +#endif + } + return (0); +} + + int pci_map_int(pcici_t cfg, pci_inthand_t *func, void *arg, unsigned *maskptr) { |