vm_offset_t -> paddr_t
Implement bus_space_mmap.
This commit is contained in:
parent
450c4305c1
commit
a9847551d5
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: bus.c,v 1.3 2001/09/10 21:19:41 chris Exp $ */
|
/* $NetBSD: bus.c,v 1.4 2001/11/30 17:49:10 fredette Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Matthew Fredette.
|
* Copyright (c) 2001 Matthew Fredette.
|
||||||
@ -230,8 +230,8 @@ _bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
|
|||||||
vaddr_t low, high;
|
vaddr_t low, high;
|
||||||
struct pglist *mlist;
|
struct pglist *mlist;
|
||||||
int error;
|
int error;
|
||||||
extern vm_offset_t avail_start;
|
extern paddr_t avail_start;
|
||||||
extern vm_offset_t avail_end;
|
extern paddr_t avail_end;
|
||||||
|
|
||||||
/* Always round the size. */
|
/* Always round the size. */
|
||||||
size = m68k_round_page(size);
|
size = m68k_round_page(size);
|
||||||
@ -520,8 +520,8 @@ static int sun68k_bus_unmap __P((bus_space_tag_t, bus_space_handle_t,
|
|||||||
static int sun68k_bus_subregion __P((bus_space_tag_t, bus_space_handle_t,
|
static int sun68k_bus_subregion __P((bus_space_tag_t, bus_space_handle_t,
|
||||||
bus_size_t, bus_size_t,
|
bus_size_t, bus_size_t,
|
||||||
bus_space_handle_t *));
|
bus_space_handle_t *));
|
||||||
static int sun68k_bus_mmap __P((bus_space_tag_t, bus_type_t,
|
static paddr_t sun68k_bus_mmap __P((bus_space_tag_t, bus_type_t,
|
||||||
bus_addr_t, int, bus_space_handle_t *));
|
bus_addr_t, off_t, int, int));
|
||||||
static void *sun68k_mainbus_intr_establish __P((bus_space_tag_t, int, int,
|
static void *sun68k_mainbus_intr_establish __P((bus_space_tag_t, int, int,
|
||||||
int, int (*) __P((void *)),
|
int, int (*) __P((void *)),
|
||||||
void *));
|
void *));
|
||||||
@ -699,16 +699,18 @@ sun68k_bus_subregion(tag, handle, offset, size, nhandlep)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
paddr_t
|
||||||
sun68k_bus_mmap(t, iospace, paddr, flags, hp)
|
sun68k_bus_mmap(t, iospace, paddr, offset, prot, flags)
|
||||||
bus_space_tag_t t;
|
bus_space_tag_t t;
|
||||||
bus_type_t iospace;
|
bus_type_t iospace;
|
||||||
bus_addr_t paddr;
|
bus_addr_t paddr;
|
||||||
|
off_t offset;
|
||||||
|
int prot;
|
||||||
int flags;
|
int flags;
|
||||||
bus_space_handle_t *hp;
|
|
||||||
{
|
{
|
||||||
*hp = (bus_space_handle_t)(paddr | iospace | PMAP_NC);
|
paddr_t npaddr;
|
||||||
return (0);
|
npaddr = m68k_trunc_page(paddr + offset);
|
||||||
|
return (npaddr | (paddr_t)iospace | PMAP_NC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: vme_sun68k.c,v 1.1 2001/06/27 02:48:32 fredette Exp $ */
|
/* $NetBSD: vme_sun68k.c,v 1.2 2001/11/30 17:49:10 fredette Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
|
* Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
|
||||||
@ -99,7 +99,7 @@ static int sun68k_vme_dmamap_load __P((bus_dma_tag_t, bus_dmamap_t, void *,
|
|||||||
static int sun68k_vme_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t,
|
static int sun68k_vme_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t,
|
||||||
bus_dma_segment_t *, int, bus_size_t, int));
|
bus_dma_segment_t *, int, bus_size_t, int));
|
||||||
|
|
||||||
int sun68k_vme_mmap_cookie __P((vme_addr_t, vme_am_t, bus_space_handle_t *));
|
paddr_t sun68k_vme_mmap_cookie __P((vme_addr_t, vme_am_t, bus_space_handle_t *));
|
||||||
|
|
||||||
struct cfattach sun68kvme_ca = {
|
struct cfattach sun68kvme_ca = {
|
||||||
sizeof(struct sun68kvme_softc), sun68kvme_match, sun68kvme_attach
|
sizeof(struct sun68kvme_softc), sun68kvme_match, sun68kvme_attach
|
||||||
@ -259,7 +259,7 @@ sun68k_vme_map(cookie, addr, size, mod, datasize, swap, tp, hp, rp)
|
|||||||
/*
|
/*
|
||||||
* Assists in mmap'ing a device on the VME bus.
|
* Assists in mmap'ing a device on the VME bus.
|
||||||
*/
|
*/
|
||||||
int
|
paddr_t
|
||||||
sun68k_vme_mmap_cookie(addr, mod, hp)
|
sun68k_vme_mmap_cookie(addr, mod, hp)
|
||||||
vme_addr_t addr;
|
vme_addr_t addr;
|
||||||
vme_am_t mod;
|
vme_am_t mod;
|
||||||
@ -274,7 +274,7 @@ sun68k_vme_mmap_cookie(addr, mod, hp)
|
|||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
return (bus_space_mmap(sc->sc_bustag, iospace, paddr, 0, hp));
|
return (bus_space_mmap2(sc->sc_bustag, iospace, paddr, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sun68k_vme_intr_handle {
|
struct sun68k_vme_intr_handle {
|
||||||
|
Loading…
Reference in New Issue
Block a user