Changeset 238 for trunk/kernel/devices


Ignore:
Timestamp:
Jul 19, 2017, 3:31:39 PM (7 years ago)
Author:
alain
Message:

Fixing bugs in vfs_lookup()

Location:
trunk/kernel/devices
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_dma.c

    r188 r238  
    4040extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
    4141
    42 ////////////////////////////////////
    43 void dev_dma_init( chdev_t * chdev )
     42//////////////////////////////////
     43void dev_dma_init( chdev_t * dma )
    4444{
    45     // get implementation & channel from DMA chdev descriptor
    46     uint32_t impl    = chdev->impl;
    47     uint32_t channel = chdev->channel;
     45    // get implementation & channel from DMA dma descriptor
     46    uint32_t impl    = dma->impl;
     47    uint32_t channel = dma->channel;
    4848
    49     // set chdev name
    50     snprintf( chdev->name , 16 , "dma_%d_%x" , channel , local_cxy );
     49    // set dma name
     50    snprintf( dma->name , 16 , "dma_%d_%x" , channel , local_cxy );
    5151
    5252    // set field "cmd", "isr", and call the relevant driver init function
    5353    if( impl == IMPL_DMA_SCL )
    5454    {
    55         chdev->cmd = &soclib_dma_cmd;
    56         chdev->isr = &soclib_dma_isr;
    57         soclib_dma_init( chdev );
     55        dma->cmd = &soclib_dma_cmd;
     56        dma->isr = &soclib_dma_isr;
     57        soclib_dma_init( dma );
    5858    }
    5959    else
     
    6363
    6464    // bind IRQ to the core defined by the DMA channel
    65     dev_pic_bind_irq( channel , chdev );
     65    dev_pic_bind_irq( channel , dma );
    6666
    6767    // enable IRQ
    68     dev_pic_enable_irq( channel, chdev );
     68    dev_pic_enable_irq( channel, XPTR( local_cxy , dma ) );
    6969
    7070    // create server thread
     
    7575                                  THREAD_DEV,
    7676                                  &chdev_sequencial_server,
    77                                   chdev,
     77                                  dma,
    7878                                  cluster_select_local_core() );
    7979    if( error )
     
    8383
    8484    // initialises server field in DMA chdev descriptor
    85     chdev->server = new_thread;
     85    dma->server = new_thread;
    8686   
    8787    // start server thread
  • trunk/kernel/devices/dev_ioc.c

    r216 r238  
    6363
    6464    // enable IRQ
    65     dev_pic_enable_irq( lid ,ioc );
     65    dev_pic_enable_irq( lid , XPTR( local_cxy , ioc ) );
    6666
    6767    // create server thread
  • trunk/kernel/devices/dev_mmc.c

    r188 r238  
    3636extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
    3737
    38 ////////////////////////////////////
    39 void dev_mmc_init( chdev_t * chdev )
     38//////////////////////////////////
     39void dev_mmc_init( chdev_t * mmc )
    4040{
    4141    // get implementation from device descriptor
    42     uint32_t  impl = chdev->impl;
    43 
    44     // set chdev name
    45     snprintf( chdev->name , 16 , "mmc_%x" , local_cxy );
     42    uint32_t  impl = mmc->impl;
     43
     44    // set mmc name
     45    snprintf( mmc->name , 16 , "mmc_%x" , local_cxy );
    4646
    4747    // set driver specific fields in device descriptor and call driver init function
    4848    if( impl == IMPL_MMC_TSR )
    4949    {
    50         chdev->cmd = &soclib_mmc_cmd;
    51         chdev->isr = &soclib_mmc_isr;
    52         soclib_mmc_init( chdev );
     50        mmc->cmd = &soclib_mmc_cmd;
     51        mmc->isr = &soclib_mmc_isr;
     52        soclib_mmc_init( mmc );
    5353    }
    5454    else
     
    5858
    5959    // bind IRQ to CP0
    60     dev_pic_bind_irq( 0 , chdev );
     60    dev_pic_bind_irq( 0 , mmc );
    6161   
    6262    // enable IRQ
    63     dev_pic_enable_irq( 0 , chdev );
     63    dev_pic_enable_irq( 0 , XPTR( local_cxy , mmc ) );
    6464
    6565}  // end dev_mmc_init()
  • trunk/kernel/devices/dev_nic.c

    r188 r238  
    133133    {
    134134        // enable NIC-RX IRQ
    135         dev_pic_enable_irq( core->lid , dev_ptr );
     135        dev_pic_enable_irq( core->lid , dev_xp );
    136136
    137137        // block on THREAD_BLOCKED_IO condition and deschedule
     
    140140
    141141        // disable NIC-RX IRQ
    142         dev_pic_disable_irq( core->lid , dev_ptr );
     142        dev_pic_disable_irq( core->lid , dev_xp );
    143143    }
    144144
     
    203203    {
    204204        // enable NIC-TX IRQ
    205         dev_pic_enable_irq( core->lid ,dev_ptr );
     205        dev_pic_enable_irq( core->lid ,dev_xp );
    206206
    207207        // block on THREAD_BLOCKED I/O condition and deschedule
     
    210210
    211211        // disable NIC-TX IRQ
    212         dev_pic_disable_irq( core->lid , dev_ptr );
     212        dev_pic_disable_irq( core->lid , dev_xp );
    213213    }
    214214
  • trunk/kernel/devices/dev_txt.c

    r188 r238  
    7777
    7878        // enable TXT IRQ
    79         dev_pic_enable_irq( lid , txt );
     79        dev_pic_enable_irq( lid , XPTR( local_cxy , txt ) );
    8080
    8181        // create server thread
Note: See TracChangeset for help on using the changeset viewer.