Author: blueswirl Date: 2008-12-28 15:04:49 +0100 (Sun, 28 Dec 2008) New Revision: 328
Modified: openbios-devel/arch/ppc/qemu/init.c Log: Add CPU reg node from PIR if available
Modified: openbios-devel/arch/ppc/qemu/init.c =================================================================== --- openbios-devel/arch/ppc/qemu/init.c 2008-12-28 13:34:52 UTC (rev 327) +++ openbios-devel/arch/ppc/qemu/init.c 2008-12-28 14:04:49 UTC (rev 328) @@ -229,26 +229,50 @@ fword("encode-string"); push_str("state"); fword("property"); +}
- fword("finish-device"); +static void +cpu_add_pir_property(void) +{ + unsigned long pir; + + asm("mfspr %0, 1023\n" + : "=r"(pir) :); + PUSH(pir); + fword("encode-int"); + push_str("reg"); + fword("property"); }
static void cpu_604_init(const struct cpudef *cpu) { cpu_generic_init(cpu); + cpu_add_pir_property(); + + fword("finish-device"); }
static void cpu_750_init(const struct cpudef *cpu) { cpu_generic_init(cpu); + + PUSH(0); + fword("encode-int"); + push_str("reg"); + fword("property"); + + fword("finish-device"); }
static void cpu_g4_init(const struct cpudef *cpu) { cpu_generic_init(cpu); + cpu_add_pir_property(); + + fword("finish-device"); }
static const struct cpudef ppc_defs[] = {