Changeset 68 for trunk/kernel/kern


Ignore:
Timestamp:
Jun 27, 2017, 10:24:13 AM (7 years ago)
Author:
alain
Message:

Fix bug in kernel_init, and reduce size of remote_fifo.

Location:
trunk/kernel/kern
Files:
5 edited

Legend:

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

    r23 r68  
    33 *
    44 * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
    5  *         Mohamed Lamine Karaoui (2015)
    6  *         Alain Greiner (2016)
     5 *         Alain Greiner (2016,2017)
    76 *
    87 * Copyright (c) UPMC Sorbonne Universites
     
    5352        core->rpc_threads       = 0;
    5453
    55         rpc_fifo_init( &core->rpc_fifo );
    56 
    5754        list_root_init( &core->rpc_free_list );
    5855
  • trunk/kernel/kern/core.h

    r19 r68  
    33 *
    44 * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
    5  *          Mohamed Lamine Karaoui (2015)
    6  *          Alain Greiner (2016)
     5 *          Alain Greiner (2016,2017)
    76 *
    87 * Copyright (c) UPMC Sorbonne Universites
     
    6261        uint32_t            rpc_threads;    /*! total number of RPC threads for this core  */
    6362        list_entry_t        rpc_free_list;  /*! root of the list of free RPC threads       */
    64         rpc_fifo_t          rpc_fifo;       /*! embedded private RPC fifo (one per core)   */
    6563
    6664        scheduler_t         scheduler;      /*! embedded private scheduler                 */
     
    6967    struct chdev_s    * pti_vector[CONFIG_MAX_PTIS_PER_ICU];     /*! on source device  */
    7068    struct chdev_s    * wti_vector[CONFIG_MAX_WTIS_PER_ICU];     /*! on source device  */
    71 
    72 //      sysfs_entry_t       node;
    7369}
    7470core_t;
  • trunk/kernel/kern/kernel_init.c

    r50 r68  
    3232#include <core.h>
    3333#include <list.h>
     34#include <xlist.h>
    3435#include <thread.h>
    3536#include <scheduler.h>
     
    5455#include <soclib_tty.h>
    5556#include <devfs.h>
     57#include <mapper.h>
    5658
    5759
     
    659661    if( core_lid == 0 ) local_cxy = info->cxy;
    660662
     663    // each core get pointer on its private idle thread descriptor
     664        thread = (thread_t *)( idle_threads + (core_lid * CONFIG_THREAD_DESC_SIZE) );
     665
     666    // each core register this thread pointer in hardware register
     667    hal_set_current_thread( thread );
     668   
    661669    // CP0 in I/O cluster initialises TXT0 chdev descriptor
    662670    if( (core_lid == 0) && (core_cxy == info->io_cxy) ) txt0_device_init( info );
     
    755763               __FUNCTION__ , core_cxy , core_lid , hal_time_stamp() );
    756764
    757     // all cores initialize the private idle thread descriptor
    758         thread = (thread_t *)( idle_threads + (core_lid * CONFIG_THREAD_DESC_SIZE) );
    759765
    760766    error = thread_kernel_init( thread,
     
    763769                                NULL,
    764770                                core_lid );
    765 
    766771    if( error )
    767772    {
     
    775780        core->scheduler.idle = thread;
    776781
    777         // register idle thread pointer in core register
    778         hal_set_current_thread( thread );
    779    
    780782        // activate the idle thread
    781783        thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
     
    816818    {
    817819        print_banner( (info->x_size * info->y_size) , info->cores_nr );
     820
     821        kinit_dmsg("\n\n*** memory fooprint of main kernet objects ***\n"
     822                   " - thread descriptor  : %d bytes\n"
     823                   " - process descriptor : %d bytes\n"
     824                   " - cluster manager    : %d bytes\n"
     825                   " - chdev descriptor   : %d bytes\n"
     826                   " - core descriptor    : %d bytes\n"
     827                   " - scheduler          : %d bytes\n"
     828                   " - rpc fifo           : %d bytes\n"
     829                   " - page descriptor    : %d bytes\n"
     830                   " - mapper root        : %d bytes\n"
     831                   " - ppm manager        : %d bytes\n"
     832                   " - kcm manager        : %d bytes\n"
     833                   " - khm manager        : %d bytes\n"
     834                   " - vmm manager        : %d bytes\n"
     835                   " - gpt root           : %d bytes\n"
     836                   " - list item          : %d bytes\n"
     837                   " - xlist item         : %d bytes\n"
     838                   " - spinlock           : %d bytes\n"
     839                   " - remote spinlock    : %d bytes\n"
     840                   " - rwlock             : %d bytes\n"
     841                   " - remote rwlock      : %d bytes\n",
     842                   sizeof( thread_t          ),
     843                   sizeof( process_t         ),
     844                   sizeof( cluster_t         ),
     845                   sizeof( chdev_t           ),
     846                   sizeof( core_t            ),
     847                   sizeof( scheduler_t       ),
     848                   sizeof( rpc_fifo_t        ),
     849                   sizeof( page_t            ),
     850                   sizeof( mapper_t          ),
     851                   sizeof( ppm_t             ),
     852                   sizeof( kcm_t             ),
     853                   sizeof( khm_t             ),
     854                   sizeof( vmm_t             ),
     855                   sizeof( gpt_t             ),
     856                   sizeof( list_entry_t      ),
     857                   sizeof( xlist_entry_t     ),
     858                   sizeof( spinlock_t        ),
     859                   sizeof( remote_spinlock_t ),
     860                   sizeof( rwlock_t          ),
     861                   sizeof( remote_rwlock_t   ));
    818862    }
    819863
  • trunk/kernel/kern/rpc.c

    r23 r68  
    12491249    reg_t      sr_save;
    12501250
    1251 printk("\n@@@ coucou 0\n");
    1252 
    12531251    // get client CPU and cluster coordinates
    12541252    cxy_t      client_cxy = local_cxy;   
     
    12671265    {
    12681266        error = remote_fifo_put_item( XPTR( server_cxy , &rf->fifo ),
    1269                                       (void *)&xp,
    1270                                       sizeof(xptr_t),
     1267                                      (uint64_t *)&xp,
    12711268                                      &first );
    12721269
     
    12801277    while( error );
    12811278 
    1282 printk("\n@@@ coucou 1\n");
    1283 
    12841279    rpc_dmsg("\n[INFO] %s on core %d in cluster %x sent RPC %p to cluster %x\n",
    12851280              __FUNCTION__ , client_lid , client_cxy , rpc , server_cxy );
     
    13021297        }
    13031298
    1304 printk("\n@@@ coucou 2\n");
    1305 
    13061299        // activate preemption to allow incoming RPC and avoid deadlock
    13071300        if( this->type == THREAD_RPC ) hal_enable_irq( &sr_save );
     
    13121305        if( rpc->response == 0 ) break;
    13131306    }
    1314 
    1315 printk("\n@@@ coucou 3\n");
    13161307
    13171308    // restore preemption
     
    13561347    {
    13571348            error = local_fifo_get_item( &rpc_fifo->fifo,
    1358                                      &xp,
    1359                                      sizeof(xptr_t) );
     1349                                     (uint64_t *)&xp );
    13601350
    13611351                if ( error == 0 )  // One RPC request successfully extracted from RPC_FIFO
  • trunk/kernel/kern/thread.c

    r60 r68  
    745745void thread_idle_func()
    746746{
     747
     748#if CONFIG_IDLE_DEBUG
    747749    lid_t  lid = CURRENT_CORE->lid;
     750#endif
    748751
    749752    while( 1 )
Note: See TracChangeset for help on using the changeset viewer.