mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-01 08:56:55 +00:00
hv:Replace dynamic memory with static for ptdev
-- Config MAX_PT_IRQ_ENTRIES 64 in Kconfig -- Remove ptdev list -- Add alloc_ptdev_entry_id api v3-->v4: -- move is_entry_active from assign.c to ptdev.h -- Add clear active flag in release_entry v2-->v3: -- Remove redundancy active check for ptdev entry in release_all_entries and get_ptdev_info v1-->v2: -- split to small patches Tracked-On: #861 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Reviewed-by: Binbin Wu <binbin.wu@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
#define PTDEV_INTR_MSI (1U << 0U)
|
||||
#define PTDEV_INTR_INTX (1U << 1U)
|
||||
|
||||
#define INVALID_PTDEV_ENTRY_ID 0xffffU
|
||||
|
||||
enum ptdev_vpin_source {
|
||||
PTDEV_VPIN_IOAPIC,
|
||||
PTDEV_VPIN_PIC,
|
||||
@@ -51,6 +53,7 @@ struct ptdev_msi_info {
|
||||
* with interrupt handler and softirq.
|
||||
*/
|
||||
struct ptdev_remapping_info {
|
||||
uint16_t ptdev_entry_id;
|
||||
uint32_t intr_type;
|
||||
union source_id phys_sid;
|
||||
union source_id virt_sid;
|
||||
@@ -59,16 +62,16 @@ struct ptdev_remapping_info {
|
||||
uint32_t allocated_pirq;
|
||||
uint32_t polarity; /* 0=active high, 1=active low*/
|
||||
struct list_head softirq_node;
|
||||
struct list_head entry_node;
|
||||
struct ptdev_msi_info msi;
|
||||
|
||||
uint64_t intr_count;
|
||||
struct hv_timer intr_delay_timer; /* used for delay intr injection */
|
||||
};
|
||||
|
||||
extern struct list_head ptdev_list;
|
||||
extern struct ptdev_remapping_info ptdev_irq_entries[];
|
||||
extern spinlock_t ptdev_lock;
|
||||
|
||||
bool is_entry_active(const struct ptdev_remapping_info *entry);
|
||||
void ptdev_softirq(uint16_t pcpu_id);
|
||||
void ptdev_init(void);
|
||||
void ptdev_release_all_entries(const struct acrn_vm *vm);
|
||||
|
Reference in New Issue
Block a user