Changeset 127 for trunk


Ignore:
Timestamp:
Jul 3, 2017, 3:00:02 PM (7 years ago)
Author:
max@…
Message:

style

File:
1 edited

Legend:

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

    r124 r127  
    11/*
    22 * kernel_init.c - kernel parallel initialization
    3  * 
     3 *
    44 * Authors :  Mohamed Lamine Karaoui (2015)
    55 *            Alain Greiner  (2016,2017)
     
    6464// They are initialised by the kernel_init() function.
    6565//
    66 // WARNING : The section names have been defined to control the base addresses of the 
     66// WARNING : The section names have been defined to control the base addresses of the
    6767// boot_info structure and the idle thread descriptors, through the kernel.ld script:
    68 // - the boot_info structure is build by the bootloader, and used by kernel_init.
    69 //   it must be first object in the kdata segment.
     68// - the boot_info structure is built by the bootloader, and used by kernel_init.
     69//   it must be the first object in the kdata segment.
    7070// - the array of idle threads descriptors must be placed on the first page boundary after
    7171//   the boot_info structure in the kdata segment.
     
    8181                                   CONFIG_MAX_LOCAL_CORES]   CONFIG_PPM_PAGE_ALIGNED;
    8282
    83 // This variable defines the local cluster manager 
     83// This variable defines the local cluster manager
    8484__attribute__((section(".kdata")))
    8585cluster_t            cluster_manager                         CONFIG_CACHE_LINE_ALIGNED;
     
    105105cxy_t                local_cxy                               CONFIG_CACHE_LINE_ALIGNED;
    106106
    107 // This variable defines the TXT0 chdev descriptor 
     107// This variable defines the TXT0 chdev descriptor
    108108__attribute__((section(".kdata")))
    109109chdev_t              txt0_chdev                              CONFIG_CACHE_LINE_ALIGNED;
    110110
    111 // This variable is used for CP0 cores sychronisation in kernel_init()
     111// This variable is used for CP0 cores synchronisation in kernel_init()
    112112__attribute__((section(".kdata")))
    113113remote_barrier_t     global_barrier                          CONFIG_CACHE_LINE_ALIGNED;
    114114
    115 // This variable is used for local cores sychronisation in kernel_init()
     115// This variable is used for local cores synchronisation in kernel_init()
    116116__attribute__((section(".kdata")))
    117117barrier_t            local_barrier                           CONFIG_CACHE_LINE_ALIGNED;
    118118
    119 // This variable defines the array of supported File System contexts 
     119// This variable defines the array of supported File System contexts
    120120__attribute__((section(".kdata")))
    121121vfs_ctx_t            fs_context[FS_TYPES_NR]                 CONFIG_CACHE_LINE_ALIGNED;
     
    126126///////////////////////////////////////////////////////////////////////////////////////////
    127127static void print_banner( uint32_t nclusters , uint32_t ncores )
    128 { 
     128{
    129129    printk("\n"
    130130           "                    _        __    __     _____     ______         __    __    _   __   _     _   \n"
     
    137137           "    /_/        \\_\\ |______| |_|    |_|   \\_____/  |______/        |_|    |_|  |_|  \\_\\ |_|   |_|  \n"
    138138           "\n\n\t\t Advanced Locality Management Operating System / Multi Kernel Hybrid\n"
    139            "\n\n\t\t\t Version 0.0   :   %d clusters   /   %d cores per cluster\n\n", nclusters , ncores ); 
     139           "\n\n\t\t\t Version 0.0   :   %d clusters   /   %d cores per cluster\n\n", nclusters , ncores );
    140140}
    141141
    142142
    143143///////////////////////////////////////////////////////////////////////////////////////////
    144 // This static function initializes the TXT0 chdev descriptor, associated to the "kernel 
    145 // terminal", and shared by all kernel instances for debug messages. It also register it
     144// This static function initializes the TXT0 chdev descriptor, associated to the "kernel
     145// terminal", and shared by all kernel instances for debug messages. It also registers it
    146146// in the chdev directory, containing extended pointers on all chdevs.
    147147// The global variable txt0_chdev is replicated in all clusters, but only the chdev
    148148// allocated in I/O cluster is used by ALMOS-MKH.
    149149// Therefore, this function must be called by a thread running in the I/O cluster.
    150 // As this TXT0 chdev supports only the TXT_SYNC_WRITE command,  we don't create
    151 // a server thread,  we don't allocate a WTI, and we don't initialize the waiting queue.
     150// As this TXT0 chdev supports only the TXT_SYNC_WRITE command, we don't create
     151// a server thread, we don't allocate a WTI, and we don't initialize the waiting queue.
    152152///////////////////////////////////////////////////////////////////////////////////////////
    153153// @ info    : pointer on the local boot-info structure.
     
    156156{
    157157    boot_device_t * dev_tbl;         // pointer on array of devices in boot_info
    158         uint32_t        dev_nr;          // actual number of devices in this cluster
    159         xptr_t          base;            // remote pointer on segment base
     158    uint32_t        dev_nr;          // actual number of devices in this cluster
     159    xptr_t          base;            // remote pointer on segment base
    160160    uint32_t        type;            // peripheral type
    161     uint32_t        func;            // device functionnal index
     161    uint32_t        func;            // device functional index
    162162    uint32_t        impl;            // device implementation index
    163         uint32_t        i;               // device index in dev_tbl
    164         uint32_t        x;               // X cluster coordinate
    165         uint32_t        y;               // Y cluster coordinate
     163    uint32_t        i;               // device index in dev_tbl
     164    uint32_t        x;               // X cluster coordinate
     165    uint32_t        y;               // Y cluster coordinate
    166166
    167167    // get number of peripherals and base of devices array from boot_info
    168         dev_nr      = info->ext_dev_nr;
     168    dev_nr      = info->ext_dev_nr;
    169169    dev_tbl     = info->ext_dev;
    170170
    171171    // loop on external peripherals to find TXT device
    172         for( i = 0 ; i < dev_nr ; i++ )
    173         {
     172    for( i = 0 ; i < dev_nr ; i++ )
     173    {
    174174        base        = dev_tbl[i].base;
    175175        type        = dev_tbl[i].type;
     
    177177        impl        = IMPL_FROM_TYPE( type );
    178178
    179         if (func == DEV_FUNC_TXT ) 
     179        if (func == DEV_FUNC_TXT )
    180180        {
    181181            // initialize basic fields
     
    210210            }
    211211
    212                     kinit_dmsg("\n[INFO] %s : core[%x][0] created TXT0 chdev"
     212            kinit_dmsg("\n[INFO] %s : core[%x][0] created TXT0 chdev"
    213213                       " / paddr = %l at cycle %d\n",
    214214                       __FUNCTION__ , local_cxy , chdev_func_str( func ),
    215215                       XPTR(local_cxy , &txt0_chdev) , hal_get_cycles() );
    216216        }
    217 
    218         } // end loop on devices
    219 
    220 }  // end txt0_device_init()
     217    }
     218}
    221219
    222220///////////////////////////////////////////////////////////////////////////////////////////
     
    233231{
    234232    boot_device_t * dev;             // pointer on boot_info device (ICU/MMC/DMA)
    235         uint32_t        x;               // X cluster coordinate
    236         uint32_t        y;               // Y cluster coordinate
    237         chdev_t       * chdev_ptr;       // local pointer on chdev descriptor
     233    uint32_t        x;               // X cluster coordinate
     234    uint32_t        y;               // Y cluster coordinate
     235    chdev_t       * chdev_ptr;       // local pointer on chdev descriptor
    238236    xptr_t          chdev_xp;        // extended pointer on chdev descriptor
    239237
     
    244242    assert( ((info->cores_nr == 0) || (dev->channels != 0)) , __FUNCTION__ ,
    245243            "ICU device must exist in cluster containing cores" );
    246        
     244
    247245    assert( (dev->channels == 1) , __FUNCTION__ ,
    248246            "channels number must be 1 for ICU device" );
     
    259257
    260258    assert( (chdev_ptr != NULL) , __FUNCTION__ , "cannot allocate ICU chdev" );
    261            
    262     // get extended pointer on chdev descriptor 
     259
     260    // get extended pointer on chdev descriptor
    263261    chdev_xp = XPTR( local_cxy , chdev_ptr );
    264262
    265     // make ICU specific initialisation 
     263    // make ICU specific initialisation
    266264    // TODO remove these three parameters
    267265    dev_icu_init( chdev_ptr , dev->param0 , dev->param1 , dev->param2 );
    268266
    269267    // initialize the ICU field in the chdev_dir[x][y] structures
    270     // replicated in all clusters, and containing extended pointers 
    271     // on all remotely accessible devices 
     268    // replicated in all clusters, and containing extended pointers
     269    // on all remotely accessible devices
    272270    for( x = 0 ; x < info->x_size ; x++ )
    273271    {
     
    280278
    281279    // initialize the entries of the local chdev_icu_input structure
    282     // defining how internal peripherals are connected to ICU 
     280    // defining how internal peripherals are connected to ICU
    283281    uint32_t   id;
    284282    uint8_t    valid;
     
    304302               __FUNCTION__ , local_cxy , hal_get_cycles() );
    305303
    306     /////////// MMC internal chdev /////////// 
     304    /////////// MMC internal chdev ///////////
    307305
    308306    dev = &info->dev_mmc;
     
    310308    if( dev->channels != 0 )   // MMC device is defined
    311309    {
    312         assert( (dev->channels == 1) , __FUNCTION__ , 
     310        assert( (dev->channels == 1) , __FUNCTION__ ,
    313311            "channels number must be 1 for MMC device" );
    314312
     
    324322
    325323        assert( (chdev_ptr != NULL) , __FUNCTION__ , "cannot allocate MMC chdev" );
    326            
    327         // get extended pointer on chdev descriptor 
     324
     325        // get extended pointer on chdev descriptor
    328326        chdev_xp = XPTR( local_cxy , chdev_ptr );
    329327
    330328        // make MMC specific initialisation
    331         dev_mmc_init( chdev_ptr );     
     329        dev_mmc_init( chdev_ptr );
    332330
    333331        // initialize the MMC field in the chdev_dir[x][y] structures
    334         // replicated in all clusters, and containing extended pointers 
    335         // on all remotely accessible devices 
     332        // replicated in all clusters, and containing extended pointers
     333        // on all remotely accessible devices
    336334        for( x = 0 ; x < info->x_size ; x++ )
    337335        {
     
    359357        uint32_t channel;
    360358        for( channel = 0 ; channel < dev->channels ; channel++ )
    361         { 
     359        {
    362360            chdev_ptr = chdev_create( FUNC_FROM_TYPE( dev->type ),
    363361                                      IMPL_FROM_TYPE( dev->type ),
     
    367365
    368366            assert( (chdev_ptr != NULL) , __FUNCTION__ , "cannot allocate DMA chdev" );
    369            
    370             // get extended pointer on channel descriptor 
     367
     368            // get extended pointer on channel descriptor
    371369            chdev_xp = XPTR( local_cxy , chdev_ptr );
    372370
    373371            // make DMA specific initialisation
    374             dev_dma_init( chdev_ptr );     
     372            dev_dma_init( chdev_ptr );
    375373
    376374            // initialize only the DMA[channel] field in the local chdev_dir[x][y]
     
    381379                       __FUNCTION__ , local_cxy , channel , hal_get_cycles() );
    382380        }
    383     } 
     381    }
    384382}  // end internal_devices_init()
    385383
    386384///////////////////////////////////////////////////////////////////////////////////////////
    387 // This static function allocates memory for the chdev descriptors associated 
     385// This static function allocates memory for the chdev descriptors associated
    388386// to the external (shared) peripherals contained in the local cluster. These external
    389 // devices (IOB, IOC, TXT, NIC, etc ) are distributed on all clusters. 
     387// devices (IOB, IOC, TXT, NIC, etc ) are distributed on all clusters.
    390388// It initialises these device descriptors as specified by the boot_info_t structure,
    391389// including the dynamic linking with the driver for the specified implementation.
    392390// Finally, all copies of the devices directory are initialised.
    393391//
    394 // The number of channel_devices depends on the device functionnal type.
    395 // There is three nested loops to build the full set of external channel_devices:
     392// The number of channel_devices depends on the device functional type.
     393// There are three nested loops to build the full set of external channel_devices:
    396394// - loop on external devices.
    397395// - loop on channels for multi-channels devices.
     
    400398// to select the cluster containing a given chdev[func,channel,direction].
    401399// All clusters scan the full set of chdevs, but only the cluster matching
    402 // (chdev_gid % (x_size*y_size)) create the corresponding chdev. 
     400// (chdev_gid % (x_size*y_size)) create the corresponding chdev.
    403401//
    404402// TODO check that cluster IO contains a PIC [AG]
     
    410408{
    411409    boot_device_t * dev_tbl;         // pointer on array of devices in boot_info
    412         uint32_t        dev_nr;          // actual number of devices in this cluster
    413         xptr_t          base;            // remote pointer on segment base
     410    uint32_t        dev_nr;          // actual number of devices in this cluster
     411    xptr_t          base;            // remote pointer on segment base
    414412    uint32_t        type;            // peripheral type
    415413    uint32_t        func;            // device functionnal index
    416414    uint32_t        impl;            // device implementation index
    417         uint32_t        i;               // device index in dev_tbl
    418         uint32_t        x;               // X cluster coordinate
    419         uint32_t        y;               // Y cluster coordinate
    420         uint32_t        channels_nr;     // number of channels
    421         uint32_t        channel;         // channel index
    422         uint32_t        directions_nr;   // number of directions
    423         uint32_t        direction;       // direction index
    424         uint32_t        p0;              // device parameter 0
    425         uint32_t        p1;              // device parameter 1
    426         uint32_t        p2;              // device parameter 2
    427         uint32_t        p3;              // device parameter 3
     415    uint32_t        i;               // device index in dev_tbl
     416    uint32_t        x;               // X cluster coordinate
     417    uint32_t        y;               // Y cluster coordinate
     418    uint32_t        channels_nr;     // number of channels
     419    uint32_t        channel;         // channel index
     420    uint32_t        directions_nr;   // number of directions
     421    uint32_t        direction;       // direction index
     422    uint32_t        p0;              // device parameter 0
     423    uint32_t        p1;              // device parameter 1
     424    uint32_t        p2;              // device parameter 2
     425    uint32_t        p3;              // device parameter 3
    428426    uint32_t        first_channel;   // used in loop on channels
    429427
    430         chdev_t       * chdev;           // local pointer on one channel_device descriptor
     428    chdev_t       * chdev;           // local pointer on one channel_device descriptor
    431429    xptr_t          chdev_xp;        // extended pointer on channel_device descriptor
    432430    uint32_t        chdev_gid = 0;   // global index of channel_device descriptor
    433431
    434432    // get number of peripherals and base of devices array from boot_info
    435         dev_nr      = info->ext_dev_nr;
     433    dev_nr      = info->ext_dev_nr;
    436434    dev_tbl     = info->ext_dev;
    437435
    438436    // loop on external peripherals
    439         for( i = 0 ; i < dev_nr ; i++ )
    440         {
     437    for( i = 0 ; i < dev_nr ; i++ )
     438    {
    441439        base        = dev_tbl[i].base;
    442440        type        = dev_tbl[i].type;
     
    461459        if( func == DEV_FUNC_ROM ) continue;
    462460
    463         // check external device functionnal type
     461        // check external device functional type
    464462        if( (func != DEV_FUNC_IOB) &&
    465463            (func != DEV_FUNC_PIC) &&
     
    467465            (func != DEV_FUNC_TXT) &&
    468466            (func != DEV_FUNC_NIC) &&
    469             (func != DEV_FUNC_FBF) ) 
     467            (func != DEV_FUNC_FBF) )
    470468        {
    471469            assert( false , __FUNCTION__ , "undefined external peripheral type" );
    472470        }
    473471
    474         // loops on channels 
     472        // loops on channels
    475473        for( channel = first_channel ; channel < channels_nr ; channel++ )
    476         { 
     474        {
    477475            // loop on directions
    478476            for( direction = 0 ; direction < directions_nr ; direction++ )
     
    494492                                          base );
    495493
    496                     assert( (chdev != NULL), __FUNCTION__ , 
     494                    assert( (chdev != NULL), __FUNCTION__ ,
    497495                            "cannot allocate external device" );
    498496
     
    514512                    }
    515513
    516                     // all external (shared) devices are remotely accessible 
     514                    // all external (shared) devices are remotely accessible
    517515                    // initialize the replicated chdev_dir[x][y] structures
    518                     // defining the extended pointers on chdev descriptors 
    519                     xptr_t * entry;   
    520                
     516                    // defining the extended pointers on chdev descriptors
     517                    xptr_t * entry;
     518
    521519                    if( func == DEV_FUNC_IOB ) entry  = &chdev_dir.iob;
    522520                    if( func == DEV_FUNC_PIC ) entry  = &chdev_dir.pic;
     
    525523                    if( func == DEV_FUNC_FBF ) entry  = &chdev_dir.fbf[channel];
    526524                    if( func == DEV_FUNC_NIC ) entry  = &chdev_dir.nic_tx[channel];
    527  
     525
    528526                    for( x = 0 ; x < info->x_size ; x++ )
    529527                    {
     
    535533                    }
    536534
    537                             kinit_dmsg("\n[INFO] %s : core[%x][0] create chdev %s[%d] at cycle %d\n",
     535                    kinit_dmsg("\n[INFO] %s : core[%x][0] create chdev %s[%d] at cycle %d\n",
    538536                               __FUNCTION__ , local_cxy , chdev_func_str( func ),
    539537                               channel , hal_get_cycles() );
     
    549547
    550548        // initialize the entries of the local chdev_pic_input structure
    551         // defining how external peripherals are connected to PIC 
    552         if( func == DEV_FUNC_PIC ) 
     549        // defining how external peripherals are connected to PIC
     550        if( func == DEV_FUNC_PIC )
    553551        {
    554552            uint32_t   id;
     
    577575                    else if( dev_func == DEV_FUNC_IOC )
    578576                    {
    579                         index = &chdev_pic_input.ioc[channel]; 
     577                        index = &chdev_pic_input.ioc[channel];
    580578                    }
    581579                    else if( (dev_func == DEV_FUNC_NIC) && (is_rx == 0) )
    582580                    {
    583                         index = &chdev_pic_input.nic_tx[channel]; 
     581                        index = &chdev_pic_input.nic_tx[channel];
    584582                    }
    585583                    else if( (dev_func == DEV_FUNC_NIC) && (is_rx != 0) )
    586584                    {
    587                         index = &chdev_pic_input.nic_rx[channel]; 
     585                        index = &chdev_pic_input.nic_rx[channel];
    588586                    }
    589587                    else
    590588                    {
    591589                        assert( false , __FUNCTION__ , "illegal source device for PIC input" );
    592                     }                   
     590                    }
    593591
    594592                    // set entry in local structure
    595                     *index = id; 
     593                    *index = id;
    596594                }
    597595            } // end loop on PIC inputs
    598596        } // end PIC
    599         } // end loop on devices
     597    } // end loop on devices
    600598}  // end external_devices_init()
    601599
     
    615613                                     gid_t       * gid )
    616614{
    617         uint32_t   i;
     615    uint32_t   i;
    618616    gid_t      global_id;
    619617
    620618    // get global identifier from hardware register
    621     global_id = hal_get_gid(); 
     619    global_id = hal_get_gid();
    622620
    623621    // makes an associative search in boot_info to get (cxy,lid) from global_id
     
    649647    lid_t        core_lid = -1;      // running core local index
    650648    cxy_t        core_cxy = -1;      // running core cluster identifier
    651     gid_t        core_gid;           // running core hardware identifier 
     649    gid_t        core_gid;           // running core hardware identifier
    652650    cluster_t  * cluster;            // pointer on local cluster manager
    653651    core_t     * core;               // pointer on running core descriptor
     
    661659                                  &core_gid );
    662660
    663     // CP0 initialise cluster identifier
     661    // CP0 initializes cluster identifier
    664662    if( core_lid == 0 ) local_cxy = info->cxy;
    665663
    666     // each core get pointer on its private idle thread descriptor
    667         thread = (thread_t *)( idle_threads + (core_lid * CONFIG_THREAD_DESC_SIZE) );
    668 
    669     // each core registers this thread pointer in hardware register 
     664    // each core gets a pointer on its private idle thread descriptor
     665    thread = (thread_t *)( idle_threads + (core_lid * CONFIG_THREAD_DESC_SIZE) );
     666
     667    // each core registers this thread pointer in hardware register
    670668    hal_set_current_thread( thread );
    671669
     
    673671    xlist_root_init( XPTR( local_cxy, &thread->xlocks_root ) );
    674672
    675     // CP0 in I/O cluster initialises TXT0 chdev descriptor
     673    // CP0 in I/O cluster initializes TXT0 chdev descriptor
    676674    if( (core_lid == 0) && (core_cxy == info->io_cxy) ) txt0_device_init( info );
    677675
    678676    /////////////////////////////////////////////////////////////////////////////////
    679677    // global & local synchro to protect access to TXT0 terminal
    680     if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ), 
     678    if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ),
    681679                                        (info->x_size * info->y_size) );
    682680    barrier_wait( &local_barrier , info->cores_nr );
    683681    /////////////////////////////////////////////////////////////////////////////////
    684682
    685     if( (core_lid ==  0) && (local_cxy == info->io_cxy) ) 
     683    if( (core_lid ==  0) && (local_cxy == info->io_cxy) )
    686684    {
    687685        kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 0 at cycle %d\n",
     
    713711    /////////////////////////////////////////////////////////////////////////////////
    714712    // global & local synchro, to protect access to cluster manager
    715     if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ), 
     713    if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ),
    716714                                        (info->x_size * info->y_size) );
    717715    barrier_wait( &local_barrier , info->cores_nr );
    718716    /////////////////////////////////////////////////////////////////////////////////
    719717
    720     if( (core_lid ==  0) && (local_cxy == info->io_cxy) ) 
     718    if( (core_lid ==  0) && (local_cxy == info->io_cxy) )
    721719    {
    722720        kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 1 at cycle %d\n",
     
    726724    // all cores get pointer on local cluster manager and on core descriptor
    727725    cluster = &cluster_manager;
    728         core    = &cluster->core_tbl[core_lid];
     726    core    = &cluster->core_tbl[core_lid];
    729727
    730728    // CP0 initializes the process_zero descriptor
     
    735733#endif
    736734
    737     // CP0 allocates and initialises the internal peripheral chdev descriptors.
     735    // CP0 allocates and initializes the internal peripheral chdev descriptors.
    738736    // Each CP0[cxy] scan the set of its internal (private) peripherals,
    739     // and allocate memory for the corresponding chdev descriptors.
     737    // and allocates memory for the corresponding chdev descriptors.
    740738    if( core_lid == 0 ) internal_devices_init( info );
    741        
    742     // CP0 allocates one WTI mailbbox per core for Inter Processor Interrupt
     739
     740    // CP0 allocates one WTI mailbox per core for Inter Processor Interrupt
    743741    // this must be done after ICU chdev initialisation, by CP0 only, and before
    744742    // external devices initialisation to enforce the rule :
     
    766764    // Each CP0[cxy] scan the set of external (shared) peripherals (but the TXT0),
    767765    // and allocates memory for the chdev descriptors that must be placed
    768     // on the (cxy) cluster according to the global index value. 
     766    // on the (cxy) cluster according to the global index value.
    769767    if( core_lid == 0 ) external_devices_init( info );
    770768
    771769    /////////////////////////////////////////////////////////////////////////////////
    772770    // global &local synchro to protect access to peripherals
    773     if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ), 
     771    if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ),
    774772                                        (info->x_size * info->y_size) );
    775773    barrier_wait( &local_barrier , info->cores_nr );
    776774    /////////////////////////////////////////////////////////////////////////////////
    777775
    778     if( (core_lid ==  0) && (local_cxy == info->io_cxy) ) 
    779     {
    780         kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 2 at cycle %d\n", 
     776    if( (core_lid ==  0) && (local_cxy == info->io_cxy) )
     777    {
     778        kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 2 at cycle %d\n",
    781779                   __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() );
    782780    }
    783781
    784782    error = thread_kernel_init( thread,
    785                                 THREAD_IDLE, 
    786                                 &thread_idle_func, 
     783                                THREAD_IDLE,
     784                                &thread_idle_func,
    787785                                NULL,
    788786                                core_lid );
     
    800798    thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
    801799
    802     if( (core_lid ==  0) && (local_cxy == info->io_cxy) ) 
     800    if( (core_lid ==  0) && (local_cxy == info->io_cxy) )
    803801    {
    804802        kinit_dmsg("\n[INFO] %s : core[%x][%d] created idle thread %x at cycle %d\n",
     
    806804    }
    807805
    808     // CP0 in all clusters initializes cooperatively VFS and DEVFS 
     806    // CP0 in all clusters initializes cooperatively VFS and DEVFS
    809807    if( (core_lid == 0)  )
    810808    {
     
    834832
    835833        // mount the DEVFS File system
    836             devfs_mount( root_inode_xp , "dev" );
     834        devfs_mount( root_inode_xp , "dev" );
    837835    }
    838836
    839837
    840838    // CP0 in I/O cluster creates the process_init and print banner
    841     if( (core_lid ==  0) && (local_cxy == info->io_cxy) ) 
     839    if( (core_lid ==  0) && (local_cxy == info->io_cxy) )
    842840    {
    843841        process_init_create();
     
    866864                   " - rwlock             : %d bytes\n"
    867865                   " - remote rwlock      : %d bytes\n",
    868                    sizeof( thread_t          ), 
     866                   sizeof( thread_t          ),
    869867                   sizeof( process_t         ),
    870868                   sizeof( cluster_t         ),
     
    895893    /////////////////////////////////////////////////////////////////////////////////
    896894
    897     if( (core_lid ==  0) && (local_cxy == info->io_cxy) ) 
    898     {
    899         kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 3 at cycle %d\n", 
     895    if( (core_lid ==  0) && (local_cxy == info->io_cxy) )
     896    {
     897        kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 3 at cycle %d\n",
    900898                   __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() );
    901899    }
    902900
    903     // each core activates its private PTI IRQ 
     901    // each core activates its private PTI IRQ
    904902    dev_icu_set_period( core_lid , CONFIG_SCHED_TICK_PERIOD );
    905903    dev_icu_enable_irq( core_lid , PTI_TYPE , core_lid , NULL );
     
    918916    // each core jump to idle thread
    919917    thread_idle_func();
    920 
    921 } // end kernel_init()
    922 
     918}
     919
Note: See TracChangeset for help on using the changeset viewer.