summaryrefslogtreecommitdiffstats
path: root/hw/apic.c
diff options
context:
space:
mode:
authorbellard2005-11-23 21:59:44 +0100
committerbellard2005-11-23 21:59:44 +0100
commit8dd69b8f2cba91b7f2bcb3b4e12fbd35574869c1 (patch)
tree3b3fac50ae14acc3c0fa57e7f85d640e2bbbe0b4 /hw/apic.c
parentRTL8029 IDs support (Warner Losh) (diff)
downloadqemu-8dd69b8f2cba91b7f2bcb3b4e12fbd35574869c1.tar.gz
qemu-8dd69b8f2cba91b7f2bcb3b4e12fbd35574869c1.tar.xz
qemu-8dd69b8f2cba91b7f2bcb3b4e12fbd35574869c1.zip
fummy DM_LOWPRI handling
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1648 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/apic.c')
-rw-r--r--hw/apic.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/hw/apic.c b/hw/apic.c
index 276dd456f8..64caadb812 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -109,8 +109,16 @@ static void apic_bus_deliver(uint32_t deliver_bitmask, uint8_t delivery_mode,
switch (delivery_mode) {
case APIC_DM_LOWPRI:
+ /* XXX: search for focus processor, arbitration */
+ if (deliver_bitmask) {
+ uint32_t m = 1;
+ while ((deliver_bitmask & m) == 0)
+ m <<= 1;
+ deliver_bitmask = m;
+ }
+ break;
+
case APIC_DM_FIXED:
- /* XXX: arbitration */
break;
case APIC_DM_SMI:
@@ -336,12 +344,12 @@ static void apic_init_ipi(APICState *s)
static void apic_startup(APICState *s, int vector_num)
{
CPUState *env = s->cpu_env;
- if (!env->cpu_halted)
+ if (!(env->hflags & HF_HALTED_MASK))
return;
env->eip = 0;
cpu_x86_load_seg_cache(env, R_CS, vector_num << 8, vector_num << 12,
0xffff, 0);
- env->cpu_halted = 0;
+ env->hflags &= ~HF_HALTED_MASK;
}
static void apic_deliver(APICState *s, uint8_t dest, uint8_t dest_mode,
@@ -368,11 +376,6 @@ static void apic_deliver(APICState *s, uint8_t dest, uint8_t dest_mode,
}
switch (delivery_mode) {
- case APIC_DM_LOWPRI:
- /* XXX: search for focus processor, arbitration */
- dest = s->id;
- break;
-
case APIC_DM_INIT:
{
int trig_mode = (s->icr[0] >> 15) & 1;