summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorjimand <none@none>2007-11-01 17:19:32 -0700
committerjimand <none@none>2007-11-01 17:19:32 -0700
commit1ba18ff1efb9bb19540297cbee0a824685da1622 (patch)
tree5d5ea876d512603e42d481a4a40c578b14a9991e /usr/src/lib
parent347d7e16e944b19ba53aaa85b52b5aaef7d8531b (diff)
downloadillumos-gate-1ba18ff1efb9bb19540297cbee0a824685da1622.tar.gz
6603018 support for Jupiter SPARC64-VI compatible mode
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c22
-rw-r--r--usr/src/lib/libprtdiag_psr/sparc/opl/common/opl_picl.c32
2 files changed, 54 insertions, 0 deletions
diff --git a/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c b/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c
index a1300645d2..b06aec606b 100644
--- a/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c
+++ b/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c
@@ -99,6 +99,7 @@ void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree,
struct system_kstat_data *kstats);
Prop *find_prop(Prom_node *pnode, char *name);
int do_piclinfo(int);
+int get_proc_mode(void);
/* Local functions */
static void opl_disp_environ(void);
@@ -789,6 +790,7 @@ opl_disp_hw_revisions(Sys_tree *tree, Prom_node *root)
{
char *version;
Prom_node *pnode;
+ int value;
(void) textdomain(TEXT_DOMAIN);
@@ -822,6 +824,26 @@ opl_disp_hw_revisions(Sys_tree *tree, Prom_node *root)
log_printf("\n\n", 0);
opl_disp_environ();
+
+ /*
+ * PICL interface needs to be used for system processor mode display.
+ * Check existence of OBP property "SPARC64-VII-mode".
+ * No display if property does not exist.
+ * If property exists then system is in (Jupiter) SPARC64-VII-mode.
+ */
+ value = get_proc_mode();
+
+ if (value == 0) {
+ /* Print the header */
+ log_printf("\n", 0);
+ log_printf("===================", 0);
+ log_printf(gettext(" System Processor Mode "), 0);
+ log_printf("===================", 0);
+ log_printf("\n\n", 0);
+
+ /* Jupiter mode */
+ log_printf("%s\n\n", "SPARC64-VII mode");
+ }
}
/*
diff --git a/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl_picl.c b/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl_picl.c
index 34f406b109..89fbdd516c 100644
--- a/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl_picl.c
+++ b/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl_picl.c
@@ -878,3 +878,35 @@ do_walk(picl_nodehdl_t rooth, const char *classname,
return (PICL_WALK_CONTINUE);
return (err);
}
+
+int
+get_proc_mode(void)
+{
+ picl_nodehdl_t nodeh;
+ picl_prophdl_t proph;
+ picl_errno_t err;
+
+ err = picl_initialize();
+ if (err != PICL_SUCCESS) {
+ (void) log_printf("picl_initialize failed: %s\n",
+ picl_strerror(err));
+ return (err);
+ }
+
+ err = picl_get_node_by_path("/platform", &nodeh);
+ if (err != PICL_SUCCESS) {
+ (void) log_printf("Getting plat node failed: %s\n",
+ picl_strerror(err));
+ return (err);
+ }
+
+ err = picl_get_prop_by_name(nodeh, "SPARC64-VII-mode", &proph);
+ if (err != PICL_SUCCESS) {
+ /* Do not display error message */
+ return (err);
+ }
+
+ (void) picl_shutdown();
+
+ return (err);
+}