003 File Manager
Current Path:
/usr/src/sys/compat/linuxkpi/common/include/linux
usr
/
src
/
sys
/
compat
/
linuxkpi
/
common
/
include
/
linux
/
π
..
π
acpi.h
(1.72 KB)
π
atomic.h
(1.5 KB)
π
backlight.h
(2.88 KB)
π
bitfield.h
(3.2 KB)
π
bitmap.h
(8.2 KB)
π
bitops.h
(9.41 KB)
π
bottom_half.h
(1.49 KB)
π
cache.h
(1.61 KB)
π
cdev.h
(3.77 KB)
π
clocksource.h
(1.63 KB)
π
compat.h
(2.07 KB)
π
compiler.h
(3.56 KB)
π
completion.h
(2.68 KB)
π
dcache.h
(1.64 KB)
π
debugfs.h
(1.96 KB)
π
delay.h
(2.25 KB)
π
device.h
(15.33 KB)
π
dma-attrs.h
(2.12 KB)
π
dma-mapping.h
(8.88 KB)
π
dmapool.h
(2.77 KB)
π
dmi.h
(2 KB)
π
err.h
(2.23 KB)
π
errno.h
(2.18 KB)
π
etherdevice.h
(2.91 KB)
π
export.h
(1.44 KB)
π
file.h
(4.46 KB)
π
firmware.h
(3.27 KB)
π
fs.h
(8.19 KB)
π
gcd.h
(1.7 KB)
π
gfp.h
(4.7 KB)
π
hardirq.h
(1.7 KB)
π
hrtimer.h
(3.04 KB)
π
idr.h
(4.61 KB)
π
if_arp.h
(1.62 KB)
π
if_ether.h
(2.12 KB)
π
if_vlan.h
(1.96 KB)
π
in.h
(1.87 KB)
π
in6.h
(1.54 KB)
π
inetdevice.h
(2.79 KB)
π
interrupt.h
(5.63 KB)
π
io-mapping.h
(3.05 KB)
π
io.h
(10.36 KB)
π
ioctl.h
(1.59 KB)
π
irq_work.h
(2.21 KB)
π
irqreturn.h
(1.56 KB)
π
jhash.h
(3.2 KB)
π
jiffies.h
(4.36 KB)
π
kdev_t.h
(1.76 KB)
π
kernel.h
(16.91 KB)
π
kmod.h
(1.89 KB)
π
kobject.h
(4.23 KB)
π
kref.h
(3.16 KB)
π
kthread.h
(2.84 KB)
π
ktime.h
(5.12 KB)
π
list.h
(12.2 KB)
π
llist.h
(2.25 KB)
π
lockdep.h
(2.99 KB)
π
log2.h
(3.96 KB)
π
math64.h
(2.7 KB)
π
miscdevice.h
(2.42 KB)
π
mm.h
(6.73 KB)
π
mm_types.h
(2.33 KB)
π
mod_devicetable.h
(2.25 KB)
π
module.h
(3.22 KB)
π
moduleparam.h
(5.26 KB)
π
mutex.h
(4.6 KB)
π
net.h
(2.42 KB)
π
net_dim.h
(9.87 KB)
π
netdevice.h
(3.85 KB)
π
notifier.h
(1.97 KB)
π
numa.h
(1.52 KB)
π
overflow.h
(2.13 KB)
π
page.h
(3.28 KB)
π
pagemap.h
(1.63 KB)
π
pci.h
(29.63 KB)
π
pfn.h
(1.75 KB)
π
pfn_t.h
(1.9 KB)
π
pid.h
(2.17 KB)
π
pm.h
(2.01 KB)
π
poll.h
(1.86 KB)
π
power_supply.h
(1.66 KB)
π
preempt.h
(1.69 KB)
π
prefetch.h
(1.55 KB)
π
printk.h
(4.08 KB)
π
radix-tree.h
(3.13 KB)
π
random.h
(2.04 KB)
π
rbtree.h
(3.37 KB)
π
rculist.h
(4.11 KB)
π
rcupdate.h
(3.66 KB)
π
refcount.h
(2.3 KB)
π
rwlock.h
(2.55 KB)
π
rwsem.h
(3.06 KB)
π
scatterlist.h
(12.58 KB)
π
sched.h
(5.91 KB)
π
semaphore.h
(2.36 KB)
π
seq_file.h
(3.03 KB)
π
shmem_fs.h
(2.26 KB)
π
shrinker.h
(2.04 KB)
π
sizes.h
(1.92 KB)
π
slab.h
(6.19 KB)
π
smp.h
(1.57 KB)
π
socket.h
(2.17 KB)
π
spinlock.h
(4.29 KB)
π
srcu.h
(2.02 KB)
π
string.h
(3.83 KB)
π
swap.h
(1.68 KB)
π
sysfs.h
(7.54 KB)
π
time.h
(3.17 KB)
π
timer.h
(3.21 KB)
π
types.h
(2.82 KB)
π
uaccess.h
(3.26 KB)
π
usb.h
(11.33 KB)
π
vmalloc.h
(1.72 KB)
π
wait.h
(9.41 KB)
π
wait_bit.h
(2.03 KB)
π
workqueue.h
(7.58 KB)
π
ww_mutex.h
(3.74 KB)
π
xarray.h
(3.33 KB)
Editing: ktime.h
/*- * Copyright (c) 2018 Limelight Networks, Inc. * Copyright (c) 2014-2018 Mellanox Technologies, Ltd. * Copyright (c) 2015 FranΓ§ois Tigeot * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice unmodified, this list of conditions, and the following * disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _LINUX_KTIME_H #define _LINUX_KTIME_H #include <linux/types.h> #include <linux/time.h> #include <linux/jiffies.h> /* time values in nanoseconds */ typedef s64 ktime_t; #define KTIME_MAX ((s64)~((u64)1 << 63)) #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) static inline int64_t ktime_to_ns(ktime_t kt) { return (kt); } static inline ktime_t ns_to_ktime(uint64_t nsec) { return (nsec); } static inline int64_t ktime_divns(const ktime_t kt, int64_t div) { return (kt / div); } static inline int64_t ktime_to_us(ktime_t kt) { return (ktime_divns(kt, NSEC_PER_USEC)); } static inline int64_t ktime_to_ms(ktime_t kt) { return (ktime_divns(kt, NSEC_PER_MSEC)); } static inline struct timeval ktime_to_timeval(ktime_t kt) { return (ns_to_timeval(kt)); } static inline ktime_t ktime_add_ns(ktime_t kt, int64_t ns) { return (kt + ns); } static inline ktime_t ktime_add_ms(ktime_t kt, int64_t ms) { return (ktime_add_ns(kt, ms * NSEC_PER_MSEC)); } static inline ktime_t ktime_add_us(ktime_t kt, int64_t us) { return (ktime_add_ns(kt, us * NSEC_PER_USEC)); } static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { return (kt - ns); } static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) { ktime_t retval = {(s64) secs * NSEC_PER_SEC + (s64) nsecs}; return (retval); } static inline ktime_t ktime_sub(ktime_t lhs, ktime_t rhs) { return (lhs - rhs); } static inline int64_t ktime_us_delta(ktime_t later, ktime_t earlier) { ktime_t diff = ktime_sub(later, earlier); return (ktime_to_us(diff)); } static inline int64_t ktime_ms_delta(ktime_t later, ktime_t earlier) { ktime_t diff = ktime_sub(later, earlier); return (ktime_to_ms(diff)); } static inline ktime_t ktime_add(ktime_t lhs, ktime_t rhs) { return (lhs + rhs); } static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) { if (cmp1 > cmp2) return (1); else if (cmp1 < cmp2) return (-1); else return (0); } static inline bool ktime_after(const ktime_t cmp1, const ktime_t cmp2) { return (ktime_compare(cmp1, cmp2) > 0); } static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) { return (ktime_compare(cmp1, cmp2) < 0); } static inline ktime_t timespec_to_ktime(struct timespec ts) { return (ktime_set(ts.tv_sec, ts.tv_nsec)); } static inline ktime_t timeval_to_ktime(struct timeval tv) { return (ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC)); } static inline int64_t timespec64_to_ns(struct timespec64 *ts) { return (timespec_to_ns(ts)); } #define ktime_to_timespec(kt) ns_to_timespec(kt) #define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) #define ktime_get_ts(ts) getnanouptime(ts) #define ktime_get_ts64(ts) getnanouptime(ts) #define ktime_get_raw_ts64(ts) getnanouptime(ts) #define getrawmonotonic64(ts) getnanouptime(ts) static inline int64_t ktime_get_ns(void) { struct timespec ts; ktime_get_ts(&ts); return (ktime_to_ns(timespec_to_ktime(ts))); } static inline ktime_t ktime_get(void) { struct timespec ts; ktime_get_ts(&ts); return (timespec_to_ktime(ts)); } static inline ktime_t ktime_get_boottime(void) { struct timespec ts; nanouptime(&ts); return (timespec_to_ktime(ts)); } static inline ktime_t ktime_get_real(void) { struct timespec ts; nanotime(&ts); return (timespec_to_ktime(ts)); } static inline ktime_t ktime_get_real_seconds(void) { struct timespec ts; nanotime(&ts); return (ts.tv_sec); } static inline ktime_t ktime_get_raw(void) { struct timespec ts; nanouptime(&ts); return (timespec_to_ktime(ts)); } static inline u64 ktime_get_raw_ns(void) { struct timespec ts; nanouptime(&ts); return (ktime_to_ns(timespec_to_ktime(ts))); } #endif /* _LINUX_KTIME_H */
Upload File
Create Folder