Path: blob/master/arch/blackfin/kernel/exception.c
10817 views
/* Basic functions for adding/removing custom exception handlers1*2* Copyright 2004-2009 Analog Devices Inc.3*4* Licensed under the GPL-2 or later5*/67#include <linux/module.h>8#include <asm/irq_handler.h>910int bfin_request_exception(unsigned int exception, void (*handler)(void))11{12void (*curr_handler)(void);1314if (exception > 0x3F)15return -EINVAL;1617curr_handler = ex_table[exception];1819if (curr_handler != ex_replaceable)20return -EBUSY;2122ex_table[exception] = handler;2324return 0;25}26EXPORT_SYMBOL(bfin_request_exception);2728int bfin_free_exception(unsigned int exception, void (*handler)(void))29{30void (*curr_handler)(void);3132if (exception > 0x3F)33return -EINVAL;3435curr_handler = ex_table[exception];3637if (curr_handler != handler)38return -EBUSY;3940ex_table[exception] = ex_replaceable;4142return 0;43}44EXPORT_SYMBOL(bfin_free_exception);454647