Subversion Repositories HelenOS

Rev

Rev 2292 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2292 Rev 2307
Line 137... Line 137...
137
    return IRQ_ACCEPT;
137
    return IRQ_ACCEPT;
138
}
138
}
139
 
139
 
140
static void l_apic_timer_irq_handler(irq_t *irq, void *arg, ...)
140
static void l_apic_timer_irq_handler(irq_t *irq, void *arg, ...)
141
{
141
{
-
 
142
    /*
-
 
143
     * Holding a spinlock could prevent clock() from preempting
-
 
144
     * the current thread. In this case, we don't need to hold the
-
 
145
     * irq->lock so we just unlock it and then lock it again.
-
 
146
     */
-
 
147
    spinlock_unlock(&irq->lock);
142
    clock();
148
    clock();
-
 
149
    spinlock_lock(&irq->lock);
143
}
150
}
144
 
151
 
145
/** Initialize APIC on BSP. */
152
/** Initialize APIC on BSP. */
146
void apic_init(void)
153
void apic_init(void)
147
{
154
{
Line 160... Line 167...
160
     * Other interrupts will be forwarded to the lowest priority CPU.
167
     * Other interrupts will be forwarded to the lowest priority CPU.
161
     */
168
     */
162
    io_apic_disable_irqs(0xffff);
169
    io_apic_disable_irqs(0xffff);
163
   
170
   
164
    irq_initialize(&l_apic_timer_irq);
171
    irq_initialize(&l_apic_timer_irq);
-
 
172
    l_apic_timer_irq.preack = true;
165
    l_apic_timer_irq.devno = device_assign_devno();
173
    l_apic_timer_irq.devno = device_assign_devno();
166
    l_apic_timer_irq.inr = IRQ_CLK;
174
    l_apic_timer_irq.inr = IRQ_CLK;
167
    l_apic_timer_irq.claim = l_apic_timer_claim;
175
    l_apic_timer_irq.claim = l_apic_timer_claim;
168
    l_apic_timer_irq.handler = l_apic_timer_irq_handler;
176
    l_apic_timer_irq.handler = l_apic_timer_irq_handler;
169
    irq_register(&l_apic_timer_irq);
177
    irq_register(&l_apic_timer_irq);