Subversion Repositories HelenOS

Rev

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

Rev 4342 Rev 4343
Line 182... Line 182...
182
}
182
}
183
 
183
 
184
/** Process keyboard interrupt.
184
/** Process keyboard interrupt.
185
 *  
185
 *  
186
 *  @param irq IRQ information.
186
 *  @param irq IRQ information.
187
 *  @param arg Not used.
-
 
188
 */
187
 */
189
static void gxemul_irq_handler(irq_t *irq, void *arg, ...)
188
static void gxemul_irq_handler(irq_t *irq)
190
{
189
{
191
    if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox)) {
190
    if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox)) {
192
        ipc_irq_send_notif(irq);
191
        ipc_irq_send_notif(irq);
193
    } else {
192
    } else {
194
        char ch = 0;
193
        char ch = 0;
Line 202... Line 201...
202
        }
201
        }
203
        chardev_push_character(&console, ch);
202
        chardev_push_character(&console, ch);
204
    }
203
    }
205
}
204
}
206
 
205
 
207
static irq_ownership_t gxemul_claim(void)
206
static irq_ownership_t gxemul_claim(void *instance)
208
{
207
{
209
    return IRQ_ACCEPT;
208
    return IRQ_ACCEPT;
210
}
209
}
211
 
210
 
212
 
211
 
Line 264... Line 263...
264
static void gxemul_timer_start(uint32_t frequency)
263
static void gxemul_timer_start(uint32_t frequency)
265
{
264
{
266
    *((uint32_t*) gxemul_hw_map.rtc_freq) = frequency;
265
    *((uint32_t*) gxemul_hw_map.rtc_freq) = frequency;
267
}
266
}
268
 
267
 
269
static irq_ownership_t gxemul_timer_claim(void)
268
static irq_ownership_t gxemul_timer_claim(void *instance)
270
{
269
{
271
    return IRQ_ACCEPT;
270
    return IRQ_ACCEPT;
272
}
271
}
273
 
272
 
274
/** Timer interrupt handler.
273
/** Timer interrupt handler.
275
 *
274
 *
276
 * @param irq Interrupt information.
275
 * @param irq Interrupt information.
277
 * @param arg Not used.
276
 * @param arg Not used.
278
 */
277
 */
279
static void gxemul_timer_irq_handler(irq_t *irq, void *arg, ...)
278
static void gxemul_timer_irq_handler(irq_t *irq)
280
{
279
{
281
    /*
280
    /*
282
    * We are holding a lock which prevents preemption.
281
    * We are holding a lock which prevents preemption.
283
    * Release the lock, call clock() and reacquire the lock again.
282
    * Release the lock, call clock() and reacquire the lock again.
284
    */
283
    */
Line 368... Line 367...
368
    for (i = 0; i < GXEMUL_IRQC_MAX_IRQ; i++) {
367
    for (i = 0; i < GXEMUL_IRQC_MAX_IRQ; i++) {
369
        if (sources & (1 << i)) {
368
        if (sources & (1 << i)) {
370
            irq_t *irq = irq_dispatch_and_lock(i);
369
            irq_t *irq = irq_dispatch_and_lock(i);
371
            if (irq) {
370
            if (irq) {
372
                /* The IRQ handler was found. */
371
                /* The IRQ handler was found. */
373
                irq->handler(irq, irq->arg);
372
                irq->handler(irq);
374
                spinlock_unlock(&irq->lock);
373
                spinlock_unlock(&irq->lock);
375
            } else {
374
            } else {
376
                /* Spurious interrupt.*/
375
                /* Spurious interrupt.*/
377
                dprintf("cpu%d: spurious interrupt (inum=%d)\n",
376
                dprintf("cpu%d: spurious interrupt (inum=%d)\n",
378
                    CPU->id, i);
377
                    CPU->id, i);