mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 08:50:27 +00:00
hv:Replace dynamic memory with static for port io
-- Add emulated port io index -- Add emulated pio array in vm structure -- Remove port list in vm structure -- Remove free_io_emulation_resource/register_io_handler/ create_io_handler APIs v2-->v3: -- not add 'is_emulated', check len == 0U -- Check if io_read/io_write handler is NULL before calling -- Replace ENUM with MACRO for emulated pio index to avoid MISRA-C violations v1-->v2: -- Remove EMUL_PIO_NUM in Kconfig, add emulated pio index for PIC/PCI/UART/RTC/PM Tracked-On: #861 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -9,6 +9,19 @@
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/* Define emulated port IO index */
|
||||
#define PIC_MASTER_PIO_IDX 0U
|
||||
#define PIC_SLAVE_PIO_IDX (PIC_MASTER_PIO_IDX + 1U)
|
||||
#define PIC_ELC_PIO_IDX (PIC_SLAVE_PIO_IDX + 1U)
|
||||
#define PCI_PIO_IDX (PIC_ELC_PIO_IDX + 1U)
|
||||
#define UART_PIO_IDX (PCI_PIO_IDX + 1U)
|
||||
#define PM1A_EVT_PIO_IDX (UART_PIO_IDX + 1U)
|
||||
#define PM1A_CNT_PIO_IDX (PM1A_EVT_PIO_IDX + 1U)
|
||||
#define PM1B_EVT_PIO_IDX (PM1A_CNT_PIO_IDX + 1U)
|
||||
#define PM1B_CNT_PIO_IDX (PM1B_EVT_PIO_IDX + 1U)
|
||||
#define RTC_PIO_IDX (PM1B_CNT_PIO_IDX + 1U)
|
||||
#define EMUL_PIO_IDX_MAX (RTC_PIO_IDX + 1U)
|
||||
|
||||
/* Write 1 byte to specified I/O port */
|
||||
static inline void pio_write8(uint8_t value, uint16_t port)
|
||||
{
|
||||
|
Reference in New Issue
Block a user