|
8 | 8 | #include <softirq.h>
|
9 | 9 | #include <ptdev.h>
|
10 | 10 | #include <irq.h>
|
11 |
| -#include <atomic.h> |
12 | 11 | #include <logmsg.h>
|
13 | 12 |
|
14 | 13 | #define PTIRQ_BITMAP_ARRAY_SIZE INT_DIV_ROUNDUP(CONFIG_MAX_PT_IRQ_ENTRIES, 64U)
|
15 | 14 | struct ptirq_remapping_info ptirq_entries[CONFIG_MAX_PT_IRQ_ENTRIES];
|
16 | 15 | static uint64_t ptirq_entry_bitmaps[PTIRQ_BITMAP_ARRAY_SIZE];
|
17 | 16 | spinlock_t ptdev_lock;
|
18 | 17 |
|
19 |
| -bool is_entry_active(const struct ptirq_remapping_info *entry) |
20 |
| -{ |
21 |
| - return atomic_load32(&entry->active) == ACTIVE_FLAG; |
22 |
| -} |
23 |
| - |
24 | 18 | static inline uint16_t ptirq_alloc_entry_id(void)
|
25 | 19 | {
|
26 | 20 | uint16_t id = (uint16_t)ffz64_ex(ptirq_entry_bitmaps, CONFIG_MAX_PT_IRQ_ENTRIES);
|
@@ -100,7 +94,7 @@ struct ptirq_remapping_info *ptirq_alloc_entry(struct acrn_vm *vm, uint32_t intr
|
100 | 94 |
|
101 | 95 | initialize_timer(&entry->intr_delay_timer, ptirq_intr_delay_callback, entry, 0UL, 0, 0UL);
|
102 | 96 |
|
103 |
| - atomic_clear32(&entry->active, ACTIVE_FLAG); |
| 97 | + entry->active = false; |
104 | 98 | } else {
|
105 | 99 | pr_err("Alloc ptdev irq entry failed");
|
106 | 100 | }
|
@@ -167,15 +161,15 @@ int32_t ptirq_activate_entry(struct ptirq_remapping_info *entry, uint32_t phys_i
|
167 | 161 | pr_err("request irq failed, please check!, phys-irq=%d", phys_irq);
|
168 | 162 | } else {
|
169 | 163 | entry->allocated_pirq = (uint32_t)retval;
|
170 |
| - atomic_set32(&entry->active, ACTIVE_FLAG); |
| 164 | + entry->active = true; |
171 | 165 | }
|
172 | 166 |
|
173 | 167 | return retval;
|
174 | 168 | }
|
175 | 169 |
|
176 | 170 | void ptirq_deactivate_entry(struct ptirq_remapping_info *entry)
|
177 | 171 | {
|
178 |
| - atomic_clear32(&entry->active, ACTIVE_FLAG); |
| 172 | + entry->active = false; |
179 | 173 | free_irq(entry->allocated_pirq);
|
180 | 174 | }
|
181 | 175 |
|
|
0 commit comments