Changeset 50 for trunk/kernel/kern


Ignore:
Timestamp:
Jun 26, 2017, 3:15:11 PM (7 years ago)
Author:
alain
Message:

bloup

Location:
trunk/kernel/kern
Files:
6 edited

Legend:

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

    r23 r50  
    2828#include <hal_atomic.h>
    2929#include <hal_special.h>
     30#include <hal_ppm.h>
    3031#include <printk.h>
    3132#include <errno.h>
     
    4344#include <dqdt.h>
    4445
    45 // TODO #include <sysfs.h>
    46 
    4746///////////////////////////////////////////////////////////////////////////////////////////
    4847// Extern global variables
     
    6261error_t cluster_init( struct boot_info_s * info )
    6362{
     63    error_t     error;
    6464    lpid_t      lpid;     // local process_index
    6565    lid_t       lid;      // local core index
     
    8282        spinlock_init( &cluster->kcm_lock );
    8383
     84    cluster_dmsg("\n[INFO] %s for cluster %x enters\n",
     85                 __FUNCTION__ , local_cxy );
     86
    8487    // initialises DQDT
    8588    cluster->dqdt_root_level = dqdt_init( info->x_size,
     
    9093
    9194    // initialises embedded PPM
    92         ppm_init( &cluster->ppm,
    93               info->pages_nr,
    94               info->pages_offset );
     95        error = hal_ppm_init( info );
     96
     97    if( error )
     98    {
     99        printk("\n[ERROR] in %s : cannot initialize PPM in cluster %x\n",
     100               __FUNCTION__ , local_cxy );
     101        return ENOMEM;
     102    }
     103
     104    cluster_dmsg("\n[INFO] %s : PPM initialized in cluster %x at cycle %d\n",
     105                 __FUNCTION__ , local_cxy , hal_time_stamp() );
    95106
    96107    // initialises embedded KHM
    97108        khm_init( &cluster->khm );
    98109
     110    cluster_dmsg("\n[INFO] %s : KHM initialized in cluster %x at cycle %d\n",
     111                 __FUNCTION__ , local_cxy , hal_time_stamp() );
     112
    99113    // initialises embedded KCM
    100114        kcm_init( &cluster->kcm , KMEM_KCM );
     115
     116    cluster_dmsg("\n[INFO] %s : KCM initialized in cluster %x at cycle %d\n",
     117                 __FUNCTION__ , local_cxy , hal_time_stamp() );
    101118
    102119    // initialises all cores descriptors
     
    108125        }
    109126
     127    cluster_dmsg("\n[INFO] %s : cores initialized in cluster %x at cycle %d\n",
     128                 __FUNCTION__ , local_cxy , hal_time_stamp() );
     129
    110130    // initialises RPC fifo
    111131        rpc_fifo_init( &cluster->rpc_fifo );
     132
     133    cluster_dmsg("\n[INFO] %s : RPC fifo inialized in cluster %x at cycle %d\n",
     134                 __FUNCTION__ , local_cxy , hal_time_stamp() );
    112135
    113136    // initialise pref_tbl[] in process manager
     
    132155        xlist_root_init( XPTR( local_cxy , &cluster->pmgr.copies_root[lpid] ) );
    133156    }
     157
     158    cluster_dmsg("\n[INFO] %s Process Manager initialized in cluster %x at cycle %d\n",
     159                 __FUNCTION__ , local_cxy , hal_time_stamp() );
    134160
    135161    hal_wbflush();
  • trunk/kernel/kern/cluster.h

    r23 r50  
    133133
    134134    pmgr_t            pmgr;            /*! embedded process manager                       */
    135 
    136         char              name[CONFIG_SYSFS_NAME_LEN];
    137 
    138 //      sysfs_entry_t     node;
    139135}
    140136cluster_t;
  • trunk/kernel/kern/do_syscall.c

    r23 r50  
    8181    sys_chmod,              // 31
    8282    sys_signal,             // 32
    83     sys_gettimeofday,       // 33
     83    sys_timeofday,          // 33
    8484    sys_kill,               // 34
    8585    sys_getpid,             // 35
  • trunk/kernel/kern/kernel_init.c

    r25 r50  
    5555#include <devfs.h>
    5656
    57 // TODO #include <sysfs.h>
    5857
    5958#define KERNEL_INIT_SYNCHRO  0xA5A5B5B5
     
    115114__attribute__((section(".kdata")))
    116115barrier_t            local_barrier                           CONFIG_CACHE_LINE_ALIGNED;
     116
     117// This variable defines the array of supported File System contexts
     118__attribute__((section(".kdata")))
     119vfs_ctx_t            fs_context[FS_TYPES_NR]                 CONFIG_CACHE_LINE_ALIGNED;
     120
    117121
    118122///////////////////////////////////////////////////////////////////////////////////////////
     
    293297    }
    294298
    295     kinit_dmsg("\n[INFO] %s : core[%x][0] creates ICU chdev at cycle %d\n",
     299    kinit_dmsg("\n[INFO] %s : core[%x][0] created ICU chdev at cycle %d\n",
    296300               __FUNCTION__ , local_cxy , hal_time_stamp() );
    297301
     
    335339        }
    336340
    337         kinit_dmsg("\n[INFO] %s : core[%x][0] creates MMC chdev at cycle %d\n",
     341        kinit_dmsg("\n[INFO] %s : core[%x][0] created MMC chdev at cycle %d\n",
    338342                   __FUNCTION__ , local_cxy , hal_time_stamp() );
    339343    }
     
    370374            chdev_dir.dma[channel] = chdev_xp;
    371375
    372             kinit_dmsg("\n[INFO] %s : core[%x][0] creates DMA[%d] chdev at cycle %d\n",
     376            kinit_dmsg("\n[INFO] %s : core[%x][0] created DMA[%d] chdev at cycle %d\n",
    373377                       __FUNCTION__ , local_cxy , channel , hal_time_stamp() );
    374378        }
     
    395399//
    396400// TODO check that cluster IO contains a PIC [AG]
     401// TODO make a default initialisation for the chdev_dir structure (XPTR_NULL )  [AG]
    397402///////////////////////////////////////////////////////////////////////////////////////////
    398403// @ info    : pointer on the local boot-info structure.
     
    713718    // CP0 allocates one WTI mailbbox per core for Inter Processor Interrupt
    714719    // this must be done after ICU chdev initialisation, by CP0 only, and before
    715     // external devices initialisation to enforce the rule (wti_id == lid)
     720    // external devices initialisation to enforce the rule :
     721    // "The WTI index for the IPI routed to core[lid] is lid"
    716722    if( core_lid == 0 )
    717723    {
     
    733739    }
    734740
    735     // CP0 contribute to initialise external peripheral chdev descriptors.
     741    // All CP0s contribute to initialise external peripheral chdev descriptors.
    736742    // Each CP0[cxy] scan the set of external (shared) peripherals (but the TXT0),
    737743    // and allocates memory for the chdev descriptors that must be placed
     
    779785    }
    780786
    781 printk("\n bloup 0\n");
    782 
    783787    // CP0 in all clusters initializes cooperatively VFS and DEVFS
    784788    if( (core_lid == 0)  )
     
    786790        xptr_t  root_inode_xp;
    787791
    788         // initialize root File System
     792        // initialize root File System (must be FATFS in this implementation)
    789793        if( CONFIG_VFS_ROOT_IS_FATFS )
    790794        {
     
    804808        }
    805809
    806 printk("\n bloup 1\n");
    807 
    808810        // mount the DEVFS File system
    809811            devfs_mount( root_inode_xp , "dev" );
    810812    }
    811 
    812 printk("\n bloup 2\n");
    813813
    814814    // CP0 in I/O cluster print banner
     
    844844
    845845    // each core jump to idle thread
    846 //    asm volatile( "j thread_idle_func\n" );
     846    thread_idle_func();
    847847
    848848} // end kernel_init()
  • trunk/kernel/kern/printk.h

    r23 r50  
    100100///////////////////////////////////////////////////////////////////////////////////
    101101
     102#if CONFIG_CLUSTER_DEBUG
     103#define cluster_dmsg(...)   printk(__VA_ARGS__)
     104#else
     105#define cluster_dmsg(...)
     106#endif
     107
    102108#if CONFIG_CONTEXT_DEBUG
    103109#define context_dmsg(...)   printk(__VA_ARGS__)
     
    112118#endif
    113119
     120#if CONFIG_DEVFS_DEBUG
     121#define devfs_dmsg(...)   printk(__VA_ARGS__)
     122#else
     123#define devfs_dmsg(...)
     124#endif
     125
     126#if CONFIG_DMA_DEBUG
     127#define dma_dmsg(...)   printk(__VA_ARGS__)
     128#else
     129#define dma_dmsg(...)
     130#endif
     131
    114132#if CONFIG_DQDT_DEBUG
    115133#define dma_dmsg(...)   printk(__VA_ARGS__)
     
    136154#endif
    137155
     156#if CONFIG_FATFS_DEBUG
     157#define fatfs_dmsg(...)   printk(__VA_ARGS__)
     158#else
     159#define fatfs_dmsg(...)
     160#endif
     161
    138162#if CONFIG_FBF_DEBUG
    139163#define fbf_dmsg(...)   printk(__VA_ARGS__)
     
    152176#else
    153177#define icu_dmsg(...)
     178#endif
     179
     180#if CONFIG_IDLE_DEBUG
     181#define idle_dmsg(...) printk(__VA_ARGS__)
     182#else
     183#define idle_dmsg(...)
    154184#endif
    155185
  • trunk/kernel/kern/thread.c

    r23 r50  
    749749    while( 1 )
    750750    {
    751         thread_dmsg("\n[INFO] %s : core[%x][%d] goes to sleep at cycle %d\n",
     751        idle_dmsg("\n[INFO] %s : core[%x][%d] goes to sleep at cycle %d\n",
    752752                    __FUNCTION__ , local_cxy , lid , hal_time_stamp() );
    753753
     
    755755        hal_core_sleep();
    756756
    757         thread_dmsg("\n[INFO] %s : core[%x][%d] wake up at cycle %d\n",
     757        idle_dmsg("\n[INFO] %s : core[%x][%d] wake up at cycle %d\n",
    758758                    __FUNCTION__ , local_cxy , lid , hal_time_stamp() );
    759759
Note: See TracChangeset for help on using the changeset viewer.