ktime.h (271127) | ktime.h (282513) |
---|---|
1/*- 2 * Copyright (c) 2014 Mellanox Technologies, Ltd. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 274 unchanged lines hidden (view full) --- 283 */ 284static inline s64 ktime_to_ns(const ktime_t kt) 285{ 286 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; 287} 288 289#endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ 290 | 1/*- 2 * Copyright (c) 2014 Mellanox Technologies, Ltd. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 274 unchanged lines hidden (view full) --- 283 */ 284static inline s64 ktime_to_ns(const ktime_t kt) 285{ 286 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; 287} 288 289#endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ 290 |
291static inline s64 ktime_get_ns(void) 292{ 293 struct timespec ts; 294 ktime_t kt; 295 ktime_get_ts(&ts); 296 kt = timespec_to_ktime(ts); 297 return (ktime_to_ns(kt)); 298} 299 |
|
291#endif /* _LINUX_KTIME_H */ | 300#endif /* _LINUX_KTIME_H */ |