Changeset 5 for trunk/kernel/kern/core.c


Ignore:
Timestamp:
Apr 26, 2017, 2:11:56 PM (7 years ago)
Author:
alain
Message:

Introduce the chdev_t structure in place of the device_t structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/core.c

    r1 r5  
    3030#include <printk.h>
    3131#include <thread.h>
     32#include <chdev.h>
    3233#include <dev_icu.h>
    3334#include <rpc.h>
     
    4142/////////////////////////////////
    4243void core_init( core_t    * core,
    43                 uint32_t    lid,
    44                 uint32_t    gid )
     44                lid_t       lid,
     45                gid_t       gid )
    4546{
    4647        core->lid               = lid;
     
    6465
    6566        sched_init( core );
    66 
    67         core->icu               = NULL;          // TODO ??? [AG]
    6867}
    6968
     
    200199
    201200///////////////////////////////////////////////////
    202 void core_set_irq_vector_entry( xptr_t     core_xp,
     201void core_set_irq_vector_entry( core_t   * core,
    203202                                uint32_t   irq_type,
    204203                                uint32_t   irq_id,
    205                                 xptr_t     dev_xp )
    206 {
    207     // get core cluster and local pointer
    208     cxy_t    core_cxy = GET_CXY( core_xp );
    209     core_t * core_ptr = (core_t *)GET_PTR( core_xp );
    210 
    211     // compute xptr on relevant interrupt vector entry
    212     xptr_t   xp;
    213     if     ( irq_type == WTI_TYPE ) xp = XPTR( core_cxy , &core_ptr->wti_vector[irq_id] );
    214     else if( irq_type == HWI_TYPE ) xp = XPTR( core_cxy , &core_ptr->hwi_vector[irq_id] );
    215     else                            xp = XPTR( core_cxy , &core_ptr->pti_vector[irq_id] );
    216 
    217     // set relevant IRQ vector entry
    218     hal_remote_swd( xp , dev_xp );
    219 }
     204                                chdev_t  * chdev )
     205{
     206    if     ( irq_type == WTI_TYPE ) core->wti_vector[irq_id] = chdev;
     207    else if( irq_type == HWI_TYPE ) core->hwi_vector[irq_id] = chdev;
     208    else                            core->pti_vector[irq_id] = chdev;
     209}
Note: See TracChangeset for help on using the changeset viewer.