Changeset 110 for trunk/hal/x86_64


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

add some code for ppm_init

File:
1 edited

Legend:

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

    r57 r110  
    11/*
    2  * hal_gpt.C - Generic Physcal Page Table API implementation for the TSAR archtecture.
     2 * hal_ppm.c - Generic Physical Page Manager API implementation for x86
    33 *
    4  * Authors  Alain Greiner (2016,2017)
    5  *
    6  *
    7  * Copyright (c) UPMC Sorbonne Universites
     4 * Copyright (c) 2017 Maxime Villard
    85 *
    96 * This file is part of ALMOS-MKH.
     
    1916 *
    2017 * You should have received a copy of the GNU General Public License
    21  * along with ALMOS-MKH; if not, write to the Free Software Foundation,
     18 * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
    2219 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    2320 */
     
    3734#include <hal_internal.h>
    3835
    39 error_t  hal_ppm_init( boot_info_t * info )
     36error_t hal_ppm_init(boot_info_t *info)
    4037{
     38        size_t i;
     39
     40        // get relevant info from boot_info structure
     41        uint32_t pages_nr         = info->pages_nr;
     42        uint32_t pages_tbl_offset = info->pages_offset;
     43        uint32_t rsvd_nr          = info->rsvd_nr;
     44
     45        // get pointer on local Physical Page Manager
     46        ppm_t * ppm = &LOCAL_CLUSTER->ppm;
     47
     48        // initialize lock protecting the free_pages[] lists
     49        spinlock_init( &ppm->free_lock );
     50
     51        // initialize lock protecting the dirty_pages list
     52        spinlock_init( &ppm->dirty_lock );
     53
     54        // initialize all free_pages[] lists as empty
     55        for( i = 0 ; i < CONFIG_PPM_MAX_ORDER ; i++ )
     56        {
     57                list_root_init( &ppm->free_pages_root[i] );
     58                ppm->free_pages_nr[i] = 0;
     59        }
     60
     61        // TODO
     62
    4163        x86_panic((char *)__func__);
    4264        return 0;
Note: See TracChangeset for help on using the changeset viewer.