Ignore:
Timestamp:
Oct 12, 2014, 6:53:47 PM (10 years ago)
Author:
cfuguet
Message:

boot: two modifications in the GietVM bootloader

  1. Verifying that all vsegs sharing a big page have the same flags.
  1. Bugfixes in the _physical_memset() function
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_boot/boot.c

    r427 r433  
    568568                    {
    569569                        // allocate contiguous big physical pages
    570                         ppn = _get_big_ppn( palloc, npages ); 
     570                        ppn = _get_big_ppn( palloc, npages );
    571571                    }
    572572                    else                           // BPP already allocated
    573573                    {
     574                        // test if new vseg has the same mode bits than
     575                        // the other vsegs in the same big page
     576                        unsigned int pte1_mode = 0;
     577                        if (pte1 & PTE_C) pte1_mode |= C_MODE_MASK;
     578                        if (pte1 & PTE_X) pte1_mode |= X_MODE_MASK;
     579                        if (pte1 & PTE_W) pte1_mode |= W_MODE_MASK;
     580                        if (pte1 & PTE_U) pte1_mode |= U_MODE_MASK;
     581                        if (vseg->mode != pte1_mode) {
     582                            _puts("\n[BOOT ERROR] in boot_vseg_map() : vseg ");
     583                            _puts( vseg->name );
     584                            _puts(" has different flags (");
     585                            _putx( vseg->mode );
     586                            _puts(") than other vsegs sharing the same big page (");
     587                            _putx( pte1_mode );
     588                            _puts(")");
     589                            _exit();
     590                        }
     591
    574592                        ppn = ((pte1 << 9) & 0x0FFFFE00);
    575593                    }
     
    613631        // compute max_pt2
    614632        _ptabs_max_pt2 = ((nsp<<12) - PT1_SIZE) / PT2_SIZE;
    615        
     633
    616634        for ( vs = 0 ; vs < nspaces ; vs++ )
    617635        {
    618             _ptabs_vaddr   [vs][x_dest][y_dest] = (vpn + offset) << 12; 
     636            _ptabs_vaddr   [vs][x_dest][y_dest] = (vpn + offset) << 12;
    619637            _ptabs_paddr   [vs][x_dest][y_dest] = ((paddr_t)(ppn + offset)) << 12;
    620638            _ptabs_next_pt2[vs][x_dest][y_dest] = 0;
    621639            offset += nsp;
    622 /*
     640
    623641            // reset all entries in PT1 (8 Kbytes)
    624642            _physical_memset( _ptabs_paddr[vs][x_dest][y_dest], PT1_SIZE, 0 );
    625            
    626 */
    627643        }
    628644    }
     
    630646#if BOOT_DEBUG_PT
    631647_puts("[BOOT DEBUG] ");
    632 _puts( vseg->name ); 
     648_puts( vseg->name );
    633649_puts(" in cluster[");
    634650_putd( x_dest );
Note: See TracChangeset for help on using the changeset viewer.