Searched refs:time (Results 1 - 200 of 7386) sorted by relevance

1234567891011>>

/linux-4.1.27/arch/mips/sibyte/bcm1480/
H A DMakefile1 obj-y := setup.o irq.o time.o
/linux-4.1.27/arch/mips/sibyte/sb1250/
H A DMakefile1 obj-y := setup.o irq.o time.o
/linux-4.1.27/arch/mips/ar7/
H A DMakefile7 time.o \
/linux-4.1.27/include/linux/
H A Dpvclock_gtod.h7 * The pvclock gtod notifier is called when the system time is updated
8 * and is used to keep guest time synchronized with host time.
11 * true (non-zero) if system time was stepped.
H A Domap-gpmc.h26 /* bool type time settings */
46 u32 cs_on; /* Assertion time */
47 u32 cs_rd_off; /* Read deassertion time */
48 u32 cs_wr_off; /* Write deassertion time */
51 u32 adv_on; /* Assertion time */
52 u32 adv_rd_off; /* Read deassertion time */
53 u32 adv_wr_off; /* Write deassertion time */
56 u32 we_on; /* WE assertion time */
57 u32 we_off; /* WE deassertion time */
60 u32 oe_on; /* OE assertion time */
61 u32 oe_off; /* OE deassertion time */
63 /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
66 u32 rd_cycle; /* Total read cycle time */
67 u32 wr_cycle; /* Total write cycle time */
93 u32 t_avdp_r; /* ADV low time (what about t_cer ?) */
95 u32 t_aavdh; /* address hold time */
97 u32 t_aa; /* access time from ADV assertion */
98 u32 t_iaa; /* initial access time */
99 u32 t_oe; /* access time from OE assertion */
100 u32 t_ce; /* access time from CS asertion */
101 u32 t_rd_cycle; /* read cycle time */
106 u32 t_wpl; /* write assertion time */
107 u32 t_wph; /* write deassertion time */
108 u32 t_wr_cycle; /* write cycle time */
112 u32 t_ces; /* CS setup time to clk */
113 u32 t_avds; /* ADV setup time to clk */
114 u32 t_avdh; /* ADV hold time from clk */
115 u32 t_ach; /* address hold time from clk */
124 u8 cyc_aavdh_oe;/* read address hold time in cycles */
125 u8 cyc_aavdh_we;/* write address hold time in cycles */
126 u8 cyc_oe; /* access time from OE assertion in cycles */
127 u8 cyc_wpl; /* write deassertion time in cycles */
128 u32 cyc_iaa; /* initial access time in cycles */
H A Dtypecheck.h5 * Check at compile time that something is of a particular type.
16 * Check at compile time that 'function' is a certain type, or is a pointer
H A Dtimekeeper_internal.h11 #include <linux/time.h>
22 * @base: ktime_t (nanoseconds) base time for readout
45 * @xtime_sec: Current CLOCK_REALTIME time in seconds
46 * @ktime_sec: Current CLOCK_MONOTONIC time in seconds
52 * @raw_time: Monotonic raw base time in timespec64 format
59 * @ntp_error: Difference between accumulated time and NTP time in ntp
66 * to get to monotonic time. Monotonic is pegged at zero at system
67 * boot time, so wall_to_monotonic will be negative, however, we will
72 * monotonic time not to jump. We need to add total_sleep_time to
73 * wall_to_monotonic to get the real boot based time offset.
75 * wall_to_monotonic is no longer the boot time, getboottime must be
102 /* Difference between accumulated time and NTP time in ntp
H A Dtimecounter.h53 * cycle counter hardware, locking issues and reading the time
90 * timecounter_adjtime - Shifts the time of the clock.
99 * timecounter_init - initialize a time counter
100 * @tc: Pointer to time counter which is to be initialized/reset
102 * @start_tstamp: Arbitrary initial time stamp.
105 * the initial time stamp. Every call to timecounter_read() increments
106 * the time stamp counter by the number of elapsed nanoseconds.
114 * plus the initial time stamp
115 * @tc: Pointer to time counter.
117 * In other words, keeps track of time since the same epoch as
118 * the function which generated the initial time stamp.
124 * time base as values returned by
126 * @tc: Pointer to time counter.
H A Dmsg.h20 time_t q_stime; /* last msgsnd time */
21 time_t q_rtime; /* last msgrcv time */
22 time_t q_ctime; /* last change time */
H A Dtimerqueue.h27 * timerqueue_getnext - Returns the timer with the earliest expiration time
32 * earliest expiration time.
H A Dmigrate_mode.h6 * on most operations but not ->writepage as the potential stall time
H A Dhrtimer.h88 * the absolute expiry time in the hrtimers internal
89 * representation. The time is related to the clock on
93 * @_softexpires: the absolute earliest expiry time of the hrtimer.
94 * The time which was given as expiry time when the timer
141 * @get_time: function to retrieve the current time of the clock
142 * @softirq_time: the time when running the hrtimer queue in the softirq
171 * @expires_next: absolute time of the next event which was scheduled
179 * @max_hang_time: Maximum time spent in hrtimer_interrupt
200 static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) hrtimer_set_expires() argument
202 timer->node.expires = time; hrtimer_set_expires()
203 timer->_softexpires = time; hrtimer_set_expires()
206 static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) hrtimer_set_expires_range() argument
208 timer->_softexpires = time; hrtimer_set_expires_range()
209 timer->node.expires = ktime_add_safe(time, delta); hrtimer_set_expires_range()
212 static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta) hrtimer_set_expires_range_ns() argument
214 timer->_softexpires = time; hrtimer_set_expires_range_ns()
215 timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta)); hrtimer_set_expires_range_ns()
224 static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) hrtimer_add_expires() argument
226 timer->node.expires = ktime_add_safe(timer->node.expires, time); hrtimer_add_expires()
227 timer->_softexpires = ktime_add_safe(timer->_softexpires, time); hrtimer_add_expires()
271 * In high resolution mode the time reference must be read accurate
306 * In non high resolution mode the time reference is taken from hrtimer_peek_ahead_timers()
307 * the base softirq time variable. hrtimer_peek_ahead_timers()
/linux-4.1.27/arch/m68k/hp300/
H A DMakefile5 obj-y := config.o time.o reboot.o
/linux-4.1.27/arch/m68k/sun3x/
H A DMakefile5 obj-y := config.o time.o dvma.o prom.o
/linux-4.1.27/arch/arm/mach-rpc/
H A DMakefile7 obj-y := dma.o ecard.o fiq.o irq.o riscpc.o time.o
/linux-4.1.27/scripts/
H A Dshow_delta4 # time data, and format with time deltas.
19 have time data prefixed because the CONFIG_PRINTK_TIME option is set, or
20 the kernel command line option "time" is specified. When run with no
21 options, the time information is converted to show the time delta between
23 are relative to a single (base) point in time.
27 -b <base> Specify a base for time references.
31 line) is used as the time reference.
50 time = string.atof(time_str)
52 #print "time=", time
53 return (time, rest)
58 # time data is expressed in seconds.useconds,
65 (time, rest) = get_time(line)
67 # if any problem parsing time, don't convert anything
71 # show time from base
72 delta = time - base_time
74 # just show time from last line
75 delta = time - last_time
76 last_time = time
78 return ("[%5.6f < %5.6f >]" % (time, delta)) + rest
111 (time, rest) = get_time(line)
115 base_time = time
/linux-4.1.27/include/asm-generic/
H A Drtc.h27 #define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */
45 static inline unsigned int __get_rtc_time(struct rtc_time *time) __get_rtc_time() argument
61 * Once the read clears, read the RTC time (again via ioctl). Easy. __get_rtc_time()
73 time->tm_sec = CMOS_READ(RTC_SECONDS); __get_rtc_time()
74 time->tm_min = CMOS_READ(RTC_MINUTES); __get_rtc_time()
75 time->tm_hour = CMOS_READ(RTC_HOURS); __get_rtc_time()
76 time->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH); __get_rtc_time()
77 time->tm_mon = CMOS_READ(RTC_MONTH); __get_rtc_time()
78 time->tm_year = CMOS_READ(RTC_YEAR); __get_rtc_time()
87 time->tm_sec = bcd2bin(time->tm_sec); __get_rtc_time()
88 time->tm_min = bcd2bin(time->tm_min); __get_rtc_time()
89 time->tm_hour = bcd2bin(time->tm_hour); __get_rtc_time()
90 time->tm_mday = bcd2bin(time->tm_mday); __get_rtc_time()
91 time->tm_mon = bcd2bin(time->tm_mon); __get_rtc_time()
92 time->tm_year = bcd2bin(time->tm_year); __get_rtc_time()
96 time->tm_year += real_year - 72; __get_rtc_time()
103 if (time->tm_year <= 69) __get_rtc_time()
104 time->tm_year += 100; __get_rtc_time()
106 time->tm_mon--; __get_rtc_time()
115 /* Set the current date and time in the real time clock. */ __set_rtc_time()
116 static inline int __set_rtc_time(struct rtc_time *time) __set_rtc_time() argument
126 yrs = time->tm_year; __set_rtc_time()
127 mon = time->tm_mon + 1; /* tm_mon starts at zero */ __set_rtc_time()
128 day = time->tm_mday; __set_rtc_time()
129 hrs = time->tm_hour; __set_rtc_time()
130 min = time->tm_min; __set_rtc_time()
131 sec = time->tm_sec; __set_rtc_time()
H A Dcputime.h4 #include <linux/time.h>
H A Dresource.h8 * boot-time rlimit defaults for the init task:
H A Dsimd.h5 * may_use_simd - whether it is allowable at this time to issue SIMD
/linux-4.1.27/arch/m32r/include/uapi/asm/
H A Dsetup.h5 * This is set up by the setup-routine at boot-time
H A Dsembuf.h16 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
H A Dmsgbuf.h16 __kernel_time_t msg_stime; /* last msgsnd time */
18 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h17 __kernel_time_t shm_atime; /* last attach time */
19 __kernel_time_t shm_dtime; /* last detach time */
21 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/m68k/atari/
H A DMakefile5 obj-y := config.o time.o debug.o ataints.o stdma.o \
/linux-4.1.27/fs/ntfs/
H A Dtime.h2 * time.h - NTFS time conversion functions. Part of the Linux-NTFS project.
25 #include <linux/time.h> /* For current_kernel_time(). */
33 * utc2ntfs - convert Linux UTC time to NTFS time
34 * @ts: Linux UTC time to convert to NTFS time
36 * Convert the Linux UTC time @ts to its corresponding NTFS time and return
39 * Linux stores time in a struct timespec consisting of a time_t (long at
44 * NTFS uses Microsoft's standard time format which is stored in a s64 and is
52 * converted to 100ns intervals, and then add the NTFS time offset. utc2ntfs()
59 * get_current_ntfs_time - get the current time in little endian NTFS format
61 * Get the current time from the Linux kernel, convert it to its corresponding
62 * NTFS time and return that in little endian format.
70 * ntfs2utc - convert NTFS time to Linux time
71 * @time: NTFS time (little endian) to convert to Linux UTC
73 * Convert the little endian NTFS time @time to its corresponding Linux UTC
74 * time and return that in cpu format.
76 * Linux stores time in a struct timespec consisting of a time_t (long at
81 * NTFS uses Microsoft's standard time format which is stored in a s64 and is
85 static inline struct timespec ntfs2utc(const sle64 time) ntfs2utc() argument
89 /* Subtract the NTFS time offset. */ ntfs2utc()
90 u64 t = (u64)(sle64_to_cpu(time) - NTFS_TIME_OFFSET); ntfs2utc()
92 * Convert the time to 1-second intervals and the remainder to ntfs2utc()
/linux-4.1.27/arch/m68k/kernel/
H A Dtime.c2 * linux/arch/m68k/kernel/time.c
6 * This file contains the m68k-specific time handling details.
28 #include <linux/time.h>
38 * timer_interrupt() needs to keep up the real-time clock,
75 struct rtc_time time; read_persistent_clock() local
80 mach_hwclk(0, &time); read_persistent_clock()
82 if ((time.tm_year += 1900) < 1970) read_persistent_clock()
83 time.tm_year += 100; read_persistent_clock()
84 ts->tv_sec = mktime(time.tm_year, time.tm_mon, time.tm_mday, read_persistent_clock()
85 time.tm_hour, time.tm_min, time.tm_sec); read_persistent_clock()
/linux-4.1.27/drivers/rtc/
H A Drtc-dm355evm.c39 union evm_time time; dm355evm_rtc_read_time() local
52 if (tries && time.bytes[0] == status) dm355evm_rtc_read_time()
54 time.bytes[0] = status; dm355evm_rtc_read_time()
59 if (tries && time.bytes[1] == status) dm355evm_rtc_read_time()
61 time.bytes[1] = status; dm355evm_rtc_read_time()
66 if (tries && time.bytes[2] == status) dm355evm_rtc_read_time()
68 time.bytes[2] = status; dm355evm_rtc_read_time()
73 if (tries && time.bytes[3] == status) dm355evm_rtc_read_time()
75 time.bytes[3] = status; dm355evm_rtc_read_time()
79 dev_dbg(dev, "read timestamp %08x\n", time.value); dm355evm_rtc_read_time()
81 rtc_time_to_tm(le32_to_cpu(time.value), tm); dm355evm_rtc_read_time()
87 union evm_time time; dm355evm_rtc_set_time() local
92 time.value = cpu_to_le32(value); dm355evm_rtc_set_time()
94 dev_dbg(dev, "write timestamp %08x\n", time.value); dm355evm_rtc_set_time()
100 status = dm355evm_msp_write(time.bytes[0], DM355EVM_MSP_RTC_0); dm355evm_rtc_set_time()
104 status = dm355evm_msp_write(time.bytes[1], DM355EVM_MSP_RTC_1); dm355evm_rtc_set_time()
108 status = dm355evm_msp_write(time.bytes[2], DM355EVM_MSP_RTC_2); dm355evm_rtc_set_time()
112 status = dm355evm_msp_write(time.bytes[3], DM355EVM_MSP_RTC_3); dm355evm_rtc_set_time()
H A Drtc-wm8350.c18 #include <linux/time.h>
36 * Read current time and date in RTC
45 * Read the time twice and compare. wm8350_rtc_readtime()
46 * If time1 == time2, then time is valid else retry. wm8350_rtc_readtime()
90 dev_err(dev, "timed out reading RTC time\n"); wm8350_rtc_readtime()
95 * Set current time and date in RTC
100 u16 time[4]; wm8350_rtc_settime() local
104 time[0] = tm->tm_sec; wm8350_rtc_settime()
105 time[0] |= tm->tm_min << WM8350_RTC_MINS_SHIFT; wm8350_rtc_settime()
106 time[1] = tm->tm_hour; wm8350_rtc_settime()
107 time[1] |= (tm->tm_wday + 1) << WM8350_RTC_DAY_SHIFT; wm8350_rtc_settime()
108 time[2] = tm->tm_mday; wm8350_rtc_settime()
109 time[2] |= (tm->tm_mon + 1) << WM8350_RTC_MTH_SHIFT; wm8350_rtc_settime()
110 time[3] = ((tm->tm_year + 1900) / 100) << WM8350_RTC_YHUNDREDS_SHIFT; wm8350_rtc_settime()
111 time[3] |= (tm->tm_year + 1900) % 100; wm8350_rtc_settime()
114 time[0], time[1], time[2], time[3]); wm8350_rtc_settime()
132 /* Write time to RTC */ wm8350_rtc_settime()
133 ret = wm8350_block_write(wm8350, WM8350_RTC_SECONDS_MINUTES, 4, time); wm8350_rtc_settime()
144 * Read alarm time and date in RTC
149 struct rtc_time *tm = &alrm->time; wm8350_rtc_readalarm()
150 u16 time[4]; wm8350_rtc_readalarm() local
153 ret = wm8350_block_read(wm8350, WM8350_ALARM_SECONDS_MINUTES, 4, time); wm8350_rtc_readalarm()
157 tm->tm_sec = time[0] & WM8350_RTC_ALMSECS_MASK; wm8350_rtc_readalarm()
161 tm->tm_min = time[0] & WM8350_RTC_ALMMINS_MASK; wm8350_rtc_readalarm()
167 tm->tm_hour = time[1] & WM8350_RTC_ALMHRS_MASK; wm8350_rtc_readalarm()
171 tm->tm_wday = ((time[1] >> WM8350_RTC_ALMDAY_SHIFT) & 0x7) - 1; wm8350_rtc_readalarm()
175 tm->tm_mon = time[2] & WM8350_RTC_ALMMTH_MASK; wm8350_rtc_readalarm()
181 tm->tm_mday = (time[2] & WM8350_RTC_ALMDATE_MASK); wm8350_rtc_readalarm()
187 alrm->enabled = !(time[3] & WM8350_RTC_ALMSTS); wm8350_rtc_readalarm()
253 struct rtc_time *tm = &alrm->time; wm8350_rtc_setalarm()
254 u16 time[3]; wm8350_rtc_setalarm() local
257 memset(time, 0, sizeof(time)); wm8350_rtc_setalarm()
260 time[0] |= tm->tm_sec; wm8350_rtc_setalarm()
262 time[0] |= WM8350_RTC_ALMSECS_MASK; wm8350_rtc_setalarm()
265 time[0] |= tm->tm_min << WM8350_RTC_ALMMINS_SHIFT; wm8350_rtc_setalarm()
267 time[0] |= WM8350_RTC_ALMMINS_MASK; wm8350_rtc_setalarm()
270 time[1] |= tm->tm_hour; wm8350_rtc_setalarm()
272 time[1] |= WM8350_RTC_ALMHRS_MASK; wm8350_rtc_setalarm()
275 time[1] |= (tm->tm_wday + 1) << WM8350_RTC_ALMDAY_SHIFT; wm8350_rtc_setalarm()
277 time[1] |= WM8350_RTC_ALMDAY_MASK; wm8350_rtc_setalarm()
280 time[2] |= tm->tm_mday; wm8350_rtc_setalarm()
282 time[2] |= WM8350_RTC_ALMDATE_MASK; wm8350_rtc_setalarm()
285 time[2] |= (tm->tm_mon + 1) << WM8350_RTC_ALMMTH_SHIFT; wm8350_rtc_setalarm()
287 time[2] |= WM8350_RTC_ALMMTH_MASK; wm8350_rtc_setalarm()
293 /* Write time to RTC */ wm8350_rtc_setalarm()
295 3, time); wm8350_rtc_setalarm()
H A Drtc-pcf50633.c56 u_int8_t time[PCF50633_TI_EXTENT]; member in struct:pcf50633_time
69 rtc->tm_sec = bcd2bin(pcf->time[PCF50633_TI_SEC]); pcf2rtc_time()
70 rtc->tm_min = bcd2bin(pcf->time[PCF50633_TI_MIN]); pcf2rtc_time()
71 rtc->tm_hour = bcd2bin(pcf->time[PCF50633_TI_HOUR]); pcf2rtc_time()
72 rtc->tm_wday = bcd2bin(pcf->time[PCF50633_TI_WKDAY]); pcf2rtc_time()
73 rtc->tm_mday = bcd2bin(pcf->time[PCF50633_TI_DAY]); pcf2rtc_time()
74 rtc->tm_mon = bcd2bin(pcf->time[PCF50633_TI_MONTH]) - 1; pcf2rtc_time()
75 rtc->tm_year = bcd2bin(pcf->time[PCF50633_TI_YEAR]) + 100; pcf2rtc_time()
80 pcf->time[PCF50633_TI_SEC] = bin2bcd(rtc->tm_sec); rtc2pcf_time()
81 pcf->time[PCF50633_TI_MIN] = bin2bcd(rtc->tm_min); rtc2pcf_time()
82 pcf->time[PCF50633_TI_HOUR] = bin2bcd(rtc->tm_hour); rtc2pcf_time()
83 pcf->time[PCF50633_TI_WKDAY] = bin2bcd(rtc->tm_wday); rtc2pcf_time()
84 pcf->time[PCF50633_TI_DAY] = bin2bcd(rtc->tm_mday); rtc2pcf_time()
85 pcf->time[PCF50633_TI_MONTH] = bin2bcd(rtc->tm_mon + 1); rtc2pcf_time()
86 pcf->time[PCF50633_TI_YEAR] = bin2bcd(rtc->tm_year % 100); rtc2pcf_time()
118 &pcf_tm.time[0]); pcf50633_rtc_read_time()
120 dev_err(dev, "Failed to read time\n"); pcf50633_rtc_read_time()
125 pcf_tm.time[PCF50633_TI_DAY], pcf50633_rtc_read_time()
126 pcf_tm.time[PCF50633_TI_MONTH], pcf50633_rtc_read_time()
127 pcf_tm.time[PCF50633_TI_YEAR], pcf50633_rtc_read_time()
128 pcf_tm.time[PCF50633_TI_HOUR], pcf50633_rtc_read_time()
129 pcf_tm.time[PCF50633_TI_MIN], pcf50633_rtc_read_time()
130 pcf_tm.time[PCF50633_TI_SEC]); pcf50633_rtc_read_time()
156 pcf_tm.time[PCF50633_TI_DAY], pcf50633_rtc_set_time()
157 pcf_tm.time[PCF50633_TI_MONTH], pcf50633_rtc_set_time()
158 pcf_tm.time[PCF50633_TI_YEAR], pcf50633_rtc_set_time()
159 pcf_tm.time[PCF50633_TI_HOUR], pcf50633_rtc_set_time()
160 pcf_tm.time[PCF50633_TI_MIN], pcf50633_rtc_set_time()
161 pcf_tm.time[PCF50633_TI_SEC]); pcf50633_rtc_set_time()
172 &pcf_tm.time[0]); pcf50633_rtc_set_time()
192 PCF50633_TI_EXTENT, &pcf_tm.time[0]); pcf50633_rtc_read_alarm()
194 dev_err(dev, "Failed to read time\n"); pcf50633_rtc_read_alarm()
198 pcf2rtc_time(&alrm->time, &pcf_tm); pcf50633_rtc_read_alarm()
200 return rtc_valid_tm(&alrm->time); pcf50633_rtc_read_alarm()
211 rtc2pcf_time(&pcf_tm, &alrm->time); pcf50633_rtc_set_alarm()
214 pcf_tm.time[PCF50633_TI_WKDAY] = 7; pcf50633_rtc_set_alarm()
224 PCF50633_TI_EXTENT, &pcf_tm.time[0]); pcf50633_rtc_set_alarm()
H A Drtc-rk808.c30 /* RK808 has a shadowed register for saving a "frozen" RTC time.
31 * When user setting "GET_TIME" to 1, the time will save in this shadowed
32 * register. If set "READSEL" to 1, user read rtc time register, actually
33 * get the time of that moment. If we need the real time, clr this bit.
59 /* Read current time and date in RTC */ rk808_rtc_readtime()
77 * After we set the GET_TIME bit, the rtc time can't be read rk808_rtc_readtime()
79 * 32khz. If we clear the GET_TIME bit here, the time of i2c transfer rk808_rtc_readtime()
104 dev_dbg(dev, "RTC date/time %4d-%02d-%02d(%d) %02d:%02d:%02d\n", rk808_rtc_readtime()
111 /* Set current time and date in RTC */ rk808_rtc_set_time()
126 dev_dbg(dev, "set RTC date/time %4d-%02d-%02d(%d) %02d:%02d:%02d\n", rk808_rtc_set_time()
155 /* Read alarm time and date in RTC */ rk808_rtc_readalarm()
167 alrm->time.tm_sec = bcd2bin(alrm_data[0] & SECONDS_REG_MSK); rk808_rtc_readalarm()
168 alrm->time.tm_min = bcd2bin(alrm_data[1] & MINUTES_REG_MAK); rk808_rtc_readalarm()
169 alrm->time.tm_hour = bcd2bin(alrm_data[2] & HOURS_REG_MSK); rk808_rtc_readalarm()
170 alrm->time.tm_mday = bcd2bin(alrm_data[3] & DAYS_REG_MSK); rk808_rtc_readalarm()
171 alrm->time.tm_mon = (bcd2bin(alrm_data[4] & MONTHS_REG_MSK)) - 1; rk808_rtc_readalarm()
172 alrm->time.tm_year = (bcd2bin(alrm_data[5] & YEARS_REG_MSK)) + 100; rk808_rtc_readalarm()
180 dev_dbg(dev, "alrm read RTC date/time %4d-%02d-%02d(%d) %02d:%02d:%02d\n", rk808_rtc_readalarm()
181 1900 + alrm->time.tm_year, alrm->time.tm_mon + 1, rk808_rtc_readalarm()
182 alrm->time.tm_mday, alrm->time.tm_wday, alrm->time.tm_hour, rk808_rtc_readalarm()
183 alrm->time.tm_min, alrm->time.tm_sec); rk808_rtc_readalarm()
225 dev_dbg(dev, "alrm set RTC date/time %4d-%02d-%02d(%d) %02d:%02d:%02d\n", rk808_rtc_setalarm()
226 1900 + alrm->time.tm_year, alrm->time.tm_mon + 1, rk808_rtc_setalarm()
227 alrm->time.tm_mday, alrm->time.tm_wday, alrm->time.tm_hour, rk808_rtc_setalarm()
228 alrm->time.tm_min, alrm->time.tm_sec); rk808_rtc_setalarm()
230 alrm_data[0] = bin2bcd(alrm->time.tm_sec); rk808_rtc_setalarm()
231 alrm_data[1] = bin2bcd(alrm->time.tm_min); rk808_rtc_setalarm()
232 alrm_data[2] = bin2bcd(alrm->time.tm_hour); rk808_rtc_setalarm()
233 alrm_data[3] = bin2bcd(alrm->time.tm_mday); rk808_rtc_setalarm()
234 alrm_data[4] = bin2bcd(alrm->time.tm_mon + 1); rk808_rtc_setalarm()
235 alrm_data[5] = bin2bcd(alrm->time.tm_year - 100); rk808_rtc_setalarm()
367 /* set init time */ rk808_rtc_probe()
370 dev_err(&pdev->dev, "Failed to read RTC time\n"); rk808_rtc_probe()
375 dev_warn(&pdev->dev, "invalid date/time\n"); rk808_rtc_probe()
H A Drtc-proc.c62 if ((unsigned int)alrm.time.tm_hour <= 24) rtc_proc_show()
63 seq_printf(seq, "%02d:", alrm.time.tm_hour); rtc_proc_show()
66 if ((unsigned int)alrm.time.tm_min <= 59) rtc_proc_show()
67 seq_printf(seq, "%02d:", alrm.time.tm_min); rtc_proc_show()
70 if ((unsigned int)alrm.time.tm_sec <= 59) rtc_proc_show()
71 seq_printf(seq, "%02d\n", alrm.time.tm_sec); rtc_proc_show()
76 if ((unsigned int)alrm.time.tm_year <= 200) rtc_proc_show()
77 seq_printf(seq, "%04d-", alrm.time.tm_year + 1900); rtc_proc_show()
80 if ((unsigned int)alrm.time.tm_mon <= 11) rtc_proc_show()
81 seq_printf(seq, "%02d-", alrm.time.tm_mon + 1); rtc_proc_show()
84 if (alrm.time.tm_mday && (unsigned int)alrm.time.tm_mday <= 31) rtc_proc_show()
85 seq_printf(seq, "%02d\n", alrm.time.tm_mday); rtc_proc_show()
H A Dsystohc.c8 #include <linux/time.h>
11 * rtc_set_ntp_time - Save NTP synchronized time to the RTC
12 * @now: Current time of day
15 * that stores time for later retrieval by rtc_hctosys.
H A Drtc-spear.c66 /* date reg equal to time reg, for debug only */
199 * spear_rtc_read_time - set the time
201 * @tm: holds date and time
203 * This function read time and date. On success it will return 0
209 unsigned int time, date; spear_rtc_read_time() local
214 time = readl(config->ioaddr + TIME_REG); spear_rtc_read_time()
216 tm->tm_sec = (time >> SECOND_SHIFT) & SECOND_MASK; spear_rtc_read_time()
217 tm->tm_min = (time >> MINUTE_SHIFT) & MIN_MASK; spear_rtc_read_time()
218 tm->tm_hour = (time >> HOUR_SHIFT) & HOUR_MASK; spear_rtc_read_time()
228 * spear_rtc_set_time - set the time
230 * @tm: holds date and time
232 * This function set time and date. On success it will return 0
238 unsigned int time, date; spear_rtc_set_time() local
244 time = (tm->tm_sec << SECOND_SHIFT) | (tm->tm_min << MINUTE_SHIFT) | spear_rtc_set_time()
248 writel(time, config->ioaddr + TIME_REG); spear_rtc_set_time()
255 * spear_rtc_read_alarm - read the alarm time
257 * @alm: holds alarm date and time
259 * This function read alarm time and date. On success it will return 0
265 unsigned int time, date; spear_rtc_read_alarm() local
269 time = readl(config->ioaddr + ALARM_TIME_REG); spear_rtc_read_alarm()
271 alm->time.tm_sec = (time >> SECOND_SHIFT) & SECOND_MASK; spear_rtc_read_alarm()
272 alm->time.tm_min = (time >> MINUTE_SHIFT) & MIN_MASK; spear_rtc_read_alarm()
273 alm->time.tm_hour = (time >> HOUR_SHIFT) & HOUR_MASK; spear_rtc_read_alarm()
274 alm->time.tm_mday = (date >> MDAY_SHIFT) & DAY_MASK; spear_rtc_read_alarm()
275 alm->time.tm_mon = (date >> MONTH_SHIFT) & MONTH_MASK; spear_rtc_read_alarm()
276 alm->time.tm_year = (date >> YEAR_SHIFT) & YEAR_MASK; spear_rtc_read_alarm()
278 bcd2tm(&alm->time); spear_rtc_read_alarm()
285 * spear_rtc_set_alarm - set the alarm time
287 * @alm: holds alarm date and time
289 * This function set alarm time and date. On success it will return 0
295 unsigned int time, date; spear_rtc_set_alarm() local
298 if (tm2bcd(&alm->time) < 0) spear_rtc_set_alarm()
303 time = (alm->time.tm_sec << SECOND_SHIFT) | (alm->time.tm_min << spear_rtc_set_alarm()
304 MINUTE_SHIFT) | (alm->time.tm_hour << HOUR_SHIFT); spear_rtc_set_alarm()
305 date = (alm->time.tm_mday << MDAY_SHIFT) | (alm->time.tm_mon << spear_rtc_set_alarm()
306 MONTH_SHIFT) | (alm->time.tm_year << YEAR_SHIFT); spear_rtc_set_alarm()
308 writel(time, config->ioaddr + ALARM_TIME_REG); spear_rtc_set_alarm()
H A Drtc-mv.c118 alm->time.tm_sec = bcd2bin(second); mv_rtc_read_alarm()
119 alm->time.tm_min = bcd2bin(minute); mv_rtc_read_alarm()
120 alm->time.tm_hour = bcd2bin(hour); mv_rtc_read_alarm()
121 alm->time.tm_mday = bcd2bin(day); mv_rtc_read_alarm()
122 alm->time.tm_wday = bcd2bin(wday); mv_rtc_read_alarm()
123 alm->time.tm_mon = bcd2bin(month) - 1; mv_rtc_read_alarm()
125 alm->time.tm_year = bcd2bin(year) + 100; mv_rtc_read_alarm()
127 if (rtc_valid_tm(&alm->time) < 0) { mv_rtc_read_alarm()
128 dev_err(dev, "retrieved alarm date/time is not valid.\n"); mv_rtc_read_alarm()
129 rtc_time_to_tm(0, &alm->time); mv_rtc_read_alarm()
142 if (alm->time.tm_sec >= 0) mv_rtc_set_alarm()
143 rtc_reg |= (RTC_ALARM_VALID | bin2bcd(alm->time.tm_sec)) mv_rtc_set_alarm()
145 if (alm->time.tm_min >= 0) mv_rtc_set_alarm()
146 rtc_reg |= (RTC_ALARM_VALID | bin2bcd(alm->time.tm_min)) mv_rtc_set_alarm()
148 if (alm->time.tm_hour >= 0) mv_rtc_set_alarm()
149 rtc_reg |= (RTC_ALARM_VALID | bin2bcd(alm->time.tm_hour)) mv_rtc_set_alarm()
154 if (alm->time.tm_mday >= 0) mv_rtc_set_alarm()
155 rtc_reg = (RTC_ALARM_VALID | bin2bcd(alm->time.tm_mday)) mv_rtc_set_alarm()
160 if (alm->time.tm_mon >= 0) mv_rtc_set_alarm()
161 rtc_reg |= (RTC_ALARM_VALID | bin2bcd(alm->time.tm_mon + 1)) mv_rtc_set_alarm()
164 if (alm->time.tm_year >= 0) mv_rtc_set_alarm()
165 rtc_reg |= (RTC_ALARM_VALID | bin2bcd(alm->time.tm_year % 100)) mv_rtc_set_alarm()
H A Drtc-ds3232.c80 "time unreliable\n"); ds3232_check_rtc_status()
103 static int ds3232_read_time(struct device *dev, struct rtc_time *time) ds3232_read_time() argument
135 time->tm_sec = bcd2bin(second); ds3232_read_time()
136 time->tm_min = bcd2bin(minute); ds3232_read_time()
140 time->tm_hour = bcd2bin(hour & 0x1F) + 12; ds3232_read_time()
142 time->tm_hour = bcd2bin(hour & 0x1F); ds3232_read_time()
144 time->tm_hour = bcd2bin(hour); ds3232_read_time()
148 time->tm_wday = bcd2bin(week) - 1; ds3232_read_time()
149 time->tm_mday = bcd2bin(day); ds3232_read_time()
151 time->tm_mon = bcd2bin(month & 0x7F) - 1; ds3232_read_time()
155 time->tm_year = bcd2bin(year) + add_century; ds3232_read_time()
157 return rtc_valid_tm(time); ds3232_read_time()
160 static int ds3232_set_time(struct device *dev, struct rtc_time *time) ds3232_set_time() argument
165 /* Extract time from rtc_time and load into ds3232*/ ds3232_set_time()
167 buf[0] = bin2bcd(time->tm_sec); ds3232_set_time()
168 buf[1] = bin2bcd(time->tm_min); ds3232_set_time()
169 buf[2] = bin2bcd(time->tm_hour); ds3232_set_time()
171 buf[3] = bin2bcd(time->tm_wday + 1); ds3232_set_time()
172 buf[4] = bin2bcd(time->tm_mday); /* Date */ ds3232_set_time()
174 buf[5] = bin2bcd(time->tm_mon + 1); ds3232_set_time()
175 if (time->tm_year >= 100) { ds3232_set_time()
177 buf[6] = bin2bcd(time->tm_year - 100); ds3232_set_time()
179 buf[6] = bin2bcd(time->tm_year); ds3232_set_time()
213 alarm->time.tm_sec = bcd2bin(buf[0] & 0x7F); ds3232_read_alarm()
214 alarm->time.tm_min = bcd2bin(buf[1] & 0x7F); ds3232_read_alarm()
215 alarm->time.tm_hour = bcd2bin(buf[2] & 0x7F); ds3232_read_alarm()
216 alarm->time.tm_mday = bcd2bin(buf[3] & 0x7F); ds3232_read_alarm()
218 alarm->time.tm_mon = -1; ds3232_read_alarm()
219 alarm->time.tm_year = -1; ds3232_read_alarm()
220 alarm->time.tm_wday = -1; ds3232_read_alarm()
221 alarm->time.tm_yday = -1; ds3232_read_alarm()
222 alarm->time.tm_isdst = -1; ds3232_read_alarm()
235 * and only 24h time mode supported indeed
250 buf[0] = bin2bcd(alarm->time.tm_sec); ds3232_set_alarm()
251 buf[1] = bin2bcd(alarm->time.tm_min); ds3232_set_alarm()
252 buf[2] = bin2bcd(alarm->time.tm_hour); ds3232_set_alarm()
253 buf[3] = bin2bcd(alarm->time.tm_mday); ds3232_set_alarm()
354 * at system resume flow, because at this time the i2c bus ds3232_irq()
H A Drtc-ds1305.c30 /* RTC date/time ... the main special cases are that we:
171 * Get/set of date and time is pretty normal.
174 static int ds1305_get_time(struct device *dev, struct rtc_time *time) ds1305_get_time() argument
181 /* Use write-then-read to get all the date/time registers ds1305_get_time()
194 time->tm_sec = bcd2bin(buf[DS1305_SEC]); ds1305_get_time()
195 time->tm_min = bcd2bin(buf[DS1305_MIN]); ds1305_get_time()
196 time->tm_hour = bcd2hour(buf[DS1305_HOUR]); ds1305_get_time()
197 time->tm_wday = buf[DS1305_WDAY] - 1; ds1305_get_time()
198 time->tm_mday = bcd2bin(buf[DS1305_MDAY]); ds1305_get_time()
199 time->tm_mon = bcd2bin(buf[DS1305_MON]) - 1; ds1305_get_time()
200 time->tm_year = bcd2bin(buf[DS1305_YEAR]) + 100; ds1305_get_time()
204 "read", time->tm_sec, time->tm_min, ds1305_get_time()
205 time->tm_hour, time->tm_mday, ds1305_get_time()
206 time->tm_mon, time->tm_year, time->tm_wday); ds1305_get_time()
209 return rtc_valid_tm(time); ds1305_get_time()
212 static int ds1305_set_time(struct device *dev, struct rtc_time *time) ds1305_set_time() argument
220 "write", time->tm_sec, time->tm_min, ds1305_set_time()
221 time->tm_hour, time->tm_mday, ds1305_set_time()
222 time->tm_mon, time->tm_year, time->tm_wday); ds1305_set_time()
224 /* Write registers starting at the first time/date address. */ ds1305_set_time()
227 *bp++ = bin2bcd(time->tm_sec); ds1305_set_time()
228 *bp++ = bin2bcd(time->tm_min); ds1305_set_time()
229 *bp++ = hour2bcd(ds1305->hr12, time->tm_hour); ds1305_set_time()
230 *bp++ = (time->tm_wday < 7) ? (time->tm_wday + 1) : 1; ds1305_set_time()
231 *bp++ = bin2bcd(time->tm_mday); ds1305_set_time()
232 *bp++ = bin2bcd(time->tm_mon + 1); ds1305_set_time()
233 *bp++ = bin2bcd(time->tm_year - 100); ds1305_set_time()
313 /* Stuff these values into alm->time and let RTC framework code ds1305_get_alarm()
317 alm->time.tm_sec = bcd2bin(buf[DS1305_SEC]); ds1305_get_alarm()
318 alm->time.tm_min = bcd2bin(buf[DS1305_MIN]); ds1305_get_alarm()
319 alm->time.tm_hour = bcd2hour(buf[DS1305_HOUR]); ds1305_get_alarm()
320 alm->time.tm_mday = -1; ds1305_get_alarm()
321 alm->time.tm_mon = -1; ds1305_get_alarm()
322 alm->time.tm_year = -1; ds1305_get_alarm()
324 alm->time.tm_wday = -1; ds1305_get_alarm()
325 alm->time.tm_mday = -1; ds1305_get_alarm()
326 alm->time.tm_isdst = -1; ds1305_get_alarm()
344 status = rtc_tm_to_time(&alm->time, &later); ds1305_set_alarm()
348 /* Read current time as time_t */ ds1305_set_alarm()
375 buf[1 + DS1305_SEC] = bin2bcd(alm->time.tm_sec); ds1305_set_alarm()
376 buf[1 + DS1305_MIN] = bin2bcd(alm->time.tm_min); ds1305_set_alarm()
377 buf[1 + DS1305_HOUR] = hour2bcd(ds1305->hr12, alm->time.tm_hour); ds1305_set_alarm()
684 /* this may need one-time (re)init */ ds1305_probe()
H A Drtc-armada38x.c44 * While setting the time, the RTC TIME register should not be
45 * accessed. Setting the RTC time involves sleeping during
67 unsigned long time, time_check; armada38x_rtc_read_time() local
70 time = readl(rtc->regs + RTC_TIME); armada38x_rtc_read_time()
72 * WA for failing time set attempts. As stated in HW ERRATA if armada38x_rtc_read_time()
73 * more than one second between two time reads is detected armada38x_rtc_read_time()
77 if ((time_check - time) > 1) armada38x_rtc_read_time()
91 unsigned long time, flags; armada38x_rtc_set_time() local
93 ret = rtc_tm_to_time(tm, &time); armada38x_rtc_set_time()
98 * Setting the RTC time not always succeeds. According to the armada38x_rtc_set_time()
100 * then wait for 100ms before writing to the time register to be armada38x_rtc_set_time()
106 rtc_delayed_write(time, rtc, RTC_TIME); armada38x_rtc_set_time()
116 unsigned long time, flags; armada38x_rtc_read_alarm() local
121 time = readl(rtc->regs + RTC_ALARM1); armada38x_rtc_read_alarm()
127 rtc_time_to_tm(time, &alrm->time); armada38x_rtc_read_alarm()
135 unsigned long time, flags; armada38x_rtc_set_alarm() local
139 ret = rtc_tm_to_time(&alrm->time, &time); armada38x_rtc_set_alarm()
146 rtc_delayed_write(time, rtc, RTC_ALARM1); armada38x_rtc_set_alarm()
H A Drtc-vr41xx.c139 static int vr41xx_rtc_read_time(struct device *dev, struct rtc_time *time) vr41xx_rtc_read_time() argument
146 rtc_time_to_tm(epoch_sec + elapsed_sec, time); vr41xx_rtc_read_time()
151 static int vr41xx_rtc_set_time(struct device *dev, struct rtc_time *time) vr41xx_rtc_set_time() argument
156 current_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday, vr41xx_rtc_set_time()
157 time->tm_hour, time->tm_min, time->tm_sec); vr41xx_rtc_set_time()
167 struct rtc_time *time = &wkalrm->time; vr41xx_rtc_read_alarm() local
178 rtc_time_to_tm((high << 17) | (mid << 1) | (low >> 15), time); vr41xx_rtc_read_alarm()
186 struct rtc_time *time = &wkalrm->time; vr41xx_rtc_set_alarm() local
188 alarm_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday, vr41xx_rtc_set_alarm()
189 time->tm_hour, time->tm_min, time->tm_sec); vr41xx_rtc_set_alarm()
H A Drtc-wm831x.c17 #include <linux/time.h>
106 * regenerated every time we set the RTC so it should be a wm831x_rtc_add_randomness()
120 * Read current time and date in RTC
156 u32 time = (time1[0] << 16) | time1[1]; wm831x_rtc_readtime() local
158 rtc_time_to_tm(time, tm); wm831x_rtc_readtime()
164 dev_err(dev, "Timed out reading current time\n"); wm831x_rtc_readtime()
170 * Set current time and date in RTC
172 static int wm831x_rtc_set_mmss(struct device *dev, unsigned long time) wm831x_rtc_set_mmss() argument
182 (time >> 16) & 0xffff); wm831x_rtc_set_mmss()
188 ret = wm831x_reg_write(wm831x, WM831X_RTC_TIME_2, time & 0xffff); wm831x_rtc_set_mmss()
194 /* Wait for the update to complete - should happen first time wm831x_rtc_set_mmss()
220 dev_err(dev, "Failed to convert time: %d\n", ret); wm831x_rtc_set_mmss()
225 if (new_time - time > 1) { wm831x_rtc_set_mmss()
234 * Read alarm time and date in RTC
241 u32 time; wm831x_rtc_readalarm() local
246 dev_err(dev, "Failed to read alarm time: %d\n", ret); wm831x_rtc_readalarm()
250 time = (data[0] << 16) | data[1]; wm831x_rtc_readalarm()
252 rtc_time_to_tm(time, &alrm->time); wm831x_rtc_readalarm()
289 unsigned long time; wm831x_rtc_setalarm() local
291 ret = rtc_tm_to_time(&alrm->time, &time); wm831x_rtc_setalarm()
293 dev_err(dev, "Failed to convert time: %d\n", ret); wm831x_rtc_setalarm()
304 (time >> 16) & 0xffff); wm831x_rtc_setalarm()
310 ret = wm831x_reg_write(wm831x, WM831X_RTC_ALARM_2, time & 0xffff); wm831x_rtc_setalarm()
H A Drtc-tps65910.c33 /* Total number of RTC registers needed to set time*/
48 * Gets current tps65910 RTC time and date parameters.
50 * The RTC's time/alarm representation is not what gmtime(3) requires
100 /* Stop RTC while updating the RTC time registers */ tps65910_rtc_set_time()
108 /* update all the time registers in one shot */ tps65910_rtc_set_time()
126 * Gets current tps65910 RTC alarm time.
142 alm->time.tm_sec = bcd2bin(alarm_data[0]); tps65910_rtc_read_alarm()
143 alm->time.tm_min = bcd2bin(alarm_data[1]); tps65910_rtc_read_alarm()
144 alm->time.tm_hour = bcd2bin(alarm_data[2]); tps65910_rtc_read_alarm()
145 alm->time.tm_mday = bcd2bin(alarm_data[3]); tps65910_rtc_read_alarm()
146 alm->time.tm_mon = bcd2bin(alarm_data[4]) - 1; tps65910_rtc_read_alarm()
147 alm->time.tm_year = bcd2bin(alarm_data[5]) + 100; tps65910_rtc_read_alarm()
169 alarm_data[0] = bin2bcd(alm->time.tm_sec); tps65910_rtc_set_alarm()
170 alarm_data[1] = bin2bcd(alm->time.tm_min); tps65910_rtc_set_alarm()
171 alarm_data[2] = bin2bcd(alm->time.tm_hour); tps65910_rtc_set_alarm()
172 alarm_data[3] = bin2bcd(alm->time.tm_mday); tps65910_rtc_set_alarm()
173 alarm_data[4] = bin2bcd(alm->time.tm_mon + 1); tps65910_rtc_set_alarm()
174 alarm_data[5] = bin2bcd(alm->time.tm_year - 100); tps65910_rtc_set_alarm()
H A Drtc-pl030.c42 rtc_time_to_tm(readl(rtc->base + RTC_MR), &alrm->time); pl030_read_alarm()
49 unsigned long time; pl030_set_alarm() local
55 ret = rtc_valid_tm(&alrm->time); pl030_set_alarm()
57 ret = rtc_tm_to_time(&alrm->time, &time); pl030_set_alarm()
59 writel(time, rtc->base + RTC_MR); pl030_set_alarm()
73 * Set the RTC time. Unfortunately, we can't accurately set
77 * edge of the 1Hz clock, we must write the time one second
83 unsigned long time; pl030_set_time() local
86 ret = rtc_tm_to_time(tm, &time); pl030_set_time()
88 writel(time + 1, rtc->base + RTC_LR); pl030_set_time()
H A Drtc-mrst.c79 * driver chose to use 1972 (1970 is UNIX time start point) as the base,
80 * and does the translation at read/write time.
86 * year will be parsed as 1960 which is not a valid UNIX time and will
89 static int mrst_read_time(struct device *dev, struct rtc_time *time) mrst_read_time() argument
97 time->tm_sec = vrtc_cmos_read(RTC_SECONDS); mrst_read_time()
98 time->tm_min = vrtc_cmos_read(RTC_MINUTES); mrst_read_time()
99 time->tm_hour = vrtc_cmos_read(RTC_HOURS); mrst_read_time()
100 time->tm_mday = vrtc_cmos_read(RTC_DAY_OF_MONTH); mrst_read_time()
101 time->tm_mon = vrtc_cmos_read(RTC_MONTH); mrst_read_time()
102 time->tm_year = vrtc_cmos_read(RTC_YEAR); mrst_read_time()
106 time->tm_year += 72; mrst_read_time()
107 time->tm_mon--; mrst_read_time()
108 return rtc_valid_tm(time); mrst_read_time()
111 static int mrst_set_time(struct device *dev, struct rtc_time *time) mrst_set_time() argument
118 yrs = time->tm_year; mrst_set_time()
119 mon = time->tm_mon + 1; /* tm_mon starts at zero */ mrst_set_time()
120 day = time->tm_mday; mrst_set_time()
121 hrs = time->tm_hour; mrst_set_time()
122 min = time->tm_min; mrst_set_time()
123 sec = time->tm_sec; mrst_set_time()
156 t->time.tm_mday = -1; mrst_read_alarm()
157 t->time.tm_mon = -1; mrst_read_alarm()
158 t->time.tm_year = -1; mrst_read_alarm()
162 t->time.tm_sec = vrtc_cmos_read(RTC_SECONDS_ALARM); mrst_read_alarm()
163 t->time.tm_min = vrtc_cmos_read(RTC_MINUTES_ALARM); mrst_read_alarm()
164 t->time.tm_hour = vrtc_cmos_read(RTC_HOURS_ALARM); mrst_read_alarm()
225 hrs = t->time.tm_hour; mrst_set_alarm()
226 min = t->time.tm_min; mrst_set_alarm()
227 sec = t->time.tm_sec; mrst_set_alarm()
H A Drtc-pcf8563.c206 "low voltage detected, date/time is not reliable.\n"); pcf8563_get_datetime()
238 * -EINVAL otherwise hwclock will refuse to set the time on bootup. pcf8563_get_datetime()
241 dev_err(&client->dev, "retrieved date/time is not valid.\n"); pcf8563_get_datetime()
287 dev_info(dev, "low voltage detected, date/time is not reliable.\n"); pcf8563_rtc_ioctl()
296 * the time has not been set already (which would pcf8563_rtc_ioctl()
340 tm->time.tm_min = bcd2bin(buf[0] & 0x7F); pcf8563_rtc_read_alarm()
341 tm->time.tm_hour = bcd2bin(buf[1] & 0x3F); pcf8563_rtc_read_alarm()
342 tm->time.tm_mday = bcd2bin(buf[2] & 0x3F); pcf8563_rtc_read_alarm()
343 tm->time.tm_wday = bcd2bin(buf[3] & 0x7); pcf8563_rtc_read_alarm()
344 tm->time.tm_mon = -1; pcf8563_rtc_read_alarm()
345 tm->time.tm_year = -1; pcf8563_rtc_read_alarm()
346 tm->time.tm_yday = -1; pcf8563_rtc_read_alarm()
347 tm->time.tm_isdst = -1; pcf8563_rtc_read_alarm()
354 " enabled=%d, pending=%d\n", __func__, tm->time.tm_min, pcf8563_rtc_read_alarm()
355 tm->time.tm_hour, tm->time.tm_mday, tm->time.tm_wday, pcf8563_rtc_read_alarm()
369 if (tm->time.tm_sec) { pcf8563_rtc_set_alarm()
370 rtc_tm_to_time(&tm->time, &alarm_time); pcf8563_rtc_set_alarm()
371 alarm_time += 60-tm->time.tm_sec; pcf8563_rtc_set_alarm()
372 rtc_time_to_tm(alarm_time, &tm->time); pcf8563_rtc_set_alarm()
377 tm->time.tm_min, tm->time.tm_hour, tm->time.tm_wday, pcf8563_rtc_set_alarm()
378 tm->time.tm_mday, tm->enabled, tm->pending); pcf8563_rtc_set_alarm()
380 buf[0] = bin2bcd(tm->time.tm_min); pcf8563_rtc_set_alarm()
381 buf[1] = bin2bcd(tm->time.tm_hour); pcf8563_rtc_set_alarm()
382 buf[2] = bin2bcd(tm->time.tm_mday); pcf8563_rtc_set_alarm()
383 buf[3] = tm->time.tm_wday & 0x07; pcf8563_rtc_set_alarm()
H A Drtc-sysfs.c23 * the local time and change to match daylight savings time. That affects
24 * attributes including date, time, since_epoch, and wakealarm.
64 static DEVICE_ATTR_RO(time);
74 unsigned long time; since_epoch_show() local
75 rtc_tm_to_time(&tm, &time); since_epoch_show()
76 retval = sprintf(buf, "%lu\n", time); since_epoch_show()
106 * rtc_sysfs_show_hctosys - indicate if the given RTC set the system time
154 rtc_tm_to_time(&alm.time, &alarm); rtc_sysfs_show_wakealarm()
174 * by writing another time, e.g. 0 meaning Jan 1 1970 UTC. rtc_sysfs_set_wakealarm()
176 retval = rtc_read_time(rtc, &alm.time); rtc_sysfs_set_wakealarm()
179 rtc_tm_to_time(&alm.time, &now); rtc_sysfs_set_wakealarm()
204 rtc_tm_to_time(&alm.time, &push); rtc_sysfs_set_wakealarm()
214 /* Provide a valid future alarm time. Linux isn't EFI, rtc_sysfs_set_wakealarm()
215 * this time won't be ignored when disabling the alarm. rtc_sysfs_set_wakealarm()
219 rtc_time_to_tm(alarm, &alm.time); rtc_sysfs_set_wakealarm()
H A Drtc-tps80031.c52 /* Numbers of registers for time and alarms */
102 /* Stop RTC while updating the RTC time registers */ tps80031_rtc_set_time()
148 buff[0] = bin2bcd(alrm->time.tm_sec); tps80031_rtc_set_alarm()
149 buff[1] = bin2bcd(alrm->time.tm_min); tps80031_rtc_set_alarm()
150 buff[2] = bin2bcd(alrm->time.tm_hour); tps80031_rtc_set_alarm()
151 buff[3] = bin2bcd(alrm->time.tm_mday); tps80031_rtc_set_alarm()
152 buff[4] = bin2bcd(alrm->time.tm_mon + 1); tps80031_rtc_set_alarm()
153 buff[5] = bin2bcd(alrm->time.tm_year % RTC_YEAR_OFFSET); tps80031_rtc_set_alarm()
178 alrm->time.tm_sec = bcd2bin(buff[0]); tps80031_rtc_read_alarm()
179 alrm->time.tm_min = bcd2bin(buff[1]); tps80031_rtc_read_alarm()
180 alrm->time.tm_hour = bcd2bin(buff[2]); tps80031_rtc_read_alarm()
181 alrm->time.tm_mday = bcd2bin(buff[3]); tps80031_rtc_read_alarm()
182 alrm->time.tm_mon = bcd2bin(buff[4]) - 1; tps80031_rtc_read_alarm()
183 alrm->time.tm_year = bcd2bin(buff[5]) + RTC_YEAR_OFFSET; tps80031_rtc_read_alarm()
257 /* If RTC have POR values, set time 01:01:2000 */ tps80031_rtc_probe()
268 "RTC set time failed, err = %d\n", ret); tps80031_rtc_probe()
H A Drtc-vt8500.c73 #define VT8500_RTC_CR_12H (1 << 1) /* 12h time format */
112 u32 date, time; vt8500_rtc_read_time() local
115 time = readl(vt8500_rtc->regbase + VT8500_RTC_TR); vt8500_rtc_read_time()
117 tm->tm_sec = bcd2bin(time & TIME_SEC_MASK); vt8500_rtc_read_time()
118 tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S); vt8500_rtc_read_time()
119 tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S); vt8500_rtc_read_time()
124 tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S; vt8500_rtc_read_time()
161 alrm->time.tm_mday = bcd2bin((alarm & ALARM_DAY_MASK) >> ALARM_DAY_S); vt8500_rtc_read_alarm()
162 alrm->time.tm_hour = bcd2bin((alarm & TIME_HOUR_MASK) >> TIME_HOUR_S); vt8500_rtc_read_alarm()
163 alrm->time.tm_min = bcd2bin((alarm & TIME_MIN_MASK) >> TIME_MIN_S); vt8500_rtc_read_alarm()
164 alrm->time.tm_sec = bcd2bin((alarm & TIME_SEC_MASK)); vt8500_rtc_read_alarm()
169 return rtc_valid_tm(&alrm->time); vt8500_rtc_read_alarm()
177 | (bin2bcd(alrm->time.tm_mday) << ALARM_DAY_S) vt8500_rtc_set_alarm()
178 | (bin2bcd(alrm->time.tm_hour) << TIME_HOUR_S) vt8500_rtc_set_alarm()
179 | (bin2bcd(alrm->time.tm_min) << TIME_MIN_S) vt8500_rtc_set_alarm()
180 | (bin2bcd(alrm->time.tm_sec)), vt8500_rtc_set_alarm()
H A Drtc-at91sam9.c17 #include <linux/time.h>
34 * - A "Real-time Timer" (RTT) counts up in seconds from a base time.
38 * base time, normally an offset from the beginning of the POSIX
50 #define AT91_RTT_MR 0x00 /* Real-time Mode Register */
51 #define AT91_RTT_RTPRES (0xffff << 0) /* Real-time Timer Prescaler Value */
56 #define AT91_RTT_AR 0x04 /* Real-time Alarm Register */
59 #define AT91_RTT_VR 0x08 /* Real-time Value Register */
60 #define AT91_RTT_CRTV (0xffffffff) /* Current Real-time Value */
62 #define AT91_RTT_SR 0x0c /* Real-time Status Register */
63 #define AT91_RTT_ALMS (1 << 0) /* Real-time Alarm Status */
64 #define AT91_RTT_RTTINC (1 << 1) /* Real-time Timer Increment */
106 * Read current time and date in RTC
114 /* read current time offset */ at91_rtc_readtime()
135 * Set current time and date in RTC
157 /* read current time offset */ at91_rtc_settime()
160 /* store the new base time in a battery backup register */ at91_rtc_settime()
164 /* adjust the alarm time for the new base */ at91_rtc_settime()
168 /* time jumped backwards, increase time until alarm */ at91_rtc_settime()
171 /* time jumped forwards, decrease time until alarm */ at91_rtc_settime()
174 /* time jumped past the alarm, disable alarm */ at91_rtc_settime()
190 struct rtc_time *tm = &alrm->time; at91_rtc_readalarm()
216 struct rtc_time *tm = &alrm->time; at91_rtc_setalarm()
228 /* time is not set */ at91_rtc_setalarm()
410 "atmel,rtt-rtc-time-reg", 1, 0, at91_rtc_probe()
468 * initialize the time from some external source like a GPS, wall at91_rtc_probe()
H A Drtc-pl031.c56 /* Common bit definations for ST v2 for reading/writing time */
129 unsigned long time; pl031_stv2_tm_to_time() local
132 rtc_tm_to_time(tm, &time); pl031_stv2_tm_to_time()
133 rtc_time_to_tm(time, &calc_tm); pl031_stv2_tm_to_time()
181 unsigned long time; pl031_stv2_set_time() local
186 ret = pl031_stv2_tm_to_time(dev, tm, &time, &bcd_year); pl031_stv2_set_time()
189 writel(time, ldata->base + RTC_LR); pl031_stv2_set_time()
201 readl(ldata->base + RTC_YMR), &alarm->time); pl031_stv2_read_alarm()
212 unsigned long time; pl031_stv2_set_alarm() local
217 ret = rtc_valid_tm(&alarm->time); pl031_stv2_set_alarm()
219 ret = pl031_stv2_tm_to_time(dev, &alarm->time, pl031_stv2_set_alarm()
220 &time, &bcd_year); pl031_stv2_set_alarm()
223 writel(time, ldata->base + RTC_MR); pl031_stv2_set_alarm()
261 unsigned long time; pl031_set_time() local
265 ret = rtc_tm_to_time(tm, &time); pl031_set_time()
268 writel(time, ldata->base + RTC_LR); pl031_set_time()
277 rtc_time_to_tm(readl(ldata->base + RTC_MR), &alarm->time); pl031_read_alarm()
288 unsigned long time; pl031_set_alarm() local
292 ret = rtc_valid_tm(&alarm->time); pl031_set_alarm()
294 ret = rtc_tm_to_time(&alarm->time, &time); pl031_set_alarm()
296 writel(time, ldata->base + RTC_MR); pl031_set_alarm()
323 unsigned long time, data; pl031_probe() local
362 time = readl(ldata->base + RTC_DR); pl031_probe()
363 if ((time & pl031_probe()
366 time = time | (0x7 << RTC_WDAY_SHIFT); pl031_probe()
368 writel(time, ldata->base + RTC_LR); pl031_probe()
H A Drtc-mxc.c106 * This function is used to obtain the RTC time or the alarm value in
136 * This function sets the RTC alarm value or the time value.
138 static void set_alarm_or_time(struct device *dev, int time_alarm, time64_t time) set_alarm_or_time() argument
145 day = div_s64_rem(time, 86400, &tod); set_alarm_or_time()
147 /* time is within a day now */ set_alarm_or_time()
151 /* time is within an hour now */ set_alarm_or_time()
177 time64_t time; rtc_update_alarm() local
182 time = rtc_tm_to_time64(alrm); rtc_update_alarm()
186 set_alarm_or_time(dev, MXC_RTC_ALARM, time); rtc_update_alarm()
270 * This function reads the current RTC time into tm in Gregorian date.
287 * This function sets the internal RTC time based on tm in Gregorian date.
289 static int mxc_rtc_set_mmss(struct device *dev, time64_t time) mxc_rtc_set_mmss() argument
295 * TTC_DAYR register is 9-bit in MX1 SoC, save time and day of year only mxc_rtc_set_mmss()
300 rtc_time64_to_tm(time, &tm); mxc_rtc_set_mmss()
302 time = rtc_tm_to_time64(&tm); mxc_rtc_set_mmss()
307 set_alarm_or_time(dev, MXC_RTC_TIME, time); mxc_rtc_set_mmss()
308 } while (time != get_alarm_or_time(dev, MXC_RTC_TIME)); mxc_rtc_set_mmss()
324 rtc_time64_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time); mxc_rtc_read_alarm()
338 rtc_update_alarm(dev, &alrm->time); mxc_rtc_set_alarm()
340 memcpy(&pdata->g_rtc_alarm, &alrm->time, sizeof(struct rtc_time)); mxc_rtc_set_alarm()
H A Drtc-rc5t583.c36 /* Total number of RTC registers needed to set time*/
61 * Gets current rc5t583 RTC time and date parameters.
63 * The RTC's time/alarm representation is not what gmtime(3) requires
78 dev_err(dev, "RTC read time failed with err:%d\n", ret); rc5t583_rtc_read_time()
110 dev_err(dev, "RTC set time failed with error %d\n", ret); rc5t583_rtc_set_time()
131 alm->time.tm_min = bcd2bin(alarm_data[0]); rc5t583_rtc_read_alarm()
132 alm->time.tm_hour = bcd2bin(alarm_data[1]); rc5t583_rtc_read_alarm()
133 alm->time.tm_mday = bcd2bin(alarm_data[2]); rc5t583_rtc_read_alarm()
134 alm->time.tm_mon = bcd2bin(alarm_data[3]) - 1; rc5t583_rtc_read_alarm()
135 alm->time.tm_year = bcd2bin(alarm_data[4]) + 100; rc5t583_rtc_read_alarm()
158 alarm_data[0] = bin2bcd(alm->time.tm_min); rc5t583_rtc_set_alarm()
159 alarm_data[1] = bin2bcd(alm->time.tm_hour); rc5t583_rtc_set_alarm()
160 alarm_data[2] = bin2bcd(alm->time.tm_mday); rc5t583_rtc_set_alarm()
161 alarm_data[3] = bin2bcd(alm->time.tm_mon + 1); rc5t583_rtc_set_alarm()
162 alarm_data[4] = bin2bcd(alm->time.tm_year - 100); rc5t583_rtc_set_alarm()
H A Drtc-mpc5121.c2 * Real-time clock driver for MPC5121
68 * time
73 * readonly time since VBAT_RTC was last connected
99 /* set time sequence */ mpc5121_rtc_update_smh()
113 * linux time is actual_time plus the offset saved in target_time mpc5121_rtc_read_time()
137 * between it and linux time to the target_time register. mpc5121_rtc_set_time()
221 if (alarm->time.tm_sec) { mpc5121_rtc_set_alarm()
222 alarm->time.tm_sec = 0; mpc5121_rtc_set_alarm()
223 alarm->time.tm_min++; mpc5121_rtc_set_alarm()
224 if (alarm->time.tm_min >= 60) { mpc5121_rtc_set_alarm()
225 alarm->time.tm_min = 0; mpc5121_rtc_set_alarm()
226 alarm->time.tm_hour++; mpc5121_rtc_set_alarm()
227 if (alarm->time.tm_hour >= 24) mpc5121_rtc_set_alarm()
228 alarm->time.tm_hour = 0; mpc5121_rtc_set_alarm()
232 alarm->time.tm_mday = -1; mpc5121_rtc_set_alarm()
233 alarm->time.tm_mon = -1; mpc5121_rtc_set_alarm()
234 alarm->time.tm_year = -1; mpc5121_rtc_set_alarm()
236 out_8(&regs->alm_min_set, alarm->time.tm_min); mpc5121_rtc_set_alarm()
237 out_8(&regs->alm_hour_set, alarm->time.tm_hour); mpc5121_rtc_set_alarm()
H A Drtc-tegra.c77 * This function tries to maximize the amount of time before the next update.
83 * introducing a race, because 250uS is plenty of time to read/write a value.
124 dev_vdbg(dev, "time read as %lu. %d/%d/%d %d:%02u:%02u\n", tegra_rtc_read_time()
150 dev_vdbg(dev, "time set to %lu. %d/%d/%d %d:%02u:%02u\n", tegra_rtc_set_time()
165 dev_vdbg(dev, "time read back as %d\n", tegra_rtc_set_time()
182 alarm->time.tm_mon = -1; tegra_rtc_read_alarm()
183 alarm->time.tm_mday = -1; tegra_rtc_read_alarm()
184 alarm->time.tm_year = -1; tegra_rtc_read_alarm()
185 alarm->time.tm_hour = -1; tegra_rtc_read_alarm()
186 alarm->time.tm_min = -1; tegra_rtc_read_alarm()
187 alarm->time.tm_sec = -1; tegra_rtc_read_alarm()
191 rtc_time_to_tm(sec, &alarm->time); tegra_rtc_read_alarm()
229 rtc_tm_to_time(&alarm->time, &sec); tegra_rtc_set_alarm()
244 alarm->time.tm_mon+1, tegra_rtc_set_alarm()
245 alarm->time.tm_mday, tegra_rtc_set_alarm()
246 alarm->time.tm_year+1900, tegra_rtc_set_alarm()
247 alarm->time.tm_hour, tegra_rtc_set_alarm()
248 alarm->time.tm_min, tegra_rtc_set_alarm()
249 alarm->time.tm_sec); tegra_rtc_set_alarm()
H A Drtc-s35390a.c216 "mon=%d, year=%d, wday=%d\n", __func__, alm->time.tm_sec, s35390a_set_alarm()
217 alm->time.tm_min, alm->time.tm_hour, alm->time.tm_mday, s35390a_set_alarm()
218 alm->time.tm_mon, alm->time.tm_year, alm->time.tm_wday); s35390a_set_alarm()
243 if (alm->time.tm_wday != -1) s35390a_set_alarm()
244 buf[S35390A_ALRM_BYTE_WDAY] = bin2bcd(alm->time.tm_wday) | 0x80; s35390a_set_alarm()
247 alm->time.tm_hour) | 0x80; s35390a_set_alarm()
248 buf[S35390A_ALRM_BYTE_MINS] = bin2bcd(alm->time.tm_min) | 0x80; s35390a_set_alarm()
250 if (alm->time.tm_hour >= 12) s35390a_set_alarm()
285 alm->time.tm_wday = bcd2bin(buf[S35390A_ALRM_BYTE_WDAY]); s35390a_read_alarm()
286 alm->time.tm_hour = s35390a_reg2hr(s35390a, s35390a_read_alarm()
288 alm->time.tm_min = bcd2bin(buf[S35390A_ALRM_BYTE_MINS]); s35390a_read_alarm()
291 __func__, alm->time.tm_min, alm->time.tm_hour, s35390a_read_alarm()
292 alm->time.tm_wday); s35390a_read_alarm()
H A Drtc-ds1307.c26 * setting the date and time), Linux can ignore the non-clock features.
66 * basic RTC date and time functionality; be careful using them.
377 /* read the RTC date and time registers all at once */ ds1307_get_time()
445 * these bits were cleared when preparing the date/time ds1307_set_time()
493 * report alarm time (ALARM1); assume 24 hour and day-of-month modes, ds1337_read_alarm()
496 t->time.tm_sec = bcd2bin(ds1307->regs[0] & 0x7f); ds1337_read_alarm()
497 t->time.tm_min = bcd2bin(ds1307->regs[1] & 0x7f); ds1337_read_alarm()
498 t->time.tm_hour = bcd2bin(ds1307->regs[2] & 0x3f); ds1337_read_alarm()
499 t->time.tm_mday = bcd2bin(ds1307->regs[3] & 0x3f); ds1337_read_alarm()
500 t->time.tm_mon = -1; ds1337_read_alarm()
501 t->time.tm_year = -1; ds1337_read_alarm()
502 t->time.tm_wday = -1; ds1337_read_alarm()
503 t->time.tm_yday = -1; ds1337_read_alarm()
504 t->time.tm_isdst = -1; ds1337_read_alarm()
512 "alarm read", t->time.tm_sec, t->time.tm_min, ds1337_read_alarm()
513 t->time.tm_hour, t->time.tm_mday, ds1337_read_alarm()
532 "alarm set", t->time.tm_sec, t->time.tm_min, ds1337_set_alarm()
533 t->time.tm_hour, t->time.tm_mday, ds1337_set_alarm()
554 buf[0] = bin2bcd(t->time.tm_sec); ds1337_set_alarm()
555 buf[1] = bin2bcd(t->time.tm_min); ds1337_set_alarm()
556 buf[2] = bin2bcd(t->time.tm_hour); ds1337_set_alarm()
557 buf[3] = bin2bcd(t->time.tm_mday); ds1337_set_alarm()
575 dev_err(dev, "can't set alarm time\n"); ds1337_set_alarm()
690 /* Report alarm 0 time assuming 24-hour and day-of-month modes. */ mcp794xx_read_alarm()
691 t->time.tm_sec = bcd2bin(ds1307->regs[3] & 0x7f); mcp794xx_read_alarm()
692 t->time.tm_min = bcd2bin(ds1307->regs[4] & 0x7f); mcp794xx_read_alarm()
693 t->time.tm_hour = bcd2bin(ds1307->regs[5] & 0x3f); mcp794xx_read_alarm()
694 t->time.tm_wday = bcd2bin(ds1307->regs[6] & 0x7) - 1; mcp794xx_read_alarm()
695 t->time.tm_mday = bcd2bin(ds1307->regs[7] & 0x3f); mcp794xx_read_alarm()
696 t->time.tm_mon = bcd2bin(ds1307->regs[8] & 0x1f) - 1; mcp794xx_read_alarm()
697 t->time.tm_year = -1; mcp794xx_read_alarm()
698 t->time.tm_yday = -1; mcp794xx_read_alarm()
699 t->time.tm_isdst = -1; mcp794xx_read_alarm()
703 t->time.tm_sec, t->time.tm_min, t->time.tm_hour, mcp794xx_read_alarm()
704 t->time.tm_wday, t->time.tm_mday, t->time.tm_mon, t->enabled, mcp794xx_read_alarm()
724 t->time.tm_sec, t->time.tm_min, t->time.tm_hour, mcp794xx_set_alarm()
725 t->time.tm_wday, t->time.tm_mday, t->time.tm_mon, mcp794xx_set_alarm()
734 regs[3] = bin2bcd(t->time.tm_sec); mcp794xx_set_alarm()
735 regs[4] = bin2bcd(t->time.tm_min); mcp794xx_set_alarm()
736 regs[5] = bin2bcd(t->time.tm_hour); mcp794xx_set_alarm()
737 regs[6] = bin2bcd(t->time.tm_wday) + 1; mcp794xx_set_alarm()
738 regs[7] = bin2bcd(t->time.tm_mday); mcp794xx_set_alarm()
739 regs[8] = bin2bcd(t->time.tm_mon) + 1; mcp794xx_set_alarm()
H A Drtc-lib.c2 * rtc and date/time utility functions
53 void rtc_time64_to_tm(time64_t time, struct rtc_time *tm) rtc_time64_to_tm() argument
59 /* time must be positive */ rtc_time64_to_tm()
60 days = div_s64(time, 86400); rtc_time64_to_tm()
61 secs = time - (unsigned int) days * 86400; rtc_time64_to_tm()
98 * Does the rtc_time represent a valid date/time?
/linux-4.1.27/sound/core/seq/
H A Dseq_prioq.c22 #include <linux/time.h>
106 return (snd_seq_compare_tick_time(&a->time.tick, &b->time.tick)); compare_timestamp()
108 /* compare real time */ compare_timestamp()
109 return (snd_seq_compare_real_time(&a->time.time, &b->time.time)); compare_timestamp()
123 if (a->time.tick > b->time.tick) compare_timestamp_rel()
125 else if (a->time.tick == b->time.tick) compare_timestamp_rel()
130 /* compare real time */ compare_timestamp_rel()
131 if (a->time.time.tv_sec > b->time.time.tv_sec) compare_timestamp_rel()
133 else if (a->time.time.tv_sec == b->time.time.tv_sec) { compare_timestamp_rel()
134 if (a->time.time.tv_nsec > b->time.time.tv_nsec) compare_timestamp_rel()
136 else if (a->time.time.tv_nsec == b->time.time.tv_nsec) compare_timestamp_rel()
187 /* new cell has earlier schedule time, */ snd_seq_prioq_cell_in()
190 /* equal schedule time and prior to others */ snd_seq_prioq_cell_in()
192 /* new cell has equal or larger schedule time, */ snd_seq_prioq_cell_in()
277 if (cell->event.time.tick) prioq_match()
281 if (cell->event.time.time.tv_sec || prioq_match()
282 cell->event.time.time.tv_nsec) prioq_match()
362 res = snd_seq_compare_tick_time(&ev->time.tick, &info->time.tick); prioq_remove_match()
364 res = snd_seq_compare_real_time(&ev->time.time, &info->time.time); prioq_remove_match()
370 res = snd_seq_compare_tick_time(&ev->time.tick, &info->time.tick); prioq_remove_match()
372 res = snd_seq_compare_real_time(&ev->time.time, &info->time.time); prioq_remove_match()
/linux-4.1.27/arch/x86/include/asm/
H A Dtimex.h7 /* Assume we use the PIT time source for the clock tick */
H A Dpvclock-abi.h10 * pvclock_vcpu_time_info holds the system time and the tsc timestamp
12 * more precise system time. There is one per virtual cpu.
14 * pvclock_wall_clock references the point in time when the system
15 * time was zero (usually boot time), thus the guest calculates the
16 * current wall clock by adding the system time.
21 * time values it got are consistent by checking the version before
H A Dsimd.h5 * may_use_simd - whether it is allowable at this time to issue SIMD
/linux-4.1.27/arch/mips/cobalt/
H A DMakefile5 obj-y := buttons.o irq.o lcd.o led.o mtd.o reset.o rtc.o serial.o setup.o time.o
/linux-4.1.27/arch/s390/include/uapi/asm/
H A Dcmb.h9 * @elapsed_time: time since last sampling
12 * @device_connect_time: time of device connect
13 * @function_pending_time: time of function pending
14 * @device_disconnect_time: time of device disconnect
15 * @control_unit_queuing_time: time of control unit queuing
16 * @device_active_only_time: time of device active only
17 * @device_busy_time: time of device busy (ext. format)
18 * @initial_command_response_time: initial command response time (ext. format)
21 * in 32 bit emulation mode. All time values are normalized to
H A Dhypfs.h42 char time[8]; /* HH:MM:SS in EBCDIC */ member in struct:hypfs_diag0c_entry
43 __u64 virtcpu; /* Virtual time consumed by the virt CPU (us) */
44 __u64 totalproc; /* Total of virtual and simulation time (us) */
H A Dmsgbuf.h16 __kernel_time_t msg_stime; /* last msgsnd time */
20 __kernel_time_t msg_rtime; /* last msgrcv time */
24 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h17 __kernel_time_t shm_atime; /* last attach time */
21 __kernel_time_t shm_dtime; /* last detach time */
25 __kernel_time_t shm_ctime; /* last change time */
H A Dsembuf.h16 __kernel_time_t sem_otime; /* last semop time */
20 __kernel_time_t sem_ctime; /* last change time */
/linux-4.1.27/arch/score/kernel/
H A DMakefile8 setup.o signal.o sys_score.o time.o traps.o \
/linux-4.1.27/arch/openrisc/kernel/
H A DMakefile8 traps.o time.o irq.o entry.o ptrace.o signal.o \
/linux-4.1.27/arch/powerpc/include/asm/
H A Drtc.h2 * Real-time clock definitions and interfaces
32 #include <asm/time.h>
41 #define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */
45 static inline unsigned int get_rtc_time(struct rtc_time *time) get_rtc_time() argument
48 ppc_md.get_rtc_time(time); get_rtc_time()
52 /* Set the current date and time in the real time clock. */ set_rtc_time()
53 static inline int set_rtc_time(struct rtc_time *time) set_rtc_time() argument
56 return ppc_md.set_rtc_time(time); set_rtc_time()
H A Dmpic_timer.h21 #include <linux/time.h>
32 const struct timeval *time);
35 void mpic_get_remain_time(struct mpic_timer *handle, struct timeval *time);
39 const struct timeval *time) { return NULL; } mpic_start_timer()
42 void mpic_get_remain_time(struct mpic_timer *handle, struct timeval *time) { } mpic_free_timer() argument
38 mpic_request_timer(irq_handler_t fn, void *dev, const struct timeval *time) mpic_request_timer() argument
H A Dfixmap.h2 * fixmap.h: compile-time virtual memory allocation
28 * Here we define all the compile-time 'special' virtual
30 * compile time, but to set the physical address only
37 * these 'compile-time allocated' memory buffers are
/linux-4.1.27/lib/
H A Dinterval_tree_test.c51 cycles_t time1, time2, time; interval_tree_test_init() local
68 time = time2 - time1; interval_tree_test_init()
70 time = div_u64(time, PERF_LOOPS); interval_tree_test_init()
71 printk(" -> %llu cycles\n", (unsigned long long)time); interval_tree_test_init()
86 time = time2 - time1; interval_tree_test_init()
88 time = div_u64(time, SEARCH_LOOPS); interval_tree_test_init()
91 (unsigned long long)time, results); interval_tree_test_init()
H A Drbtree_test.c178 cycles_t time1, time2, time; rbtree_test_init() local
195 time = time2 - time1; rbtree_test_init()
197 time = div_u64(time, PERF_LOOPS); rbtree_test_init()
198 printk(" -> %llu cycles\n", (unsigned long long)time); rbtree_test_init()
227 time = time2 - time1; rbtree_test_init()
229 time = div_u64(time, PERF_LOOPS); rbtree_test_init()
230 printk(" -> %llu cycles\n", (unsigned long long)time); rbtree_test_init()
/linux-4.1.27/tools/power/cpupower/bench/
H A Dparse.h23 long sleep; /* sleep time in µs */
24 long load; /* load time in µs */
25 long sleep_step; /* time value which changes the
26 * sleep time after every round in µs */
27 long load_step; /* time value which changes the
28 * load time after every round in µs */
29 unsigned int cycles; /* calculation cycles with the same sleep/load time */
30 unsigned int rounds; /* calculation rounds with iterated sleep/load time */
H A Dbenchmark.c38 * to get the given load time
40 * @param load aimed load time in µs
56 /* get the initial calculation time for a specific number of rounds */ calculate_timespace()
63 /* approximation of the wanted load time by comparing with the calculate_timespace()
64 * initial calculation time */ calculate_timespace()
83 * generates a specific sleep an load time with the performance
84 * governor and compares the used time for same calculations done
119 /* calibrate the calculation time. the resulting calculation start_benchmark()
121 * load time */ start_benchmark()
/linux-4.1.27/include/linux/mfd/
H A Dds1wm.h6 /* in milliseconds, the amount of time to */
9 /* time respects the 1-wire spec since the*/
/linux-4.1.27/drivers/iio/common/ssp_sensors/
H A Dssp_iio_sensor.h45 /* Converts time in ms to frequency */ ssp_convert_to_freq()
46 static inline void ssp_convert_to_freq(u32 time, int *integer_part, ssp_convert_to_freq() argument
49 if (time == 0) { ssp_convert_to_freq()
55 *integer_part = SSP_FACTOR_WITH_MS / time; ssp_convert_to_freq()
60 /* Converts frequency to time in ms */ ssp_convert_to_time()
/linux-4.1.27/drivers/net/fddi/skfp/
H A Dhwt.c52 * u_long time) ;
56 * time - The time in units of 16us to load the timer with.
63 void hwt_start(struct s_smc *smc, u_long time) hwt_start() argument
67 if (time > HWT_MAX) hwt_start()
68 time = HWT_MAX ; hwt_start()
70 smc->hw.t_start = time ; hwt_start()
73 cnt = (u_short)time ; hwt_start()
75 * if time < 16 us hwt_start()
76 * time = 16 us hwt_start()
155 * Stop hardware timer and read time elapsed since last start.
161 * The elapsed time since last start in units of 16us.
202 u_long time ; hwt_quick_read() local
206 time = inpd(ADDR(B2_TI_VAL)) ; hwt_quick_read()
207 outpd(ADDR(B2_TI_INI),time) ; hwt_quick_read() local
211 return time; hwt_quick_read()
218 * This function returnes after the amount of time is elapsed
219 * since the start time.
221 * para start start time
222 * duration time to wait
H A Dsmttimer.c62 void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time, smt_timer_start() argument
69 time /= 16 ; /* input is uS, clock ticks are 16uS */ smt_timer_start()
70 if (!time) smt_timer_start()
71 time = 1 ; smt_timer_start()
79 timer->tm_delta = time ; smt_timer_start()
80 hwt_start(smc,time) ; smt_timer_start()
93 if (delta + tm->tm_delta > time) { smt_timer_start()
101 timer->tm_delta = time - delta ; smt_timer_start()
/linux-4.1.27/arch/powerpc/include/uapi/asm/
H A Dmsgbuf.h15 __kernel_time_t msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */
23 __kernel_time_t msg_ctime; /* last change time */
/linux-4.1.27/arch/ia64/include/uapi/asm/
H A Dmsgbuf.h15 __kernel_time_t msg_stime; /* last msgsnd time */
16 __kernel_time_t msg_rtime; /* last msgrcv time */
17 __kernel_time_t msg_ctime; /* last change time */
H A Dsembuf.h15 __kernel_time_t sem_otime; /* last semop time */
16 __kernel_time_t sem_ctime; /* last change time */
H A Dshmbuf.h16 __kernel_time_t shm_atime; /* last attach time */
17 __kernel_time_t shm_dtime; /* last detach time */
18 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/alpha/include/uapi/asm/
H A Dmsgbuf.h15 __kernel_time_t msg_stime; /* last msgsnd time */
16 __kernel_time_t msg_rtime; /* last msgrcv time */
17 __kernel_time_t msg_ctime; /* last change time */
H A Dsembuf.h15 __kernel_time_t sem_otime; /* last semop time */
16 __kernel_time_t sem_ctime; /* last change time */
H A Dshmbuf.h16 __kernel_time_t shm_atime; /* last attach time */
17 __kernel_time_t shm_dtime; /* last detach time */
18 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/net/appletalk/
H A Dsysctl_net_atalk.c15 .procname = "aarp-expiry-time",
22 .procname = "aarp-tick-time",
36 .procname = "aarp-resolve-time",
/linux-4.1.27/drivers/scsi/qla2xxx/
H A Dqla_settings.h9 /* Max time to wait for the loop to be in LOOP_READY state */
/linux-4.1.27/arch/xtensa/include/uapi/asm/
H A Dsembuf.h29 __kernel_time_t sem_otime; /* last semop time */
31 __kernel_time_t sem_ctime; /* last change time */
35 __kernel_time_t sem_otime; /* last semop time */
37 __kernel_time_t sem_ctime; /* last change time */
H A Dmsgbuf.h24 __kernel_time_t msg_stime; /* last msgsnd time */
26 __kernel_time_t msg_rtime; /* last msgrcv time */
28 __kernel_time_t msg_ctime; /* last change time */
30 __kernel_time_t msg_stime; /* last msgsnd time */
32 __kernel_time_t msg_rtime; /* last msgrcv time */
34 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h26 __kernel_time_t shm_atime; /* last attach time */
28 __kernel_time_t shm_dtime; /* last detach time */
30 __kernel_time_t shm_ctime; /* last change time */
42 __kernel_time_t shm_atime; /* last attach time */
44 __kernel_time_t shm_dtime; /* last detach time */
46 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/um/include/shared/skas/
H A Dstub-data.h9 #include <sys/time.h>
/linux-4.1.27/arch/mips/dec/
H A DMakefile6 kn02-irq.o kn02xa-berr.o platform.o reset.o setup.o time.o
/linux-4.1.27/arch/c6x/kernel/
H A DMakefile8 obj-y += setup.o sys_c6x.o time.o devicetree.o
/linux-4.1.27/arch/cris/arch-v10/kernel/
H A DMakefile9 process.o setup.o signal.o traps.o time.o ptrace.o \
/linux-4.1.27/arch/cris/arch-v32/kernel/
H A DMakefile9 process.o ptrace.o setup.o signal.o traps.o time.o \
/linux-4.1.27/arch/cris/kernel/
H A DMakefile9 obj-y := process.o traps.o irq.o ptrace.o setup.o time.o sys_cris.o
H A Dtime.c2 * linux/arch/cris/kernel/time.c
8 * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
13 * fixed time warps in do_[slow|fast]_gettimeoffset()
48 /* grab the time from the RTC chip */ get_cmos_time()
/linux-4.1.27/arch/m32r/kernel/
H A DMakefile7 obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \
/linux-4.1.27/arch/arm/mach-gemini/
H A DMakefile7 obj-y := irq.o mm.o time.o devices.o gpio.o idle.o reset.o
/linux-4.1.27/lib/zlib_deflate/
H A DMakefile3 # allocation ahead of time.
/linux-4.1.27/include/uapi/linux/
H A Dnet_tstamp.h2 * Userspace API for hardware time stamping of network packets
56 * No outgoing packet will need hardware time stamping;
58 * time stamping will be done.
63 * Enables hardware time stamping for outgoing packets;
65 * time stamped by setting %SOF_TIMESTAMPING_TX_SOFTWARE
71 * Enables time stamping for outgoing packets just as
72 * HWTSTAMP_TX_ON does, but also enables time stamp insertion
74 * packets will not received a time stamp via the socket error
82 /* time stamp no incoming packet at all */
85 /* time stamp any incoming packet */
88 /* return value: time stamp all packets requested plus some others */
H A Dposix_types.h13 * <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
14 * place for them. Solved by having dummy defines in <sys/time.h>.
H A Dresource.h4 #include <linux/time.h>
15 * Otherwise, each time we add new items, programs which depend on this
24 struct timeval ru_utime; /* user time used */
25 struct timeval ru_stime; /* system time used */
H A Dtaskstats.h44 * Each time the struct is changed, the value should be incremented.
86 /* cpu "wall-clock" running time
87 * On some architectures, value will adjust for cpu time stolen
94 /* cpu "virtual" running time
95 * Uses time intervals seen by the kernel i.e. no adjustment
114 __u32 ac_btime; /* Begin time [sec since 1970] */
116 /* Elapsed time [usec] */
117 __u64 ac_utime; /* User CPU time [usec] */
118 __u64 ac_stime; /* SYstem CPU time [usec] */
125 * The current rss usage is added to this counter every time
126 * a tick is charged to a task's system time. So, at the end we
127 * will have memory usage multiplied by system time. Thus an
128 * average usage per system time unit can be calculated.
158 /* time accounting for SMT machines */
/linux-4.1.27/drivers/cpufreq/
H A Dppc_cbe_cpufreq_pervasive.c28 #include <linux/time.h>
60 long time; cbe_cpufreq_set_pmode() local
69 time = jiffies; cbe_cpufreq_set_pmode()
94 time = jiffies - time; cbe_cpufreq_set_pmode()
95 time = jiffies_to_msecs(time); cbe_cpufreq_set_pmode()
97 "pervasive unit\n", time); cbe_cpufreq_set_pmode()
H A Dppc_cbe_cpufreq_pmi.c35 #include <asm/time.h>
54 long time; cbe_cpufreq_set_pmode_pmi() local
61 time = jiffies; cbe_cpufreq_set_pmode_pmi()
66 time = jiffies - time; cbe_cpufreq_set_pmode_pmi()
67 time = jiffies_to_msecs(time); cbe_cpufreq_set_pmode_pmi()
69 "PMI\n", time); cbe_cpufreq_set_pmode_pmi()
/linux-4.1.27/arch/x86/include/uapi/asm/
H A Dsembuf.h15 __kernel_time_t sem_otime; /* last semop time */
17 __kernel_time_t sem_ctime; /* last change time */
/linux-4.1.27/arch/um/os-Linux/
H A DMakefile7 registers.o sigio.o signal.o start_up.o time.o tty.o \
13 main.o mem.o process.o registers.o sigio.o signal.o start_up.o time.o \
H A Dtime.c9 #include <time.h>
10 #include <sys/time.h>
49 * Ripped from linux/time.h because it's a kernel header, and thus
60 struct itimerval time = ((struct itimerval) { { 0, 0 }, { 0, 0 } }); disable_timer() local
63 if (setitimer(ITIMER_VIRTUAL, &time, &time) < 0) disable_timer()
67 remain = timeval_to_ns(&time.it_value); disable_timer()
107 /* Protection against the host's time going backwards */ deliver_alarm()
144 * setitimer to larger than the one passed in. Over time, after_sleep_interval()
145 * this will cause the remaining time to be greater than the after_sleep_interval()
/linux-4.1.27/arch/mips/include/uapi/asm/
H A Dsembuf.h15 __kernel_time_t sem_otime; /* last semop time */
16 __kernel_time_t sem_ctime; /* last change time */
H A Dshmbuf.h16 __kernel_time_t shm_atime; /* last attach time */
17 __kernel_time_t shm_dtime; /* last detach time */
18 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/mn10300/include/uapi/asm/
H A Dsembuf.h16 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
H A Dmsgbuf.h16 __kernel_time_t msg_stime; /* last msgsnd time */
18 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h17 __kernel_time_t shm_atime; /* last attach time */
19 __kernel_time_t shm_dtime; /* last detach time */
21 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/avr32/include/uapi/asm/
H A Dsembuf.h16 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
H A Dmsgbuf.h16 __kernel_time_t msg_stime; /* last msgsnd time */
18 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h17 __kernel_time_t shm_atime; /* last attach time */
19 __kernel_time_t shm_dtime; /* last detach time */
21 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/cris/include/uapi/asm/
H A Dsembuf.h16 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
H A Dmsgbuf.h18 __kernel_time_t msg_stime; /* last msgsnd time */
20 __kernel_time_t msg_rtime; /* last msgrcv time */
22 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h17 __kernel_time_t shm_atime; /* last attach time */
19 __kernel_time_t shm_dtime; /* last detach time */
21 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/frv/include/uapi/asm/
H A Dsembuf.h16 __kernel_time_t sem_otime; /* last semop time */
18 __kernel_time_t sem_ctime; /* last change time */
H A Dmsgbuf.h16 __kernel_time_t msg_stime; /* last msgsnd time */
18 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h17 __kernel_time_t shm_atime; /* last attach time */
19 __kernel_time_t shm_dtime; /* last detach time */
21 __kernel_time_t shm_ctime; /* last change time */
/linux-4.1.27/arch/ia64/include/asm/
H A Dftrace.h11 /* In IA64, MCOUNT_ADDR is set in link time, so it's not a constant at compile time */
H A Dcputime.h14 * If we have CONFIG_VIRT_CPU_ACCOUNTING_NATIVE, we measure cpu time in nsec.
15 * Otherwise we measure cpu time in jiffies using the generic definitions.
/linux-4.1.27/arch/arm/plat-orion/include/plat/
H A Dtime.h2 * arch/arm/plat-orion/include/plat/time.h
4 * Marvell Orion SoC time handling.
/linux-4.1.27/drivers/base/power/
H A Dtrace.c28 * can just use the few bytes of actual time data, which means that
32 * (since the time between the hang and the boot might be more
84 static struct rtc_time time = { set_magic_time() local
96 time.tm_year = (n % 100); set_magic_time()
98 time.tm_mon = (n % 12); set_magic_time()
100 time.tm_mday = (n % 28) + 1; set_magic_time()
102 time.tm_hour = (n % 24); set_magic_time()
104 time.tm_min = (n % 20) * 3; set_magic_time()
106 set_rtc_time(&time); set_magic_time()
112 struct rtc_time time; read_magic_time() local
115 get_rtc_time(&time); read_magic_time()
116 pr_info("RTC time: %2d:%02d:%02d, date: %02d/%02d/%02d\n", read_magic_time()
117 time.tm_hour, time.tm_min, time.tm_sec, read_magic_time()
118 time.tm_mon + 1, time.tm_mday, time.tm_year % 100); read_magic_time()
119 val = time.tm_year; /* 100 years */ read_magic_time()
122 val += time.tm_mon * 100; /* 12 months */ read_magic_time()
123 val += (time.tm_mday-1) * 100 * 12; /* 28 month-days */ read_magic_time()
124 val += time.tm_hour * 100 * 12 * 28; /* 24 hours */ read_magic_time()
125 val += (time.tm_min / 3) * 100 * 12 * 28 * 24; /* 20 3-minute intervals */ read_magic_time()
/linux-4.1.27/kernel/time/
H A Dtimecounter.c2 * linux/kernel/time/timecounter.c
5 * linux/kernel/time/clocksource.c
35 * @tc: Pointer to time counter
41 * The first call to this function for a new time counter initializes
42 * the time tracking and returns an undefined result.
59 /* update time stamp of timecounter_read_delta() call: */ timecounter_read_delta()
69 /* increment time by nanoseconds since last call */ timecounter_read()
80 * time previous to the time stored in the cycle counter.
101 * future and treat it as old time stamp instead. timecounter_cyc2time()
H A DMakefile1 obj-y += time.o timer.o hrtimer.o itimer.o posix-timers.o posix-cpu-timers.o
16 $(obj)/time.o: $(obj)/timeconst.h
H A Dtimekeeping_internal.h7 #include <linux/time.h>
H A Dtimeconv.c23 * Converts the calendar time to broken-down time representation
30 #include <linux/time.h>
70 * time_to_tm - converts the calendar time to local broken-down time
75 * @result pointer to struct tm variable to receive broken-down time
/linux-4.1.27/sound/core/seq/oss/
H A Dseq_oss_writeq.c97 abstime_t time; snd_seq_oss_writeq_sync() local
99 time = snd_seq_oss_timer_cur_tick(dp->timer); snd_seq_oss_writeq_sync()
100 if (q->sync_time >= time) snd_seq_oss_writeq_sync()
111 ev.time.tick = time; snd_seq_oss_writeq_sync()
116 rec->t.time = time; snd_seq_oss_writeq_sync()
125 if (! q->sync_event_put || q->sync_time >= time) snd_seq_oss_writeq_sync()
134 snd_seq_oss_writeq_wakeup(struct seq_oss_writeq *q, abstime_t time) snd_seq_oss_writeq_wakeup() argument
139 q->sync_time = time; snd_seq_oss_writeq_wakeup()
/linux-4.1.27/Documentation/ptp/
H A Dtestptp.c32 #include <sys/time.h>
35 #include <time.h>
120 " -e val read 'val' external time stamp events\n" usage()
122 " -g get the ptp clock time\n" usage()
125 " -k val measure the time offset between system and phc clock\n" usage()
132 " 1 - external time stamp\n" usage()
136 " -s set the ptp clock time from the system time\n" usage()
137 " -S set the system time from the ptp clock time\n" usage()
138 " -t val shift the ptp clock time by 'val' seconds\n" usage()
139 " -T val set the ptp clock time to 'val' seconds\n", usage()
276 " %d external time stamp channels\n" main()
303 tx.time.tv_sec = adjtime; main()
304 tx.time.tv_usec = 0; main()
308 puts("time shift okay"); main()
316 printf("clock time: %ld.%09ld or %s", main()
326 puts("set time okay"); main()
335 puts("set time okay"); main()
345 puts("set time okay"); main()
357 puts("external time stamp request okay"); main()
472 puts("pps for system time request okay"); main()
493 puts("system and phc clock time offset request okay"); main()
503 printf("system time: %lld.%u\n", main()
505 printf("phc time: %lld.%u\n", main()
507 printf("system time: %lld.%u\n", main()
509 printf("system/phc clock time offset is %" PRId64 " ns\n" main()
510 "system clock time delay is %" PRId64 " ns\n", main()
/linux-4.1.27/kernel/sched/
H A Dcputime.c13 * There are no locks covering percpu hardirq/softirq time.
17 * This may result in other CPU reading this CPU's irq time and can
19 * or new value with a side effect of accounting a slice of irq time to wrong
64 * We do not account for softirq time from ksoftirqd here. irqtime_account_irq()
65 * We want to continue accounting softirq time to ksoftirqd thread irqtime_account_irq()
67 * that do not consume any time, but still wants to run. irqtime_account_irq()
130 * Account user cpu time to a process.
131 * @p: the process that the cpu time gets accounted to
132 * @cputime: the cpu time spent in user space since the last update
140 /* Add user time to process. */ account_user_time()
147 /* Add user time to cpustat. */ account_user_time()
150 /* Account for user time used */ account_user_time()
155 * Account guest cpu time to a process.
156 * @p: the process that the cpu time gets accounted to
157 * @cputime: the cpu time spent in virtual machine since the last update
165 /* Add guest time to process. */ account_guest_time()
171 /* Add guest time to cpustat. */ account_guest_time()
182 * Account system cpu time to a process and desired cpustat field
183 * @p: the process that the cpu time gets accounted to
184 * @cputime: the cpu time spent in kernel space since the last update
192 /* Add system time to process. */ __account_system_time()
197 /* Add system time to cpustat. */ __account_system_time()
200 /* Account for system time used */ __account_system_time()
205 * Account system cpu time to a process.
206 * @p: the process that the cpu time gets accounted to
208 * @cputime: the cpu time spent in kernel space since the last update
232 * Account for involuntary wait time.
233 * @cputime: the cpu time spent in involuntary wait
243 * Account for idle time.
244 * @cputime: the cpu time spent in idle wait
269 * time in jiffies. Lets cast the result to jiffies steal_account_process_tick()
283 * Accumulate raw cputime values of dead tasks (sig->[us]time) and live
320 * @p: the process that the cpu time gets accounted to
329 * - system time
333 * Check for hardirq is done both for system and user time as there is
335 * opportunity to update it solely in system time.
336 * p->stime and friends are only updated on system time and not on irq
358 * ksoftirqd time do not get accounted in cpu_softirq_time. irqtime_account_process_tick()
367 } else if (p->flags & PF_VCPU) { /* System time or guest time */ irqtime_account_process_tick()
407 * Archs that account the whole time spent in the idle task
408 * (outside irq) as idle time can rely on this and just implement
410 * have other meaning of the idle time (s390 only includes the
411 * time spent by the CPU when it's in low power mode) must override
422 * we need to flush user time on kernel entry. vtime_common_account_irq_enter()
459 * Account a single tick of cpu time.
460 * @p: the process that the cpu time gets accounted to
489 * Account multiple ticks of steal time.
490 * @p: the process from which the cpu time has been stolen
499 * Account multiple ticks of idle time.
598 * time is bigger than already exported. Note that can happen, that we cputime_adjust()
784 * add up the pending nohz execution time since the last
815 * Task runs either in user or kernel space, add pending nohz time to fetch_task_cputime()
/linux-4.1.27/drivers/usb/host/
H A Dxhci-rcar.c83 int retval, index, j, time; xhci_rcar_download_firmware() local
108 for (time = 0; time < timeout; time++) { xhci_rcar_download_firmware()
114 if (time == timeout) { xhci_rcar_download_firmware()
124 for (time = 0; time < timeout; time++) { xhci_rcar_download_firmware()
132 if (time == timeout) xhci_rcar_download_firmware()
/linux-4.1.27/arch/s390/include/asm/
H A Dtimex.h18 static inline int set_tod_clock(__u64 time) set_tod_clock() argument
26 : "=d" (cc) : "Q" (time) : "cc"); set_tod_clock()
30 static inline int store_tod_clock(__u64 *time) store_tod_clock() argument
38 : "=d" (cc), "=Q" (*time) : : "cc"); store_tod_clock()
42 static inline void set_clock_comparator(__u64 time) set_clock_comparator() argument
44 asm volatile("sckc %0" : : "Q" (time)); set_clock_comparator()
47 static inline void store_clock_comparator(__u64 *time) store_clock_comparator() argument
49 asm volatile("stckc %0" : "=Q" (*time)); store_clock_comparator()
122 * get_clock_monotonic - returns current time in clock rate units
/linux-4.1.27/arch/sh/boards/mach-dreamcast/
H A Drtc.c13 #include <linux/time.h>
18 seconds) to get the standard Unix Epoch when getting the time, and add
19 20 years when setting the time. */
28 * aica_rtc_gettimeofday - Get the time from the AICA RTC
52 * aica_rtc_settimeofday - Set the AICA RTC to the current time
/linux-4.1.27/arch/arm64/include/asm/
H A Dfixmap.h2 * fixmap.h: compile-time virtual memory allocation
23 * Here we define all the compile-time 'special' virtual
25 * compile time, but to set the physical address only
28 * These 'compile-time allocated' memory buffers are
40 * Temporary boot-time mappings, used by early_ioremap(),
H A Dvdso_datapage.h25 __u64 xtime_clock_sec; /* Kernel time */
27 __u64 xtime_coarse_sec; /* Coarse time */
29 __u64 wtm_clock_sec; /* Wall to monotonic time */
/linux-4.1.27/arch/m68k/include/asm/
H A Drtc.h27 #define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */
31 static inline unsigned int get_rtc_time(struct rtc_time *time) get_rtc_time() argument
40 mach_hwclk(0, time); get_rtc_time()
44 static inline int set_rtc_time(struct rtc_time *time) set_rtc_time() argument
47 return mach_hwclk(1, time); set_rtc_time()
H A Dcoldfire.h17 * Define master clock frequency. This is done at config time now.
19 * in any case new boards come along from time to time that have yet
37 * The value of MBAR or IPSBAR is config time selectable, we no
/linux-4.1.27/include/linux/mfd/syscon/
H A Datmel-st.h30 #define AT91_ST_RTMR 0x0c /* Real-time Mode Register */
31 #define AT91_ST_RTPRES 0xffff /* Real-time Prescalar Value */
36 #define AT91_ST_RTTINC BIT(2) /* Real-time Timer Increment */
43 #define AT91_ST_RTAR 0x20 /* Real-time Alarm Register */
46 #define AT91_ST_CRTR 0x24 /* Current Real-time Register */
/linux-4.1.27/tools/perf/scripts/python/
H A Dnetdev-times.py1 # Display a process of packets and processed time.
23 net_rx_dic = {}; # key is cpu and value include time of NET_RX softirq-entry
55 # Calculate a time interval(msec) from src(nsec) to dst(nsec)
112 (diff_msec(base_t, irq_event['time']),
173 # order all events in time
302 (name, context, cpu, time, pid, comm, irq, irq_name) = event_info
305 irq_record = {'irq':irq, 'name':irq_name, 'cpu':cpu, 'irq_ent_t':time}
309 (name, context, cpu, time, pid, comm, irq, ret) = event_info
315 irq_record.update({'irq_ext_t':time})
321 (name, context, cpu, time, pid, comm, vec) = event_info
330 irq_event_list.append({'time':time, 'event':'sirq_raise'})
335 (name, context, cpu, time, pid, comm, vec) = event_info
336 net_rx_dic[cpu] = {'sirq_ent_t':time, 'event_list':[]}
339 (name, context, cpu, time, pid, comm, vec) = event_info
351 rec_data = {'sirq_ent_t':sirq_ent_t, 'sirq_ext_t':time,
357 (name, context, cpu, time, pid, comm, napi, dev_name) = event_info
361 'dev':dev_name, 'event_t':time}
365 (name, context, cpu, time, pid, comm,
375 irq_event_list.append({'time':time, 'event':'netif_rx',
383 (name, context, cpu, time, pid, comm,
387 'event_t':time, 'skbaddr':skbaddr, 'len':skblen}
398 (name, context, cpu, time, pid, comm,
400 skb = {'dev':dev_name, 'skbaddr':skbaddr, 'len':skblen, 'queue_t':time}
409 (name, context, cpu, time, pid, comm,
415 skb['xmit_t'] = time
424 (name, context, cpu, time, pid, comm,
434 skb['free_t'] = time
442 'comm':comm, 'pid':pid, 'comm_t':time})
447 (name, context, cpu, time, pid, comm, skbaddr) = event_info
451 skb['free_t'] = time
457 (name, context, cpu, time, pid, comm, skbaddr, skblen) = event_info
462 'comm':comm, 'pid':pid, 'comm_t':time})
/linux-4.1.27/arch/sparc/include/uapi/asm/
H A Dmsgbuf.h24 __kernel_time_t msg_stime; /* last msgsnd time */
26 __kernel_time_t msg_rtime; /* last msgrcv time */
28 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h23 __kernel_time_t shm_atime; /* last attach time */
25 __kernel_time_t shm_dtime; /* last detach time */
27 __kernel_time_t shm_ctime; /* last change time */
H A Dsembuf.h22 __kernel_time_t sem_otime; /* last semop time */
24 __kernel_time_t sem_ctime; /* last change time */
/linux-4.1.27/arch/mips/include/asm/
H A Ddebug.h2 * Debug macros for run-time debugging.
20 * run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in
23 * Use them as run-time debugging aid. NEVER USE THEM AS ERROR HANDLING CODE!!!
/linux-4.1.27/drivers/gpu/drm/radeon/
H A Dradeon_benchmark.c76 unsigned int time, radeon_benchmark_log_results()
80 unsigned int throughput = (n * (size >> 10)) / time; radeon_benchmark_log_results()
83 kind, n, size >> 10, sdomain, ddomain, time, radeon_benchmark_log_results()
94 int time; radeon_benchmark_move() local
123 time = radeon_benchmark_do_move(rdev, size, saddr, daddr, radeon_benchmark_move()
126 if (time < 0) radeon_benchmark_move()
128 if (time > 0) radeon_benchmark_move()
129 radeon_benchmark_log_results(n, size, time, radeon_benchmark_move()
134 time = radeon_benchmark_do_move(rdev, size, saddr, daddr, radeon_benchmark_move()
137 if (time < 0) radeon_benchmark_move()
139 if (time > 0) radeon_benchmark_move()
140 radeon_benchmark_log_results(n, size, time, radeon_benchmark_move()
75 radeon_benchmark_log_results(int n, unsigned size, unsigned int time, unsigned sdomain, unsigned ddomain, char *kind) radeon_benchmark_log_results() argument
/linux-4.1.27/fs/quota/
H A Dquotaio_v1.h7 * The following constants define the amount of time given a user
27 time_t dqb_btime; /* time limit for excessive disk use */
28 time_t dqb_itime; /* time limit for excessive inode use */
/linux-4.1.27/arch/parisc/include/uapi/asm/
H A Dmsgbuf.h21 __kernel_time_t msg_stime; /* last msgsnd time */
25 __kernel_time_t msg_rtime; /* last msgrcv time */
29 __kernel_time_t msg_ctime; /* last change time */
H A Dshmbuf.h21 __kernel_time_t shm_atime; /* last attach time */
25 __kernel_time_t shm_dtime; /* last detach time */
29 __kernel_time_t shm_ctime; /* last change time */
H A Dsembuf.h21 __kernel_time_t sem_otime; /* last semop time */
25 __kernel_time_t sem_ctime; /* last change time */
/linux-4.1.27/drivers/net/wireless/iwlwifi/
H A Diwl-devtrace-ucode.h36 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
37 TP_ARGS(dev, time, data, ev),
41 __field(u32, time)
47 __entry->time = time;
52 __get_str(dev), __entry->time, __entry->data, __entry->ev)
/linux-4.1.27/fs/isofs/
H A Dutil.c5 #include <linux/time.h>
12 * take into account daylight savings time, but it shouldn't matter.
13 * The time stored should be localtime (with or without DST in effect),
29 if (flag == 0) tz = p[6]; /* High sierra has no time zone */ iso_date()
45 * The time is always stored in localtime with the iso_date()
48 * to get to true GMT, which is what we store the time iso_date()
/linux-4.1.27/arch/powerpc/kernel/
H A Drtas-rtc.c2 #include <linux/time.h>
10 #include <asm/time.h>
24 error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); rtas_get_boot_time()
28 /* This is boot time so we spin. */ rtas_get_boot_time()
56 error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); rtas_get_rtc_time()
93 error = rtas_call(rtas_token("set-time-of-day"), 7, 1, NULL, rtas_set_rtc_time()
/linux-4.1.27/drivers/input/
H A Dinput-compat.c27 event->time.tv_sec = compat_event.time.tv_sec; input_event_from_user()
28 event->time.tv_usec = compat_event.time.tv_usec; input_event_from_user()
47 compat_event.time.tv_sec = event->time.tv_sec; input_event_to_user()
48 compat_event.time.tv_usec = event->time.tv_usec; input_event_to_user()
/linux-4.1.27/arch/mips/loongson/common/
H A Dtime.c13 #include <asm/mc146818-time.h>
14 #include <asm/time.h>
/linux-4.1.27/arch/arm/plat-samsung/include/plat/
H A Dsamsung-time.h1 /* linux/arch/arm/plat-samsung/include/plat/samsung-time.h
6 * Header file for samsung s3c and s5p time support
/linux-4.1.27/Documentation/laptops/
H A Ddslm.c12 #include <time.h>
58 static char *myctime(time_t time) myctime() argument
60 char *ts = ctime(&time); myctime()
84 start_time = last_time = time(0); measure()
93 curr_time = time(0); measure()
109 total_time = time(0) - start_time; measure()
110 printf("\nTotal running time: %lus\n", curr_time - start_time); measure()
128 puts("usage: dslm [-w <time>] <disk>"); usage()
/linux-4.1.27/tools/testing/selftests/timers/
H A DMakefile7 # system time or require escalated privledges
22 # and may modify the system time or trigger
H A Dset-2038.c6 * NOTE: This is a meta-test which sets the time to edge cases then
28 #include <time.h>
29 #include <sys/time.h>
59 int settime(long long time) settime() argument
64 now.tv_sec = (time_t)time; settime()
69 printf("Setting time to 0x%lx: %d\n", (long)time, ret); settime()
99 start = time(0); main()
H A Dleapcrash.c20 #include <time.h>
21 #include <sys/time.h>
87 /* Get the current time */ main()
98 /* set the time to 2 seconds before the leap */ main()
109 while (tx.time.tv_sec < next_leap + 1) { main()
H A Dleap-a-day.c18 * time by 24 hours every ~16 seconds, it may cause application
44 #include <time.h>
45 #include <sys/time.h>
163 printf("Setting time to speed up testing\n"); main()
174 printf(" -s: Set time to right before leap second each iteration\n"); main()
176 printf(" -t: Print TAI time\n"); main()
206 /* Get the current time */ main()
219 printf("Setting time to %s", ctime(&tv.tv_sec)); main()
222 /* Reset NTP time state */ main()
248 printf("Using TAI time," main()
275 now = tx.time.tv_sec; main()
290 ctime_r(&tx.time.tv_sec, buf); main()
295 tx.time.tv_usec, main()
299 now = tx.time.tv_sec; main()
/linux-4.1.27/include/asm-generic/bitops/
H A Dconst_hweight.h5 * Compile time versions of __arch_hweightN()
39 * Type invariant interface to the compile time constant hweight functions.
/linux-4.1.27/arch/powerpc/sysdev/
H A Dmpic_timer.c93 const u64 ticks, struct timeval *time) convert_ticks_to_time()
97 time->tv_sec = (__kernel_time_t)div_u64(ticks, priv->timerfreq); convert_ticks_to_time()
98 tmp_sec = (u64)time->tv_sec * (u64)priv->timerfreq; convert_ticks_to_time()
100 time->tv_usec = 0; convert_ticks_to_time()
103 time->tv_usec = (__kernel_suseconds_t) convert_ticks_to_time()
109 /* the time set by the user is converted to "ticks" */ convert_time_to_ticks()
111 const struct timeval *time, u64 *ticks) convert_time_to_ticks()
122 if (time->tv_sec > max_value || convert_time_to_ticks()
123 (time->tv_sec == max_value && time->tv_usec > 0)) convert_time_to_ticks()
126 tmp_sec = (u64)time->tv_sec * (u64)priv->timerfreq; convert_time_to_ticks()
129 tmp_ms = time->tv_usec / 1000; convert_time_to_ticks()
133 tmp_us = time->tv_usec % 1000; convert_time_to_ticks()
206 /* Two cascade timers: Support the maximum time */ get_cascade_timer()
226 static struct mpic_timer *get_timer(const struct timeval *time) get_timer() argument
238 ret = convert_time_to_ticks(priv, time, &ticks); get_timer()
316 * mpic_get_remain_time - get timer time
318 * @time: time for timer
320 * Query timer remaining time.
322 void mpic_get_remain_time(struct mpic_timer *handle, struct timeval *time) mpic_get_remain_time() argument
343 convert_ticks_to_time(priv, ticks, time); mpic_get_remain_time()
388 * @time: time for timer
394 const struct timeval *time) mpic_request_timer()
402 if (!(time->tv_sec + time->tv_usec) || mpic_request_timer()
403 time->tv_sec < 0 || time->tv_usec < 0) mpic_request_timer()
406 if (time->tv_usec > ONE_SECOND) mpic_request_timer()
409 allocated_timer = get_timer(time); mpic_request_timer()
92 convert_ticks_to_time(struct timer_group_priv *priv, const u64 ticks, struct timeval *time) convert_ticks_to_time() argument
110 convert_time_to_ticks(struct timer_group_priv *priv, const struct timeval *time, u64 *ticks) convert_time_to_ticks() argument
393 mpic_request_timer(irq_handler_t fn, void *dev, const struct timeval *time) mpic_request_timer() argument
/linux-4.1.27/drivers/firmware/efi/
H A Defi-pstore.c54 unsigned long time, size; efi_pstore_read_func() local
63 cb_data->type, &part, &cnt, &time, &data_type) == 5) { efi_pstore_read_func()
64 *cb_data->id = generic_id(time, part, cnt); efi_pstore_read_func()
66 cb_data->timespec->tv_sec = time; efi_pstore_read_func()
73 cb_data->type, &part, &cnt, &time) == 4) { efi_pstore_read_func()
74 *cb_data->id = generic_id(time, part, cnt); efi_pstore_read_func()
76 cb_data->timespec->tv_sec = time; efi_pstore_read_func()
80 cb_data->type, &part, &time) == 3) { efi_pstore_read_func()
86 *cb_data->id = generic_id(time, part, 0); efi_pstore_read_func()
88 cb_data->timespec->tv_sec = time; efi_pstore_read_func()
269 struct timespec time; member in struct:pstore_erase_data
296 (unsigned int)ed->id, ed->time.tv_sec); efi_pstore_erase_func()
322 struct timespec time, struct pstore_info *psi) efi_pstore_erase()
333 sprintf(name, "dump-type%u-%u-%d-%lu", type, part, count, time.tv_sec); efi_pstore_erase()
341 edata.time = time; efi_pstore_erase()
321 efi_pstore_erase(enum pstore_type_id type, u64 id, int count, struct timespec time, struct pstore_info *psi) efi_pstore_erase() argument
/linux-4.1.27/arch/x86/vdso/
H A Dvdso.lds.S25 time;
H A Dvgetcpu.c10 #include <linux/time.h>
/linux-4.1.27/drivers/char/mwave/
H A DMakefile14 # To compile in lots (~20 KiB) of run-time enablable printk()s for debugging:
/linux-4.1.27/arch/metag/kernel/
H A Dtime.c4 * This file contains the Meta-specific time handling details.
/linux-4.1.27/arch/microblaze/include/asm/
H A Dfixmap.h2 * fixmap.h: compile-time virtual memory allocation
32 * Here we define all the compile-time 'special' virtual
34 * compile time, but to set the physical address only
41 * these 'compile-time allocated' memory buffers are
/linux-4.1.27/include/uapi/linux/netfilter/
H A Dxt_SECMARK.h8 * at the same time).
H A Dxt_time.h17 /* Match against local time (instead of UTC) */
/linux-4.1.27/arch/sh/include/mach-sh03/mach/
H A Dio.h12 #include <linux/time.h>
/linux-4.1.27/arch/mips/mti-malta/
H A DMakefile10 malta-reset.o malta-setup.o malta-time.o
/linux-4.1.27/arch/avr32/kernel/
H A DMakefile10 obj-y += signal.o process.o time.o
/linux-4.1.27/arch/cris/include/arch-v10/arch/
H A Dtlb.h4 /* The TLB can host up to 64 different mm contexts at the same time.
/linux-4.1.27/arch/hexagon/kernel/
H A DMakefile5 obj-y += setup.o irq_cpu.o traps.o syscalltab.o signal.o time.o
/linux-4.1.27/arch/metag/include/asm/
H A Dfixmap.h2 * fixmap.h: compile-time virtual memory allocation
23 * Here we define all the compile-time 'special' virtual
25 * compile time, but to set the physical address only
32 * these 'compile-time allocated' memory buffers are
/linux-4.1.27/arch/arm/mach-spear/
H A DMakefile8 obj-y := restart.o time.o
/linux-4.1.27/arch/arm/mach-w90x900/
H A DMakefile7 obj-y := irq.o time.o mfp.o gpio.o clock.o
/linux-4.1.27/arch/arm/include/asm/mach/
H A Dtime.h2 * arch/arm/include/asm/mach/time.h
/linux-4.1.27/include/xen/interface/hvm/
H A Dparams.h53 * Do not advance a vcpu's time beyond the correct delivery time for
56 * time stepwise for each one.
58 * As above, missed interrupts are delivered, but guest time always tracks
59 * wallclock (i.e., real) time while doing so.
67 * Guest time always tracks wallclock (i.e., real) time.
/linux-4.1.27/tools/perf/tests/
H A Dperf-time-to-tsc.c29 * test__perf_time_to_tsc - test converting perf time to TSC.
31 * This function implements a test that checks that the conversion of perf time
119 comm1_time = sample.time; test__perf_time_to_tsc()
124 comm2_time = sample.time; test__perf_time_to_tsc()
138 pr_debug("1st event perf time %"PRIu64" tsc %"PRIu64"\n", test__perf_time_to_tsc()
140 pr_debug("rdtsc time %"PRIu64" tsc %"PRIu64"\n", test__perf_time_to_tsc()
142 pr_debug("2nd event perf time %"PRIu64" tsc %"PRIu64"\n", test__perf_time_to_tsc()
/linux-4.1.27/sound/oss/
H A Dsound_timer.c125 long time; timer_event() local
127 if (parm <= curr_ticks) /* It's the time */ timer_event()
129 time = parm; timer_event()
130 next_event_time = prev_event_time = time; timer_event()
256 static void timer_arm(int dev, long time) timer_arm() argument
258 if (time < 0) timer_arm()
259 time = curr_ticks + 1; timer_arm()
260 else if (time <= curr_ticks) /* It's the time */ timer_arm()
263 next_event_time = prev_event_time = time; timer_arm()
H A Dsys_timer.c126 long time; def_tmr_event() local
128 if (parm <= curr_ticks) /* It's the time */ def_tmr_event()
131 time = parm; def_tmr_event()
132 next_event_time = prev_event_time = time; def_tmr_event()
256 def_tmr_arm(int dev, long time) def_tmr_arm() argument
258 if (time < 0) def_tmr_arm()
259 time = curr_ticks + 1; def_tmr_arm()
260 else if (time <= curr_ticks) /* It's the time */ def_tmr_arm()
263 next_event_time = prev_event_time = time; def_tmr_arm()
/linux-4.1.27/include/linux/platform_data/
H A Dmtd-nand-s3c2410.h20 * look for it at boot time and also skip the NAND
31 * a warning at boot time.
49 int tacls; /* time for active CLE/ALE to nWE/nOE */
50 int twrph0; /* active time for nWE/nOE */
51 int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
/linux-4.1.27/arch/powerpc/platforms/ps3/
H A Dtime.c2 * PS3 time and rtc routines.
44 static void __maybe_unused _dump_time(int time, const char *func, _dump_time() argument
49 to_tm(time, &tm); _dump_time()
51 pr_debug("%s:%d time %d\n", func, line, time); _dump_time()
/linux-4.1.27/arch/mn10300/unit-asb2305/
H A Dleds.c82 void peripheral_leds7x4_display_minssecs(unsigned int time, unsigned int points) peripheral_leds7x4_display_minssecs() argument
86 leds = asb2305_led_hex_tbl[(time/600) % 6]; peripheral_leds7x4_display_minssecs()
88 leds |= asb2305_led_hex_tbl[(time/60) % 10]; peripheral_leds7x4_display_minssecs()
90 leds |= asb2305_led_hex_tbl[(time/10) % 6]; peripheral_leds7x4_display_minssecs()
92 leds |= asb2305_led_hex_tbl[time % 10]; peripheral_leds7x4_display_minssecs()
/linux-4.1.27/arch/arm/kernel/
H A Dtime.c2 * linux/arch/arm/kernel/time.c
11 * This file contains the ARM-specific time handling details:
26 #include <linux/time.h>
31 #include <asm/mach/time.h>
42 /* change this if you have some constant time drift */
/linux-4.1.27/drivers/power/
H A Dapm_power.c196 int time; calculate_time() local
198 time = do_calculate_time(status, SOURCE_ENERGY); calculate_time()
199 if (time != -1) calculate_time()
200 return time; calculate_time()
202 time = do_calculate_time(status, SOURCE_CHARGE); calculate_time()
203 if (time != -1) calculate_time()
204 return time; calculate_time()
206 time = do_calculate_time(status, SOURCE_VOLTAGE); calculate_time()
207 if (time != -1) calculate_time()
208 return time; calculate_time()
337 /* time */ apm_battery_apm_get_power_status()
344 info->time = time_to_full.intval / 60; apm_battery_apm_get_power_status()
346 info->time = calculate_time(status.intval); apm_battery_apm_get_power_status()
350 info->time = time_to_empty.intval / 60; apm_battery_apm_get_power_status()
352 info->time = calculate_time(status.intval); apm_battery_apm_get_power_status()
/linux-4.1.27/kernel/power/
H A Dsuspend_test.c16 * time in the future, then suspending. Suspending the devices won't
19 * The time it takes is system-specific though, so when we test this
20 * during system bootup we allow a LOT of time.
55 "Component: %s, time: %u\n", label, msec); suspend_test_finish()
66 KERN_ERR "PM: can't read %s time, err %d\n"; test_wakealarm()
80 status = rtc_read_time(rtc, &alm.time); test_wakealarm()
85 rtc_tm_to_time(&alm.time, &now); test_wakealarm()
88 rtc_time_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time); test_wakealarm()
143 * at startup time. They're normally disabled, for faster boot and because
/linux-4.1.27/drivers/net/wireless/iwlwifi/mvm/
H A Dtime-event.h78 * concurrently, the fw may choose to jump to another channel at any time.
79 * In order to make sure that the fw is on a specific channel at a certain time
80 * and for a certain duration, the driver needs to issue a time event.
82 * The simplest example is for BSS association. The driver issues a time event,
92 * time and for a certain duration, it sends a Time Event. The flow against the
102 * What is the start time of the event?
103 * Is there an end-time for the event?
113 * In order to simplify the use of time events to the rest of the driver,
114 * we abstract the use of time events. This component provides the functions
128 * @max_delay: maximum delay before starting the time event (in TU)
129 * @wait_for_notif: true if it is required that a time event notification be
130 * waited for (that the time event has been scheduled before returning)
151 * the other bindings wait for the medium during that time.
195 * iwl_mvm_remove_time_event - general function to clean up of time event
197 * @vif: the vif to which the time event belongs
198 * @te_data: the time event data that corresponds to that time event
200 * This function can be used to cancel a time event regardless its type.
201 * It is useful for cleaning up time events running before removing an
209 * iwl_mvm_te_clear_data - remove time event from list
211 * @te_data: the time event data to remove
226 * @apply_time: NoA start time in GP2.
228 * This function is used to schedule NoA time event and is used to perform
237 * @te_data: the time event data that corresponds to that time event
/linux-4.1.27/kernel/trace/
H A Dring_buffer_benchmark.c19 /* run time and sleep time in seconds */
216 unsigned long long time; ring_buffer_producer() local
257 * cond_resched and also add any time that was lost by a ring_buffer_producer()
283 time = ktime_us_delta(end_time, start_time); ring_buffer_producer()
311 trace_printk("Time: %lld (usecs)\n", time); ring_buffer_producer()
323 /* Convert time from usecs to millisecs */ ring_buffer_producer()
324 do_div(time, USEC_PER_MSEC); ring_buffer_producer()
325 if (time) ring_buffer_producer()
326 hit /= (long)time; ring_buffer_producer()
333 /* Calculate the average time in nanosecs */ ring_buffer_producer()
339 if (time) ring_buffer_producer()
340 missed /= (long)time; ring_buffer_producer()
351 /* Caculate the average time in nanosecs */ ring_buffer_producer()
/linux-4.1.27/net/netfilter/
H A Dxt_time.c6 * This is a module which is used for time matching
40 * Since time progresses forward, it is best to organize this array in reverse,
41 * to minimize lookup time.
77 static inline unsigned int localtime_1(struct xtm *r, time_t time) localtime_1() argument
82 v = time % SECONDS_PER_DAY; localtime_1()
90 static inline void localtime_2(struct xtm *r, time_t time) localtime_2() argument
96 r->dse = time / 86400; localtime_2()
105 static void localtime_3(struct xtm *r, time_t time) localtime_3() argument
167 * If you match against processing time (get_seconds) it time_mt()
183 * - 'now' is in the global time range date_start..date_end time_mt()
222 /* Do not spend time computing monthday if all days match anyway */ time_mt()
239 "stop time greater than 23:59:59\n"); time_mt_check()
256 .name = "time",
288 MODULE_DESCRIPTION("Xtables: time-based matching");
/linux-4.1.27/drivers/staging/lustre/include/linux/libcfs/
H A Dlibcfs_time.h43 * generic time manipulation functions.
114 struct timespec time; cfs_fs_timeval() local
116 cfs_fs_time_current(&time); cfs_fs_timeval()
117 cfs_fs_time_usec(&time, tv); cfs_fs_timeval()
121 * return valid time-out based on user supplied one. Currently we only check
122 * that time-out is not shorted than allowed.
/linux-4.1.27/arch/mn10300/kernel/
H A Dtime.c1 /* MN10300 Low level time management
5 * - Derived from arch/i386/kernel/time.c
15 #include <linux/time.h>
29 static unsigned long mn10300_last_tsc; /* time-stamp counter at last time
35 * scheduler clock - returns current time in nanosec units.
/linux-4.1.27/arch/blackfin/kernel/
H A Dtime.c2 * arch/blackfin/kernel/time.c
4 * This file contains the Blackfin-specific time handling details.
14 #include <linux/time.h>
20 #include <asm/time.h>
115 * timer_interrupt() needs to keep up the real-time clock,
150 * userspace to have to deal with time values greater than time_init()
/linux-4.1.27/arch/frv/kernel/
H A Dtime.c0 /* time.c: FRV arch-specific time handling
5 * - Derived from arch/m68k/kernel/time.c
51 * timer_interrupt() needs to keep up the real-time clock,
95 /* without this time is undefined and can overflow time_t, causing */ read_persistent_clock()
117 * Scheduler clock - returns current time in nanosec units.

Completed in 8550 milliseconds

1234567891011>>