aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss Anderson <rja@sgi.com>2007-10-16 18:02:38 -0400
committerTony Luck <tony.luck@intel.com>2007-11-09 16:05:30 -0500
commitb8de471f37dcafc8892a2e58c80764d7af221715 (patch)
tree47b2055ce6c794ceb461741449d714d3d03e6df1
parentc9d059def234d7cd60809a6a122102ff96d2d0ca (diff)
[IA64] Update printing of feature set bits
Newer Itanium versions have added additional processor feature set bits. This patch prints all the implemented feature set bits. Some bit descriptions have not been made public. For those bits, a generic "Feature set X bit Y" message is printed. Bits that are not implemented will no longer be printed. Signed-off-by: Russ Anderson <rja@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/kernel/palinfo.c91
-rw-r--r--include/asm-ia64/pal.h5
2 files changed, 82 insertions, 14 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
473static const char *proc_features[]={ 473static 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
505static 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
525static 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
533static char *
534feature_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
506static int 568static int
507processor_info(char *page) 569processor_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
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index abfcb3a2588f..8a695d3407d2 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -1379,10 +1379,11 @@ struct pal_features_s;
1379static inline s64 1379static inline s64
1380ia64_pal_proc_get_features (u64 *features_avail, 1380ia64_pal_proc_get_features (u64 *features_avail,
1381 u64 *features_status, 1381 u64 *features_status,
1382 u64 *features_control) 1382 u64 *features_control,
1383 u64 features_set)
1383{ 1384{
1384 struct ia64_pal_retval iprv; 1385 struct ia64_pal_retval iprv;
1385 PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0); 1386 PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, features_set, 0);
1386 if (iprv.status == 0) { 1387 if (iprv.status == 0) {
1387 *features_avail = iprv.v0; 1388 *features_avail = iprv.v0;
1388 *features_status = iprv.v1; 1389 *features_status = iprv.v1;