Rev 668 | Rev 676 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 668 | Rev 673 | ||
|---|---|---|---|
| Line 43... | Line 43... | ||
| 43 | #include <arch.h> |
43 | #include <arch.h> |
| 44 | #include <func.h> |
44 | #include <func.h> |
| 45 | #include <macros.h> |
45 | #include <macros.h> |
| 46 | #include <debug.h> |
46 | #include <debug.h> |
| 47 | #include <symtab.h> |
47 | #include <symtab.h> |
| 48 | - | ||
| - | 48 | #include <cpu.h> |
|
| 49 | #include <mm/tlb.h> |
49 | #include <mm/tlb.h> |
| 50 | #include <arch/mm/tlb.h> |
50 | #include <arch/mm/tlb.h> |
| 51 | #include <mm/frame.h> |
51 | #include <mm/frame.h> |
| - | 52 | #include <main/version.h> |
|
| 52 | 53 | ||
| 53 | /** Data and methods for 'help' command. */ |
54 | /** Data and methods for 'help' command. */ |
| 54 | static int cmd_help(cmd_arg_t *argv); |
55 | static int cmd_help(cmd_arg_t *argv); |
| 55 | static cmd_info_t help_info = { |
56 | static cmd_info_t help_info = { |
| 56 | .name = "help", |
57 | .name = "help", |
| Line 117... | Line 118... | ||
| 117 | .func = cmd_set4, |
118 | .func = cmd_set4, |
| 118 | .argc = 2, |
119 | .argc = 2, |
| 119 | .argv = set4_argv |
120 | .argv = set4_argv |
| 120 | }; |
121 | }; |
| 121 | 122 | ||
| 122 | - | ||
| 123 | - | ||
| 124 | /** Data and methods for 'call0' command. */ |
123 | /** Data and methods for 'call0' command. */ |
| 125 | static char call0_buf[MAX_CMDLINE+1]; |
124 | static char call0_buf[MAX_CMDLINE+1]; |
| 126 | static char carg1_buf[MAX_CMDLINE+1]; |
125 | static char carg1_buf[MAX_CMDLINE+1]; |
| 127 | static char carg2_buf[MAX_CMDLINE+1]; |
126 | static char carg2_buf[MAX_CMDLINE+1]; |
| 128 | static char carg3_buf[MAX_CMDLINE+1]; |
127 | static char carg3_buf[MAX_CMDLINE+1]; |
| Line 230... | Line 229... | ||
| 230 | .description = "Halt the kernel.", |
229 | .description = "Halt the kernel.", |
| 231 | .func = cmd_halt, |
230 | .func = cmd_halt, |
| 232 | .argc = 0 |
231 | .argc = 0 |
| 233 | }; |
232 | }; |
| 234 | 233 | ||
| 235 | /** Data and methods for 'ptlb' command. */ |
234 | /** Data and methods for 'tlb' command. */ |
| 236 | static int cmd_ptlb(cmd_arg_t *argv); |
235 | static int cmd_tlb(cmd_arg_t *argv); |
| 237 | cmd_info_t ptlb_info = { |
236 | cmd_info_t tlb_info = { |
| 238 | .name = "ptlb", |
237 | .name = "tlb", |
| 239 | .description = "Print TLB of current processor.", |
238 | .description = "Print TLB of current processor.", |
| 240 | .help = NULL, |
239 | .help = NULL, |
| 241 | .func = cmd_ptlb, |
240 | .func = cmd_tlb, |
| 242 | .argc = 0, |
241 | .argc = 0, |
| 243 | .argv = NULL |
242 | .argv = NULL |
| 244 | }; |
243 | }; |
| 245 | 244 | ||
| 246 | 245 | ||
| Line 260... | Line 259... | ||
| 260 | .type = ARG_TYPE_INT, |
259 | .type = ARG_TYPE_INT, |
| 261 | .buffer = zone_buf, |
260 | .buffer = zone_buf, |
| 262 | .len = sizeof(zone_buf) |
261 | .len = sizeof(zone_buf) |
| 263 | }; |
262 | }; |
| 264 | 263 | ||
| 265 | - | ||
| 266 | static cmd_info_t zone_info = { |
264 | static cmd_info_t zone_info = { |
| 267 | .name = "zone", |
265 | .name = "zone", |
| 268 | .description = "Show memory zone structure.", |
266 | .description = "Show memory zone structure.", |
| 269 | .func = cmd_zone, |
267 | .func = cmd_zone, |
| 270 | .argc = 1, |
268 | .argc = 1, |
| 271 | .argv = &zone_argv |
269 | .argv = &zone_argv |
| 272 | }; |
270 | }; |
| 273 | 271 | ||
| - | 272 | /** Data and methods for 'cpus' command. */ |
|
| - | 273 | static int cmd_cpus(cmd_arg_t *argv); |
|
| - | 274 | cmd_info_t cpus_info = { |
|
| - | 275 | .name = "cpus", |
|
| - | 276 | .description = "List all processors.", |
|
| - | 277 | .help = NULL, |
|
| - | 278 | .func = cmd_cpus, |
|
| - | 279 | .argc = 0, |
|
| - | 280 | .argv = NULL |
|
| - | 281 | }; |
|
| - | 282 | ||
| - | 283 | /** Data and methods for 'version' command. */ |
|
| - | 284 | static int cmd_version(cmd_arg_t *argv); |
|
| - | 285 | cmd_info_t version_info = { |
|
| - | 286 | .name = "version", |
|
| - | 287 | .description = "Print version information.", |
|
| - | 288 | .help = NULL, |
|
| - | 289 | .func = cmd_version, |
|
| - | 290 | .argc = 0, |
|
| - | 291 | .argv = NULL |
|
| - | 292 | }; |
|
| - | 293 | ||
| - | 294 | ||
| 274 | 295 | ||
| 275 | 296 | ||
| 276 | /** Initialize command info structure. |
297 | /** Initialize command info structure. |
| 277 | * |
298 | * |
| 278 | * @param cmd Command info structure. |
299 | * @param cmd Command info structure. |
| Line 325... | Line 346... | ||
| 325 | 346 | ||
| 326 | cmd_initialize(&halt_info); |
347 | cmd_initialize(&halt_info); |
| 327 | if (!cmd_register(&halt_info)) |
348 | if (!cmd_register(&halt_info)) |
| 328 | panic("could not register command %s\n", halt_info.name); |
349 | panic("could not register command %s\n", halt_info.name); |
| 329 | 350 | ||
| 330 | cmd_initialize(&ptlb_info); |
351 | cmd_initialize(&tlb_info); |
| 331 | if (!cmd_register(&ptlb_info)) |
352 | if (!cmd_register(&tlb_info)) |
| 332 | panic("could not register command %s\n", ptlb_info.name); |
353 | panic("could not register command %s\n", tlb_info.name); |
| 333 | 354 | ||
| 334 | cmd_initialize(&zones_info); |
355 | cmd_initialize(&zones_info); |
| 335 | if (!cmd_register(&zones_info)) |
356 | if (!cmd_register(&zones_info)) |
| 336 | panic("could not register command %s\n", zones_info.name); |
357 | panic("could not register command %s\n", zones_info.name); |
| 337 | 358 | ||
| 338 | cmd_initialize(&zone_info); |
359 | cmd_initialize(&zone_info); |
| 339 | if (!cmd_register(&zone_info)) |
360 | if (!cmd_register(&zone_info)) |
| 340 | panic("could not register command %s\n", zone_info.name); |
361 | panic("could not register command %s\n", zone_info.name); |
| 341 | 362 | ||
| - | 363 | cmd_initialize(&cpus_info); |
|
| - | 364 | if (!cmd_register(&cpus_info)) |
|
| - | 365 | panic("could not register command %s\n", cpus_info.name); |
|
| - | 366 | ||
| - | 367 | cmd_initialize(&version_info); |
|
| - | 368 | if (!cmd_register(&version_info)) |
|
| - | 369 | panic("could not register command %s\n", version_info.name); |
|
| - | 370 | ||
| - | 371 | ||
| 342 | 372 | ||
| 343 | } |
373 | } |
| 344 | 374 | ||
| 345 | 375 | ||
| 346 | /** List supported commands. |
376 | /** List supported commands. |
| Line 536... | Line 566... | ||
| 536 | * |
566 | * |
| 537 | * @param argv Not used. |
567 | * @param argv Not used. |
| 538 | * |
568 | * |
| 539 | * @return Always returns 1. |
569 | * @return Always returns 1. |
| 540 | */ |
570 | */ |
| 541 | int cmd_ptlb(cmd_arg_t *argv) |
571 | int cmd_tlb(cmd_arg_t *argv) |
| 542 | { |
572 | { |
| 543 | tlb_print(); |
573 | tlb_print(); |
| 544 | return 1; |
574 | return 1; |
| 545 | } |
575 | } |
| 546 | 576 | ||
| Line 574... | Line 604... | ||
| 574 | } |
604 | } |
| 575 | 605 | ||
| 576 | return 1; |
606 | return 1; |
| 577 | } |
607 | } |
| 578 | 608 | ||
| 579 | - | ||
| 580 | int cmd_zones(cmd_arg_t * argv) { |
609 | int cmd_zones(cmd_arg_t * argv) { |
| 581 | printf("Zones listing not implemented\n"); |
610 | printf("Zones listing not implemented\n"); |
| 582 | return 1; |
611 | return 1; |
| 583 | } |
612 | } |
| - | 613 | ||
| 584 | int cmd_zone(cmd_arg_t * argv) { |
614 | int cmd_zone(cmd_arg_t * argv) { |
| 585 | printf("Zone details not implemented\n"); |
615 | printf("Zone details not implemented\n"); |
| 586 | return 1; |
616 | return 1; |
| 587 | } |
617 | } |
| 588 | 618 | ||
| - | 619 | /** Command for listing processors. |
|
| - | 620 | * |
|
| - | 621 | * @param argv Ignored. |
|
| - | 622 | * |
|
| - | 623 | * return Always 1. |
|
| - | 624 | */ |
|
| - | 625 | int cmd_cpus(cmd_arg_t *argv) |
|
| - | 626 | { |
|
| - | 627 | cpu_list(); |
|
| - | 628 | return 1; |
|
| - | 629 | } |
|
| - | 630 | ||
| - | 631 | /** Command for printing kernel version. |
|
| - | 632 | * |
|
| - | 633 | * @param argv Ignored. |
|
| - | 634 | * |
|
| - | 635 | * return Always 1. |
|
| - | 636 | */ |
|
| - | 637 | int cmd_version(cmd_arg_t *argv) |
|
| - | 638 | { |
|
| - | 639 | version_print(); |
|
| - | 640 | return 1; |
|
| - | 641 | } |
|