/openbmc/linux/include/trace/events/ |
H A D | rtc.h | 12 TP_PROTO(time64_t secs, int err), 14 TP_ARGS(secs, err), 17 __field(time64_t, secs) 22 __entry->secs = secs; 27 __entry->secs, __entry->err 33 TP_PROTO(time64_t secs, int err), 35 TP_ARGS(secs, err) 40 TP_PROTO(time64_t secs, int err), 42 TP_ARGS(secs, err) 47 TP_PROTO(time64_t secs, int err), [all …]
|
/openbmc/linux/drivers/rtc/ |
H A D | rtc-pcap.c | 44 unsigned long secs; in pcap_rtc_read_alarm() local 49 secs = tod & PCAP_RTC_TOD_MASK; in pcap_rtc_read_alarm() 52 secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY; in pcap_rtc_read_alarm() 54 rtc_time64_to_tm(secs, tm); in pcap_rtc_read_alarm() 62 unsigned long secs = rtc_tm_to_time64(&alrm->time); in pcap_rtc_set_alarm() local 65 tod = secs % SEC_PER_DAY; in pcap_rtc_set_alarm() 68 days = secs / SEC_PER_DAY; in pcap_rtc_set_alarm() 77 unsigned long secs; in pcap_rtc_read_time() local 81 secs = tod & PCAP_RTC_TOD_MASK; in pcap_rtc_read_time() 84 secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY; in pcap_rtc_read_time() [all …]
|
H A D | rtc-pm8xxx.c | 121 static int pm8xxx_rtc_read_raw(struct pm8xxx_rtc *rtc_dd, u32 *secs) in pm8xxx_rtc_read_raw() argument 147 *secs = get_unaligned_le32(value); in pm8xxx_rtc_read_raw() 152 static int pm8xxx_rtc_update_offset(struct pm8xxx_rtc *rtc_dd, u32 secs) in pm8xxx_rtc_update_offset() argument 165 offset = secs - raw_secs; in pm8xxx_rtc_update_offset() 188 static int __pm8xxx_rtc_set_time(struct pm8xxx_rtc *rtc_dd, u32 secs) in __pm8xxx_rtc_set_time() argument 195 put_unaligned_le32(secs, value); in __pm8xxx_rtc_set_time() 242 u32 secs; in pm8xxx_rtc_set_time() local 245 secs = rtc_tm_to_time64(tm); in pm8xxx_rtc_set_time() 248 rc = __pm8xxx_rtc_set_time(rtc_dd, secs); in pm8xxx_rtc_set_time() 250 rc = pm8xxx_rtc_update_offset(rtc_dd, secs); in pm8xxx_rtc_set_time() [all …]
|
H A D | rtc-ab8500.c | 65 unsigned long mins, secs; in ab8500_rtc_read_time() local 99 secs = (buf[3] << 8) | buf[4]; in ab8500_rtc_read_time() 100 secs = secs / COUNTS_PER_SEC; in ab8500_rtc_read_time() 101 secs = secs + (mins * 60); in ab8500_rtc_read_time() 103 rtc_time64_to_tm(secs, tm); in ab8500_rtc_read_time() 111 unsigned long no_secs, no_mins, secs = 0; in ab8500_rtc_set_time() local 113 secs = rtc_tm_to_time64(tm); in ab8500_rtc_set_time() 115 no_mins = secs / 60; in ab8500_rtc_set_time() 117 no_secs = secs % 60; in ab8500_rtc_set_time() 145 unsigned long secs, mins; in ab8500_rtc_read_alarm() local [all …]
|
H A D | lib_test.c | 48 time64_t secs; in rtc_time64_to_tm_test_date_range() local 51 for (secs = 0; secs <= total_secs; secs += 86400) { in rtc_time64_to_tm_test_date_range() 53 rtc_time64_to_tm(secs, &result); in rtc_time64_to_tm_test_date_range() 55 days = div_s64(secs, 86400); in rtc_time64_to_tm_test_date_range()
|
H A D | rtc-at91sam9.c | 106 u32 secs, secs2; in at91_rtc_readtime() local 115 secs = rtt_readl(rtc, VR); in at91_rtc_readtime() 117 if (secs != secs2) in at91_rtc_readtime() 118 secs = rtt_readl(rtc, VR); in at91_rtc_readtime() 120 rtc_time64_to_tm(offset + secs, tm); in at91_rtc_readtime() 134 unsigned long secs; in at91_rtc_settime() local 138 secs = rtc_tm_to_time64(tm); in at91_rtc_settime() 149 secs += 1; in at91_rtc_settime() 150 gpbr_writel(rtc, secs); in at91_rtc_settime() 155 if (offset > secs) { in at91_rtc_settime() [all …]
|
H A D | rtc-sunplus.c | 65 static void sp_get_seconds(struct device *dev, unsigned long *secs) in sp_get_seconds() argument 69 *secs = (unsigned long)readl(sp_rtc->reg_base + RTC_TIMER_OUT); in sp_get_seconds() 72 static void sp_set_seconds(struct device *dev, unsigned long secs) in sp_set_seconds() argument 76 writel((u32)secs, sp_rtc->reg_base + RTC_TIMER_SET); in sp_set_seconds() 81 unsigned long secs; in sp_rtc_read_time() local 83 sp_get_seconds(dev, &secs); in sp_rtc_read_time() 84 rtc_time64_to_tm(secs, tm); in sp_rtc_read_time() 91 unsigned long secs; in sp_rtc_set_time() local 93 secs = rtc_tm_to_time64(tm); in sp_rtc_set_time() 94 dev_dbg(dev, "%s, secs = %lu\n", __func__, secs); in sp_rtc_set_time() [all …]
|
H A D | rtc-sc27xx.c | 167 time64_t *secs) in sprd_rtc_get_secs() argument 219 *secs = (((time64_t)(day * 24) + hour) * 60 + min) * 60 + sec; in sprd_rtc_get_secs() 224 time64_t secs) in sprd_rtc_set_secs() argument 231 day = div_s64_rem(secs, 86400, &rem); in sprd_rtc_set_secs() 305 time64_t secs = rtc_tm_to_time64(&alrm->time); in sprd_rtc_set_aux_alarm() local 314 ret = sprd_rtc_set_secs(rtc, SPRD_RTC_AUX_ALARM, secs); in sprd_rtc_set_aux_alarm() 335 time64_t secs; in sprd_rtc_read_time() local 343 ret = sprd_rtc_get_secs(rtc, SPRD_RTC_TIME, &secs); in sprd_rtc_read_time() 347 rtc_time64_to_tm(secs, tm); in sprd_rtc_read_time() 354 time64_t secs = rtc_tm_to_time64(tm); in sprd_rtc_set_time() local [all …]
|
H A D | lib.c | 54 unsigned int secs; in rtc_time64_to_tm() local 63 days = div_s64_rem(time, 86400, &secs); in rtc_time64_to_tm() 135 tm->tm_hour = secs / 3600; in rtc_time64_to_tm() 136 secs -= tm->tm_hour * 3600; in rtc_time64_to_tm() 137 tm->tm_min = secs / 60; in rtc_time64_to_tm() 138 tm->tm_sec = secs - tm->tm_min * 60; in rtc_time64_to_tm()
|
H A D | rtc-jz4740.c | 145 uint32_t secs, secs2; in jz4740_rtc_read_time() local 155 secs = jz4740_rtc_reg_read(rtc, JZ_REG_RTC_SEC); in jz4740_rtc_read_time() 158 while (secs != secs2 && --timeout) { in jz4740_rtc_read_time() 159 secs = secs2; in jz4740_rtc_read_time() 166 rtc_time64_to_tm(secs, time); in jz4740_rtc_read_time() 186 uint32_t secs; in jz4740_rtc_read_alarm() local 189 secs = jz4740_rtc_reg_read(rtc, JZ_REG_RTC_SEC_ALARM); in jz4740_rtc_read_alarm() 196 rtc_time64_to_tm(secs, &alrm->time); in jz4740_rtc_read_alarm() 205 uint32_t secs = lower_32_bits(rtc_tm_to_time64(&alrm->time)); in jz4740_rtc_set_alarm() local 207 ret = jz4740_rtc_reg_write(rtc, JZ_REG_RTC_SEC_ALARM, secs); in jz4740_rtc_set_alarm()
|
H A D | rtc-ds1672.c | 86 unsigned long secs = rtc_tm_to_time64(tm); in ds1672_set_time() local 89 buf[1] = secs & 0x000000FF; in ds1672_set_time() 90 buf[2] = (secs & 0x0000FF00) >> 8; in ds1672_set_time() 91 buf[3] = (secs & 0x00FF0000) >> 16; in ds1672_set_time() 92 buf[4] = (secs & 0xFF000000) >> 24; in ds1672_set_time()
|
/openbmc/u-boot/drivers/rtc/ |
H A D | mxsrtc.c | 18 int mxs_rtc_set_time(uint32_t secs) in mxs_rtc_set_time() argument 23 writel(secs, &rtc_regs->hw_rtc_seconds); in mxs_rtc_set_time() 42 uint32_t secs; in rtc_get() local 44 secs = readl(&rtc_regs->hw_rtc_seconds); in rtc_get() 45 rtc_to_tm(secs, time); in rtc_get() 52 uint32_t secs; in rtc_set() local 54 secs = rtc_mktime(time); in rtc_set() 56 return mxs_rtc_set_time(secs); in rtc_set()
|
H A D | rtc-lib.c | 40 unsigned int month, year, secs; in rtc_to_tm() local 43 days = div_u64_rem(time, 86400, &secs); in rtc_to_tm() 70 tm->tm_hour = secs / 3600; in rtc_to_tm() 71 secs -= tm->tm_hour * 3600; in rtc_to_tm() 72 tm->tm_min = secs / 60; in rtc_to_tm() 73 tm->tm_sec = secs - tm->tm_min * 60; in rtc_to_tm()
|
/openbmc/linux/kernel/time/ |
H A D | time_test.c | 67 time64_t secs; in time64_to_tm_test_date_range() local 70 for (secs = -total_secs; secs <= total_secs; secs += 86400) { in time64_to_tm_test_date_range() 72 time64_to_tm(secs, 0, &result); in time64_to_tm_test_date_range() 74 days = div_s64(secs, 86400); in time64_to_tm_test_date_range()
|
H A D | ntp.c | 281 static inline s64 ntp_update_offset_fll(s64 offset64, long secs) in ntp_update_offset_fll() argument 285 if (secs < MINSEC) in ntp_update_offset_fll() 288 if (!(time_status & STA_FLL) && (secs <= MAXSEC)) in ntp_update_offset_fll() 293 return div64_long(offset64 << (NTP_SCALE_SHIFT - SHIFT_FLL), secs); in ntp_update_offset_fll() 300 long secs; in ntp_update_offset() local 321 secs = (long)(__ktime_get_real_seconds() - time_reftime); in ntp_update_offset() 323 secs = 0; in ntp_update_offset() 328 freq_adj = ntp_update_offset_fll(offset64, secs); in ntp_update_offset() 335 if (unlikely(secs > 1 << (SHIFT_PLL + 1 + time_constant))) in ntp_update_offset() 336 secs = 1 << (SHIFT_PLL + 1 + time_constant); in ntp_update_offset() [all …]
|
/openbmc/linux/arch/x86/kernel/cpu/sgx/ |
H A D | ioctl.c | 57 static int sgx_encl_create(struct sgx_encl *encl, struct sgx_secs *secs) in sgx_encl_create() argument 71 if (!is_power_of_2(secs->size)) in sgx_encl_create() 82 encl_size = secs->size + PAGE_SIZE; in sgx_encl_create() 93 secs_epc = sgx_alloc_epc_page(&encl->secs, true); in sgx_encl_create() 99 encl->secs.epc_page = secs_epc; in sgx_encl_create() 102 pginfo.contents = (unsigned long)secs; in sgx_encl_create() 104 pginfo.secs = 0; in sgx_encl_create() 113 if (secs->attributes & SGX_ATTR_DEBUG) in sgx_encl_create() 116 encl->secs.encl = encl; in sgx_encl_create() 117 encl->secs.type = SGX_PAGE_TYPE_SECS; in sgx_encl_create() [all …]
|
H A D | virt.c | 334 int sgx_virt_ecreate(struct sgx_pageinfo *pageinfo, void __user *secs, in sgx_virt_ecreate() argument 350 if (WARN_ON_ONCE(!access_ok(secs, PAGE_SIZE))) in sgx_virt_ecreate() 354 ret = __ecreate(pageinfo, (void *)secs); in sgx_virt_ecreate() 369 void __user *secs) in __sgx_virt_einit() argument 381 !access_ok(secs, PAGE_SIZE))) in __sgx_virt_einit() 385 ret = __einit((void *)sigstruct, (void *)token, (void *)secs); in __sgx_virt_einit() 409 void __user *secs, u64 *lepubkeyhash, int *trapnr) in sgx_virt_einit() argument 414 ret = __sgx_virt_einit(sigstruct, token, secs); in sgx_virt_einit() 420 ret = __sgx_virt_einit(sigstruct, token, secs); in sgx_virt_einit()
|
H A D | encls.h | 140 static inline int __ecreate(struct sgx_pageinfo *pginfo, void *secs) in __ecreate() argument 142 return __encls_2(ECREATE, pginfo, secs); in __ecreate() 146 static inline int __eextend(void *secs, void *addr) in __eextend() argument 148 return __encls_2(EEXTEND, secs, addr); in __eextend() 161 static inline int __einit(void *sigstruct, void *token, void *secs) in __einit() argument 163 return __encls_ret_3(EINIT, sigstruct, secs, token); in __einit()
|
/openbmc/linux/tools/testing/selftests/rtc/ |
H A D | rtctest.c | 198 time_t secs, new; in TEST_F() local 208 secs = timegm((struct tm *)&tm) + ALARM_DELTA; in TEST_F() 209 gmtime_r(&secs, (struct tm *)&tm); in TEST_F() 247 ASSERT_EQ(new, secs); in TEST_F() 256 time_t secs, new; in TEST_F() local 266 secs = timegm((struct tm *)&alarm.time) + ALARM_DELTA; in TEST_F() 267 gmtime_r(&secs, (struct tm *)&alarm.time); in TEST_F() 300 ASSERT_EQ(new, secs); in TEST_F() 308 time_t secs, new; variable 318 secs = timegm((struct tm *)&tm) + 60 - tm.tm_sec; [all …]
|
/openbmc/linux/drivers/net/dsa/microchip/ |
H A D | lan937x_main.c | 263 u32 secs = msecs; in lan937x_set_ageing_time() local 278 secs /= 1000; in lan937x_set_ageing_time() 279 if (!secs) in lan937x_set_ageing_time() 280 secs = 1; in lan937x_set_ageing_time() 283 else if (secs > 7 * MAX_TIMER_VAL) in lan937x_set_ageing_time() 304 max_val = DIV_ROUND_UP(secs, mult); in lan937x_set_ageing_time() 305 if (max_val > MAX_TIMER_VAL || max_val * mult != secs) in lan937x_set_ageing_time() 309 data = DIV_ROUND_UP(secs, max_val); in lan937x_set_ageing_time() 318 secs = DIV_ROUND_UP(secs, data); in lan937x_set_ageing_time() 320 value = FIELD_GET(SW_AGE_PERIOD_7_0_M, secs); in lan937x_set_ageing_time() [all …]
|
/openbmc/linux/tools/testing/selftests/sgx/ |
H A D | load.c | 82 struct sgx_secs *secs = &encl->secs; in encl_ioc_create() local 88 memset(secs, 0, sizeof(*secs)); in encl_ioc_create() 89 secs->ssa_frame_size = 1; in encl_ioc_create() 90 secs->attributes = SGX_ATTR_MODE64BIT; in encl_ioc_create() 91 secs->xfrm = 3; in encl_ioc_create() 92 secs->base = encl->encl_base; in encl_ioc_create() 93 secs->size = encl->encl_size; in encl_ioc_create() 95 ioc.src = (unsigned long)secs; in encl_ioc_create() 99 munmap((void *)secs->base, encl->encl_size); in encl_ioc_create()
|
/openbmc/linux/arch/mips/mti-malta/ |
H A D | malta-time.c | 66 int secs; in estimate_frequencies() local 106 secs = secs2 - secs1; in estimate_frequencies() 107 if (secs < 1) in estimate_frequencies() 108 secs += 60; in estimate_frequencies() 111 count /= secs; in estimate_frequencies() 115 giccount = div_u64(giccount - gicstart, secs); in estimate_frequencies()
|
/openbmc/linux/tools/lib/bpf/ |
H A D | linker.c | 62 struct src_sec *secs; member 140 struct dst_sec *secs; member 201 struct dst_sec *sec = &linker->secs[i]; in bpf_linker__free() 211 free(linker->secs); in bpf_linker__free() 249 struct dst_sec *secs = linker->secs, *sec; in add_dst_sec() local 252 secs = libbpf_reallocarray(secs, new_cnt, sizeof(*secs)); in add_dst_sec() 253 if (!secs) in add_dst_sec() 257 memset(secs + linker->sec_cnt, 0, (new_cnt - linker->sec_cnt) * sizeof(*secs)); in add_dst_sec() 259 linker->secs = secs; in add_dst_sec() 262 sec = &linker->secs[new_cnt - 1]; in add_dst_sec() [all …]
|
/openbmc/u-boot/board/gateworks/gw_ventana/ |
H A D | gsc.c | 183 unsigned long secs = 0; in do_gsc_sleep() local 188 secs = simple_strtoul(argv[1], NULL, 10); in do_gsc_sleep() 189 printf("GSC Sleeping for %ld seconds\n", secs); in do_gsc_sleep() 192 reg = (secs >> 24) & 0xff; in do_gsc_sleep() 195 reg = (secs >> 16) & 0xff; in do_gsc_sleep() 198 reg = (secs >> 8) & 0xff; in do_gsc_sleep() 201 reg = secs & 0xff; in do_gsc_sleep()
|
/openbmc/qemu/hw/block/ |
H A D | hd-geometry.c | 121 int cylinders, heads, secs, translation; in hd_geometry_guess() local 131 } else if (guess_disk_lchs(blk, &cylinders, &heads, &secs) < 0) { in hd_geometry_guess() 147 *psecs = secs; in hd_geometry_guess() 163 int hd_bios_chs_auto_trans(uint32_t cyls, uint32_t heads, uint32_t secs) in hd_bios_chs_auto_trans() argument 165 return cyls <= 1024 && heads <= 16 && secs <= 63 in hd_bios_chs_auto_trans()
|