source: rtems/cpukit/score/src/coretodsecondssinceepoch.c @ f68401e

4.115
Last change on this file since f68401e was d50acdbb, checked in by Sebastian Huber <sebastian.huber@…>, on 03/10/14 at 07:25:32

score: Add local context to SMP lock API

Add a local context structure to the SMP lock API for acquire and
release pairs. This context can be used to store the ISR level and
profiling information. It may be later used to enable more
sophisticated lock algorithms, e.g. MCS locks.

There is only one lock that cannot be used with a local context. This
is the per-CPU lock since here we would have to transfer the local
context through a context switch which is very complicated.

  • Property mode set to 100644
File size: 699 bytes
Line 
1/*
2 * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.com/license/LICENSE.
13 */
14
15#if HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/score/todimpl.h>
20
21uint32_t _TOD_Seconds_since_epoch( void )
22{
23  TOD_Control      *tod = &_TOD;
24  ISR_lock_Context  lock_context;
25  Timestamp_Control now;
26
27  _TOD_Acquire( tod, &lock_context );
28   now = tod->now;
29  _TOD_Release( tod, &lock_context );
30
31  return _Timestamp_Get_seconds( &now );
32}
Note: See TracBrowser for help on using the repository browser.