Skip to content

Commit 445c088

Browse files
cjwatsonjkkm
authored andcommitted
parisc: expose 32/64-bit capabilities in cpuinfo
It'd be rather useful for debian-installer if we could get hold of accurate firmware information on whether only 32-bit kernels are supported, only 64-bit kernels, or both; this would allow us to present an accurate menu of kernel packages if more than one is available, rather than the user having to guess. This patch attempts to expose it in cpuinfo. I adjusted pdc_model_capabilities to cope with a potential PDC_INVALID_ARG return as the firmware manual instructs, by assuming 32-bit only. This may be the wrong place for it. I made up user-visible capability names by total fiat and for the moment ignored the other bits that may appear in the capabilities word. I have no PA-RISC machine myself to test on, and no PA experience either, so I rather hope that somebody will kind-heartedly take this and fix it up if needed. I ran it past Dann Frazier on IRC and he said "looks good to me", but I think without testing. Also, this is against the Ubuntu 2.6.28 kernel tree since that's what I had handy and I was a bit tight on disk space to slurp down another tree. Sorry if it's skewed in any relevant way; I'll be happy to adjust if necessary. Thanks in advance! Signed-off-by: Colin Watson <cjwatson@canonical.com> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
1 parent 1152a68 commit 445c088

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎arch/parisc/include/asm/pdc.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
#define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */
5050
#define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */
5151
/* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
52+
#define PDC_MODEL_OS64 (1 << 0)
53+
#define PDC_MODEL_OS32 (1 << 1)
5254
#define PDC_MODEL_IOPDIR_FDC (1 << 2)
5355
#define PDC_MODEL_NVA_MASK (3 << 4)
5456
#define PDC_MODEL_NVA_SUPPORTED (0 << 4)

‎arch/parisc/kernel/firmware.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,11 @@ int pdc_model_capabilities(unsigned long *capabilities)
527527
pdc_result[0] = 0; /* preset zero (call may not be implemented!) */
528528
retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0);
529529
convert_to_wide(pdc_result);
530-
*capabilities = pdc_result[0];
530+
if (retval == PDC_OK) {
531+
*capabilities = pdc_result[0];
532+
} else {
533+
*capabilities = PDC_MODEL_OS32;
534+
}
531535
spin_unlock_irqrestore(&pdc_lock, flags);
532536

533537
return retval;

‎arch/parisc/kernel/processor.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,13 @@ show_cpuinfo (struct seq_file *m, void *v)
364364
boot_cpu_data.cpu_hz / 1000000,
365365
boot_cpu_data.cpu_hz % 1000000 );
366366

367+
seq_printf(m, "capabilities\t:");
368+
if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS32)
369+
seq_printf(m, " os32");
370+
if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS64)
371+
seq_printf(m, " os64");
372+
seq_printf(m, "\n");
373+
367374
seq_printf(m, "model\t\t: %s\n"
368375
"model name\t: %s\n",
369376
boot_cpu_data.pdc.sys_model_name,

0 commit comments

Comments
 (0)