Skip to content

Commit

Permalink
[IA64] Format /proc/pal/*/version_info correctly
Browse files Browse the repository at this point in the history
/proc/pal/*/version_info is a bit confusing.  HP firmware, at least,
reports 07.31 instead of 0.7.31.  Also, the comment is out of place;
it's an internal detail about the implementation of ia64_pal_version.
Since the 2.2 revision of the SDM still states that PAL_VERSION can
be called in virtual mode, correct the comment to be more accurate.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Matthew Wilcox authored and Tony Luck committed Jul 31, 2006
1 parent b6ff508 commit 1bf1eba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
34 changes: 14 additions & 20 deletions arch/ia64/kernel/palinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,29 +566,23 @@ version_info(char *page)
pal_version_u_t min_ver, cur_ver;
char *p = page;

/* The PAL_VERSION call is advertised as being able to support
* both physical and virtual mode calls. This seems to be a documentation
* bug rather than firmware bug. In fact, it does only support physical mode.
* So now the code reflects this fact and the pal_version() has been updated
* accordingly.
*/
if (ia64_pal_version(&min_ver, &cur_ver) != 0) return 0;
if (ia64_pal_version(&min_ver, &cur_ver) != 0)
return 0;

p += sprintf(p,
"PAL_vendor : 0x%02x (min=0x%02x)\n"
"PAL_A : %x.%x.%x (min=%x.%x.%x)\n"
"PAL_B : %x.%x.%x (min=%x.%x.%x)\n",
cur_ver.pal_version_s.pv_pal_vendor, min_ver.pal_version_s.pv_pal_vendor,

cur_ver.pal_version_s.pv_pal_a_model>>4,
cur_ver.pal_version_s.pv_pal_a_model&0xf, cur_ver.pal_version_s.pv_pal_a_rev,
min_ver.pal_version_s.pv_pal_a_model>>4,
min_ver.pal_version_s.pv_pal_a_model&0xf, min_ver.pal_version_s.pv_pal_a_rev,

cur_ver.pal_version_s.pv_pal_b_model>>4,
cur_ver.pal_version_s.pv_pal_b_model&0xf, cur_ver.pal_version_s.pv_pal_b_rev,
min_ver.pal_version_s.pv_pal_b_model>>4,
min_ver.pal_version_s.pv_pal_b_model&0xf, min_ver.pal_version_s.pv_pal_b_rev);
"PAL_A : %02x.%02x (min=%02x.%02x)\n"
"PAL_B : %02x.%02x (min=%02x.%02x)\n",
cur_ver.pal_version_s.pv_pal_vendor,
min_ver.pal_version_s.pv_pal_vendor,
cur_ver.pal_version_s.pv_pal_a_model,
cur_ver.pal_version_s.pv_pal_a_rev,
min_ver.pal_version_s.pv_pal_a_model,
min_ver.pal_version_s.pv_pal_a_rev,
cur_ver.pal_version_s.pv_pal_b_model,
cur_ver.pal_version_s.pv_pal_b_rev,
min_ver.pal_version_s.pv_pal_b_model,
min_ver.pal_version_s.pv_pal_b_rev);
return p - page;
}

Expand Down
7 changes: 6 additions & 1 deletion include/asm-ia64/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,12 @@ typedef union pal_version_u {
} pal_version_u_t;


/* Return PAL version information */
/*
* Return PAL version information. While the documentation states that
* PAL_VERSION can be called in either physical or virtual mode, some
* implementations only allow physical calls. We don't call it very often,
* so the overhead isn't worth eliminating.
*/
static inline s64
ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
{
Expand Down

0 comments on commit 1bf1eba

Please sign in to comment.