ia64/xen-unstable

view xen/include/asm-x86/vmx_vioapic.h @ 7815:00aa8e4609e2

Properly declare ioapic_update_EOI().

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Nov 15 11:28:33 2005 +0100 (2005-11-15)
parents c405c0d1b49b
children
line source
1 /*
2 *
3 * Copyright (C) 2001 MandrakeSoft S.A.
4 *
5 * MandrakeSoft S.A.
6 * 43, rue d'Aboukir
7 * 75002 Paris - France
8 * http://www.linux-mandrake.com/
9 * http://www.mandrakesoft.com/
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
26 #ifndef _IOAPIC_H_
27 #define _IOAPIC_H_
29 #include <xen/config.h>
30 #include <xen/types.h>
31 #include <xen/smp.h>
33 #ifndef __ia64__
34 #define IOAPIC_VERSION_ID 0x11
35 #else
36 #define IOAPIC_VERSION_ID 0x21
37 #endif
39 #define IOAPIC_NUM_PINS 24
40 #define MAX_LAPIC_NUM 32
42 #define IOAPIC_LEVEL_TRIGGER 1
44 #define IOAPIC_DEFAULT_BASE_ADDRESS 0xfec00000
45 #define IOAPIC_MEM_LENGTH 0x100
47 #define IOAPIC_ENABLE_MASK 0x0
48 #define IOAPIC_ENABLE_FLAG (1 << IOAPIC_ENABLE_MASK)
49 #define IOAPICEnabled(s) (s->flags & IOAPIC_ENABLE_FLAG)
51 #define IOAPIC_REG_SELECT 0x0
52 #define IOAPIC_REG_WINDOW 0x10
54 #ifdef __ia64__
55 #define IOAPIC_REG_ASSERTION 0x20
56 #define IOAPIC_REG_EOI 0x40
57 #endif
59 #ifndef __ia64__
60 #define IOAPIC_REG_APIC_ID 0x0
61 #define IOAPIC_REG_ARB_ID 0x2
62 #endif
64 #define IOAPIC_REG_VERSION 0x1
66 typedef union RedirStatus
67 {
68 uint64_t value;
69 struct {
70 uint8_t vector;
71 uint8_t deliver_mode:3;
72 uint8_t destmode:1;
73 uint8_t delivestatus:1;
74 uint8_t polarity:1;
75 uint8_t remoteirr:1;
76 uint8_t trigmod:1;
77 uint8_t mask:1; /* interrupt mask*/
78 uint8_t reserve:7;
79 #ifndef __ia64__
80 uint8_t reserved[4];
81 uint8_t dest_id;
82 #else
83 uint8_t reserved[3];
84 uint16_t dest_id;
85 #endif
86 } RedirForm;
87 } RedirStatus;
89 #define IOAPIC_MEM_LENGTH 0x100
90 #define IOAPIC_ENABLE_MASK 0x0
91 #define IOAPIC_ENABLE_FLAG (1 << IOAPIC_ENABLE_MASK)
92 #define MAX_LAPIC_NUM 32
94 typedef struct vmx_vioapic {
95 uint32_t irr;
96 uint32_t isr; /* This is used for level trigger */
97 uint32_t imr;
98 uint32_t ioregsel;
99 uint32_t flags;
100 uint32_t lapic_count;
101 uint32_t id;
102 uint32_t arb_id;
103 unsigned long base_address;
104 RedirStatus redirtbl[IOAPIC_NUM_PINS];
105 struct vlapic *lapic_info[MAX_LAPIC_NUM];
106 struct domain *domain;
107 } vmx_vioapic_t;
109 vmx_vioapic_t *vmx_vioapic_init(struct domain *d);
111 void vmx_vioapic_do_irqs_clear(struct domain *d, uint16_t irqs);
112 void vmx_vioapic_do_irqs(struct domain *d, uint16_t irqs);
113 void vmx_vioapic_set_irq(struct domain *d, int irq, int level);
115 int vmx_vioapic_add_lapic(struct vlapic *vlapic, struct vcpu *v);
117 void ioapic_update_EOI(struct domain *d, int vector);
119 #ifdef VMX_DOMAIN_SAVE_RESTORE
120 void ioapic_save(QEMUFile* f, void* opaque);
121 int ioapic_load(QEMUFile* f, void* opaque, int version_id);
122 #endif
124 #endif