Changeset 107


Ignore:
Timestamp:
Jun 30, 2017, 9:28:00 AM (7 years ago)
Author:
max@…
Message:

reorder the code a bit, to reduce the (future) diff with x86

File:
1 edited

Legend:

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

    r106 r107  
    11/*
    2  * hal_ppm.c - Generic Physical Page Table API implementation for TSAR
     2 * hal_ppm.c - Generic Physical Page Manager API implementation for TSAR
    33 *
    44 * Authors  Alain Greiner (2016,2017)
     
    4949
    5050        // get relevant info from boot_info structure
    51         uint32_t   pages_nr         = info->pages_nr;
    52         uint32_t   pages_tbl_offset = info->pages_offset;
    53         uint32_t   rsvd_nr          = info->rsvd_nr;
     51        uint32_t pages_nr         = info->pages_nr;
     52        uint32_t pages_tbl_offset = info->pages_offset;
     53        uint32_t rsvd_nr          = info->rsvd_nr;
    5454
    5555        // check no reserved zones other than kernel code for TSAR
     
    7575        list_root_init( &ppm->dirty_root );
    7676
    77         // initialize pages_nr, pages_tbl, and vaddr_base pointers
    78         // (TSAR uses identity mapping for kernel pointers)
    79         // x86 architectures should use vaddr_base = 0xFFFF8000000000 + (cxy << 36)
    80         ppm->pages_nr      = pages_nr;
    81         ppm->vaddr_base = NULL;
    82         ppm->pages_tbl  = (page_t*)( ppm->vaddr_base +
    83                                      (pages_tbl_offset << CONFIG_PPM_PAGE_SHIFT) );
    84 
    8577        // compute size of pages_tbl[] array rounded to an integer number of pages
    8678        uint32_t bytes = ARROUND_UP( pages_nr * sizeof(page_t), CONFIG_PPM_PAGE_SIZE );
     
    9183        // compute total number of reserved pages (kernel code & pages_tbl[])
    9284        uint32_t reserved_pages = pages_tbl_offset + pages_tbl_nr;
     85
     86        // initialize pages_nr, pages_tbl, and vaddr_base pointers
     87        // (TSAR uses identity mapping for kernel pointers)
     88        // x86 architectures should use vaddr_base = 0xFFFF8000000000 + (cxy << 36)
     89        ppm->pages_nr   = pages_nr;
     90        ppm->vaddr_base = NULL;
     91        ppm->pages_tbl  = (page_t*)( ppm->vaddr_base +
     92                                     (pages_tbl_offset << CONFIG_PPM_PAGE_SHIFT) );
    9393
    9494        // initialize all page descriptors in pages_tbl[]
Note: See TracChangeset for help on using the changeset viewer.