From 7b3ce2d227aa2d8fec507f52e372478ebfc69f47 Mon Sep 17 00:00:00 2001 From: Aras Ashraf Gandomi Date: Tue, 17 Mar 2026 02:32:57 +0100 Subject: [PATCH 1/2] fix(deps): Reduced remio_assign_vm_cpus interface This change also allows to remove vm.h from inclusion path. Signed-off-by: Aras Ashraf Gandomi --- src/core/inc/remio.h | 4 ++-- src/core/remio.c | 6 +++--- src/core/vm.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/inc/remio.h b/src/core/inc/remio.h index 6079036bb..dc38ff898 100644 --- a/src/core/inc/remio.h +++ b/src/core/inc/remio.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include /** * @struct remio_shmem @@ -64,7 +64,7 @@ void remio_init(void); * one with the lowest ID, since only one CPU is required to inject VM interrupts * @param vm Pointer to the VM structure */ -void remio_assign_vm_cpus(struct vm* vm); +void remio_assign_vm_cpus(vmid_t vmid); /** * @brief Remote I/O hypercall callback diff --git a/src/core/remio.c b/src/core/remio.c index 9921b18ef..146e817b6 100644 --- a/src/core/remio.c +++ b/src/core/remio.c @@ -406,13 +406,13 @@ void remio_init(void) } } -void remio_assign_vm_cpus(struct vm* vm) +void remio_assign_vm_cpus(vmid_t vmid) { list_foreach (remio_device_list, struct remio_device, dev) { - if (vm->id == dev->config.backend.vm_id) { + if (vmid == dev->config.backend.vm_id) { dev->config.backend.cpu_id = min(dev->config.backend.cpu_id, cpu()->id); dev->config.backend.ready = true; - } else if (vm->id == dev->config.frontend.vm_id) { + } else if (vmid == dev->config.frontend.vm_id) { dev->config.frontend.cpu_id = min(dev->config.frontend.cpu_id, cpu()->id); dev->config.frontend.ready = true; } diff --git a/src/core/vm.c b/src/core/vm.c index 003a6093a..cda9e1772 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -285,7 +285,7 @@ static void vm_init_remio(struct vm* vm, const struct vm_config* vm_config) struct remio_dev* remio_dev = &vm_config->platform.remio_devs[i]; vm_init_remio_dev(vm, remio_dev); } - remio_assign_vm_cpus(vm); + remio_assign_vm_cpus(vm->id); } static struct vm* vm_allocation_init(struct vm_allocation* vm_alloc) From 9a61e52b43fc3a9266337ea25567829e3ad7acc2 Mon Sep 17 00:00:00 2001 From: Aras Ashraf Gandomi Date: Tue, 24 Mar 2026 01:07:01 +0100 Subject: [PATCH 2/2] fix(deps): Make console_write() static Motivation: console_write is not used output of console.c. Signed-off-by: Aras Ashraf Gandomi --- src/core/console.c | 2 +- src/core/inc/console.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/console.c b/src/core/console.c index 83732bf76..b8b035a26 100644 --- a/src/core/console.c +++ b/src/core/console.c @@ -39,7 +39,7 @@ void console_init(void) cpu_sync_and_clear_msgs(&cpu_glb_sync); } -void console_write(const char* buf, size_t n) +static void console_write(const char* buf, size_t n) { while (!console_ready) ; diff --git a/src/core/inc/console.h b/src/core/inc/console.h index 6a9d7601d..bee519f03 100644 --- a/src/core/inc/console.h +++ b/src/core/inc/console.h @@ -6,10 +6,9 @@ #ifndef __CONSOLE_H__ #define __CONSOLE_H__ -#include +#include void console_init(void); -void console_write(const char* buf, size_t n); void console_printk(const char* fmt, ...); #endif /* __CONSOLE_H__ */