forked from Imagelibrary/rtems
2010-12-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* score/src/watchdognanoseconds.c: New file. * score/Makefile.am: Reflect change above. * score/include/rtems/score/watchdog.h, score/src/coretodget.c, score/src/coretodgetuptime.c: Do not allow NULL as nanoseconds since last tick handler pointer.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2010-12-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* score/src/watchdognanoseconds.c: New file.
|
||||
* score/Makefile.am: Reflect change above.
|
||||
* score/include/rtems/score/watchdog.h, score/src/coretodget.c,
|
||||
score/src/coretodgetuptime.c: Do not allow NULL as nanoseconds since
|
||||
last tick handler pointer.
|
||||
|
||||
2010-12-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* libnetworking/loop.h, libnetworking/net/if_loop.c,
|
||||
|
||||
@@ -203,7 +203,8 @@ libscore_a_SOURCES += src/coretod.c src/coretodset.c src/coretodget.c \
|
||||
## WATCHDOG_C_FILES
|
||||
libscore_a_SOURCES += src/watchdog.c src/watchdogadjust.c \
|
||||
src/watchdogadjusttochain.c src/watchdoginsert.c src/watchdogremove.c \
|
||||
src/watchdogtickle.c src/watchdogreport.c src/watchdogreportchain.c
|
||||
src/watchdogtickle.c src/watchdogreport.c src/watchdogreportchain.c \
|
||||
src/watchdognanoseconds.c
|
||||
|
||||
## USEREXT_C_FILES
|
||||
libscore_a_SOURCES += src/userextaddset.c \
|
||||
|
||||
@@ -170,8 +170,8 @@ SCORE_EXTERN volatile Watchdog_Interval _Watchdog_Ticks_since_boot;
|
||||
* This is a pointer to the optional BSP plugin to obtain the number
|
||||
* of nanoseconds since the last clock tick.
|
||||
*/
|
||||
SCORE_EXTERN Watchdog_Nanoseconds_since_last_tick_routine
|
||||
_Watchdog_Nanoseconds_since_tick_handler;
|
||||
extern Watchdog_Nanoseconds_since_last_tick_routine
|
||||
_Watchdog_Nanoseconds_since_tick_handler;
|
||||
|
||||
/** @brief Per Ticks Watchdog List
|
||||
*
|
||||
@@ -302,6 +302,13 @@ void _Watchdog_Report_chain(
|
||||
Chain_Control *header
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Default nanoseconds since last tick handler.
|
||||
*
|
||||
* @retval 0 Always.
|
||||
*/
|
||||
uint32_t _Watchdog_Nanoseconds_since_tick_default_handler( void );
|
||||
|
||||
#ifndef __RTEMS_APPLICATION__
|
||||
#include <rtems/score/watchdog.inl>
|
||||
#endif
|
||||
|
||||
@@ -45,11 +45,9 @@ void _TOD_Get(
|
||||
/* assume time checked for NULL by caller */
|
||||
|
||||
/* _TOD_Now is the native current time */
|
||||
nanoseconds = 0;
|
||||
_ISR_Disable( level );
|
||||
now = _TOD_Now;
|
||||
if ( _Watchdog_Nanoseconds_since_tick_handler )
|
||||
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
|
||||
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
|
||||
_ISR_Enable( level );
|
||||
|
||||
_Timestamp_Set( &offset, 0, nanoseconds );
|
||||
|
||||
@@ -45,11 +45,9 @@ void _TOD_Get_uptime(
|
||||
/* assume time checked for NULL by caller */
|
||||
|
||||
/* _TOD_Uptime is in native timestamp format */
|
||||
nanoseconds = 0;
|
||||
_ISR_Disable( level );
|
||||
up = _TOD_Uptime;
|
||||
if ( _Watchdog_Nanoseconds_since_tick_handler )
|
||||
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
|
||||
nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
|
||||
_ISR_Enable( level );
|
||||
|
||||
_Timestamp_Set( &offset, 0, nanoseconds );
|
||||
|
||||
31
cpukit/score/src/watchdognanoseconds.c
Normal file
31
cpukit/score/src/watchdognanoseconds.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2010 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
Watchdog_Nanoseconds_since_last_tick_routine
|
||||
_Watchdog_Nanoseconds_since_tick_handler =
|
||||
_Watchdog_Nanoseconds_since_tick_default_handler;
|
||||
|
||||
uint32_t _Watchdog_Nanoseconds_since_tick_default_handler( void )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user