int
vme_probe(
void *vc
, vme_addr_t vmeaddr
, vme_size_t len
, vme_am_t am
, vme_datasize_t datasize
, int (*callback)()
, void *arg
)
int
vme_space_map(
void *vc
vme_addr_t vmeaddr
vme_size_t len
vme_am_t am
vme_datasize_t datasize
vme_swap_t swap
bus_space_tag_t *tag
bus_space_handle_t *handle
vme_mapresc_t *resc
)
void
vme_space_unmap(
void *vc
, vme_mapresc_t resc
)
int
vme_intr_map(
void *vc
, int level
, int vector
, vme_intr_handle_t *handlep
)
void
*
vme_intr_establish(
void *vc
, vme_intr_handle_t handle
, int prio
, int (*func)(void *)
, void *arg
)
void
vme_intr_disestablish(
void *vc
, void *cookie
)
const
struct
evcnt
*
vme_intr_evcnt(
void *vc
, vme_intr_handle_t handle
)
int
vme_dmamap_create(
void *vc
vme_size_t size
vme_am_t am
vme_datasize_t datasize
vme_swap_t swap
int nsegs
vme_size_t segsz
vme_addr_t bound
int flags
bus_dmamap_t *map
)
void
vme_dmamap_destroy(
void *vc
, bus_dmamap_t map
)
int
vme_dmamem_alloc(
void *vc
vme_size_t size
vme_am_t am
vme_datasize_t datasize
vme_swap_t swap
bus_dma_segment_t *segs
int nsegs
int *rsegs
int flags
)
void
vme_dmamem_free(
void *vc
, bus_dma_segment_t *segs
, int nsegs
)
int
vme_space_alloc(
struct vmebus_softc *tag
, vme_addr_t addr
, vme_size_t size
, vme_am_t ams
)
void
vme_space_free(
void *vc
, vme_addr_t addr
, vme_size_t size
, vme_am_t ams
)
int
vme_space_get(
void *vc
, vme_size_t size
, vme_am_t ams
, u_long align
, vme_addr_t *addr
)
The VME bus supports 8, 16, and 32-bit transfers over non-multiplexed 32-bit data and address paths. The latest revisions allow 64-bit, multiplexed transfers. It supports asynchronous, fully handshaken transfers at speeds up to 80 MB/sec. It has a master-slave architecture, encouraging multiprocessing and supports up to seven interrupt levels.
vme_chipset_tag_t
vme_addr_t
vme_am_t
vme_datasize_t
vme_mapresc_t
vme_intr_handle_t
vme_swap_t
struct
vme_range
vme_addr_t offset;
vme_size_t size;
vme_am_t am;
struct
vme_attach_args
vme_chipset_tag_t va_vct;
bus_dma_tag_t va_bdt;
int ivector;
int ilevel;
int numcfranges;
struct vme_range r[VME_MAXCFRANGES];
vc
, vmeaddr
, len
, am
, datasize
, callback
, arg
)
vc
at address
vmeaddr
,
length
len
,
with address modifiers
am
and datasize
datasize
for a device.
If a VME device is found, the function
callback()
(if it is not NULL) is called to perform device-specific
identification.
callback()
is called with the argument
arg
,
and the bus-space tag and bus-space handle for accessing the VME space
mapping and should return a nonzero positive integer for a positive
device match.
vc
, vmeaddr
, len
, am
, datasize
, swap
, tag
, handle
, resc
)
vc
at address
vmeaddr
,
length
len
,
with address modifiers
am
,
datasize
datasize
and endianness
swap
for a device.
If the mapping is successful
tag
contains the bus-space tag and
handle
contains the bus-space handle for accessing the VME space mapping.
resc
contains the resources for the mappings.
vme_space_map(
)
returns 0 on success, and nonzero on error.
vc
, resc
)
vc
and resources
resc
.
vc
, level
, vector
, handlep
)
handlep
to a machine-dependent value which identifies a particular interrupt
source at level
level
and vector
vector
on the controller
vc
.
vme_intr_map(
)
returns zero on success, and nonzero on failure.
vc
, handle
, prio
, func
, arg
)
handlep
.
When the device interrupts,
func()
will be called with a single argument
arg
and will run at the interrupt priority level
prio
.
The return value of
vme_intr_establish(
)
may be saved and passed to
vme_intr_disestablish(
).
vc
, cookie
)
cookie
is the value returned by
vme_intr_establish(
).
vc
, handle
)
handle
.
vc
, size
, am
, datasize
, swap
, nsegs
, segsz
, bound
, flags
, map
)
am
,
datasize
datasize
,
and endianness
swap
.
The remaining parameters are described in
bus_dma(9).
vc
, map
)
vc
, size
, am
, datasize
, swap
, segs
, nsegs
, rsegs
, flags
)
vc
.
The VME-specific parameters describe the
address-space modifiers
am
,
datasize
datasize
,
and endianness
swap
.
The remaining parameters are described in
bus_dma(9).
vc
, segs
, nsegs
)
)
for the VME space managed by controller
vc
.
tag
, addr
, size
, ams
)
tag
at address
addr
of size
size
and address-space modifiers
ams
.
vme_space_alloc(
)
returns EINVAL on invalid inputs.
vc
, addr
, size
, ams
)
tag
at address
addr
of size
size
and address-space modifiers
ams
.
vc
, size
, ams
, align
, addr
)
struct
vme_attach_args
hinting at "locations" (address ranges) on the VME bus where the
device may be located.
The driver should check the number of address
ranges, allocate the address space of these ranges using
vme_space_alloc(
),
and probe the address space for the device using
vme_probe(
).
During driver attach the driver should also map the address ranges
using
vme_space_map().
The interrupt locators in
struct
vme_attach_args
are used by
vme_intr_map()
and
vme_intr_establish(
).
/usr/src
.
The
VME
subsystem itself is implemented within the file
sys/dev/vme/vme.c
.