diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-10-13 17:06:33 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-10-13 17:06:33 +0000 |
commit | 08467405b0277cc0b17f2a234e920d344af5138f (patch) | |
tree | 89f2f32289926805b9145283482853687034897b /c/src/lib/libbsp/shared/clock_driver_simidle.c | |
parent | libnetworking/rtems/rtems_glue.c: Copy nothing if rtems_bsdnet_parse_driver_n... (diff) | |
download | rtems-08467405b0277cc0b17f2a234e920d344af5138f.tar.bz2 |
2008-10-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* clock_driver_simidle.c: Ensure ISR nest level and Thread Dispatch
disable level are in the same state they would be in a true ISR. This
ensures that all of the clock tick handling is as similar as possible
in this limited environment.
Diffstat (limited to 'c/src/lib/libbsp/shared/clock_driver_simidle.c')
-rw-r--r-- | c/src/lib/libbsp/shared/clock_driver_simidle.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/shared/clock_driver_simidle.c b/c/src/lib/libbsp/shared/clock_driver_simidle.c index 6d174bff65..39a82c08ff 100644 --- a/c/src/lib/libbsp/shared/clock_driver_simidle.c +++ b/c/src/lib/libbsp/shared/clock_driver_simidle.c @@ -7,7 +7,9 @@ * $Id$ */ +#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #include <rtems.h> +#include <rtems/score/thread.h> #define CLOCK_VECTOR 0 @@ -40,8 +42,13 @@ Thread clock_driver_sim_idle_body( ) { for( ; ; ) { - if ( clock_driver_enabled ) - rtems_clock_tick(); + if ( clock_driver_enabled ) { + _Thread_Disable_dispatch(); + _ISR_Nest_level++; + rtems_clock_tick(); + _ISR_Nest_level--; + _Thread_Enable_dispatch(); + } } return 0; /* to avoid warning */ } |