Added iommu_extract() for debug purposes.
Anyone caught using it for anything other than debug will be shot.
This commit is contained in:
parent
17d975073d
commit
388726b340
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: iommu.c,v 1.38 2001/09/10 21:19:26 chris Exp $ */
|
||||
/* $NetBSD: iommu.c,v 1.39 2001/09/15 06:55:50 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Matthew R. Green
|
||||
|
@ -321,6 +321,25 @@ iommu_enter(is, va, pa, flags)
|
|||
(u_long)tte));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Find the value of a DVMA address (debug routine).
|
||||
*/
|
||||
paddr_t
|
||||
iommu_extract(is, dva)
|
||||
struct iommu_state *is;
|
||||
vaddr_t dva;
|
||||
{
|
||||
int64_t tte = 0;
|
||||
|
||||
if (dva >= is->is_dvmabase)
|
||||
tte = is->is_tsb[IOTSBSLOT(dva,is->is_tsbsize)];
|
||||
|
||||
if ((tte&IOTTE_V) == 0)
|
||||
return ((paddr_t)-1L);
|
||||
return (tte&IOTTE_PAMASK);
|
||||
}
|
||||
|
||||
/*
|
||||
* iommu_remove: removes mappings created by iommu_enter
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: iommuvar.h,v 1.7 2001/07/20 00:07:13 eeh Exp $ */
|
||||
/* $NetBSD: iommuvar.h,v 1.8 2001/09/15 06:55:50 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Matthew R. Green
|
||||
|
@ -57,6 +57,7 @@ void iommu_init __P((char *, struct iommu_state *, int, u_int32_t));
|
|||
void iommu_reset __P((struct iommu_state *));
|
||||
void iommu_enter __P((struct iommu_state *, vaddr_t, int64_t, int));
|
||||
void iommu_remove __P((struct iommu_state *, vaddr_t, size_t));
|
||||
paddr_t iommu_extract __P((struct iommu_state *, vaddr_t));
|
||||
|
||||
int iommu_dvmamap_load __P((bus_dma_tag_t, struct iommu_state *,
|
||||
bus_dmamap_t, void *, bus_size_t, struct proc *, int));
|
||||
|
|
Loading…
Reference in New Issue