Ignore:
Timestamp:
Mar 12, 2019, 1:37:38 PM (5 years ago)
Author:
alain
Message:

Fix several bugs to use the instruction MMU in kernel mode
in replacement of the instruction address extension register,
and remove the "kentry" segment.

This version is running on the tsar_generic_iob" platform.

One interesting bug: the cp0_ebase defining the kernel entry point
(for interrupts, exceptions and syscalls) must be initialized
early in kernel_init(), because the VFS initialisation done by
kernel_ini() uses RPCs, and RPCs uses Inter-Processor-Interrup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_busylock.c

    r619 r624  
    22 * remote_busylock.c - remote kernel busy-waiting lock implementation.
    33 *
    4  * Authors     Alain Greiner (2016,2017,2018)
     4 * Authors     Alain Greiner (2016,2017,2018,2019)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    8787#if DEBUG_BUSYLOCK
    8888uint32_t type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->type ) );
    89 if( (type != LOCK_CHDEV_TXT0) &&
    90     ((uint32_t)hal_get_cycles() > DEBUG_BUSYLOCK) )
     89if( type != LOCK_CHDEV_TXT0 )
    9190{
     91    // update thread list of busyslocks
    9292    xptr_t root_xp = XPTR( local_cxy , &this->busylocks_root );
    93 
    94     // update thread list of busyslocks
    9593    xlist_add_last( root_xp , XPTR( lock_cxy  , &lock_ptr->xlist ) );
    9694}
    9795#endif
    9896
    99 #if( DEBUG_BUSYLOCK && DEBUG_BUSYLOCK_THREAD_XP )
     97#if( DEBUG_BUSYLOCK & 1 )
    10098if( (type != LOCK_CHDEV_TXT0) &&
    101     (XPTR( local_cxy , this ) == DEBUG_BUSYLOCK_THREAD_XP) )
     99    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
     100    (this->trdid == DEBUG_BUSYLOCK_TRDID) )
    102101{
    103102    printk("\n[%s] thread[%x,%x] ACQUIRE lock %s\n",
     
    131130#if DEBUG_BUSYLOCK
    132131uint32_t type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->type ) );
    133 if( (type != LOCK_CHDEV_TXT0) &&
    134     (XPTR( local_cxy , this ) == DEBUG_BUSYLOCK_THREAD_XP) &&
    135     ((uint32_t)hal_get_cycles() > DEBUG_BUSYLOCK) )
     132if( type != LOCK_CHDEV_TXT0 )
    136133{
    137134    // remove lock from thread list of busyslocks
     
    140137#endif
    141138
    142 #if (DEBUG_BUSYLOCK && DEBUG_BUSYLOCK_THREAD_XP )
     139#if( DEBUG_BUSYLOCK & 1 )
    143140if( (type != LOCK_CHDEV_TXT0) &&
    144     (XPTR( local_cxy , this ) == DEBUG_BUSYLOCK_THREAD_XP) )
     141    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
     142    (this->trdid == DEBUG_BUSYLOCK_TRDID) )
    145143{
    146144    printk("\n[%s] thread[%x,%x] RELEASE lock %s\n",
Note: See TracChangeset for help on using the changeset viewer.