Changeset 661 for trunk/libs/libalmosmkh/almosmkh.c
- Timestamp:
- Oct 10, 2020, 4:41:37 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/libalmosmkh/almosmkh.c
r657 r661 57 57 } 58 58 59 ////////////////////////////////////// 60 int get_config( unsigned int * x_size, 61 unsigned int * y_size, 62 unsigned int * ncores ) 59 /////////////////////////////////////////////// 60 int get_config( struct hard_config_s * config ) 63 61 { 64 62 return hal_user_syscall( SYS_GET_CONFIG, 65 (reg_t)x_size, 66 (reg_t)y_size, 67 (reg_t)ncores, 0 ); 63 (reg_t)config, 0, 0, 0); 68 64 } 69 65 … … 242 238 if( length >= maxlen-1 ) 243 239 { 244 return -1; // return failure 240 // cancel all echo characters 241 while( length ) 242 { 243 printf("\b \b"); // cancel one echo character 244 length--; 245 } 245 246 } 246 247 … … 257 258 else if (c == 0x0A) // LF character marks end of string 258 259 { 260 putchar( c ); 259 261 done = 1; 260 262 } … … 264 266 if ( length > 0 ) 265 267 { 268 printf("\b \b"); // cancel one echo character 266 269 length--; 267 printf("\b \b"); // BS / / BS268 270 } 269 271 } 270 272 else if ( c == 0 ) // EOF character 271 273 { 274 // cancel all echo characters 275 while( length ) 276 { 277 printf("\b \b"); // cancel one echo character 278 length--; 279 } 272 280 return -1; // return failure 273 281 } … … 276 284 // set NUL character in string and return success 277 285 string[length] = 0; 278 return 0;286 return length + 1; 279 287 280 288 } // end get_string() … … 399 407 (reg_t)nb_slots, 0 ); 400 408 } 409 410 ///////////////////////////////////// 411 int display_socket( unsigned int pid, 412 unsigned int fdid ) 413 { 414 return hal_user_syscall( SYS_DISPLAY, 415 DISPLAY_SOCKET, 416 (reg_t)pid, 417 (reg_t)fdid, 0 ); 418 } 401 419 402 420 /////////////////////////////// … … 1495 1513 1496 1514 // get platform parameters 1497 unsigned int x_size; 1498 unsigned int y_size; 1499 unsigned int ncores; 1500 get_config( &x_size , &y_size , &ncores ); 1515 hard_config_t config; 1516 get_config( &config ); 1517 unsigned int x_size = config.x_size; 1518 unsigned int y_size = config.y_size; 1519 unsigned int ncores = config.ncores; 1501 1520 1502 1521 // get calling thread cluster identifier
Note: See TracChangeset
for help on using the changeset viewer.