mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-05 15:15:29 +00:00
[HUST][CSE]mips/common/exception.c/rt_set_except_vector (#7238)
* mips/common/exception.c/rt_set_except_vector * Update exception.c --------- Co-authored-by: Bernard Xiong <bernard.xiong@gmail.com>
This commit is contained in:
@@ -82,13 +82,14 @@ exception_func_t sys_exception_handlers[RT_EXCEPTION_MAX];
|
|||||||
*/
|
*/
|
||||||
exception_func_t rt_set_except_vector(int n, exception_func_t func)
|
exception_func_t rt_set_except_vector(int n, exception_func_t func)
|
||||||
{
|
{
|
||||||
exception_func_t old_handler = sys_exception_handlers[n];
|
exception_func_t old_handler;
|
||||||
|
|
||||||
if ((n == 0) || (n > RT_EXCEPTION_MAX) || (!func))
|
if ((n < 0) || (n >= RT_EXCEPTION_MAX) || (!func))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
old_handler = sys_exception_handlers[n];
|
||||||
sys_exception_handlers[n] = func;
|
sys_exception_handlers[n] = func;
|
||||||
|
|
||||||
return old_handler;
|
return old_handler;
|
||||||
|
|||||||
Reference in New Issue
Block a user