Changeset 703 for soft/giet_vm/applications/shell/main.c
- Timestamp:
- Aug 12, 2015, 5:58:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/shell/main.c
r687 r703 8 8 9 9 #include "stdio.h" 10 #include "st ring.h"10 #include "stdlib.h" 11 11 #include "malloc.h" 12 12 … … 243 243 if ( ret == -2 ) 244 244 { 245 giet_tty_printf("\n error : %s cannot be killed\n", argv[ 0] );245 giet_tty_printf("\n error : %s cannot be killed\n", argv[1] ); 246 246 } 247 247 } … … 251 251 { 252 252 giet_tasks_status(); 253 } 254 255 /////////////////////////////////////////////// 256 static void cmd_sleep(int argc, char** argv) 257 { 258 int start = giet_proctime(); 259 260 if (argc < 2) 261 { 262 giet_tty_printf("%s <cycles>\n", argv[0]); 263 return; 264 } 265 266 while (giet_proctime() < start + atoi(argv[1])); 253 267 } 254 268 … … 267 281 { "kill", cmd_kill }, 268 282 { "ps", cmd_ps }, 283 { "sleep", cmd_sleep }, 269 284 { NULL, NULL } 270 285 }; … … 273 288 274 289 /////////////////////////////////////// 275 static void parse(char *buf , int count)290 static void parse(char *buf) 276 291 { 277 292 int argc = 0; … … 336 351 // get a private TTY 337 352 giet_tty_alloc( 0 ); 353 giet_tty_printf( "~~~ shell ~~~\n" ); 338 354 339 355 // display first prompt … … 358 374 { 359 375 buf[count] = '\0'; 360 parse((char*)&buf , count);376 parse((char*)&buf); 361 377 } 362 378 prompt();
Note: See TracChangeset
for help on using the changeset viewer.