1/* 2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7#include <asm_defs.h> 8 9#include "interrupts.h" 10 11 12// #pragma mark - interrupt functions 13 14 15#define INTERRUPT_FUNCTION(vector) \ 16.align 8; \ 17FUNCTION(interrupt_function##vector): \ 18 pushl $0; \ 19 pusha; \ 20 pushl $vector; \ 21 call handle_exception; 22 23#undef INTERRUPT_FUNCTION_ERROR 24#define INTERRUPT_FUNCTION_ERROR(vector) \ 25.align 8; \ 26FUNCTION(interrupt_function##vector): \ 27 pusha; \ 28 pushl $vector; \ 29 call handle_exception; 30 31INTERRUPT_FUNCTIONS() 32 33 34// #pragma mark - interrupt functions during exception 35 36 37#undef INTERRUPT_FUNCTION 38#define INTERRUPT_FUNCTION(vector) \ 39.align 8; \ 40FUNCTION(exception_interrupt_function##vector): \ 41 call handle_exception_exception; 42 43#undef INTERRUPT_FUNCTION_ERROR 44#define INTERRUPT_FUNCTION_ERROR(vector) INTERRUPT_FUNCTION(vector) 45 46INTERRUPT_FUNCTIONS() 47