00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _NLIBC_SYS_TIMES_H_
00009 #define _NLIBC_SYS_TIMES_H_
00010
00011 #include <nlibc.h>
00012 #include <time.h>
00013 #include <confregs.h>
00014
00018 struct tms {
00020 clock_t tms_utime;
00022 clock_t tms_stime;
00024 clock_t tms_cutime;
00026 clock_t tms_cstime;
00027 };
00028
00029
00055
00056
00057 #if defined(_uses_times_times_h) || !defined(__cflow_processed)
00058 inline clock_t times(struct tms *buf) {
00059 register vector unsigned cr_clkcnt;
00060 register unsigned utime;
00061
00062 asm("\tctr %0 %1 !! get clock counter\n"
00063 : "=r" (cr_clkcnt) : "I" (_CR_CLKCNT));
00064
00065 utime = cr_clkcnt.lo;
00066
00067 where (buf != NULL) {
00068 register struct tms rbuf;
00069
00070 rbuf.tms_utime = utime;
00071 rbuf.tms_stime = 0;
00072 rbuf.tms_cutime = 0;
00073 rbuf.tms_cstime = 0;
00074
00075 *buf = rbuf;
00076 }
00077
00078 return utime;
00079 }
00080 #endif // times()
00081
00082 #endif // _NLIBC_SYS_TIMES_H_