Changeset 409 for trunk/hal


Ignore:
Timestamp:
Dec 20, 2017, 4:51:09 PM (4 years ago)
Author:
alain
Message:

Fix bugs in exec

Location:
trunk/hal
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/generic/hal_ppm.h

    r407 r409  
    3030
    3131/////////////////////////////////////////////////////////////////////////////////////////
    32 //           Generic Physical Page Table API (implementation in hal_ppm.c)
     32//           Generic Physical Page Manager API (implementation in hal_ppm.c)
    3333//
    3434// Any arch-specific implementation must implement this API.
  • trunk/hal/tsar_mips32/core/hal_exception.c

    r408 r409  
    9999xcode_values_t;
    100100
    101 ////////////////////////////////////////////////////
    102 static char * hal_mmu_exception_str( uint32_t code )
     101/////////////////////////////////////////////
     102char * hal_mmu_exception_str( uint32_t code )
    103103{
    104104    if     ( code == MMU_WRITE_PT1_UNMAPPED        ) return "WRITE_PT1_UNMAPPED";
     
    201201    }
    202202
    203 // @@@
    204 thread_t * parent = (thread_t *)0xa4000;
    205 uint32_t cond = (this == 0xe0000) && (hal_time_stamp() > 5380000);
    206 
    207 if( cond ) hal_gpt_display( this->process );
    208 if( cond ) hal_gpt_display( parent->process );
    209 if( cond ) printk("\n[DBG] %s : core[%x,%d] / is_ins %d / %s / vaddr %x\n",
     203excp_dmsg("\n[DBG] %s : core[%x,%d] / is_ins %d / %s / vaddr %x\n",
    210204__FUNCTION__ , local_cxy , this->core->lid , is_ins,
    211205hal_mmu_exception_str(excp_code) , bad_vaddr );
     
    267261                {
    268262
    269 if( cond ) printk("\n[DBG] %s : core[%x,%d] / copy-on-write handled for vaddr = %x\n",
     263excp_dmsg("\n[DBG] %s : core[%x,%d] / copy-on-write handled for vaddr = %x\n",
    270264__FUNCTION__ , local_cxy , this->core->lid , bad_vaddr );
    271265
     
    275269            else                             // non writable user error
    276270            {
    277                 printk("\n[ERROR] in %s for thread %x : write to non-writable vaddr = %x\n",
     271                printk("\n[ERROR] in %s for thread %x : non-writable vaddr = %x\n",
    278272                __FUNCTION__ , this->trdid , bad_vaddr );
    279273
  • trunk/hal/tsar_mips32/core/hal_gpt.c

    r408 r409  
    131131        page_t   * page;
    132132    xptr_t     page_xp;
    133     vpn_t      vpn;
    134     error_t    error;
    135     uint32_t   attr;
    136133
    137134gpt_dmsg("\n[DBG] %s : core[%x,%d] enter\n",
     
    159156        gpt->ptr  = GET_PTR( ppm_page2base( page_xp ) );
    160157        gpt->ppn  = ppm_page2ppn( page_xp );
    161 
    162     // identity map the kentry_vseg (must exist for all processes)
    163     attr = GPT_MAPPED | GPT_SMALL | GPT_EXECUTABLE | GPT_CACHABLE | GPT_GLOBAL;
    164     for( vpn = CONFIG_VMM_KENTRY_BASE;
    165          vpn < (CONFIG_VMM_KENTRY_BASE + CONFIG_VMM_KENTRY_SIZE); vpn++ )
    166     {
    167 
    168 gpt_dmsg("\n[DBG] %s : identity map vpn %d\n", __FUNCTION__ , vpn );
    169 
    170         error = hal_gpt_set_pte( gpt,
    171                                  vpn,
    172                                  attr,
    173                                  (local_cxy<<20) | (vpn & 0xFFFFF) );
    174 
    175         if( error )
    176         {
    177             printk("\n[ERROR] in %s : cannot identity map kentry vseg\n", __FUNCTION__ );
    178             return ENOMEM;
    179         }
    180     }
    181158
    182159gpt_dmsg("\n[DBG] %s : core[%x,%d] exit\n",
     
    933910    pte2_attr = pt2[2*ix2];
    934911
    935 if( (CURRENT_THREAD == 0xe0000) && (hal_time_stamp() > 5380000) )
    936 printk("\n@@@ %s : vpn = %X / attr = %X\n", __FUNCTION__ , vpn , tsar2gpt( pte2_attr ) );
    937 
    938912    if( (pte2_attr & TSAR_MMU_MAPPED) == 0 ) return false;
    939913
  • trunk/hal/tsar_mips32/core/hal_ppm.c

    r407 r409  
    3535
    3636//////////////////////////////////////////////////////////////////////////////////////////
    37 // This file contains the TSAR specific code for :
    38 // - cores registers initialisation,
    39 // - memory allocators initialisation.
     37// This file contains the TSAR specific code for the physical memory
     38// allocators initialisation.
    4039//
    4140// For The TSAR architecture, the kernel pointers are identity mapped:
Note: See TracChangeset for help on using the changeset viewer.