Changeset 2da0777 in rtems-libbsd


Ignore:
Timestamp:
Apr 18, 2012, 12:59:28 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
d8c5df7
Parents:
60ed795
Message:

Add BUS_DMA(9) support for mbufs

Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r60ed795 r2da0777  
    4747C_FILES += rtemsbsd/src/rtems-bsd-support.c
    4848C_FILES += rtemsbsd/src/rtems-bsd-bus-dma.c
     49C_FILES += rtemsbsd/src/rtems-bsd-bus-dma-mbuf.c
    4950C_FILES += rtemsbsd/src/rtems-bsd-sysctl.c
    5051C_FILES += rtemsbsd/src/rtems-bsd-sysctlbyname.c
  • freebsd-to-rtems.py

    r60ed795 r2da0777  
    503503                'rtems/machine/rtems-bsd-select.h',
    504504                'rtems/machine/rtems-bsd-taskqueue.h',
     505                'rtems/machine/rtems-bsd-bus-dma.h',
    505506                'bsd.h',
    506507        ]
     
    540541                'src/rtems-bsd-support.c',
    541542                'src/rtems-bsd-bus-dma.c',
     543                'src/rtems-bsd-bus-dma-mbuf.c',
    542544                'src/rtems-bsd-sysctl.c',
    543545                'src/rtems-bsd-sysctlbyname.c',
  • rtemsbsd/src/rtems-bsd-bus-dma.c

    r60ed795 r2da0777  
    66 * @brief TODO.
    77 *
    8  * File origin from FreeBSD 'sys/powerpc/powerpc/busdma_machdep.c'.
     8 * File origin from FreeBSD "sys/powerpc/powerpc/busdma_machdep.c".
    99 */
    1010
    1111/*-
    12  * Copyright (c) 2009, 2010 embedded brains GmbH.  All rights reserved.
     12 * Copyright (c) 2009-2012 embedded brains GmbH.  All rights reserved.
    1313 *
    1414 *  embedded brains GmbH
     
    4747#include <freebsd/machine/rtems-bsd-config.h>
    4848#include <freebsd/machine/rtems-bsd-cache.h>
     49#include <freebsd/machine/rtems-bsd-bus-dma.h>
     50
    4951#include <rtems/malloc.h>
    5052
    51 #include <freebsd/sys/param.h>
    52 #include <freebsd/sys/types.h>
    53 #include <freebsd/sys/lock.h>
    54 #include <freebsd/sys/mutex.h>
    55 #include <freebsd/sys/systm.h>
    5653#include <freebsd/sys/malloc.h>
    5754#include <freebsd/machine/atomic.h>
    58 #include <freebsd/machine/bus.h>
    5955
    6056#ifdef CPU_DATA_CACHE_ALIGNMENT
     
    6258  #define CLMASK (CLSZ - (uintptr_t) 1)
    6359#endif
    64 
    65 struct bus_dma_tag {
    66         bus_dma_tag_t     parent;
    67         bus_size_t      alignment;
    68         bus_size_t      boundary;
    69         bus_addr_t      lowaddr;
    70         bus_addr_t      highaddr;
    71         bus_dma_filter_t *filter;
    72         void         *filterarg;
    73         bus_size_t      maxsize;
    74         int            nsegments;
    75         bus_size_t      maxsegsz;
    76         int            flags;
    77         int            ref_count;
    78         int            map_count;
    79         bus_dma_lock_t   *lockfunc;
    80         void             *lockfuncarg;
    81 };
    82 
    83 struct bus_dmamap {
    84         void *buffer_begin;
    85         bus_size_t buffer_size;
    86 };
    8760
    8861/*
     
    298271 * first indicates if this is the first invocation of this function.
    299272 */
    300 static int
     273int
    301274bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t segs[],
    302275    void *buf, bus_size_t buflen, struct thread *td, int flags,
Note: See TracChangeset for help on using the changeset viewer.