109 |
|
|
110 |
switch (delivery_mode) { |
switch (delivery_mode) { |
111 |
case APIC_DM_LOWPRI: |
case APIC_DM_LOWPRI: |
112 |
|
/* XXX: search for focus processor, arbitration */ |
113 |
|
if (deliver_bitmask) { |
114 |
|
uint32_t m = 1; |
115 |
|
while ((deliver_bitmask & m) == 0) |
116 |
|
m <<= 1; |
117 |
|
deliver_bitmask = m; |
118 |
|
} |
119 |
|
break; |
120 |
|
|
121 |
case APIC_DM_FIXED: |
case APIC_DM_FIXED: |
|
/* XXX: arbitration */ |
|
122 |
break; |
break; |
123 |
|
|
124 |
case APIC_DM_SMI: |
case APIC_DM_SMI: |
344 |
static void apic_startup(APICState *s, int vector_num) |
static void apic_startup(APICState *s, int vector_num) |
345 |
{ |
{ |
346 |
CPUState *env = s->cpu_env; |
CPUState *env = s->cpu_env; |
347 |
if (!env->cpu_halted) |
if (!(env->hflags & HF_HALTED_MASK)) |
348 |
return; |
return; |
349 |
env->eip = 0; |
env->eip = 0; |
350 |
cpu_x86_load_seg_cache(env, R_CS, vector_num << 8, vector_num << 12, |
cpu_x86_load_seg_cache(env, R_CS, vector_num << 8, vector_num << 12, |
351 |
0xffff, 0); |
0xffff, 0); |
352 |
env->cpu_halted = 0; |
env->hflags &= ~HF_HALTED_MASK; |
353 |
} |
} |
354 |
|
|
355 |
static void apic_deliver(APICState *s, uint8_t dest, uint8_t dest_mode, |
static void apic_deliver(APICState *s, uint8_t dest, uint8_t dest_mode, |
376 |
} |
} |
377 |
|
|
378 |
switch (delivery_mode) { |
switch (delivery_mode) { |
|
case APIC_DM_LOWPRI: |
|
|
/* XXX: search for focus processor, arbitration */ |
|
|
dest = s->id; |
|
|
break; |
|
|
|
|
379 |
case APIC_DM_INIT: |
case APIC_DM_INIT: |
380 |
{ |
{ |
381 |
int trig_mode = (s->icr[0] >> 15) & 1; |
int trig_mode = (s->icr[0] >> 15) & 1; |