4 * Copyright (c) 2004-2005 Fabrice Bellard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>
19 #include "qemu/osdep.h"
20 #include "qemu/thread.h"
21 #include "qemu/error-report.h"
22 #include "hw/i386/apic_internal.h"
23 #include "hw/i386/apic.h"
24 #include "hw/intc/ioapic.h"
25 #include "hw/intc/i8259.h"
26 #include "hw/intc/kvm_irqcount.h"
27 #include "hw/pci/msi.h"
28 #include "qemu/host-utils.h"
29 #include "sysemu/kvm.h"
31 #include "hw/i386/apic-msidef.h"
32 #include "qapi/error.h"
33 #include "qom/object.h"
36 #define MAX_APIC_WORDS 8
38 #define SYNC_FROM_VAPIC 0x1
39 #define SYNC_TO_VAPIC 0x2
40 #define SYNC_ISR_IRR_TO_VAPIC 0x4
42 static APICCommonState
*local_apics
[MAX_APICS
+ 1];
44 #define TYPE_APIC "apic"
45 /*This is reusing the APICCommonState typedef from APIC_COMMON */
46 DECLARE_INSTANCE_CHECKER(APICCommonState
, APIC
,
49 static void apic_set_irq(APICCommonState
*s
, int vector_num
, int trigger_mode
);
50 static void apic_update_irq(APICCommonState
*s
);
51 static void apic_get_delivery_bitmask(uint32_t *deliver_bitmask
,
52 uint8_t dest
, uint8_t dest_mode
);
54 /* Find first bit starting from msb */
55 static int apic_fls_bit(uint32_t value
)
57 return 31 - clz32(value
);
60 /* Find first bit starting from lsb */
61 static int apic_ffs_bit(uint32_t value
)
66 static inline void apic_reset_bit(uint32_t *tab
, int index
)
70 mask
= 1 << (index
& 0x1f);
74 /* return -1 if no bit is set */
75 static int get_highest_priority_int(uint32_t *tab
)
78 for (i
= 7; i
>= 0; i
--) {
80 return i
* 32 + apic_fls_bit(tab
[i
]);
86 static void apic_sync_vapic(APICCommonState
*s
, int sync_type
)
88 VAPICState vapic_state
;
93 if (!s
->vapic_paddr
) {
96 if (sync_type
& SYNC_FROM_VAPIC
) {
97 cpu_physical_memory_read(s
->vapic_paddr
, &vapic_state
,
99 s
->tpr
= vapic_state
.tpr
;
101 if (sync_type
& (SYNC_TO_VAPIC
| SYNC_ISR_IRR_TO_VAPIC
)) {
102 start
= offsetof(VAPICState
, isr
);
103 length
= offsetof(VAPICState
, enabled
) - offsetof(VAPICState
, isr
);
105 if (sync_type
& SYNC_TO_VAPIC
) {
106 assert(qemu_cpu_is_self(CPU(s
->cpu
)));
108 vapic_state
.tpr
= s
->tpr
;
109 vapic_state
.enabled
= 1;
111 length
= sizeof(VAPICState
);
114 vector
= get_highest_priority_int(s
->isr
);
118 vapic_state
.isr
= vector
& 0xf0;
120 vapic_state
.zero
= 0;
122 vector
= get_highest_priority_int(s
->irr
);
126 vapic_state
.irr
= vector
& 0xff;
128 address_space_write_rom(&address_space_memory
,
129 s
->vapic_paddr
+ start
,
130 MEMTXATTRS_UNSPECIFIED
,
131 ((void *)&vapic_state
) + start
, length
);
135 static void apic_vapic_base_update(APICCommonState
*s
)
137 apic_sync_vapic(s
, SYNC_TO_VAPIC
);
140 static void apic_local_deliver(APICCommonState
*s
, int vector
)
142 uint32_t lvt
= s
->lvt
[vector
];
145 trace_apic_local_deliver(vector
, (lvt
>> 8) & 7);
147 if (lvt
& APIC_LVT_MASKED
)
150 switch ((lvt
>> 8) & 7) {
152 cpu_interrupt(CPU(s
->cpu
), CPU_INTERRUPT_SMI
);
156 cpu_interrupt(CPU(s
->cpu
), CPU_INTERRUPT_NMI
);
160 cpu_interrupt(CPU(s
->cpu
), CPU_INTERRUPT_HARD
);
164 trigger_mode
= APIC_TRIGGER_EDGE
;
165 if ((vector
== APIC_LVT_LINT0
|| vector
== APIC_LVT_LINT1
) &&
166 (lvt
& APIC_LVT_LEVEL_TRIGGER
))
167 trigger_mode
= APIC_TRIGGER_LEVEL
;
168 apic_set_irq(s
, lvt
& 0xff, trigger_mode
);
172 void apic_deliver_pic_intr(DeviceState
*dev
, int level
)
174 APICCommonState
*s
= APIC(dev
);
177 apic_local_deliver(s
, APIC_LVT_LINT0
);
179 uint32_t lvt
= s
->lvt
[APIC_LVT_LINT0
];
181 switch ((lvt
>> 8) & 7) {
183 if (!(lvt
& APIC_LVT_LEVEL_TRIGGER
))
185 apic_reset_bit(s
->irr
, lvt
& 0xff);
194 static void apic_external_nmi(APICCommonState
*s
)
196 apic_local_deliver(s
, APIC_LVT_LINT1
);
199 #define foreach_apic(apic, deliver_bitmask, code) \
202 for(__i = 0; __i < MAX_APIC_WORDS; __i++) {\
203 uint32_t __mask = deliver_bitmask[__i];\
205 for(__j = 0; __j < 32; __j++) {\
206 if (__mask & (1U << __j)) {\
207 apic = local_apics[__i * 32 + __j];\
217 static void apic_bus_deliver(const uint32_t *deliver_bitmask
,
218 uint8_t delivery_mode
, uint8_t vector_num
,
219 uint8_t trigger_mode
)
221 APICCommonState
*apic_iter
;
223 switch (delivery_mode
) {
225 /* XXX: search for focus processor, arbitration */
229 for(i
= 0; i
< MAX_APIC_WORDS
; i
++) {
230 if (deliver_bitmask
[i
]) {
231 d
= i
* 32 + apic_ffs_bit(deliver_bitmask
[i
]);
236 apic_iter
= local_apics
[d
];
238 apic_set_irq(apic_iter
, vector_num
, trigger_mode
);
248 foreach_apic(apic_iter
, deliver_bitmask
,
249 cpu_interrupt(CPU(apic_iter
->cpu
), CPU_INTERRUPT_SMI
)
254 foreach_apic(apic_iter
, deliver_bitmask
,
255 cpu_interrupt(CPU(apic_iter
->cpu
), CPU_INTERRUPT_NMI
)
260 /* normal INIT IPI sent to processors */
261 foreach_apic(apic_iter
, deliver_bitmask
,
262 cpu_interrupt(CPU(apic_iter
->cpu
),
268 /* handled in I/O APIC code */
275 foreach_apic(apic_iter
, deliver_bitmask
,
276 apic_set_irq(apic_iter
, vector_num
, trigger_mode
) );
279 void apic_deliver_irq(uint8_t dest
, uint8_t dest_mode
, uint8_t delivery_mode
,
280 uint8_t vector_num
, uint8_t trigger_mode
)
282 uint32_t deliver_bitmask
[MAX_APIC_WORDS
];
284 trace_apic_deliver_irq(dest
, dest_mode
, delivery_mode
, vector_num
,
287 apic_get_delivery_bitmask(deliver_bitmask
, dest
, dest_mode
);
288 apic_bus_deliver(deliver_bitmask
, delivery_mode
, vector_num
, trigger_mode
);
291 static void apic_set_base(APICCommonState
*s
, uint64_t val
)
293 s
->apicbase
= (val
& 0xfffff000) |
294 (s
->apicbase
& (MSR_IA32_APICBASE_BSP
| MSR_IA32_APICBASE_ENABLE
));
295 /* if disabled, cannot be enabled again */
296 if (!(val
& MSR_IA32_APICBASE_ENABLE
)) {
297 s
->apicbase
&= ~MSR_IA32_APICBASE_ENABLE
;
298 cpu_clear_apic_feature(&s
->cpu
->env
);
299 s
->spurious_vec
&= ~APIC_SV_ENABLE
;
303 static void apic_set_tpr(APICCommonState
*s
, uint8_t val
)
305 /* Updates from cr8 are ignored while the VAPIC is active */
306 if (!s
->vapic_paddr
) {
312 int apic_get_highest_priority_irr(DeviceState
*dev
)
320 s
= APIC_COMMON(dev
);
321 return get_highest_priority_int(s
->irr
);
324 static uint8_t apic_get_tpr(APICCommonState
*s
)
326 apic_sync_vapic(s
, SYNC_FROM_VAPIC
);
330 int apic_get_ppr(APICCommonState
*s
)
335 isrv
= get_highest_priority_int(s
->isr
);
346 static int apic_get_arb_pri(APICCommonState
*s
)
348 /* XXX: arbitration */
354 * <0 - low prio interrupt,
356 * >0 - interrupt number
358 static int apic_irq_pending(APICCommonState
*s
)
362 if (!(s
->spurious_vec
& APIC_SV_ENABLE
)) {
366 irrv
= get_highest_priority_int(s
->irr
);
370 ppr
= apic_get_ppr(s
);
371 if (ppr
&& (irrv
& 0xf0) <= (ppr
& 0xf0)) {
378 /* signal the CPU if an irq is pending */
379 static void apic_update_irq(APICCommonState
*s
)
382 DeviceState
*dev
= (DeviceState
*)s
;
385 if (!qemu_cpu_is_self(cpu
)) {
386 cpu_interrupt(cpu
, CPU_INTERRUPT_POLL
);
387 } else if (apic_irq_pending(s
) > 0) {
388 cpu_interrupt(cpu
, CPU_INTERRUPT_HARD
);
389 } else if (!apic_accept_pic_intr(dev
) || !pic_get_output(isa_pic
)) {
390 cpu_reset_interrupt(cpu
, CPU_INTERRUPT_HARD
);
394 void apic_poll_irq(DeviceState
*dev
)
396 APICCommonState
*s
= APIC(dev
);
398 apic_sync_vapic(s
, SYNC_FROM_VAPIC
);
402 static void apic_set_irq(APICCommonState
*s
, int vector_num
, int trigger_mode
)
404 kvm_report_irq_delivered(!apic_get_bit(s
->irr
, vector_num
));
406 apic_set_bit(s
->irr
, vector_num
);
408 apic_set_bit(s
->tmr
, vector_num
);
410 apic_reset_bit(s
->tmr
, vector_num
);
411 if (s
->vapic_paddr
) {
412 apic_sync_vapic(s
, SYNC_ISR_IRR_TO_VAPIC
);
414 * The vcpu thread needs to see the new IRR before we pull its current
415 * TPR value. That way, if we miss a lowering of the TRP, the guest
416 * has the chance to notice the new IRR and poll for IRQs on its own.
419 apic_sync_vapic(s
, SYNC_FROM_VAPIC
);
424 static void apic_eoi(APICCommonState
*s
)
427 isrv
= get_highest_priority_int(s
->isr
);
430 apic_reset_bit(s
->isr
, isrv
);
431 if (!(s
->spurious_vec
& APIC_SV_DIRECTED_IO
) && apic_get_bit(s
->tmr
, isrv
)) {
432 ioapic_eoi_broadcast(isrv
);
434 apic_sync_vapic(s
, SYNC_FROM_VAPIC
| SYNC_TO_VAPIC
);
438 static int apic_find_dest(uint8_t dest
)
440 APICCommonState
*apic
= local_apics
[dest
];
443 if (apic
&& apic
->id
== dest
)
444 return dest
; /* shortcut in case apic->id == local_apics[dest]->id */
446 for (i
= 0; i
< MAX_APICS
; i
++) {
447 apic
= local_apics
[i
];
448 if (apic
&& apic
->id
== dest
)
457 static void apic_get_delivery_bitmask(uint32_t *deliver_bitmask
,
458 uint8_t dest
, uint8_t dest_mode
)
460 APICCommonState
*apic_iter
;
463 if (dest_mode
== 0) {
465 memset(deliver_bitmask
, 0xff, MAX_APIC_WORDS
* sizeof(uint32_t));
467 int idx
= apic_find_dest(dest
);
468 memset(deliver_bitmask
, 0x00, MAX_APIC_WORDS
* sizeof(uint32_t));
470 apic_set_bit(deliver_bitmask
, idx
);
473 /* XXX: cluster mode */
474 memset(deliver_bitmask
, 0x00, MAX_APIC_WORDS
* sizeof(uint32_t));
475 for(i
= 0; i
< MAX_APICS
; i
++) {
476 apic_iter
= local_apics
[i
];
478 if (apic_iter
->dest_mode
== 0xf) {
479 if (dest
& apic_iter
->log_dest
)
480 apic_set_bit(deliver_bitmask
, i
);
481 } else if (apic_iter
->dest_mode
== 0x0) {
482 if ((dest
& 0xf0) == (apic_iter
->log_dest
& 0xf0) &&
483 (dest
& apic_iter
->log_dest
& 0x0f)) {
484 apic_set_bit(deliver_bitmask
, i
);
494 static void apic_startup(APICCommonState
*s
, int vector_num
)
496 s
->sipi_vector
= vector_num
;
497 cpu_interrupt(CPU(s
->cpu
), CPU_INTERRUPT_SIPI
);
500 void apic_sipi(DeviceState
*dev
)
502 APICCommonState
*s
= APIC(dev
);
504 cpu_reset_interrupt(CPU(s
->cpu
), CPU_INTERRUPT_SIPI
);
506 if (!s
->wait_for_sipi
)
508 cpu_x86_load_seg_cache_sipi(s
->cpu
, s
->sipi_vector
);
509 s
->wait_for_sipi
= 0;
512 static void apic_deliver(DeviceState
*dev
, uint8_t dest
, uint8_t dest_mode
,
513 uint8_t delivery_mode
, uint8_t vector_num
,
514 uint8_t trigger_mode
)
516 APICCommonState
*s
= APIC(dev
);
517 uint32_t deliver_bitmask
[MAX_APIC_WORDS
];
518 int dest_shorthand
= (s
->icr
[0] >> 18) & 3;
519 APICCommonState
*apic_iter
;
521 switch (dest_shorthand
) {
523 apic_get_delivery_bitmask(deliver_bitmask
, dest
, dest_mode
);
526 memset(deliver_bitmask
, 0x00, sizeof(deliver_bitmask
));
527 apic_set_bit(deliver_bitmask
, s
->id
);
530 memset(deliver_bitmask
, 0xff, sizeof(deliver_bitmask
));
533 memset(deliver_bitmask
, 0xff, sizeof(deliver_bitmask
));
534 apic_reset_bit(deliver_bitmask
, s
->id
);
538 switch (delivery_mode
) {
541 int trig_mode
= (s
->icr
[0] >> 15) & 1;
542 int level
= (s
->icr
[0] >> 14) & 1;
543 if (level
== 0 && trig_mode
== 1) {
544 foreach_apic(apic_iter
, deliver_bitmask
,
545 apic_iter
->arb_id
= apic_iter
->id
);
552 foreach_apic(apic_iter
, deliver_bitmask
,
553 apic_startup(apic_iter
, vector_num
) );
557 apic_bus_deliver(deliver_bitmask
, delivery_mode
, vector_num
, trigger_mode
);
560 static bool apic_check_pic(APICCommonState
*s
)
562 DeviceState
*dev
= (DeviceState
*)s
;
564 if (!apic_accept_pic_intr(dev
) || !pic_get_output(isa_pic
)) {
567 apic_deliver_pic_intr(dev
, 1);
571 int apic_get_interrupt(DeviceState
*dev
)
573 APICCommonState
*s
= APIC(dev
);
576 /* if the APIC is installed or enabled, we let the 8259 handle the
580 if (!(s
->spurious_vec
& APIC_SV_ENABLE
))
583 apic_sync_vapic(s
, SYNC_FROM_VAPIC
);
584 intno
= apic_irq_pending(s
);
586 /* if there is an interrupt from the 8259, let the caller handle
587 * that first since ExtINT interrupts ignore the priority.
589 if (intno
== 0 || apic_check_pic(s
)) {
590 apic_sync_vapic(s
, SYNC_TO_VAPIC
);
592 } else if (intno
< 0) {
593 apic_sync_vapic(s
, SYNC_TO_VAPIC
);
594 return s
->spurious_vec
& 0xff;
596 apic_reset_bit(s
->irr
, intno
);
597 apic_set_bit(s
->isr
, intno
);
598 apic_sync_vapic(s
, SYNC_TO_VAPIC
);
605 int apic_accept_pic_intr(DeviceState
*dev
)
607 APICCommonState
*s
= APIC(dev
);
613 lvt0
= s
->lvt
[APIC_LVT_LINT0
];
615 if ((s
->apicbase
& MSR_IA32_APICBASE_ENABLE
) == 0 ||
616 (lvt0
& APIC_LVT_MASKED
) == 0)
617 return isa_pic
!= NULL
;
622 static void apic_timer_update(APICCommonState
*s
, int64_t current_time
)
624 if (apic_next_timer(s
, current_time
)) {
625 timer_mod(s
->timer
, s
->next_time
);
631 static void apic_timer(void *opaque
)
633 APICCommonState
*s
= opaque
;
635 apic_local_deliver(s
, APIC_LVT_TIMER
);
636 apic_timer_update(s
, s
->next_time
);
639 static uint64_t apic_mem_read(void *opaque
, hwaddr addr
, unsigned size
)
650 dev
= cpu_get_current_apic();
656 index
= (addr
>> 4) & 0xff;
661 case 0x03: /* version */
662 val
= s
->version
| ((APIC_LVT_NB
- 1) << 16);
665 apic_sync_vapic(s
, SYNC_FROM_VAPIC
);
666 if (apic_report_tpr_access
) {
667 cpu_report_tpr_access(&s
->cpu
->env
, TPR_ACCESS_READ
);
672 val
= apic_get_arb_pri(s
);
676 val
= apic_get_ppr(s
);
682 val
= s
->log_dest
<< 24;
685 val
= (s
->dest_mode
<< 28) | 0xfffffff;
688 val
= s
->spurious_vec
;
691 val
= s
->isr
[index
& 7];
694 val
= s
->tmr
[index
& 7];
697 val
= s
->irr
[index
& 7];
704 val
= s
->icr
[index
& 1];
707 val
= s
->lvt
[index
- 0x32];
710 val
= s
->initial_count
;
713 val
= apic_get_current_count(s
);
716 val
= s
->divide_conf
;
719 s
->esr
|= APIC_ESR_ILLEGAL_ADDRESS
;
723 trace_apic_mem_readl(addr
, val
);
727 static void apic_send_msi(MSIMessage
*msi
)
729 uint64_t addr
= msi
->address
;
730 uint32_t data
= msi
->data
;
731 uint8_t dest
= (addr
& MSI_ADDR_DEST_ID_MASK
) >> MSI_ADDR_DEST_ID_SHIFT
;
732 uint8_t vector
= (data
& MSI_DATA_VECTOR_MASK
) >> MSI_DATA_VECTOR_SHIFT
;
733 uint8_t dest_mode
= (addr
>> MSI_ADDR_DEST_MODE_SHIFT
) & 0x1;
734 uint8_t trigger_mode
= (data
>> MSI_DATA_TRIGGER_SHIFT
) & 0x1;
735 uint8_t delivery
= (data
>> MSI_DATA_DELIVERY_MODE_SHIFT
) & 0x7;
736 /* XXX: Ignore redirection hint. */
737 apic_deliver_irq(dest
, dest_mode
, delivery
, vector
, trigger_mode
);
740 static void apic_mem_write(void *opaque
, hwaddr addr
, uint64_t val
,
745 int index
= (addr
>> 4) & 0xff;
751 if (addr
> 0xfff || !index
) {
752 /* MSI and MMIO APIC are at the same memory location,
753 * but actually not on the global bus: MSI is on PCI bus
754 * APIC is connected directly to the CPU.
755 * Mapping them on the global bus happens to work because
756 * MSI registers are reserved in APIC MMIO and vice versa. */
757 MSIMessage msi
= { .address
= addr
, .data
= val
};
762 dev
= cpu_get_current_apic();
768 trace_apic_mem_writel(addr
, val
);
777 if (apic_report_tpr_access
) {
778 cpu_report_tpr_access(&s
->cpu
->env
, TPR_ACCESS_WRITE
);
781 apic_sync_vapic(s
, SYNC_TO_VAPIC
);
791 s
->log_dest
= val
>> 24;
794 s
->dest_mode
= val
>> 28;
797 s
->spurious_vec
= val
& 0x1ff;
807 apic_deliver(dev
, (s
->icr
[1] >> 24) & 0xff, (s
->icr
[0] >> 11) & 1,
808 (s
->icr
[0] >> 8) & 7, (s
->icr
[0] & 0xff),
809 (s
->icr
[0] >> 15) & 1);
816 int n
= index
- 0x32;
818 if (n
== APIC_LVT_TIMER
) {
819 apic_timer_update(s
, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
));
820 } else if (n
== APIC_LVT_LINT0
&& apic_check_pic(s
)) {
826 s
->initial_count
= val
;
827 s
->initial_count_load_time
= qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL
);
828 apic_timer_update(s
, s
->initial_count_load_time
);
835 s
->divide_conf
= val
& 0xb;
836 v
= (s
->divide_conf
& 3) | ((s
->divide_conf
>> 1) & 4);
837 s
->count_shift
= (v
+ 1) & 7;
841 s
->esr
|= APIC_ESR_ILLEGAL_ADDRESS
;
846 static void apic_pre_save(APICCommonState
*s
)
848 apic_sync_vapic(s
, SYNC_FROM_VAPIC
);
851 static void apic_post_load(APICCommonState
*s
)
853 if (s
->timer_expiry
!= -1) {
854 timer_mod(s
->timer
, s
->timer_expiry
);
860 static const MemoryRegionOps apic_io_ops
= {
861 .read
= apic_mem_read
,
862 .write
= apic_mem_write
,
863 .impl
.min_access_size
= 1,
864 .impl
.max_access_size
= 4,
865 .valid
.min_access_size
= 1,
866 .valid
.max_access_size
= 4,
867 .endianness
= DEVICE_NATIVE_ENDIAN
,
870 static void apic_realize(DeviceState
*dev
, Error
**errp
)
872 APICCommonState
*s
= APIC(dev
);
874 if (s
->id
>= MAX_APICS
) {
875 error_setg(errp
, "%s initialization failed. APIC ID %d is invalid",
876 object_get_typename(OBJECT(dev
)), s
->id
);
881 warn_report("Userspace local APIC is deprecated for KVM.");
882 warn_report("Do not use kernel-irqchip except for the -M isapc machine type.");
885 memory_region_init_io(&s
->io_memory
, OBJECT(s
), &apic_io_ops
, s
, "apic-msi",
888 s
->timer
= timer_new_ns(QEMU_CLOCK_VIRTUAL
, apic_timer
, s
);
889 local_apics
[s
->id
] = s
;
891 msi_nonbroken
= true;
894 static void apic_unrealize(DeviceState
*dev
)
896 APICCommonState
*s
= APIC(dev
);
898 timer_free(s
->timer
);
899 local_apics
[s
->id
] = NULL
;
902 static void apic_class_init(ObjectClass
*klass
, void *data
)
904 APICCommonClass
*k
= APIC_COMMON_CLASS(klass
);
906 k
->realize
= apic_realize
;
907 k
->unrealize
= apic_unrealize
;
908 k
->set_base
= apic_set_base
;
909 k
->set_tpr
= apic_set_tpr
;
910 k
->get_tpr
= apic_get_tpr
;
911 k
->vapic_base_update
= apic_vapic_base_update
;
912 k
->external_nmi
= apic_external_nmi
;
913 k
->pre_save
= apic_pre_save
;
914 k
->post_load
= apic_post_load
;
915 k
->send_msi
= apic_send_msi
;
918 static const TypeInfo apic_info
= {
920 .instance_size
= sizeof(APICCommonState
),
921 .parent
= TYPE_APIC_COMMON
,
922 .class_init
= apic_class_init
,
925 static void apic_register_types(void)
927 type_register_static(&apic_info
);
930 type_init(apic_register_types
)