Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:13

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSAPIBSD
0007  *
0008  * @brief BSD Compatibility API
0009  */
0010 
0011 /*
0012  * Copyright (c) 2015 embedded brains GmbH & Co. KG
0013  *
0014  * Redistribution and use in source and binary forms, with or without
0015  * modification, are permitted provided that the following conditions
0016  * are met:
0017  * 1. Redistributions of source code must retain the above copyright
0018  *    notice, this list of conditions and the following disclaimer.
0019  * 2. Redistributions in binary form must reproduce the above copyright
0020  *    notice, this list of conditions and the following disclaimer in the
0021  *    documentation and/or other materials provided with the distribution.
0022  *
0023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0024  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0025  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0026  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0027  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0028  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0029  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0030  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0031  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0033  * POSSIBILITY OF SUCH DAMAGE.
0034  */
0035 
0036 #ifndef _RTEMS_BSD_H
0037 #define _RTEMS_BSD_H
0038 
0039 #include <rtems/score/timecounter.h>
0040 #include <rtems/score/basedefs.h>
0041 
0042 #ifdef __cplusplus
0043 extern "C" {
0044 #endif /* __cplusplus */
0045 
0046 /**
0047  * @defgroup RTEMSAPIBSD BSD Compatibility Support
0048  *
0049  * @ingroup RTEMSAPI
0050  *
0051  * @{
0052  */
0053 
0054 /**
0055  * @copydoc _Timecounter_Bintime()
0056  */
0057 static inline void rtems_bsd_bintime( struct bintime *bt )
0058 {
0059   _Timecounter_Bintime( bt );
0060 }
0061 
0062 /**
0063  * @copydoc _Timecounter_Nanotime()
0064  */
0065 static inline void rtems_bsd_nanotime( struct timespec *ts )
0066 {
0067   _Timecounter_Nanotime( ts );
0068 }
0069 
0070 /**
0071  * @copydoc _Timecounter_Microtime()
0072  */
0073 static inline void rtems_bsd_microtime( struct timeval *tv )
0074 {
0075   _Timecounter_Microtime( tv );
0076 }
0077 
0078 /**
0079  * @copydoc _Timecounter_Binuptime()
0080  */
0081 static inline void rtems_bsd_binuptime( struct bintime *bt )
0082 {
0083   _Timecounter_Binuptime( bt );
0084 }
0085 
0086 /**
0087  * @copydoc _Timecounter_Nanouptime()
0088  */
0089 static inline void rtems_bsd_nanouptime( struct timespec *ts )
0090 {
0091   _Timecounter_Nanouptime( ts );
0092 }
0093 
0094 /**
0095  * @copydoc _Timecounter_Microtime()
0096  */
0097 static inline void rtems_bsd_microuptime( struct timeval *tv )
0098 {
0099   _Timecounter_Microuptime( tv );
0100 }
0101 
0102 /**
0103  * @copydoc _Timecounter_Getbintime()
0104  */
0105 static inline void rtems_bsd_getbintime( struct bintime *bt )
0106 {
0107   _Timecounter_Getbintime( bt );
0108 }
0109 
0110 /**
0111  * @copydoc _Timecounter_Getnanotime()
0112  */
0113 static inline void rtems_bsd_getnanotime( struct timespec *ts )
0114 {
0115   _Timecounter_Getnanotime( ts );
0116 }
0117 
0118 /**
0119  * @copydoc _Timecounter_Getmicrotime()
0120  */
0121 static inline void rtems_bsd_getmicrotime( struct timeval *tv )
0122 {
0123   _Timecounter_Getmicrotime( tv );
0124 }
0125 
0126 /**
0127  * @copydoc _Timecounter_Getbinuptime()
0128  */
0129 static inline void rtems_bsd_getbinuptime( struct bintime *bt )
0130 {
0131   _Timecounter_Getbinuptime( bt );
0132 }
0133 
0134 /**
0135  * @copydoc _Timecounter_Getnanouptime()
0136  */
0137 static inline void rtems_bsd_getnanouptime( struct timespec *ts )
0138 {
0139   _Timecounter_Getnanouptime( ts );
0140 }
0141 
0142 /**
0143  * @copydoc _Timecounter_Getmicrouptime()
0144  */
0145 static inline void rtems_bsd_getmicrouptime( struct timeval *tv )
0146 {
0147   _Timecounter_Getmicrouptime( tv );
0148 }
0149 
0150 /** @} */
0151 
0152 #ifdef __cplusplus
0153 }
0154 #endif /* __cplusplus */
0155 
0156 #endif /* _RTEMS_BSD_H */