diff options
Diffstat (limited to 'arch/ia64/kernel/palinfo.c')
-rw-r--r-- | arch/ia64/kernel/palinfo.c | 91 |
1 files changed, 79 insertions, 12 deletions
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 6ef6ffb943a0..396004e8cd14 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c | |||
@@ -470,7 +470,7 @@ register_info(char *page) | |||
470 | return p - page; | 470 | return p - page; |
471 | } | 471 | } |
472 | 472 | ||
473 | static const char *proc_features[]={ | 473 | static char *proc_features_0[]={ /* Feature set 0 */ |
474 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, | 474 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, |
475 | NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL, | 475 | NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL, |
476 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, | 476 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, |
@@ -502,25 +502,92 @@ static const char *proc_features[]={ | |||
502 | "Enable BERR promotion" | 502 | "Enable BERR promotion" |
503 | }; | 503 | }; |
504 | 504 | ||
505 | static char *proc_features_16[]={ /* Feature set 16 */ | ||
506 | "Disable ETM", | ||
507 | "Enable ETM", | ||
508 | "Enable MCA on half-way timer", | ||
509 | "Enable snoop WC", | ||
510 | NULL, | ||
511 | "Enable Fast Deferral", | ||
512 | "Disable MCA on memory aliasing", | ||
513 | "Enable RSB", | ||
514 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
515 | "DP system processor", | ||
516 | "Low Voltage", | ||
517 | "HT supported", | ||
518 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
519 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
520 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
521 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
522 | NULL, NULL, NULL, NULL, NULL | ||
523 | }; | ||
524 | |||
525 | static char **proc_features[]={ | ||
526 | proc_features_0, | ||
527 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
528 | NULL, NULL, NULL, NULL, | ||
529 | proc_features_16, | ||
530 | NULL, NULL, NULL, NULL, | ||
531 | }; | ||
532 | |||
533 | static char * | ||
534 | feature_set_info(char *page, u64 avail, u64 status, u64 control, u64 set) | ||
535 | { | ||
536 | char *p = page; | ||
537 | char **vf, **v; | ||
538 | int i; | ||
539 | |||
540 | vf = v = proc_features[set]; | ||
541 | for(i=0; i < 64; i++, avail >>=1, status >>=1, control >>=1) { | ||
542 | |||
543 | if (!(control)) /* No remaining bits set */ | ||
544 | break; | ||
545 | if (!(avail & 0x1)) /* Print only bits that are available */ | ||
546 | continue; | ||
547 | if (vf) | ||
548 | v = vf + i; | ||
549 | if ( v && *v ) { | ||
550 | p += sprintf(p, "%-40s : %s %s\n", *v, | ||
551 | avail & 0x1 ? (status & 0x1 ? | ||
552 | "On " : "Off"): "", | ||
553 | avail & 0x1 ? (control & 0x1 ? | ||
554 | "Ctrl" : "NoCtrl"): ""); | ||
555 | } else { | ||
556 | p += sprintf(p, "Feature set %2ld bit %2d\t\t\t" | ||
557 | " : %s %s\n", | ||
558 | set, i, | ||
559 | avail & 0x1 ? (status & 0x1 ? | ||
560 | "On " : "Off"): "", | ||
561 | avail & 0x1 ? (control & 0x1 ? | ||
562 | "Ctrl" : "NoCtrl"): ""); | ||
563 | } | ||
564 | } | ||
565 | return p; | ||
566 | } | ||
505 | 567 | ||
506 | static int | 568 | static int |
507 | processor_info(char *page) | 569 | processor_info(char *page) |
508 | { | 570 | { |
509 | char *p = page; | 571 | char *p = page; |
510 | const char **v = proc_features; | 572 | u64 avail=1, status=1, control=1, feature_set=0; |
511 | u64 avail=1, status=1, control=1; | ||
512 | int i; | ||
513 | s64 ret; | 573 | s64 ret; |
514 | 574 | ||
515 | if ((ret=ia64_pal_proc_get_features(&avail, &status, &control)) != 0) return 0; | 575 | do { |
576 | ret = ia64_pal_proc_get_features(&avail, &status, &control, | ||
577 | feature_set); | ||
578 | if (ret < 0) { | ||
579 | return p - page; | ||
580 | } | ||
581 | if (ret == 1) { | ||
582 | feature_set++; | ||
583 | continue; | ||
584 | } | ||
585 | |||
586 | p = feature_set_info(p, avail, status, control, feature_set); | ||
587 | |||
588 | feature_set++; | ||
589 | } while(1); | ||
516 | 590 | ||
517 | for(i=0; i < 64; i++, v++,avail >>=1, status >>=1, control >>=1) { | ||
518 | if ( ! *v ) continue; | ||
519 | p += sprintf(p, "%-40s : %s%s %s\n", *v, | ||
520 | avail & 0x1 ? "" : "NotImpl", | ||
521 | avail & 0x1 ? (status & 0x1 ? "On" : "Off"): "", | ||
522 | avail & 0x1 ? (control & 0x1 ? "Ctrl" : "NoCtrl"): ""); | ||
523 | } | ||
524 | return p - page; | 591 | return p - page; |
525 | } | 592 | } |
526 | 593 | ||