Subversion Repositories HelenOS

Rev

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

Rev 2300 Rev 2306
Line 40... Line 40...
40
#include <sysinfo/sysinfo.h>
40
#include <sysinfo/sysinfo.h>
41
#include <print.h>
41
#include <print.h>
42
#include <ddi/device.h>
42
#include <ddi/device.h>
43
#include <mm/page.h>
43
#include <mm/page.h>
44
#include <arch/machine.h>
44
#include <arch/machine.h>
-
 
45
#include <arch/debug_print/print.h>
45
 
46
 
46
/** Address of devices. */
47
/** Address of devices. */
47
#define GXEMUL_VIDEORAM            0x10000000
48
#define GXEMUL_VIDEORAM            0x10000000
48
#define GXEMUL_KBD                 0x10000000
49
#define GXEMUL_KBD                 0x10000000
49
#define GXEMUL_HALT_OFFSET         0x10
50
#define GXEMUL_HALT_OFFSET         0x10
Line 316... Line 317...
316
    }
317
    }
317
   
318
   
318
    *(addr + GXEMUL_HALT_OFFSET) = '\0';
319
    *(addr + GXEMUL_HALT_OFFSET) = '\0';
319
}
320
}
320
 
321
 
-
 
322
void machine_irq_exception(int exc_no, istate_t *istate)
-
 
323
{
-
 
324
    uint32_t sources = gxemul_irqc_get_sources();
-
 
325
    int i = 0;
-
 
326
    for (; i < GXEMUL_IRQC_MAX_IRQ; i++) {
-
 
327
        if (sources & (1 << i)) {
-
 
328
            irq_t *irq = irq_dispatch_and_lock(i);
-
 
329
            if (irq) {
-
 
330
                /* The IRQ handler was found. */
-
 
331
                irq->handler(irq, irq->arg);
-
 
332
                spinlock_unlock(&irq->lock);
-
 
333
            } else {
-
 
334
                /* Spurious interrupt.*/
-
 
335
                dprintf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, i);
-
 
336
            }
-
 
337
        }
-
 
338
    }
-
 
339
    /* TODO remove after testing the above code
-
 
340
            noirq = 0;
-
 
341
            if (i == CONSOLE_IRQ) {
-
 
342
                char readchar = *(char*)0x10000000;
-
 
343
                if (readchar == 0) {
-
 
344
                    aux_puts("?");
-
 
345
                }
-
 
346
                else {
-
 
347
                    dprintf("%c", readchar);
-
 
348
                }
-
 
349
               
-
 
350
            }
-
 
351
            else if (i == TIMER_IRQ) {
-
 
352
                dprintf("\n.\n");
-
 
353
                //acknowledge
-
 
354
                *(uint32_t*)0x15000110 = 0;
-
 
355
            }
-
 
356
        }
-
 
357
    }
-
 
358
 
-
 
359
    if (noirq)
-
 
360
    aux_puts("IRQ exception without source\n");*/
-
 
361
}
321
 
362
 
322
/** @}
363
/** @}
323
 */
364
 */