Ignore:
Timestamp:
May 3, 2018, 5:51:22 PM (4 years ago)
Author:
alain
Message:

1/ Fix a bug in the Multithreaded "sort" applicationr:
The pthread_create() arguments must be declared as global variables.
2/ The exit syscall can be called by any thread of a process..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_exception.c

    r438 r440  
    3434#include <core.h>
    3535#include <syscalls.h>
     36#include <shared_syscalls.h>
    3637#include <remote_spinlock.h>
    3738#include <hal_kentry.h>
     
    163164//////////////////////////////////////////////////////////////////////////////////////////
    164165// @ this     : pointer on faulty thread descriptor.
     166// @ excPC    :
    165167// @ is_ins   : IBE if true / DBE if false.
    166168// @ return EXCP_NON_FATAL / EXCP_USER_ERROR / EXCP_KERNEL_PANIC
     
    218220            // try to map the unmapped PTE
    219221            error = vmm_handle_page_fault( process,
    220                                            bad_vaddr >> CONFIG_PPM_PAGE_SHIFT );  // vpn
     222                                           bad_vaddr >> CONFIG_PPM_PAGE_SHIFT,  // vpn
     223                                           false );                             // not a COW
    221224            if( error )   
    222225            {
     
    256259            {
    257260                // try to allocate and copy the page
    258                 error = vmm_handle_cow( process,
    259                                         bad_vaddr >> CONFIG_PPM_PAGE_SHIFT ); 
     261                error = vmm_handle_page_fault( process,
     262                                               bad_vaddr >> CONFIG_PPM_PAGE_SHIFT,  // vpn
     263                                               true );                              // COW
    260264                if( error )
    261265                {
     
    295299        default:                             // this is a kernel error => panic   
    296300        {
    297             assert( false , __FUNCTION__ , "thread %x / epc %x / %s / vaddr = %x\n",
    298             this, excPC, hal_mmu_exception_str(excp_code) , bad_vaddr );
     301            assert( false , __FUNCTION__ ,
     302            "thread %x / core[%x,%d] / epc %x / vaddr %x / cycle %d\n",
     303            this, local_cxy, this->core->lid, excPC, bad_vaddr, (uint32_t)hal_get_cycles() );
    299304
    300305            return EXCP_KERNEL_PANIC;
     
    440445        hal_exception_dump( this , uzone , error );
    441446
    442         sys_kill( this->process->pid , SIGKILL );
     447        sys_exit( EXIT_FAILURE );
    443448        }
    444449    else if( error == EXCP_KERNEL_PANIC )   // kernel error => kernel panic
     
    447452
    448453        assert( false , __FUNCTION__ , "thread %x in process %x on core [%x,%d]",
    449         this->trdid , this->process->pid , local_cxy , this->core->lid );
     454        this , this->process->pid , local_cxy , this->core->lid );
    450455    }
    451456
Note: See TracChangeset for help on using the changeset viewer.