Changeset 623 for trunk/hal/generic


Ignore:
Timestamp:
Mar 6, 2019, 4:37:15 PM (3 years ago)
Author:
alain
Message:

Introduce three new types of vsegs (KCODE,KDATA,KDEV)
to map the kernel vsegs in the process VSL and GPT.
This now used by both the TSAR and the I86 architectures.

Location:
trunk/hal/generic
Files:
3 edited

Legend:

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

    r587 r623  
    7777/****************************************************************************************
    7878 * This function allocates physical memory for first level page table (PT1),
    79  * and initializes the page table descriptor.
     79 * and initializes the GPT descriptor, creating an empty GPT.
    8080 ****************************************************************************************
    8181 * @ gpt     : pointer on generic page table descriptor.
     
    126126
    127127/****************************************************************************************
    128  * This function map a - local or remote - GPT entry identified by its VPN, from values
    129  * defined by the <ppn> and <attr> arguments. It allocates physical memory in remote
    130  * cluster for the GPT PT2, using a RPC_PMEM_GET_PAGES, if required.
    131  ****************************************************************************************
    132  * @ gpt       : [in] pointer on the page table
     128 * This function maps in a - local or remote - GPT identified by the <gpt_xp> argument
     129 * an entry identified by the <vpn> argument, as defined by <ppn> and <attr> arguments.
     130 * It allocates physical memory for the GPT PT2, using a RPC_PMEM_GET_PAGES if required.
     131 ****************************************************************************************
     132 * @ gpt_xp    : [in] pointer on the page table
    133133 * @ vpn       : [in] virtual page number
    134134 * @ attr      : [in] generic attributes
     
    154154/****************************************************************************************
    155155 * This function returns in the <attr> and <ppn> arguments the current values stored
    156  * in a -local or remote - GPT entry, identified by the <gpt> and <vpn> arguments.
     156 * in a - local or remote - GPT entry, identified by the <gpt> and <vpn> arguments.
    157157 ****************************************************************************************
    158158 * @ gpt_xp    : [in]  extended pointer on the page table
  • trunk/hal/generic/hal_special.h

    r619 r623  
    3131
    3232struct thread_s;
     33struct gpt_s;
    3334
    3435///////////////////////////////////////////////////////////////////////////////////////////
     
    3738// ALMOS-MKH uses the following API to access the core protected registers.
    3839///////////////////////////////////////////////////////////////////////////////////////////
     40
     41/*****************************************************************************************
     42 * This function initialise - for architectures requiring it - the protected register(s)
     43 * containing the kernel_entry adresse(s) for interrupts / exceptions / syscalls.
     44 ****************************************************************************************/
     45void hal_set_kentry( void );
     46
     47/*****************************************************************************************
     48 * This function initializes - for architectures requiring it - the MMU registers
     49 * as required by the target architecture to execute the kernel threads attached
     50 * to kernel process zero. It is called by all cores in the kernel_init() function.
     51 *****************************************************************************************
     52 * @ gpt :  local pointer on the kernel page table descriptor.
     53 ****************************************************************************************/
     54void hal_mmu_init( struct gpt_s * gpt );
    3955
    4056/*****************************************************************************************
     
    103119/*****************************************************************************************
    104120 * This function makes an uncachable read to a 32 bits variable in local memory.
     121 *****************************************************************************************
    105122 * @ ptr     : pointer on the variable
    106123 * @ returns the value
     
    137154/*****************************************************************************************
    138155 * This function returns information on MMU exceptions :
     156 *****************************************************************************************
    139157 * @ mmu_ins_excp_code : [out] instruction fetch exception code
    140158 * @ mmu_ins_bad_vaddr : [out] instruction fetch faulty virtual address
  • trunk/hal/generic/hal_vmm.h

    r457 r623  
    11/*
    2  * hal_vmm.h - Generic Virtual Memory Manager initialisation
     2 * hal_vmm.h - Kernel Virtual Memory Manager initialisation
    33 *
    4  * Authors  Alain Greiner (2016,2017)
     4 * Authors  Alain Greiner (2016,2017,2018,2019)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    2222 */
    2323
    24 #ifndef _HAL_PPM_H_
    25 #define _HAL_PPM_H_
     24#ifndef _HAL_VMM_H_
     25#define _HAL_VMM_H_
    2626
    2727#include <hal_kernel_types.h>
     
    2929
    3030/////////////////////////////////////////////////////////////////////////////////////////
    31 //    Generic Virtual Memory Manager initialisation (implementation in hal_vmm.c)
     31//    Kernel Virtual Memory Manager initialisation (implementation in hal_vmm.c)
    3232//
    3333// Any arch-specific implementation must implement this API.
     
    3636/****  Forward declarations  ****/
    3737
    38 struct vmm_s;
     38struct process_s;
     39struct boot_info_s;
    3940
    4041/****************************************************************************************
    41  * This function makes all architecture specific initialisations
    42  * in the VSL (Virtual segments List) and in the GPT (Generic Page Table).
     42 * Depending on the hardware architecture, this function creates (i.e. allocates memory
     43 * and initializes) the VSL (Virtual segments List) and the GPT (Generic Page Table),
     44 * for all vsegs required by the kernel process.
    4345 ****************************************************************************************
    44  * @ vmm   : pointer on virtual memory manager.
     46 * @ info  : local pointer on boot_info (for kernel segments base & size).
    4547 * @ return 0 if success / return ENOMEM if failure.
    4648 ***************************************************************************************/
    47 error_t hal_vmm_init( struct vmm_s * vmm );
     49error_t hal_vmm_kernel_init( struct boot_info_s * info );
    4850
    49 #endif  /* HAL_PPM_H_ */
     51/****************************************************************************************
     52 * Depending on the hardware architecture, this function updates the VMM of an user
     53 * process identified by the <process> argument. It registers in VSL and GPT all
     54 * kernel vsegs required by this architecture.
     55 ****************************************************************************************
     56 * @ process   : local pointer on user process descriptor.
     57 * @ return 0 if success / return ENOMEM if failure.
     58 ***************************************************************************************/
     59error_t hal_vmm_kernel_update( struct process_s * process );
     60
     61#endif  /* HAL_VMM_H_ */
Note: See TracChangeset for help on using the changeset viewer.