summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/rtclock.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-09-11 19:35:39 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-09-11 19:35:39 +0000
commit3a4ae6c210bcc37754767966f1128ae23c77b6af (patch)
tree8804983e5b92bec788d548df13db7513118d351d /cpukit/rtems/src/rtclock.c
parentnew file -- split from inlines (diff)
downloadrtems-3a4ae6c210bcc37754767966f1128ae23c77b6af.tar.bz2
The word "RTEMS" almost completely removed from the core.
Configuration Table Template file added and all tests modified to use this. All gvar.h and conftbl.h files removed from test directories. Configuration parameter maximum_devices added. Core semaphore and mutex handlers added and RTEMS API Semaphore Manager updated to reflect this. Initialization sequence changed to invoke API specific initialization routines. Initialization tasks table now owned by RTEMS Tasks Manager. Added user extension for post-switch. Utilized user extensions to implement API specific functionality like signal dispatching. Added extensions to the System Initialization Thread so that an API can register a function to be invoked while the system is being initialized. These are largely equivalent to the pre-driver and post-driver hooks. Added the Modules file oar-go32_p5, modified oar-go32, and modified the file make/custom/go32.cfg to look at an environment varable which determines what CPU model is being used. All BSPs updated to reflect named devices and clock driver's IOCTL used by the Shared Memory Driver. Also merged clock isr into main file and removed ckisr.c where possible. Updated spsize to reflect new and moved variables. Makefiles for the executive source and include files updated to show break down of files into Core, RTEMS API, and Neither. Header and inline files installed into subdirectory based on whether logically in the Core or a part of the RTEMS API.
Diffstat (limited to 'cpukit/rtems/src/rtclock.c')
-rw-r--r--cpukit/rtems/src/rtclock.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/cpukit/rtems/src/rtclock.c b/cpukit/rtems/src/rtclock.c
index f82baa6337..01f61374cf 100644
--- a/cpukit/rtems/src/rtclock.c
+++ b/cpukit/rtems/src/rtclock.c
@@ -13,12 +13,12 @@
*/
#include <rtems/system.h>
-#include <rtems/clock.h>
-#include <rtems/config.h>
-#include <rtems/isr.h>
-#include <rtems/thread.h>
-#include <rtems/tod.h>
-#include <rtems/watchdog.h>
+#include <rtems/rtems/status.h>
+#include <rtems/rtems/clock.h>
+#include <rtems/core/isr.h>
+#include <rtems/core/thread.h>
+#include <rtems/core/tod.h>
+#include <rtems/core/watchdog.h>
/*PAGE
*
@@ -49,29 +49,29 @@ rtems_status_code rtems_clock_get(
switch ( option ) {
case RTEMS_CLOCK_GET_TOD:
if ( !_TOD_Is_set() )
- return( RTEMS_NOT_DEFINED );
+ return RTEMS_NOT_DEFINED;
*(rtems_time_of_day *)time_buffer = _TOD_Current;
- return( RTEMS_SUCCESSFUL );
+ return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
if ( !_TOD_Is_set() )
- return( RTEMS_NOT_DEFINED );
+ return RTEMS_NOT_DEFINED;
*(rtems_interval *)time_buffer = _TOD_Seconds_since_epoch;
- return( RTEMS_SUCCESSFUL );
+ return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_TICKS_SINCE_BOOT:
*(rtems_interval *)time_buffer = _TOD_Ticks_since_boot;
- return( RTEMS_SUCCESSFUL );
+ return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_TICKS_PER_SECOND:
*(rtems_interval *)time_buffer = _TOD_Ticks_per_second;
- return( RTEMS_SUCCESSFUL );
+ return RTEMS_SUCCESSFUL;
case RTEMS_CLOCK_GET_TIME_VALUE:
if ( !_TOD_Is_set() )
- return( RTEMS_NOT_DEFINED );
+ return RTEMS_NOT_DEFINED;
_ISR_Disable( level );
((rtems_clock_time_value *)time_buffer)->seconds =
@@ -79,13 +79,13 @@ rtems_status_code rtems_clock_get(
tmp = _TOD_Current.ticks;
_ISR_Enable( level );
- tmp *= _Configuration_Table->microseconds_per_tick;
+ tmp *= _TOD_Microseconds_per_tick;
((rtems_clock_time_value *)time_buffer)->microseconds = tmp;
- return( RTEMS_SUCCESSFUL );
+ return RTEMS_SUCCESSFUL;
}
- return( RTEMS_SUCCESSFUL ); /* should never get here */
+ return RTEMS_INTERNAL_ERROR; /* should never get here */
}
@@ -107,18 +107,16 @@ rtems_status_code rtems_clock_set(
rtems_time_of_day *time_buffer
)
{
- rtems_status_code local_result;
- rtems_interval seconds;
+ rtems_interval seconds;
- local_result = _TOD_Validate( time_buffer );
- if ( rtems_is_status_successful( local_result ) ) {
+ if ( _TOD_Validate( time_buffer ) ) {
seconds = _TOD_To_seconds( time_buffer );
_Thread_Disable_dispatch();
_TOD_Set( time_buffer, seconds );
_Thread_Enable_dispatch();
-
+ return RTEMS_SUCCESSFUL;
}
- return( local_result );
+ return RTEMS_INVALID_CLOCK;
}
/*PAGE
@@ -149,5 +147,5 @@ rtems_status_code rtems_clock_tick( void )
_Thread_Is_dispatching_enabled() )
_Thread_Dispatch();
- return( RTEMS_SUCCESSFUL );
+ return RTEMS_SUCCESSFUL;
}