aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-01-01 15:42:45 +0100
committerHelge Deller <deller@gmx.de>2022-01-02 19:53:02 +0100
commit187db62f09584263f25961f01aa9a0aecf0da83f (patch)
tree3b7e072c55ebc36b13a11f007e7f8d88b5cfd827
parentb12acac4be27b6d5d9fbe48c4be1286dcc245fbb (diff)
downloadseabios-hppa-187db62f09584263f25961f01aa9a0aecf0da83f.zip
seabios-hppa-187db62f09584263f25961f01aa9a0aecf0da83f.tar.gz
seabios-hppa-187db62f09584263f25961f01aa9a0aecf0da83f.tar.bz2
parisc: Add opt/hostid fw_cfg option to change hostid
Allow the user to select another hostid value. In HP/UX the "uname -i" command shows the number, and in Linux it's visible in the /proc/cpuinfo output. The default hostid number is 2006243326, any other value can be selected with this qemu command line option: -fw_cfg opt/hostid,string=334455 Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/parisc/parisc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 2715c8e..56e68cf 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -839,16 +839,17 @@ static int pdc_pim(unsigned int *arg)
return PDC_BAD_PROC;
}
+static struct pdc_model model = { PARISC_PDC_MODEL };
+
static int pdc_model(unsigned int *arg)
{
- static unsigned long model[] = { PARISC_PDC_MODEL };
static const char model_str[] = PARISC_MODEL;
unsigned long option = ARG1;
unsigned long *result = (unsigned long *)ARG2;
switch (option) {
case PDC_MODEL_INFO:
- memcpy(result, model, sizeof(model));
+ memcpy(result, &model, sizeof(model));
return PDC_OK;
case PDC_MODEL_VERSIONS:
switch (ARG3) {
@@ -866,7 +867,7 @@ static int pdc_model(unsigned int *arg)
return PDC_OK;
case PDC_MODEL_ENSPEC:
case PDC_MODEL_DISPEC:
- if (ARG3 != model[7])
+ if (ARG3 != model.pot_key)
return -20;
return PDC_OK;
case PDC_MODEL_CPU_ID:
@@ -1807,6 +1808,9 @@ void __VISIBLE start_parisc_firmware(void)
/* use -fw_cfg opt/pdc_debug,string=255 to enable all firmware debug infos */
pdc_debug = romfile_loadstring_to_int("opt/pdc_debug", 0);
+ model.sw_id = romfile_loadstring_to_int("opt/hostid", model.sw_id);
+ dprintf(0, "fw_cfg: machine hostid %lu\n", model.sw_id);
+
/* Initialize PAGE0 */
memset((void*)PAGE0, 0, sizeof(*PAGE0));