jiffies.h (282513) | jiffies.h (283675) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 28 unchanged lines hidden (view full) --- 37 38static inline int 39msecs_to_jiffies(int msec) 40{ 41 struct timeval tv; 42 43 tv.tv_sec = msec / 1000; 44 tv.tv_usec = (msec % 1000) * 1000; | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 28 unchanged lines hidden (view full) --- 37 38static inline int 39msecs_to_jiffies(int msec) 40{ 41 struct timeval tv; 42 43 tv.tv_sec = msec / 1000; 44 tv.tv_usec = (msec % 1000) * 1000; |
45 return (tvtohz(&tv)); | 45 return (tvtohz(&tv) - 1); |
46} 47 48#define jiffies ticks 49#define jiffies_to_msecs(x) (((int64_t)(x)) * 1000 / hz) 50 51#define time_after(a, b) ((int)((b) - (a)) < 0) 52#define time_before(a, b) time_after(b,a) 53#define time_after_eq(a, b) ((int)((a) - (b)) >= 0) 54#define time_before_eq(a, b) time_after_eq(b, a) 55 56#define HZ hz 57 58#endif /* _LINUX_JIFFIES_H_ */ | 46} 47 48#define jiffies ticks 49#define jiffies_to_msecs(x) (((int64_t)(x)) * 1000 / hz) 50 51#define time_after(a, b) ((int)((b) - (a)) < 0) 52#define time_before(a, b) time_after(b,a) 53#define time_after_eq(a, b) ((int)((a) - (b)) >= 0) 54#define time_before_eq(a, b) time_after_eq(b, a) 55 56#define HZ hz 57 58#endif /* _LINUX_JIFFIES_H_ */ |