The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sparc64/include/bus_private.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 1997, 1998 Justin T. Gibbs.
    3  * Copyright (c) 2002 by Thomas Moestl <tmm@FreeBSD.org>.
    4  * All rights reserved.
    5  *
    6  * Redistribution and use in source and binary forms, with or without
    7  * modification, are permitted provided that the following conditions
    8  * are met:
    9  * 1. Redistributions of source code must retain the above copyright
   10  *    notice, this list of conditions and the following disclaimer.
   11  * 2. Redistributions in binary form must reproduce the above copyright
   12  *    notice, this list of conditions and the following disclaimer in the
   13  *    documentation and/or other materials provided with the distribution.
   14  *
   15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   18  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   19  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   21  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   22  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   23  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
   24  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   25  *
   26  *      from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.25 2002/01/05
   27  *
   28  * $FreeBSD: releng/10.1/sys/sparc64/include/bus_private.h 225931 2011-10-02 23:22:38Z marius $
   29  */
   30 
   31 #ifndef _MACHINE_BUS_PRIVATE_H_
   32 #define _MACHINE_BUS_PRIVATE_H_
   33 
   34 #include <sys/queue.h>
   35 
   36 /*
   37  * Helpers
   38  */
   39 int sparc64_bus_mem_map(bus_space_tag_t tag, bus_addr_t addr, bus_size_t size,
   40     int flags, vm_offset_t vaddr, bus_space_handle_t *hp);
   41 int sparc64_bus_mem_unmap(bus_space_tag_t tag, bus_space_handle_t handle,
   42     bus_size_t size);
   43 bus_space_tag_t sparc64_alloc_bus_tag(void *cookie,
   44     struct bus_space_tag *ptag, int type, void *barrier);
   45 bus_space_handle_t sparc64_fake_bustag(int space, bus_addr_t addr,
   46     struct bus_space_tag *ptag);
   47 
   48 struct bus_dmamap_res {
   49         struct resource         *dr_res;
   50         bus_size_t              dr_used;
   51         SLIST_ENTRY(bus_dmamap_res)     dr_link;
   52 };
   53 
   54 /*
   55  * Callers of the bus_dma interfaces must always protect their tags and maps
   56  * appropriately against concurrent access. However, when a map is on a LRU
   57  * queue, there is a second access path to it; for this case, the locking rules
   58  * are given in the parenthesized comments below:
   59  *      q - locked by the mutex protecting the queue.
   60  *      p - private to the owner of the map, no access through the queue.
   61  *      * - comment refers to pointer target.
   62  * Only the owner of the map is allowed to insert the map into a queue. Removal
   63  * and repositioning (i.e. temporal removal and reinsertion) is allowed to all
   64  * if the queue lock is held.
   65  */
   66 struct bus_dmamap {
   67         TAILQ_ENTRY(bus_dmamap) dm_maplruq;             /* (q) */
   68         SLIST_HEAD(, bus_dmamap_res)    dm_reslist;     /* (q, *q) */
   69         int                     dm_onq;                 /* (q) */
   70         int                     dm_flags;               /* (p) */
   71 };
   72 
   73 /* Flag values */
   74 #define DMF_LOADED      (1 << 0)        /* Map is loaded. */
   75 #define DMF_COHERENT    (1 << 1)        /* Coherent mapping requested. */
   76 #define DMF_STREAMED    (1 << 2)        /* Streaming cache used. */
   77 
   78 int sparc64_dma_alloc_map(bus_dma_tag_t dmat, bus_dmamap_t *mapp);
   79 void sparc64_dma_free_map(bus_dma_tag_t dmat, bus_dmamap_t map);
   80 
   81 #endif /* !_MACHINE_BUS_PRIVATE_H_ */

Cache object: b199ba90b05875c9836c24acc6420e76


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.