Changeset 261


Ignore:
Timestamp:
Jul 20, 2017, 3:13:58 PM (4 years ago)
Author:
max@…
Message:

Hide soclib_dma.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/generic/hal_drivers.h

    r259 r261  
    3535void hal_drivers_nic_init(chdev_t *nic, uint32_t impl);
    3636
     37void hal_drivers_dma_init(chdev_t *dma, uint32_t impl);
     38
    3739#endif  /* HAL_DRIVERS_H_ */
    3840
  • trunk/hal/tsar_mips32/core/hal_drivers.c

    r259 r261  
    130130}
    131131
     132///////////////////////////////////////////////////////////////////////////////
     133//    DMA
     134///////////////////////////////////////////////////////////////////////////////
     135
     136//////////////////////////////////////////
     137void hal_drivers_dma_init( chdev_t  * dma,
     138                           uint32_t   impl )
     139{
     140    if( impl == IMPL_DMA_SCL )
     141    {
     142        soclib_dma_init( dma );
     143    }
     144    else
     145    {
     146        assert( false , __FUNCTION__ , "undefined DMA implementation" );
     147    }
     148}
     149
  • trunk/hal/tsar_mips32/drivers/soclib_dma.c

    r75 r261  
    3434    cxy_t      dma_cxy  = GET_CXY( chdev->base );
    3535    uint32_t * dma_ptr  = (uint32_t *)GET_PTR( chdev->base );
     36
     37    // set driver specific fields in chdev descriptor
     38    chdev->cmd = &soclib_dma_cmd;
     39    chdev->isr = &soclib_dma_isr;
    3640
    3741    // enable interrupts
  • trunk/hal/x86_64/core/hal_drivers.c

    r259 r261  
    7777        x86_panic("NIC driver not implemented");
    7878}
     79
     80/* -------------------------------------------------------------------------- */
     81
     82void hal_drivers_dma_init(chdev_t *dma, uint32_t impl)
     83{
     84        x86_panic("DMA driver not implemented");
     85}
     86
  • trunk/kernel/devices/dev_dma.c

    r238 r261  
    3232#include <soclib_dma.h>
    3333#include <dev_dma.h>
    34 #include <soclib_dma.h>
     34#include <hal_drivers.h>
    3535
    3636/////////////////////////////////////////////////////////////////////////////////////////
     
    5050    snprintf( dma->name , 16 , "dma_%d_%x" , channel , local_cxy );
    5151
    52     // set field "cmd", "isr", and call the relevant driver init function
    53     if( impl == IMPL_DMA_SCL )
    54     {
    55         dma->cmd = &soclib_dma_cmd;
    56         dma->isr = &soclib_dma_isr;
    57         soclib_dma_init( dma );
    58     }
    59     else
    60     {
    61         assert( false , __FUNCTION__ , "undefined DMA implementation" );
    62     }
     52    // call driver init function
     53    hal_drivers_dma_init( dma, impl );
    6354
    6455    // bind IRQ to the core defined by the DMA channel
Note: See TracChangeset for help on using the changeset viewer.