vuart: add dummy vuart for risc-v

vUART will not enable before VM could be created.

Tracked-On: #8805
Signed-off-by: Fei Li <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Fei Li
2025-09-23 23:57:45 +08:00
committed by acrnsi-robot
parent df5a5f2657
commit f687574a58
3 changed files with 30 additions and 5 deletions

View File

@@ -7,8 +7,21 @@
#ifndef RISCV_VCPU_H #ifndef RISCV_VCPU_H
#define RISCV_VCPU_H #define RISCV_VCPU_H
#include <cpu.h>
#include <io_req.h>
struct acrn_vm;
struct acrn_vcpu { struct acrn_vcpu {
struct acrn_vm *vm; /* Reference to the VM this VCPU belongs to */
struct io_request req; /* used by io/ept emulation */
}; };
static inline uint16_t pcpuid_from_vcpu(__unused const struct acrn_vcpu *vcpu)
{
return INVALID_CPU_ID;
}
#endif /* RISCV_VCPU_H */ #endif /* RISCV_VCPU_H */

View File

@@ -4,11 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#ifndef VM_H_ #ifndef RISCV_VM_H_
#define VM_H_ #define RISCV_VM_H_
#include <vm_configurations.h>
#include <vuart.h>
#include <asm/guest/vcpu.h>
#define INVALID_PIO_IDX -1U
#define UART_PIO_IDX0 INVALID_PIO_IDX
struct acrn_vm { struct acrn_vm {
struct acrn_vuart vuart[MAX_VUART_NUM_PER_VM]; /* Virtual UART */
}; };
/* FIXME: riscv dummy function */ /* FIXME: riscv dummy function */
@@ -17,4 +26,5 @@ static inline bool need_shutdown_vm(uint16_t pcpu_id)
(void)pcpu_id; (void)pcpu_id;
return false; return false;
} }
#endif /* VM_H_ */
#endif /* RISCV_VM_H_ */

View File

@@ -8,7 +8,9 @@
#define CONSOLE_H #define CONSOLE_H
#include <vuart.h> #include <vuart.h>
#include <asm/guest/vcpu.h>
struct acrn_vcpu;
/** Initializes the console module. /** Initializes the console module.
* *