On 10/9/25 23:18, Philippe Mathieu-Daudé wrote:
Current code uses CPUHPPAState::@kernel_entry to hold either:
- kernel entry virtual address
- firmware interactive mode
and CPUHPPAState::@cmdline_or_bootorder to either:
- kernel &cmdline physical address
- firmware boot order
Besides, these variables don't belong to CPUHPPAState, they
depend on how the machine is started, and only apply to the
first CPU.
The MachineReset handler initialize some registers of the
first CPU. Hold these register reset values in the MachineState,
initializing them once in machine_HP_common_init_tail().
Start by addressing the kernel entry and firmware interactive
mode values, stored in $GP25.
Suggested-by: Richard Henderson <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
target/hppa/cpu.h | 1 -
hw/hppa/machine.c | 28 ++++++++++++++++------------
2 files changed, 16 insertions(+), 13 deletions(-)
Reviewed-by: Richard Henderson <[email protected]>
- }
-
- if (!kernel_entry) {
+ } else {
/* When booting via firmware, tell firmware if we want interactive
- * mode (kernel_entry=1), and to boot from CD
(cmdline_or_bootorder='d')
+ * mode (interactive_mode=1), and to boot from CD
(cmdline_or_bootorder='d')
* or hard disc (cmdline_or_bootorder='c').
*/
- kernel_entry = machine->boot_config.has_menu ?
machine->boot_config.menu : 0;
+ hms->boot_info.gr25 = machine->boot_config.has_menu
+ ? machine->boot_config.menu
+ : 0;
There is no interactive_mode variable, so the change to the comment isn't great. Perhaps
just mention gr25.
As an aside, the expression involves two booleans, so better written as
machine->boot_config.has_menu && machine->boot_config.menu
r~