6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
#ifndef _LINUX_NTFS_TIME_H
#define _LINUX_NTFS_TIME_H
#include <linux/time.h> /* For current_kernel_time(). */
#include <asm/div64.h> /* For do_div(). */
#include "endian.h"
#define NTFS_TIME_OFFSET ((s64)(369 * 365 + 89) * 24 * 3600 * 10000000)
static inline sle64 utc2ntfs(const struct timespec ts)
{
return cpu_to_sle64((s64)ts.tv_sec * 10000000 + ts.tv_nsec / 100 +
NTFS_TIME_OFFSET);
}
static inline sle64 get_current_ntfs_time(void)
{
return utc2ntfs(current_kernel_time());
}
static inline struct timespec ntfs2utc(const sle64 time)
{
struct timespec ts;
u64 t = (u64)(sle64_to_cpu(time) - NTFS_TIME_OFFSET);
ts.tv_nsec = do_div(t, 10000000) * 100;
ts.tv_sec = t;
return ts;
}
#endif /* _LINUX_NTFS_TIME_H */
|