Ignore:
Timestamp:
Jan 13, 2021, 12:45:27 AM (3 years ago)
Author:
alain
Message:

Introduce the display_socket() function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/libalmosmkh/almosmkh.h

    r678 r685  
    22 * almosmkh.h - User level ALMOS-MKH specific library definition.
    33 *
    4  * Author     Alain Greiner (2016,2017,2018,2019,2020)
     4 * Author        Alain Greiner (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    2626
    2727/***************************************************************************************
    28  * This file defines an user level, ALMOS-MKH specific library, containing:
     28 * This file defines an user level, ALMOS-MKH specific library, containing various
     29 * non standard functions and system calls:
     30 *
     31 * - non standard get_uint32() and get_string() functions.
    2932 * - non standard system calls.
    30  * - debug functions.
    31  * - remote malloc extensions.
    32  * - a parallel_pthread_create function.
    33  * - Frame Buffer access syscalls.
     33 * - non standard debug functions.
     34 * - non standard remote_malloc() functions.
     35 * - non standard parallel_pthread_create() function.
     36 * - non standard FBF access syscalls.
    3437 **************************************************************************************/
    3538
    3639#include <pthread.h>
    3740#include <shared_almos.h>
     41
     42
     43/****************** Non standard (ALMOS_MKH specific) functions  **********************/
     44
     45
     46/***************************************************************************************
     47 * This syscall returns a 32 bits integer captures from the STDIN terminal.
     48 * The value is copied in buffer pointed by the <buf> argument
     49 * Both decimal numbers and hexadecimal numbers (prefixed by 0x) are supported.
     50 ***************************************************************************************
     51 * @ buffer    : pointer on buffer.
     52 * @ returns 0 if success / returns -1 if failure.
     53 **************************************************************************************/
     54void get_uint32( unsigned int * buffer );
     55
     56
     57/***************************************************************************************
     58 * These syscalls return a NUL terminated string captured from the STDIN terminal.
     59 * The characters are copied in buffer pointed by the <string> argument.
     60 * If the number of captured characters exceeds <maxlen>, all characters are discarded,
     61 * and removed from the <string> buffer, and a new string capture start.
     62 * - All printable characters 'c' such as (0x20 <= c) and (c < 0x7f) are echoed
     63 *   and copied in the target buffer.
     64 * - The LF (0x0A) or CR (0x13) characters are interpreted as "end of string".
     65 *   It is echoed, and replaced by the NUL (0x00) character in the target buffer.
     66 * - The DEL (0x7F), BS (0x08) control characters are taken into account, and can be
     67 *   used to correct both the buffer content and the echoed string.
     68 * - All other non printable characters are discarded
     69 ***************************************************************************************
     70 * @ string   : pointer on the user space string buffer.
     71 * @ maxlen   : max number of bytes in string buffer, including the terminating NUL.
     72 * @ returns string length (including NUL) if success / returns 0 if failure.
     73 **************************************************************************************/
     74int get_string( char * string,
     75                int    maxlen );
     76
    3877
    3978
     
    112151                   unsigned int * lid );
    113152
     153/***************************************************************************************
     154 * This syscall returns in the user buffer defined by the <u_buf> and <size> arguments
     155 * a string containing the description of the processes registered in cluster specified
     156 * by the <cxy> argument (one line per process in the NUL terminated string).
     157 * Only the owned processes are returned when the <owned> argument is non zero.
     158 * It can be called by any thread running in any cluster.
     159 ***************************************************************************************
     160 * @ cxy      : [in] target cluster identifier.
     161 * @ owned    : [in] only owned processes if non zero.
     162 * @ return 0 if success / return -1 if illegal argument.
     163 **************************************************************************************/
     164int get_processes( unsigned int   cxy,
     165                   unsigned int   owned,
     166                   char         * u_buf,
     167                   unsigned int   size );
     168
    114169/***************************************************************************************
    115170 * This function returns the value contained in the calling core cycles counter,
     
    120175 **************************************************************************************/
    121176int get_cycle( unsigned long long * cycle );
    122 
    123 /***************************************************************************************
    124  * This syscall allows the calling thread to specify the target cluster for
    125  * a subsequent fork(). It must be called for each fork().
    126  ***************************************************************************************
    127  * @ cxy      : [in] target cluster identifier.
    128  * @ return 0 if success / returns -1 if illegal cxy argument.
    129  **************************************************************************************/
    130 int place_fork( unsigned int cxy );
    131 
    132 /***************************************************************************************
    133  * This syscall implements the operations related to User Thread Local Storage.
    134  ***************************************************************************************
    135  * @ operation  : UTLS operation type as defined in "shared_sycalls.h" file.
    136  * @ value      : argument value for the UTLS_SET operation.
    137  * @ return value for the UTLS_GET and UTLS_GET_ERRNO / return -1 if failure.
    138  **************************************************************************************/
    139 int utls( unsigned int operation,
    140           unsigned int value );
    141 
    142 /***************************************************************************************
    143  * This syscall returns an 32 bits integer from the TXT terminal.
    144  * The value is copied in buffer pointed by the <buf> argument
    145  * Both decimal numbers and hexadecimal numbers (prefixed by 0x) are supported.
    146  ***************************************************************************************
    147  * @ buffer    : pointer on buffer.
    148  * @ returns 0 if success / returns -1 if failure.
    149  **************************************************************************************/
    150 void get_uint32( unsigned int * buffer );
    151 
    152 
    153 /***************************************************************************************
    154  * These syscalls return a NUL terminated character string from the TXT terminal.
    155  * The characters are copied in buffer pointed by the <string> argument.
    156  * If the number of characters exceeds <maxlen>, all read characters are discarded,
    157  * and removed from the <string> buffer, and a new string capture start.
    158  * - Only printable characters c such as (0x20 <= c) and (c < 0x7f) are echoed
    159  *   and copied in the target buffer.
    160  * - The LF (0x0A) character signaling the end of string is replaced by an extra
    161  *   NUL (0x00) character in the target buffer.
    162  * - the DEL (0x7F), BS (0x08) control characters are taken into account, and can be
    163  *   used to correct both the buffer content and the echoed string.
    164  ***************************************************************************************
    165  * @ string   : pointer on the user space string buffer.
    166  * @ maxlen   : max number of bytes in string buffer, including the terminating NUL.
    167  * @ returns string length (including NUL) if success / returns 0 if failure.
    168  **************************************************************************************/
    169 int get_string( char * string,
    170                 int    maxlen );
    171 
    172 
    173 /***************** Non standard (ALMOS-MKH specific) debug functions ******************/
    174177
    175178/***************************************************************************************
     
    182185int get_thread_info( thread_info_t * info );
    183186
     187/***************************************************************************************
     188 * This syscall allows the calling thread to specify the target cluster for
     189 * a subsequent fork(). It must be called for each fork().
     190 ***************************************************************************************
     191 * @ cxy      : [in] target cluster identifier.
     192 * @ return 0 if success / returns -1 if illegal cxy argument.
     193 **************************************************************************************/
     194int place_fork( unsigned int cxy );
     195
     196/***************************************************************************************
     197 * This syscall implements the operations related to User Thread Local Storage.
     198 ***************************************************************************************
     199 * @ operation  : UTLS operation type as defined in "shared_sycalls.h" file.
     200 * @ value      : argument value for the UTLS_SET operation.
     201 * @ return value for the UTLS_GET and UTLS_GET_ERRNO / return -1 if failure.
     202 **************************************************************************************/
     203int utls( unsigned int operation,
     204          unsigned int value );
     205
     206
     207
     208/***************** Non standard (ALMOS-MKH specific) debug functions ******************/
     209
    184210/***************************************************************************************
    185211 * This debug syscall displays on the kernel terminal TXT0
    186  * the thread / process / core identifiers, the current cycle, plus a user defined
    187  * message as specified by the <string> argument.
     212 * an user defined message specified by the <string> argument, plus the current cycle.
    188213 ***************************************************************************************
    189214 * @ string    : [in] user defined message.
Note: See TracChangeset for help on using the changeset viewer.