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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.