Changeset 23 for trunk/hal/generic


Ignore:
Timestamp:
Jun 18, 2017, 10:06:41 PM (5 years ago)
Author:
alain
Message:

Introduce syscalls.

Location:
trunk/hal/generic
Files:
3 edited

Legend:

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

    r17 r23  
    6767
    6868/*****************************************************************************************
    69  * This blocking function atomically increments a 32 bits unsigned int shared variable,
    70  * returning only when atomic increment is successful.
    71  *****************************************************************************************
    72  * @ ptr     : pointer on the shared variable
    73  * @ return shared variable value before increment
    74  ****************************************************************************************/
    75 uint32_t hal_atomic_inc( uint32_t * ptr );
    76 
    77 /*****************************************************************************************
    78  * This blocking function atomically decrements a 32 bits unsigned int shared variable,
    79  * returning only when atomic decrement is successful.
    80  *****************************************************************************************
    81  * @ ptr     : pointer on the shared variable
    82  * @ return shared variable value before decrement
    83  ****************************************************************************************/
    84 uint32_t hal_atomic_dec( uint32_t * ptr );
    85 
    86 /*****************************************************************************************
    8769 * This NON blocking function makes an atomic Compare-And-Swap on a 32 bits unsigned int
    8870 * shared variable, returning a Boolean to indicate both success and atomicity.
  • trunk/hal/generic/hal_gpt.h

    r17 r23  
    166166                      uint32_t * attr,
    167167                      ppn_t    * ppn );
     168/****************************************************************************************
     169 * This function copies all valid entries from the source <src_gpt> to the <dst_pgt>.
     170 * The <src_gpt> and the <dst_gpt> point on the same physical pages.
     171 * If the <cow> argument is true, the GPT_WRITABLE attribute is reset for all writable
     172 * entries in both <src_gpt> and <dst_gpt>, and the PG_COW flag is registered in all
     173 * writable physical page descriptors, to support the Copy-On-Write mechanism.
     174 ****************************************************************************************
     175 * @ dst_gpt   : [in]  pointer on the destination GPT.
     176 * @ src_gpt   : [in]  pointer on the source GPT.
     177 * @ cow       : [in]  activate the COPY-On-Write mechanism if true.
     178 ***************************************************************************************/
     179error_t hal_gpt_copy( gpt_t    * dst_gpt,
     180                      gpt_t    * src_gpt,
     181                      bool_t     cow );
    168182
    169183
  • trunk/hal/generic/hal_uspace.h

    r17 r23  
    22 * hal_uspace.h - Generic User Space Access API definition
    33 *
    4  * Authors   Mohamed Karaoui  (2015)
    5  *           Alain Greiner    (2016)
     4 * Authors    Alain Greiner (2016,2017)
    65 *
    76 * Copyright (c)  UPMC Sorbonne Universites
     
    3332// When moving data between user space and kernel space, the user address is always
    3433// a virtual address, but the kernel address can be a physical address, on some
    35 // architectures. Therefore, data transfers must use the following API.
     34// architectures. For sake of portability, data transfers must use the following API.
    3635//////////////////////////////////////////////////////////////////////////////////////////
    3736
     
    3938/*****************************************************************************************
    4039 * This function tranfers a data buffer from the user space to the kernel space.
    41  * As the kernel is using physical addresses on the TSAR architecture, it activates
    42  * the MMU to access the user buffer.
     40 * If the kernel uses physical addresses, it activates the MMU to access the user buffer.
    4341 *****************************************************************************************
    4442 * @ k_dst     : destination address in kernel space.
     
    5250/*****************************************************************************************
    5351 * This function tranfers a data buffer from the kernel space to the user space.
    54  * As the kernel is using physical addresses on the TSAR architecture, it activates
    55  * the MMU to access the user buffer.
     52 * If the kernel uses physical addresses, it activates the MMU to access the user buffer.
    5653 *****************************************************************************************
    57  * @ u_dst     : destination buffer address and size in user space.
     54 * @ u_dst     : destination buffer address in user space.
    5855 * @ k_src     : source address in kernel space.
    5956 * @ size      : size (number of bytes).
    6057 ****************************************************************************************/
    61 extern void hal_copy_to_uspace( void     * udst,
    62                                 void     * ksrc,
     58extern void hal_copy_to_uspace( void     * u_dst,
     59                                void     * k_src,
    6360                                uint32_t   size );
    6461
    6562/*****************************************************************************************
    66  * This function activates the MMU to compute the length of a string in user space,
    67  * and returns it to a kernel buffer.
     63 * This function computes the length of a string in user space.
     64 * If the kernel uses physical addresses, it activates the MMU to access the user buffer.
    6865 *****************************************************************************************
    6966 * @ u_str     : string address in user space.
Note: See TracChangeset for help on using the changeset viewer.