diff options
author | Keir Fraser <keir@xensource.com> | 2007-10-03 16:33:23 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-10-03 16:33:23 +0100 |
commit | 49f9842b3227ade7359735546a32f025e696b085 (patch) | |
tree | 0f717f384c44ee13944e67149b6fe8f6f1149a9e /xen/arch/x86/hvm/vioapic.c | |
parent | fe210320d95598b2d990eea420ecc1a5fc315f00 (diff) | |
download | xen-49f9842b3227ade7359735546a32f025e696b085.tar.gz xen-49f9842b3227ade7359735546a32f025e696b085.tar.bz2 xen-49f9842b3227ade7359735546a32f025e696b085.zip |
hvm: More changes to reduce size of domain structure.
It is now smaller than a page (4kB) on x86/32 and x86/64.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/hvm/vioapic.c')
-rw-r--r-- | xen/arch/x86/hvm/vioapic.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index c6faba3490..bb8e178a31 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -300,8 +300,7 @@ static uint32_t ioapic_get_delivery_bitmask( static inline int pit_channel0_enabled(void) { PITState *pit = ¤t->domain->arch.hvm_domain.pl_time.vpit; - struct periodic_time *pt = &pit->pt[0]; - return pt->enabled; + return pit->pt0.enabled; } static void vioapic_deliver(struct hvm_hw_vioapic *vioapic, int irq) @@ -517,13 +516,27 @@ static int ioapic_load(struct domain *d, hvm_domain_context_t *h) HVM_REGISTER_SAVE_RESTORE(IOAPIC, ioapic_save, ioapic_load, 1, HVMSR_PER_DOM); -void vioapic_init(struct domain *d) +int vioapic_init(struct domain *d) { - struct hvm_hw_vioapic *vioapic = domain_vioapic(d); + struct hvm_vioapic *vioapic; int i; - memset(vioapic, 0, sizeof(*vioapic)); + vioapic = d->arch.hvm_domain.vioapic = xmalloc(struct hvm_vioapic); + if ( vioapic == NULL ) + return -ENOMEM; + + vioapic->domain = d; + + memset(&vioapic->hvm_hw_vioapic, 0, sizeof(vioapic->hvm_hw_vioapic)); for ( i = 0; i < VIOAPIC_NUM_PINS; i++ ) - vioapic->redirtbl[i].fields.mask = 1; - vioapic->base_address = VIOAPIC_DEFAULT_BASE_ADDRESS; + vioapic->hvm_hw_vioapic.redirtbl[i].fields.mask = 1; + vioapic->hvm_hw_vioapic.base_address = VIOAPIC_DEFAULT_BASE_ADDRESS; + + return 0; +} + +void vioapic_deinit(struct domain *d) +{ + xfree(d->arch.hvm_domain.vioapic); + d->arch.hvm_domain.vioapic = NULL; } |