Changeset 299 for trunk/hal


Ignore:
Timestamp:
Jul 31, 2017, 2:19:12 PM (7 years ago)
Author:
max@…
Message:

The uspace strcpy function is allowed to fail (not implemented yet).

Location:
trunk/hal
Files:
3 edited

Legend:

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

    r121 r299  
    6464 * This function tranfers a NUL terminated string from the user space to the kernel space.
    6565 * If the kernel uses physical addresses, it activates the MMU to access the user buffer.
    66  * TODO : implement the max_size argument handling
     66 * TODO : implement the max_size argument handling, and error handling
    6767 *****************************************************************************************
    6868 * @ u_dst     : destination buffer address in user space.
     
    7070 * @ max_size  : max number of characters to be copied.
    7171 ****************************************************************************************/
    72 extern void hal_strcpy_from_uspace( char     * k_dst,
    73                                     char     * u_src,
    74                                     uint32_t   max_size );
     72extern error_t hal_strcpy_from_uspace( char     * k_dst,
     73                                       char     * u_src,
     74                                       uint32_t   max_size );
    7575
    7676/*****************************************************************************************
    7777 * This function tranfers a NUL terminated string from the kernel space to the user space.
    7878 * If the kernel uses physical addresses, it activates the MMU to access the user buffer.
    79  * TODO : implement the max_size argument handling
     79 * TODO : implement the max_size argument handling, and error handling
    8080 *****************************************************************************************
    8181 * @ u_dst     : destination buffer address in user space.
     
    8383 * @ max_size  : max number of characters to be copied.
    8484 ****************************************************************************************/
    85 extern void hal_strcpy_to_uspace( char     * u_dst,
    86                                   char     * k_src,
    87                                   uint32_t   max_size );
     85extern error_t hal_strcpy_to_uspace( char     * u_dst,
     86                                     char     * k_src,
     87                                     uint32_t   max_size );
    8888
    8989/*****************************************************************************************
  • trunk/hal/tsar_mips32/core/hal_uspace.c

    r121 r299  
    128128
    129129//////////////////////////////////////////
    130 void hal_strcpy_from_uspace( char     * k_dst,
    131                              char     * u_src,
    132                              uint32_t   max_size )
    133 
    134 {
    135 
    136 // TODO implement the max_size handling
     130error_t hal_strcpy_from_uspace( char     * k_dst,
     131                                char     * u_src,
     132                                uint32_t   max_size )
     133
     134{
     135
     136// TODO implement the max_size handling, and error handling
    137137
    138138    uint32_t save_sr;
     
    159159    hal_restore_irq( save_sr );
    160160
     161    return 0;
    161162} // hal_strcpy_from_uspace()
    162163
    163164////////////////////////////////////////////
    164 void hal_strcpy_to_uspace( char     * u_dst,
    165                            char     * k_src,
    166                            uint32_t   max_size )
    167 {
    168 
    169 // TODO implement the max_size handling
     165error_t hal_strcpy_to_uspace( char     * u_dst,
     166                              char     * k_src,
     167                              uint32_t   max_size )
     168{
     169
     170// TODO implement the max_size handling, and error handling
    170171
    171172    uint32_t save_sr;
     
    192193    hal_restore_irq( save_sr );
    193194
    194 } // hal_strcpy_from_uspace()
     195    return 0;
     196} // hal_strcpy_to_uspace()
    195197
    196198///////////////////////////////////////////////
  • trunk/hal/x86_64/core/hal_uspace.c

    r189 r299  
    2929#include <hal_internal.h>
    3030
    31 void hal_copy_from_uspace( void     * k_dst,
    32                            void     * u_src,
    33                            uint32_t   size )
     31void hal_copy_from_uspace(void *k_dst, void *u_src, uint32_t size)
    3432{
    3533        x86_panic((char *)__func__);
    3634}
    3735
    38 void hal_copy_to_uspace( void     * u_dst,
    39                          void     * k_src,
    40                          uint32_t   size )
     36void hal_copy_to_uspace(void *u_dst, void *k_src, uint32_t size)
    4137{
    4238        x86_panic((char *)__func__);
     
    4945}
    5046
    51 void hal_strcpy_from_uspace( char     * k_dst,
    52                              char     * u_src,
    53                              uint32_t   max_size )
     47error_t hal_strcpy_to_uspace(char *u_dst, char *k_src, uint32_t max_size)
    5448{
    5549        x86_panic((char *)__func__);
     50        return 0;
    5651}
    5752
     53error_t hal_strcpy_from_uspace(char *k_dst, char *u_src, uint32_t max_size)
     54{
     55        x86_panic((char *)__func__);
     56        return 0;
     57}
     58
Note: See TracChangeset for help on using the changeset viewer.