提交 82210fc7 编写于 作者: A Arnd Bergmann

y2038: vdso: change timespec to __kernel_old_timespec

In order to remove 'timespec' completely from the kernel, all
internal uses should be converted to a y2038-safe type, while
those that are only for compatibity with existing user space
should be marked appropriately.

Change vdso to use __kernel_old_timespec in order to avoid
the deprecated type and mark these interfaces as outdated.
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
上级 ddccf40f
...@@ -211,7 +211,7 @@ void foo(void) ...@@ -211,7 +211,7 @@ void foo(void)
offsetof (struct cpuinfo_ia64, ptce_stride)); offsetof (struct cpuinfo_ia64, ptce_stride));
BLANK(); BLANK();
DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET, DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET,
offsetof (struct timespec, tv_nsec)); offsetof (struct __kernel_old_timespec, tv_nsec));
DEFINE(IA64_TIME_SN_SPEC_SNSEC_OFFSET, DEFINE(IA64_TIME_SN_SPEC_SNSEC_OFFSET,
offsetof (struct time_sn_spec, snsec)); offsetof (struct time_sn_spec, snsec));
......
...@@ -48,9 +48,9 @@ static notrace int vdso_read_retry(const struct vdso_data *vdata, u32 start) ...@@ -48,9 +48,9 @@ static notrace int vdso_read_retry(const struct vdso_data *vdata, u32 start)
} }
static notrace long clock_gettime_fallback(clockid_t _clkid, static notrace long clock_gettime_fallback(clockid_t _clkid,
struct timespec *_ts) struct __kernel_old_timespec *_ts)
{ {
register struct timespec *ts asm("$r1") = _ts; register struct __kernel_old_timespec *ts asm("$r1") = _ts;
register clockid_t clkid asm("$r0") = _clkid; register clockid_t clkid asm("$r0") = _clkid;
register long ret asm("$r0"); register long ret asm("$r0");
...@@ -63,7 +63,7 @@ static notrace long clock_gettime_fallback(clockid_t _clkid, ...@@ -63,7 +63,7 @@ static notrace long clock_gettime_fallback(clockid_t _clkid,
return ret; return ret;
} }
static notrace int do_realtime_coarse(struct timespec *ts, static notrace int do_realtime_coarse(struct __kernel_old_timespec *ts,
struct vdso_data *vdata) struct vdso_data *vdata)
{ {
u32 seq; u32 seq;
...@@ -78,7 +78,7 @@ static notrace int do_realtime_coarse(struct timespec *ts, ...@@ -78,7 +78,7 @@ static notrace int do_realtime_coarse(struct timespec *ts,
return 0; return 0;
} }
static notrace int do_monotonic_coarse(struct timespec *ts, static notrace int do_monotonic_coarse(struct __kernel_old_timespec *ts,
struct vdso_data *vdata) struct vdso_data *vdata)
{ {
struct timespec tomono; struct timespec tomono;
...@@ -115,7 +115,7 @@ static notrace inline u64 vgetsns(struct vdso_data *vdso) ...@@ -115,7 +115,7 @@ static notrace inline u64 vgetsns(struct vdso_data *vdso)
return ((u64) cycle_delta & vdso->cs_mask) * vdso->cs_mult; return ((u64) cycle_delta & vdso->cs_mask) * vdso->cs_mult;
} }
static notrace int do_realtime(struct timespec *ts, struct vdso_data *vdata) static notrace int do_realtime(struct __kernel_old_timespec *ts, struct vdso_data *vdata)
{ {
unsigned count; unsigned count;
u64 ns; u64 ns;
...@@ -133,7 +133,7 @@ static notrace int do_realtime(struct timespec *ts, struct vdso_data *vdata) ...@@ -133,7 +133,7 @@ static notrace int do_realtime(struct timespec *ts, struct vdso_data *vdata)
return 0; return 0;
} }
static notrace int do_monotonic(struct timespec *ts, struct vdso_data *vdata) static notrace int do_monotonic(struct __kernel_old_timespec *ts, struct vdso_data *vdata)
{ {
struct timespec tomono; struct timespec tomono;
u64 nsecs; u64 nsecs;
...@@ -158,7 +158,7 @@ static notrace int do_monotonic(struct timespec *ts, struct vdso_data *vdata) ...@@ -158,7 +158,7 @@ static notrace int do_monotonic(struct timespec *ts, struct vdso_data *vdata)
return 0; return 0;
} }
notrace int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts) notrace int __vdso_clock_gettime(clockid_t clkid, struct __kernel_old_timespec *ts)
{ {
struct vdso_data *vdata; struct vdso_data *vdata;
int ret = -1; int ret = -1;
...@@ -191,10 +191,10 @@ notrace int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts) ...@@ -191,10 +191,10 @@ notrace int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts)
} }
static notrace int clock_getres_fallback(clockid_t _clk_id, static notrace int clock_getres_fallback(clockid_t _clk_id,
struct timespec *_res) struct __kernel_old_timespec *_res)
{ {
register clockid_t clk_id asm("$r0") = _clk_id; register clockid_t clk_id asm("$r0") = _clk_id;
register struct timespec *res asm("$r1") = _res; register struct __kernel_old_timespec *res asm("$r1") = _res;
register int ret asm("$r0"); register int ret asm("$r0");
asm volatile ("movi $r15, %3\n" asm volatile ("movi $r15, %3\n"
...@@ -206,7 +206,7 @@ static notrace int clock_getres_fallback(clockid_t _clk_id, ...@@ -206,7 +206,7 @@ static notrace int clock_getres_fallback(clockid_t _clk_id,
return ret; return ret;
} }
notrace int __vdso_clock_getres(clockid_t clk_id, struct timespec *res) notrace int __vdso_clock_getres(clockid_t clk_id, struct __kernel_old_timespec *res)
{ {
struct vdso_data *vdata = __get_datapage(); struct vdso_data *vdata = __get_datapage();
...@@ -248,7 +248,7 @@ static notrace inline int gettimeofday_fallback(struct __kernel_old_timeval *_tv ...@@ -248,7 +248,7 @@ static notrace inline int gettimeofday_fallback(struct __kernel_old_timeval *_tv
notrace int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) notrace int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
{ {
struct timespec ts; struct __kernel_old_timespec ts;
struct vdso_data *vdata; struct vdso_data *vdata;
int ret; int ret;
......
...@@ -63,7 +63,7 @@ notrace static __always_inline struct vvar_data *get_vvar_data(void) ...@@ -63,7 +63,7 @@ notrace static __always_inline struct vvar_data *get_vvar_data(void)
return (struct vvar_data *) ret; return (struct vvar_data *) ret;
} }
notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) notrace static long vdso_fallback_gettime(long clock, struct __kernel_old_timespec *ts)
{ {
register long num __asm__("g1") = __NR_clock_gettime; register long num __asm__("g1") = __NR_clock_gettime;
register long o0 __asm__("o0") = clock; register long o0 __asm__("o0") = clock;
...@@ -144,7 +144,7 @@ notrace static __always_inline u64 vgetsns_stick(struct vvar_data *vvar) ...@@ -144,7 +144,7 @@ notrace static __always_inline u64 vgetsns_stick(struct vvar_data *vvar)
} }
notrace static __always_inline int do_realtime(struct vvar_data *vvar, notrace static __always_inline int do_realtime(struct vvar_data *vvar,
struct timespec *ts) struct __kernel_old_timespec *ts)
{ {
unsigned long seq; unsigned long seq;
u64 ns; u64 ns;
...@@ -164,7 +164,7 @@ notrace static __always_inline int do_realtime(struct vvar_data *vvar, ...@@ -164,7 +164,7 @@ notrace static __always_inline int do_realtime(struct vvar_data *vvar,
} }
notrace static __always_inline int do_realtime_stick(struct vvar_data *vvar, notrace static __always_inline int do_realtime_stick(struct vvar_data *vvar,
struct timespec *ts) struct __kernel_old_timespec *ts)
{ {
unsigned long seq; unsigned long seq;
u64 ns; u64 ns;
...@@ -184,7 +184,7 @@ notrace static __always_inline int do_realtime_stick(struct vvar_data *vvar, ...@@ -184,7 +184,7 @@ notrace static __always_inline int do_realtime_stick(struct vvar_data *vvar,
} }
notrace static __always_inline int do_monotonic(struct vvar_data *vvar, notrace static __always_inline int do_monotonic(struct vvar_data *vvar,
struct timespec *ts) struct __kernel_old_timespec *ts)
{ {
unsigned long seq; unsigned long seq;
u64 ns; u64 ns;
...@@ -204,7 +204,7 @@ notrace static __always_inline int do_monotonic(struct vvar_data *vvar, ...@@ -204,7 +204,7 @@ notrace static __always_inline int do_monotonic(struct vvar_data *vvar,
} }
notrace static __always_inline int do_monotonic_stick(struct vvar_data *vvar, notrace static __always_inline int do_monotonic_stick(struct vvar_data *vvar,
struct timespec *ts) struct __kernel_old_timespec *ts)
{ {
unsigned long seq; unsigned long seq;
u64 ns; u64 ns;
...@@ -224,7 +224,7 @@ notrace static __always_inline int do_monotonic_stick(struct vvar_data *vvar, ...@@ -224,7 +224,7 @@ notrace static __always_inline int do_monotonic_stick(struct vvar_data *vvar,
} }
notrace static int do_realtime_coarse(struct vvar_data *vvar, notrace static int do_realtime_coarse(struct vvar_data *vvar,
struct timespec *ts) struct __kernel_old_timespec *ts)
{ {
unsigned long seq; unsigned long seq;
...@@ -237,7 +237,7 @@ notrace static int do_realtime_coarse(struct vvar_data *vvar, ...@@ -237,7 +237,7 @@ notrace static int do_realtime_coarse(struct vvar_data *vvar,
} }
notrace static int do_monotonic_coarse(struct vvar_data *vvar, notrace static int do_monotonic_coarse(struct vvar_data *vvar,
struct timespec *ts) struct __kernel_old_timespec *ts)
{ {
unsigned long seq; unsigned long seq;
...@@ -251,7 +251,7 @@ notrace static int do_monotonic_coarse(struct vvar_data *vvar, ...@@ -251,7 +251,7 @@ notrace static int do_monotonic_coarse(struct vvar_data *vvar,
} }
notrace int notrace int
__vdso_clock_gettime(clockid_t clock, struct timespec *ts) __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
{ {
struct vvar_data *vvd = get_vvar_data(); struct vvar_data *vvd = get_vvar_data();
...@@ -275,11 +275,11 @@ __vdso_clock_gettime(clockid_t clock, struct timespec *ts) ...@@ -275,11 +275,11 @@ __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
return vdso_fallback_gettime(clock, ts); return vdso_fallback_gettime(clock, ts);
} }
int int
clock_gettime(clockid_t, struct timespec *) clock_gettime(clockid_t, struct __kernel_old_timespec *)
__attribute__((weak, alias("__vdso_clock_gettime"))); __attribute__((weak, alias("__vdso_clock_gettime")));
notrace int notrace int
__vdso_clock_gettime_stick(clockid_t clock, struct timespec *ts) __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts)
{ {
struct vvar_data *vvd = get_vvar_data(); struct vvar_data *vvd = get_vvar_data();
...@@ -311,7 +311,7 @@ __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) ...@@ -311,7 +311,7 @@ __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
if (likely(vvd->vclock_mode != VCLOCK_NONE)) { if (likely(vvd->vclock_mode != VCLOCK_NONE)) {
if (likely(tv != NULL)) { if (likely(tv != NULL)) {
union tstv_t { union tstv_t {
struct timespec ts; struct __kernel_old_timespec ts;
struct __kernel_old_timeval tv; struct __kernel_old_timeval tv;
} *tstv = (union tstv_t *) tv; } *tstv = (union tstv_t *) tv;
do_realtime(vvd, &tstv->ts); do_realtime(vvd, &tstv->ts);
...@@ -347,7 +347,7 @@ __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz) ...@@ -347,7 +347,7 @@ __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz)
if (likely(vvd->vclock_mode != VCLOCK_NONE)) { if (likely(vvd->vclock_mode != VCLOCK_NONE)) {
if (likely(tv != NULL)) { if (likely(tv != NULL)) {
union tstv_t { union tstv_t {
struct timespec ts; struct __kernel_old_timespec ts;
struct __kernel_old_timeval tv; struct __kernel_old_timeval tv;
} *tstv = (union tstv_t *) tv; } *tstv = (union tstv_t *) tv;
do_realtime_stick(vvd, &tstv->ts); do_realtime_stick(vvd, &tstv->ts);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/getcpu.h> #include <linux/getcpu.h>
#include <asm/unistd.h> #include <asm/unistd.h>
int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
{ {
long ret; long ret;
...@@ -22,7 +22,7 @@ int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) ...@@ -22,7 +22,7 @@ int __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
return ret; return ret;
} }
int clock_gettime(clockid_t, struct timespec *) int clock_gettime(clockid_t, struct __kernel_old_timespec *)
__attribute__((weak, alias("__vdso_clock_gettime"))); __attribute__((weak, alias("__vdso_clock_gettime")));
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册