Ignore:
Timestamp:
Jul 17, 2017, 8:42:59 AM (7 years ago)
Author:
alain
Message:

Bug fix in kernel_init
-This line, and those below, will be ignored--

M params.mk
M kernel_config.h
M Makefile
M hdd/virt_hdd.dmg
M tools/bootloader_tsar/boot.c
M kernel/libk/bits.h
M kernel/libk/elf.c
M kernel/libk/xhtab.c
M kernel/libk/elf.h
M kernel/libk/xhtab.h
M kernel/devices/dev_pic.c
M kernel/mm/vmm.c
M kernel/mm/mapper.c
M kernel/mm/mapper.h
M kernel/vfs/devfs.h
M kernel/vfs/vfs.c
M kernel/vfs/vfs.h
M kernel/vfs/devfs.c
M kernel/kern/chdev.h
M kernel/kern/kernel_init.c
M kernel/kern/process.c
M kernel/kern/process.h
M hal/tsar_mips32/core/hal_remote.c
M hal/tsar_mips32/drivers/soclib_pic.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/mapper.c

    r183 r204  
    8888
    8989    return mapper;
    90 }
     90
     91}  // end mapper_create()
    9192
    9293///////////////////////////////////////////
     
    127128
    128129    return 0;
    129 }
     130
     131}  // end mapper_destroy()
    130132
    131133////////////////////////////////////////////
     
    137139    error_t       error;
    138140
     141    mapper_dmsg("\n[INFO] %s : enter for page %d / mapper = %x\n",
     142                __FUNCTION__ , index , mapper );
     143
    139144    thread_t * this = CURRENT_THREAD;
    140145
     
    148153    if( ( page == NULL) || page_is_flag( page , PG_INLOAD ) )  // page not available
    149154    {
     155
    150156        // release the lock in READ_MODE and take it in WRITE_MODE
    151157        rwlock_rd_unlock( &mapper->lock );
     
    160166        if ( page == NULL )   // missing page => load it from file system
    161167        {
     168            mapper_dmsg("\n[INFO] %s : missing page => load from FS\n", __FUNCTION__ );
     169
    162170            // allocate one page from PPM
    163171            req.type  = KMEM_PAGE;
     
    237245                sched_yield();
    238246            }
    239 
    240         }
    241 
    242         return page;
    243     }
    244     else
    245     {
    246          // release lock from READ_MODE
    247          rwlock_rd_unlock( &mapper->lock );
    248 
    249          return page;
    250     }
    251 }
     247        }
     248    }
     249    else                          // page available in mapper
     250    {
     251
     252        rwlock_rd_unlock( &mapper->lock );
     253    }
     254
     255    mapper_dmsg("\n[INFO] %s : exit for page %d / page desc = %x\n",
     256                __FUNCTION__ , index , page );
     257
     258    return page;
     259
     260}  // end mapper_get_page()
    252261
    253262///////////////////////////////////////////////
     
    282291
    283292    return 0;
    284 }
     293
     294}  // end mapper_release_page()
    285295
    286296/////////////////////////////////////////
     
    298308    uint8_t  * map_ptr;        // current mapper  address
    299309    uint8_t  * buf_ptr;        // current buffer  address
     310 
     311    mapper_dmsg("\n[INFO] %s : enter / to_buf = %d / buffer = %x\n",
     312                __FUNCTION__ , to_buffer , buffer );
    300313
    301314    // compute offsets of first and last bytes in file
     
    347360    }
    348361
     362    mapper_dmsg("\n[INFO] %s : exit for buffer %x\n",
     363                __FUNCTION__, buffer );
     364
    349365    return 0;
    350 }
    351 
     366
     367}  // end mapper_move()
     368
Note: See TracChangeset for help on using the changeset viewer.