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/busylock.c

    r600 r624  
    22 * busylock.c - local 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
     
    7676
    7777#if DEBUG_BUSYLOCK
    78 if( (lock->type != LOCK_CHDEV_TXT0) &&
    79     ((uint32_t)hal_get_cycles() > DEBUG_BUSYLOCK) )
     78if( lock->type != LOCK_CHDEV_TXT0 )
    8079{
     80    // update thread list of busylocks
    8181    xptr_t root_xp = XPTR( local_cxy , &this->busylocks_root );
    82 
    83     // update thread list of busylocks
    8482    xlist_add_last( root_xp , XPTR( local_cxy , &lock->xlist ) );
    8583}
    8684#endif
    8785
    88 #if( DEBUG_BUSYLOCK && DEBUG_BUSYLOCK_THREAD_XP )
     86#if( DEBUG_BUSYLOCK & 1 )
    8987if( (lock->type != LOCK_CHDEV_TXT0) &&
    90     (XPTR( local_cxy , this ) == DEBUG_BUSYLOCK_THREAD_XP) )
     88    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
     89    (this->trdid == DEBUG_BUSYLOCK_TRDID) )
    9190{
    92     // get cluster and local pointer of target thread
    93     cxy_t      thread_cxy = GET_CXY( DEBUG_BUSYLOCK_THREAD_XP );
    94     thread_t * thread_ptr = GET_PTR( DEBUG_BUSYLOCK_THREAD_XP );
    95 
    96     // display message on kernel TXT0
    9791    printk("\n[%s] thread[%x,%x] ACQUIRE lock %s\n",
    9892    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] );
     
    120114
    121115#if DEBUG_BUSYLOCK
    122 if( (lock->type != LOCK_CHDEV_TXT0) &&
    123     ((uint32_t)hal_get_cycles() > DEBUG_BUSYLOCK) )
     116if( lock->type != LOCK_CHDEV_TXT0 )
    124117{
    125118    // remove lock from thread list of busylocks
     
    128121#endif
    129122
    130 #if( DEBUG_BUSYLOCK && DEBUG_BUSYLOCK_THREAD_XP )
     123#if( DEBUG_BUSYLOCK & 1 )
    131124if( (lock->type != LOCK_CHDEV_TXT0) &&
    132     (XPTR( local_cxy , this ) == DEBUG_BUSYLOCK_THREAD_XP) )
     125    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
     126    (this->trdid == DEBUG_BUSYLOCK_TRDID) )
    133127{
    134     // get cluster and local pointer of target thread
    135     cxy_t      thread_cxy = GET_CXY( DEBUG_BUSYLOCK_THREAD_XP );
    136     thread_t * thread_ptr = GET_PTR( DEBUG_BUSYLOCK_THREAD_XP );
    137 
    138     // display message on kernel TXT0
    139128    printk("\n[%s] thread[%x,%x] RELEASE lock %s\n",
    140129    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] );
Note: See TracChangeset for help on using the changeset viewer.