File tree Expand file tree Collapse file tree 7 files changed +22
-23
lines changed Expand file tree Collapse file tree 7 files changed +22
-23
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ int32_t reset_vm(struct acrn_vm *vm)
321
321
}
322
322
323
323
reset_vm_ioreqs (vm );
324
- vioapic_reset (vm_ioapic ( vm ) );
324
+ vioapic_reset (vm );
325
325
destroy_secure_world (vm , false);
326
326
vm -> sworld_control .flag .active = 0UL ;
327
327
ret = 0 ;
Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ static uint8_t vuart_intr_reason(const struct acrn_vuart *vu)
122
122
}
123
123
}
124
124
125
+ struct acrn_vuart * vm_vuart (struct acrn_vm * vm )
126
+ {
127
+ return & (vm -> vuart );
128
+ }
129
+
125
130
/*
126
131
* Toggle the COM port's intr pin depending on whether or not we have an
127
132
* interrupt condition to report to the processor.
Original file line number Diff line number Diff line change 40
40
#define IOAPIC_ID_MASK 0x0f000000U
41
41
#define MASK_ALL_INTERRUPTS 0x0001000000010000UL
42
42
43
+ static inline struct acrn_vioapic * vm_ioapic (const struct acrn_vm * vm )
44
+ {
45
+ return (struct acrn_vioapic * )& (vm -> arch_vm .vioapic );
46
+ }
47
+
43
48
/**
44
49
* @pre pin < vioapic_pincount(vm)
45
50
*/
@@ -495,12 +500,13 @@ vioapic_process_eoi(struct acrn_vm *vm, uint32_t vector)
495
500
}
496
501
497
502
void
498
- vioapic_reset (struct acrn_vioapic * vioapic )
503
+ vioapic_reset (struct acrn_vm * vm )
499
504
{
500
505
uint32_t pin , pincount ;
506
+ struct acrn_vioapic * vioapic = vm_ioapic (vm );
501
507
502
508
/* Initialize all redirection entries to mask all interrupts */
503
- pincount = vioapic_pincount (vioapic -> vm );
509
+ pincount = vioapic_pincount (vm );
504
510
for (pin = 0U ; pin < pincount ; pin ++ ) {
505
511
vioapic -> rtbl [pin ].full = MASK_ALL_INTERRUPTS ;
506
512
}
@@ -514,7 +520,7 @@ vioapic_init(struct acrn_vm *vm)
514
520
vm -> arch_vm .vioapic .vm = vm ;
515
521
spinlock_init (& (vm -> arch_vm .vioapic .mtx ));
516
522
517
- vioapic_reset (vm_ioapic ( vm ) );
523
+ vioapic_reset (vm );
518
524
519
525
(void )register_mmio_emulation_handler (vm ,
520
526
vioapic_mmio_access_handler ,
Original file line number Diff line number Diff line change 33
33
34
34
static void vpic_set_pinstate (struct acrn_vpic * vpic , uint32_t pin , uint8_t level );
35
35
36
+ static inline struct acrn_vpic * vm_pic (const struct acrn_vm * vm )
37
+ {
38
+ return (struct acrn_vpic * )& (vm -> arch_vm .vpic );
39
+ }
40
+
36
41
static inline bool master_pic (const struct acrn_vpic * vpic , const struct i8259_reg_state * i8259 )
37
42
{
38
43
bool ret ;
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ struct acrn_vioapic {
60
60
};
61
61
62
62
void vioapic_init (struct acrn_vm * vm );
63
- void vioapic_reset (struct acrn_vioapic * vioapic );
63
+ void vioapic_reset (struct acrn_vm * vm );
64
64
65
65
66
66
/**
Original file line number Diff line number Diff line change @@ -272,24 +272,6 @@ static inline struct acrn_vcpu *get_primary_vcpu(struct acrn_vm *vm)
272
272
return target_vcpu ;
273
273
}
274
274
275
- static inline struct acrn_vuart *
276
- vm_vuart (struct acrn_vm * vm )
277
- {
278
- return & (vm -> vuart );
279
- }
280
-
281
- static inline struct acrn_vpic *
282
- vm_pic (const struct acrn_vm * vm )
283
- {
284
- return (struct acrn_vpic * )& (vm -> arch_vm .vpic );
285
- }
286
-
287
- static inline struct acrn_vioapic *
288
- vm_ioapic (const struct acrn_vm * vm )
289
- {
290
- return (struct acrn_vioapic * )& (vm -> arch_vm .vioapic );
291
- }
292
-
293
275
int32_t shutdown_vm (struct acrn_vm * vm );
294
276
void pause_vm (struct acrn_vm * vm );
295
277
void resume_vm (struct acrn_vm * vm );
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ struct acrn_vuart {
70
70
extern int8_t vuart_vmid ;
71
71
#endif /* CONFIG_PARTITION_MODE */
72
72
73
+ struct acrn_vuart * vm_vuart (struct acrn_vm * vm );
73
74
void vuart_init (struct acrn_vm * vm );
74
75
struct acrn_vuart * vuart_console_active (void );
75
76
void vuart_console_tx_chars (struct acrn_vuart * vu );
You can’t perform that action at this time.
0 commit comments