Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v5.7-rc1 84 lines 1.9 kB view raw
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (C) 2012 - 2014 Cisco Systems 4 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 5 */ 6 7#ifndef __TIMER_INTERNAL_H__ 8#define __TIMER_INTERNAL_H__ 9#include <linux/list.h> 10 11#define TIMER_MULTIPLIER 256 12#define TIMER_MIN_DELTA 500 13 14enum time_travel_mode { 15 TT_MODE_OFF, 16 TT_MODE_BASIC, 17 TT_MODE_INFCPU, 18 TT_MODE_EXTERNAL, 19}; 20 21#ifdef CONFIG_UML_TIME_TRAVEL_SUPPORT 22struct time_travel_event { 23 unsigned long long time; 24 void (*fn)(struct time_travel_event *d); 25 struct list_head list; 26 bool pending, onstack; 27}; 28 29extern enum time_travel_mode time_travel_mode; 30 31void time_travel_sleep(unsigned long long duration); 32 33static inline void 34time_travel_set_event_fn(struct time_travel_event *e, 35 void (*fn)(struct time_travel_event *d)) 36{ 37 e->fn = fn; 38} 39 40void __time_travel_propagate_time(void); 41 42static inline void time_travel_propagate_time(void) 43{ 44 if (time_travel_mode == TT_MODE_EXTERNAL) 45 __time_travel_propagate_time(); 46} 47 48void __time_travel_wait_readable(int fd); 49 50static inline void time_travel_wait_readable(int fd) 51{ 52 if (time_travel_mode == TT_MODE_EXTERNAL) 53 __time_travel_wait_readable(fd); 54} 55 56void time_travel_add_irq_event(struct time_travel_event *e); 57#else 58struct time_travel_event { 59}; 60 61#define time_travel_mode TT_MODE_OFF 62 63static inline void time_travel_sleep(unsigned long long duration) 64{ 65} 66 67/* this is a macro so the event/function need not exist */ 68#define time_travel_set_event_fn(e, fn) do {} while (0) 69 70static inline void time_travel_propagate_time(void) 71{ 72} 73 74static inline void time_travel_wait_readable(int fd) 75{ 76} 77#endif /* CONFIG_UML_TIME_TRAVEL_SUPPORT */ 78 79/* 80 * Without CONFIG_UML_TIME_TRAVEL_SUPPORT this is a linker error if used, 81 * which is intentional since we really shouldn't link it in that case. 82 */ 83void time_travel_ndelay(unsigned long nsec); 84#endif /* __TIMER_INTERNAL_H__ */