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/syscalls/sys_kill.c

    r594 r624  
    7474tm_start = hal_get_cycles();
    7575if( DEBUG_SYS_KILL < tm_start )
    76 printk("\n[%s] thread[%x,%x] enter / process %x / %s / cycle %d\n",
    77 __FUNCTION__, this->process->pid, this->trdid, pid,
    78 sig_type_str(sig_id), (uint32_t)tm_start );
     76printk("\n[%s] thread[%x,%x] enter : %s to process %x / cycle %d\n",
     77__FUNCTION__, this->process->pid, this->trdid,
     78sig_type_str(sig_id), pid, (uint32_t)tm_start );
    7979#endif
    8080
     
    8686#if (DEBUG_SYS_KILL & 1)
    8787if( DEBUG_SYS_KILL < tm_start )
    88 printk("\n[%s] thread[%x,%x] get owner process %x in cluster %x\n",
     88printk("\n[%s] thread[%x,%x] get target process descriptor %x in owner cluster %x\n",
    8989__FUNCTION__ , this->process->pid, this->trdid, owner_ptr, owner_cxy );
    9090#endif
     
    108108#if (DEBUG_SYS_KILL & 1)
    109109if( DEBUG_SYS_KILL < tm_start )
    110 printk("\n[%x] thread[%x,%x] get parent process %x in cluster %x\n",
     110printk("\n[%s] thread[%x,%x] get parent process descriptor %x in cluster %x\n",
    111111__FUNCTION__ , this->process->pid, this->trdid, parent_ptr, parent_cxy );
    112112#endif
     
    128128            process_sigaction( pid , BLOCK_ALL_THREADS );
    129129
     130#if (DEBUG_SYS_KILL & 1)
     131if( DEBUG_SYS_KILL < tm_start )
     132printk("\n[%s] thread[%x,%x] blocked all threads of process %x\n",
     133__FUNCTION__ , this->process->pid, this->trdid, pid );
     134#endif
    130135            // atomically update owner process termination state
    131136            hal_remote_atomic_or( XPTR( owner_cxy , &owner_ptr->term_state ) ,
     
    136141
    137142            // calling thread deschedules when it is itself a target thread
    138             if( this->process->pid == pid ) sched_yield("block itself");
     143            if( this->process->pid == pid )
     144            {
     145
     146#if (DEBUG_SYS_KILL & 1)
     147if( DEBUG_SYS_KILL < tm_start )
     148printk("\n[%s] thread[%x,%x] is a target thread => deschedule\n",
     149__FUNCTION__ , this->process->pid, this->trdid );
     150#endif
     151                sched_yield("block itself");
     152            }
    139153
    140154            break;
Note: See TracChangeset for help on using the changeset viewer.