Changeset 80bff342 in mainline
- Timestamp:
- 2005-12-30T15:39:00Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 65fb232
- Parents:
- feb5915
- Location:
- generic/src/console
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/console/cmd.c
rfeb5915 r80bff342 49 49 #include <mm/tlb.h> 50 50 #include <arch/mm/tlb.h> 51 #include <mm/frame.h> 51 52 52 53 /** Data and methods for 'help' command. */ … … 118 119 .argv = set4_argv 119 120 }; 121 120 122 121 123 … … 242 244 }; 243 245 246 247 /** Data and methods for 'zones' command */ 248 static int cmd_zones(cmd_arg_t *argv); 249 static cmd_info_t zones_info = { 250 .name = "zones", 251 .description = "List of memory zones.", 252 .func = cmd_zones, 253 .argc = 0 254 }; 255 256 /** Data and methods for 'zone' command */ 257 static int cmd_zone(cmd_arg_t *argv); 258 static char zone_buf[MAX_CMDLINE+1]; 259 static cmd_arg_t zone_argv = { 260 .type = ARG_TYPE_INT, 261 .buffer = zone_buf, 262 .len = sizeof(zone_buf) 263 }; 264 265 266 static cmd_info_t zone_info = { 267 .name = "zone", 268 .description = "Show memory zone structure.", 269 .func = cmd_zone, 270 .argc = 1, 271 .argv = &zone_argv 272 }; 273 274 275 244 276 /** Initialize command info structure. 245 277 * … … 299 331 if (!cmd_register(&ptlb_info)) 300 332 panic("could not register command %s\n", ptlb_info.name); 333 334 cmd_initialize(&zones_info); 335 if (!cmd_register(&zones_info)) 336 panic("could not register command %s\n", zones_info.name); 337 338 cmd_initialize(&zone_info); 339 if (!cmd_register(&zone_info)) 340 panic("could not register command %s\n", zone_info.name); 341 342 301 343 } 302 344 … … 534 576 return 1; 535 577 } 578 579 580 int cmd_zones(cmd_arg_t * argv) { 581 printf("Zones listing not implemented\n"); 582 return 1; 583 } 584 int cmd_zone(cmd_arg_t * argv) { 585 printf("Zone details not implemented\n"); 586 return 1; 587 } 588 -
generic/src/console/kconsole.c
rfeb5915 r80bff342 472 472 link_t *cur; 473 473 int i; 474 int error = 0; 474 475 475 476 if (!parse_argument(cmdline, len, &start, &end)) { … … 521 522 } 522 523 524 error = 0; 523 525 switch (cmd->argv[i].type) { 524 526 case ARG_TYPE_STRING: … … 530 532 if (parse_int_arg(cmdline+start, end-start+1, 531 533 &cmd->argv[i].intval)) 532 return NULL;534 error = 1; 533 535 break; 534 536 case ARG_TYPE_VAR: … … 545 547 else { 546 548 printf("Unrecognized variable argument.\n"); 547 return NULL;549 error = 1; 548 550 } 549 551 break; … … 551 553 default: 552 554 printf("invalid argument type\n"); 553 return NULL;555 error = 1; 554 556 break; 555 557 } 558 } 559 560 if (error) { 561 spinlock_unlock(&cmd->lock); 562 return NULL; 556 563 } 557 564
Note:
See TracChangeset
for help on using the changeset viewer.