From eedbfd94e0e37135041c8adf51cabc7e81aa4ea6 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 1 Dec 1995 19:27:40 +0000 Subject: Corrected use of the state WATCHDOG_REINSERT and renamed it WATCHDOG_BEING_INSERTED. --- c/src/exec/score/headers/watchdog.h | 8 ++++---- c/src/exec/score/include/rtems/score/watchdog.h | 8 ++++---- c/src/exec/score/src/watchdog.c | 25 +++++++++++++++++++------ cpukit/score/include/rtems/score/watchdog.h | 8 ++++---- cpukit/score/src/watchdog.c | 25 +++++++++++++++++++------ 5 files changed, 50 insertions(+), 24 deletions(-) diff --git a/c/src/exec/score/headers/watchdog.h b/c/src/exec/score/headers/watchdog.h index 4fc2849343..de2f332e22 100644 --- a/c/src/exec/score/headers/watchdog.h +++ b/c/src/exec/score/headers/watchdog.h @@ -66,10 +66,10 @@ typedef enum { */ typedef enum { - WATCHDOG_INACTIVE, /* off all chains */ - WATCHDOG_ACTIVE, /* on chain, allowed to fire */ - WATCHDOG_REINSERT, /* on chain, reset without firing if expires */ - WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */ + WATCHDOG_INACTIVE, /* off all chains */ + WATCHDOG_BEING_INSERTED, /* off all chains, searching for insertion point */ + WATCHDOG_ACTIVE, /* on chain, allowed to fire */ + WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */ } Watchdog_States; /* diff --git a/c/src/exec/score/include/rtems/score/watchdog.h b/c/src/exec/score/include/rtems/score/watchdog.h index 4fc2849343..de2f332e22 100644 --- a/c/src/exec/score/include/rtems/score/watchdog.h +++ b/c/src/exec/score/include/rtems/score/watchdog.h @@ -66,10 +66,10 @@ typedef enum { */ typedef enum { - WATCHDOG_INACTIVE, /* off all chains */ - WATCHDOG_ACTIVE, /* on chain, allowed to fire */ - WATCHDOG_REINSERT, /* on chain, reset without firing if expires */ - WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */ + WATCHDOG_INACTIVE, /* off all chains */ + WATCHDOG_BEING_INSERTED, /* off all chains, searching for insertion point */ + WATCHDOG_ACTIVE, /* on chain, allowed to fire */ + WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */ } Watchdog_States; /* diff --git a/c/src/exec/score/src/watchdog.c b/c/src/exec/score/src/watchdog.c index 9b2c165ee8..b7963f5408 100644 --- a/c/src/exec/score/src/watchdog.c +++ b/c/src/exec/score/src/watchdog.c @@ -58,7 +58,7 @@ Watchdog_States _Watchdog_Remove( case WATCHDOG_INACTIVE: break; - case WATCHDOG_REINSERT: + case WATCHDOG_BEING_INSERTED: /* * It is not actually on the chain so just change the state and @@ -151,7 +151,7 @@ void _Watchdog_Insert( insert_isr_nest_level = _ISR_Nest_level; - the_watchdog->state = WATCHDOG_REINSERT; + the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; restart: @@ -184,7 +184,7 @@ restart: _ISR_Flash( level ); - if ( the_watchdog->state != WATCHDOG_REINSERT ) { + if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { goto exit_insert; } @@ -243,10 +243,23 @@ void _Watchdog_Tickle( the_watchdog->user_data ); break; - case WATCHDOG_REINSERT: - _Watchdog_Insert( header, the_watchdog, WATCHDOG_ACTIVATE_NOW ); - break; + case WATCHDOG_INACTIVE: + /* + * This state indicates that the watchdog is not on any chain. + * Thus, it is NOT on a chain being tickled. This case should + * never occur. + */ + break; + + case WATCHDOG_BEING_INSERTED: + /* + * This state indicates that the watchdog is in the process of + * BEING inserted on the chain. Thus, it can NOT be on a chain + * being tickled. This case should never occur. + */ + break; + case WATCHDOG_REMOVE_IT: break; } diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h index 4fc2849343..de2f332e22 100644 --- a/cpukit/score/include/rtems/score/watchdog.h +++ b/cpukit/score/include/rtems/score/watchdog.h @@ -66,10 +66,10 @@ typedef enum { */ typedef enum { - WATCHDOG_INACTIVE, /* off all chains */ - WATCHDOG_ACTIVE, /* on chain, allowed to fire */ - WATCHDOG_REINSERT, /* on chain, reset without firing if expires */ - WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */ + WATCHDOG_INACTIVE, /* off all chains */ + WATCHDOG_BEING_INSERTED, /* off all chains, searching for insertion point */ + WATCHDOG_ACTIVE, /* on chain, allowed to fire */ + WATCHDOG_REMOVE_IT /* on chain, remove without firing if expires */ } Watchdog_States; /* diff --git a/cpukit/score/src/watchdog.c b/cpukit/score/src/watchdog.c index 9b2c165ee8..b7963f5408 100644 --- a/cpukit/score/src/watchdog.c +++ b/cpukit/score/src/watchdog.c @@ -58,7 +58,7 @@ Watchdog_States _Watchdog_Remove( case WATCHDOG_INACTIVE: break; - case WATCHDOG_REINSERT: + case WATCHDOG_BEING_INSERTED: /* * It is not actually on the chain so just change the state and @@ -151,7 +151,7 @@ void _Watchdog_Insert( insert_isr_nest_level = _ISR_Nest_level; - the_watchdog->state = WATCHDOG_REINSERT; + the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; restart: @@ -184,7 +184,7 @@ restart: _ISR_Flash( level ); - if ( the_watchdog->state != WATCHDOG_REINSERT ) { + if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { goto exit_insert; } @@ -243,10 +243,23 @@ void _Watchdog_Tickle( the_watchdog->user_data ); break; - case WATCHDOG_REINSERT: - _Watchdog_Insert( header, the_watchdog, WATCHDOG_ACTIVATE_NOW ); - break; + case WATCHDOG_INACTIVE: + /* + * This state indicates that the watchdog is not on any chain. + * Thus, it is NOT on a chain being tickled. This case should + * never occur. + */ + break; + + case WATCHDOG_BEING_INSERTED: + /* + * This state indicates that the watchdog is in the process of + * BEING inserted on the chain. Thus, it can NOT be on a chain + * being tickled. This case should never occur. + */ + break; + case WATCHDOG_REMOVE_IT: break; } -- cgit v1.2.3