diff mbox series

[4/4] alpha: Provide console information to the PALcode at start-up.

Message ID 20210613211549.18094-5-thorpej@me.com (mailing list archive)
State New, archived
Headers show
Series Emulator fixes to enable running NetBSD/alpha | expand

Commit Message

Jason Thorpe June 13, 2021, 9:15 p.m. UTC
Redefine the a2 register passed by Qemu at start-up to also include
some configuration flags, in addition to the CPU count, and define
a flag to mirror the "-nographics" option.

Signed-off-by: Jason Thorpe <thorpej@me.com>
---
 hw/alpha/dp264.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Richard Henderson June 15, 2021, 4:08 a.m. UTC | #1
On 6/13/21 2:15 PM, Jason Thorpe wrote:
> Redefine the a2 register passed by Qemu at start-up to also include
> some configuration flags, in addition to the CPU count, and define
> a flag to mirror the "-nographics" option.
> 
> Signed-off-by: Jason Thorpe <thorpej@me.com>
> ---
>   hw/alpha/dp264.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index ac97104464..d86dcb1d81 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -72,9 +72,20 @@ static void clipper_init(MachineState *machine)
>           cpus[i] = ALPHA_CPU(cpu_create(machine->cpu_type));
>       }
>   
> +    /* arg0 -> memory size
> +       arg1 -> kernel entry point
> +       arg2 -> config word
> +
> +       Config word: bits 0-5 -> ncpus
> +                    bit  6   -> nographics option (for HWRPB CTB)
> +
> +       See init_hwrpb() in the PALcode.  */
> +
>       cpus[0]->env.trap_arg0 = ram_size;
>       cpus[0]->env.trap_arg1 = 0;
>       cpus[0]->env.trap_arg2 = smp_cpus;
> +    if (!machine->enable_graphics)
> +      cpus[0]->env.trap_arg2 |= (1 << 6);

Thanks, I have fixed up the style problems and queued.


r~
diff mbox series

Patch

diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index ac97104464..d86dcb1d81 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -72,9 +72,20 @@  static void clipper_init(MachineState *machine)
         cpus[i] = ALPHA_CPU(cpu_create(machine->cpu_type));
     }
 
+    /* arg0 -> memory size
+       arg1 -> kernel entry point
+       arg2 -> config word
+
+       Config word: bits 0-5 -> ncpus
+                    bit  6   -> nographics option (for HWRPB CTB)
+
+       See init_hwrpb() in the PALcode.  */
+
     cpus[0]->env.trap_arg0 = ram_size;
     cpus[0]->env.trap_arg1 = 0;
     cpus[0]->env.trap_arg2 = smp_cpus;
+    if (!machine->enable_graphics)
+      cpus[0]->env.trap_arg2 |= (1 << 6);
 
     /* Init the chipset.  Because we're using CLIPPER IRQ mappings,
        the minimum PCI device IdSel is 1.  */