diff options
Diffstat (limited to '')
-rw-r--r-- | bsps/shared/irq/irq-handler-iterate.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/bsps/shared/irq/irq-handler-iterate.c b/bsps/shared/irq/irq-handler-iterate.c index 385cb8db2d..8bb29191fd 100644 --- a/bsps/shared/irq/irq-handler-iterate.c +++ b/bsps/shared/irq/irq-handler-iterate.c @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2017 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2017, 2021 embedded brains GmbH (http://www.embedded-brains.de) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,7 +45,7 @@ rtems_status_code rtems_interrupt_handler_iterate( rtems_status_code sc; rtems_vector_number index; rtems_option options; - rtems_interrupt_entry *current; + rtems_interrupt_entry *entry; sc = bsp_interrupt_check_and_lock( vector, @@ -56,15 +56,14 @@ rtems_status_code rtems_interrupt_handler_iterate( return sc; } - index = bsp_interrupt_handler_index(vector); - current = &bsp_interrupt_handler_table [index]; - if (!bsp_interrupt_is_empty_handler_entry(current)) { - do { - options = bsp_interrupt_is_handler_unique(index) ? - RTEMS_INTERRUPT_UNIQUE : RTEMS_INTERRUPT_SHARED; - routine(arg, current->info, options, current->handler, current->arg); - current = current->next; - } while (current != NULL); + index = bsp_interrupt_handler_index( vector ); + options = bsp_interrupt_is_handler_unique( index ) ? + RTEMS_INTERRUPT_UNIQUE : RTEMS_INTERRUPT_SHARED; + entry = bsp_interrupt_handler_table[ index ]; + + while ( entry != NULL ) { + ( *routine )( arg, entry->info, options, entry->handler, entry->arg ); + entry = entry->next; } bsp_interrupt_unlock(); |