Lesson 23, section 6

This commit is contained in:
Carlos
2015-08-28 10:52:05 +02:00
parent c473761432
commit b109691179
8 changed files with 44 additions and 51 deletions

View File

@@ -71,7 +71,13 @@ extern void irq15();
#define IRQ14 46
#define IRQ15 47
/* Struct which aggregates many registers */
/* Struct which aggregates many registers.
* It matches exactly the pushes on interrupt.asm. From the bottom:
* - Pushed by the processor automatically
* - `push byte`s on the isr-specific code: error code, then int number
* - All the registers by pusha
* - `push eax` whose lower 16-bits contain DS
*/
typedef struct {
uint32_t ds; /* Data segment selector */
uint32_t edi, esi, ebp, useless, ebx, edx, ecx, eax; /* Pushed by pusha. */
@@ -80,10 +86,10 @@ typedef struct {
} registers_t;
void isr_install();
void isr_handler(registers_t r);
void isr_handler(registers_t *r);
void irq_install();
typedef void (*isr_t)(registers_t);
typedef void (*isr_t)(registers_t*);
void register_interrupt_handler(uint8_t n, isr_t handler);
#endif