Changeset 8eaa39f in rtems-libbsd


Ignore:
Timestamp:
May 15, 2015, 12:29:57 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
e65165b
Parents:
f2cb584
git-author:
Sebastian Huber <sebastian.huber@…> (05/15/15 12:29:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/20/15 07:58:22)
Message:

Update due to API changes (timecounters)

Files:
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • libbsd.py

    rf2cb584 r8eaa39f  
    270270            'sys/sys/nlist_aout.h',
    271271            'sys/rpc/types.h',
    272             'sys/sys/timepps.h',
    273             'sys/sys/timetc.h',
    274             'sys/sys/timex.h',
    275272            'sys/sys/tree.h',
    276273            'sys/sys/ttycom.h',
  • rtemsbsd/include/rtems/bsd/sys/time.h

    rf2cb584 r8eaa39f  
    3333
    3434#include <sys/time.h>
    35 #include <rtems.h>
     35#include <rtems/timecounter.h>
    3636
    37 static inline time_t
    38 rtems_bsd_time_second(void)
    39 {
    40         return time(NULL);
    41 }
    42 
    43 static inline time_t
    44 rtems_bsd_time_uptime(void)
    45 {
    46         return rtems_clock_get_uptime_seconds();
    47 }
    48 
    49 #define time_second rtems_bsd_time_second()
    50 #define time_uptime rtems_bsd_time_uptime()
     37#define bintime(_x) _Timecounter_Bintime(_x)
     38#define nanotime(_x) _Timecounter_Nanotime(_x)
     39#define microtime(_x) _Timecounter_Microtime(_x)
     40#define binuptime(_x) _Timecounter_Binuptime(_x)
     41#define nanouptime(_x) _Timecounter_Nanouptime(_x)
     42#define microuptime(_x) _Timecounter_Microuptime(_x)
     43#define getbintime(_x) _Timecounter_Getbintime(_x)
     44#define getnanotime(_x) _Timecounter_Getnanotime(_x)
     45#define getmicrotime(_x) _Timecounter_Getmicrotime(_x)
     46#define getbinuptime(_x) _Timecounter_Getbinuptime(_x)
     47#define getnanouptime(_x) _Timecounter_Getnanouptime(_x)
     48#define getmicrouptime(_x) _Timecounter_Getmicrouptime(_x)
     49#define time_second _Timecounter_Time_second
     50#define time_uptime _Timecounter_Time_uptime
    5151
    5252#endif /* _RTEMS_BSD_SYS_TIME_H_ */
  • rtemsbsd/rtems/rtems-bsd-init.c

    rf2cb584 r8eaa39f  
    7272int maxusers;     /* base tunable */
    7373
    74 struct bintime boottimebin;
    75 struct timeval boottime;
    76 
    7774static SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD|CTLFLAG_CAPRD, NULL,
    7875    "Kernel SMP");
     
    104101        maxid_maxcpus = (int) rtems_get_processor_count();
    105102
    106         gettimeofday(&boottime, NULL);
    107         timeval2bintime(&boottime, &boottimebin);
    108 
    109103        mkdir("/etc", S_IRWXU | S_IRWXG | S_IRWXO);
    110104
  • rtemsbsd/rtems/rtems-bsd-timesupport.c

    rf2cb584 r8eaa39f  
    5353  return (int) _Timespec_To_ticks( &ts );
    5454}
    55 
    56 void
    57 binuptime(struct bintime *bt)
    58 {
    59         struct timeval tv;
    60 
    61         rtems_clock_get_uptime_timeval(&tv);
    62         timeval2bintime(&tv, bt);
    63 }
    64 
    65 void
    66 bintime(struct bintime *bt)
    67 {
    68         struct timeval tv;
    69 
    70         gettimeofday(&tv, NULL);
    71         timeval2bintime(&tv, bt);
    72 }
    73 
    74 void
    75 microtime(struct timeval *tvp)
    76 {
    77         gettimeofday(tvp, NULL);
    78 }
    79 
    80 void
    81 getbinuptime(struct bintime *bt)
    82 {
    83         binuptime(bt);
    84 }
    85 
    86 void
    87 getmicrouptime(struct timeval *tvp)
    88 {
    89         rtems_clock_get_uptime_timeval(tvp);
    90 }
    91 
    92 void
    93 getmicrotime(struct timeval *tvp)
    94 {
    95         microtime(tvp);
    96 }
Note: See TracChangeset for help on using the changeset viewer.