RTEMS 6.1-rc2
Loading...
Searching...
No Matches
imfsimpl.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
10/*
11 * Copyright (C) 2013, 2018 embedded brains GmbH & Co. KG
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#ifndef _RTEMS_IMFSIMPL_H
36#define _RTEMS_IMFSIMPL_H
37
38#include <rtems/imfs.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
51static inline time_t _IMFS_get_time( void )
52{
53 struct bintime now;
54
55 /* Use most efficient way to get the time in seconds (CLOCK_REALTIME) */
56 _Timecounter_Getbintime( &now );
57
58 return now.sec;
59}
60
61static inline void IMFS_update_atime( IMFS_jnode_t *jnode )
62{
63 jnode->stat_atime = _IMFS_get_time();
64}
65
66static inline void IMFS_update_mtime( IMFS_jnode_t *jnode )
67{
68 jnode->stat_mtime = _IMFS_get_time();
69}
70
71static inline void IMFS_update_ctime( IMFS_jnode_t *jnode )
72{
73 jnode->stat_ctime = _IMFS_get_time();
74}
75
76static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode )
77{
78 time_t now;
79
80 now = _IMFS_get_time();
81
82 jnode->stat_mtime = now;
83 jnode->stat_ctime = now;
84}
85
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* _RTEMS_IMFSIMPL_H */
This header file defines the API of the In-Memory File System.
This header file provides interfaces of the Timecounter Handler which are used by the implementation ...
Definition: imfs.h:267