[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 45/49] hw/tricore/triboard: Remove unnecessary use of &first_cpu
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 45/49] hw/tricore/triboard: Remove unnecessary use of &first_cpu |
Date: |
Sun, 12 Jan 2025 23:17:21 +0100 |
triboard_machine_init() has access to the single CPU via:
TriBoardMachineState {
TC27XSoCState {
TriCoreCPU cpu;
...
} tc27x_soc;
} ms;
Pass it as argument to tricore_load_kernel() so we can
remove the &first_cpu global use.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <20250110180909.83165-1-philmd@linaro.org>
---
hw/tricore/triboard.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/tricore/triboard.c b/hw/tricore/triboard.c
index 4dba0259cd3..9cc8d282ff2 100644
--- a/hw/tricore/triboard.c
+++ b/hw/tricore/triboard.c
@@ -31,11 +31,10 @@
#include "hw/tricore/triboard.h"
#include "hw/tricore/tc27x_soc.h"
-static void tricore_load_kernel(const char *kernel_filename)
+static void tricore_load_kernel(TriCoreCPU *cpu, const char *kernel_filename)
{
uint64_t entry;
long kernel_size;
- TriCoreCPU *cpu;
CPUTriCoreState *env;
kernel_size = load_elf(kernel_filename, NULL,
@@ -46,7 +45,6 @@ static void tricore_load_kernel(const char *kernel_filename)
error_report("no kernel file '%s'", kernel_filename);
exit(1);
}
- cpu = TRICORE_CPU(first_cpu);
env = &cpu->env;
env->PC = entry;
}
@@ -62,7 +60,7 @@ static void triboard_machine_init(MachineState *machine)
sysbus_realize(SYS_BUS_DEVICE(&ms->tc27x_soc), &error_fatal);
if (machine->kernel_filename) {
- tricore_load_kernel(machine->kernel_filename);
+ tricore_load_kernel(&ms->tc27x_soc.cpu, machine->kernel_filename);
}
}
--
2.47.1
- [PULL 36/49] tests: Add functional tests for HPPA machines, (continued)
- [PULL 36/49] tests: Add functional tests for HPPA machines, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 30/49] tests/qtest/libqos: Reuse TYPE_IMX_I2C define, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 37/49] target/hppa: Convert hppa_cpu_init() to ResetHold handler, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 38/49] hw/hppa: Reset vCPUs calling resettable_reset(), Philippe Mathieu-Daudé, 2025/01/12
- [PULL 39/49] target/hppa: Only set PSW 'M' bit on reset, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 40/49] target/hppa: Set PC on vCPU reset, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 41/49] target/hppa: Speed up hppa_is_pa20(), Philippe Mathieu-Daudé, 2025/01/12
- [PULL 42/49] hw/loongarch/virt: Checkpatch cleanup, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 43/49] backends/cryptodev-vhost-user: Fix local_error leaks, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 44/49] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 45/49] hw/tricore/triboard: Remove unnecessary use of &first_cpu,
Philippe Mathieu-Daudé <=
- [PULL 46/49] MAINTAINERS: remove myself from sbsa-ref, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 47/49] MAINTAINERS: Add me as the maintainer for ivshmem-flat, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 48/49] MAINTAINERS: Update path to coreaudio.m, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 49/49] Add a b4 configuration file, Philippe Mathieu-Daudé, 2025/01/12
- Re: [PULL 00/49] Misc HW patches for 2025-01-12, Philippe Mathieu-Daudé, 2025/01/13