sys_ppc32.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /*
  2. * sys_ppc32.c: Conversion between 32bit and 64bit native syscalls.
  3. *
  4. * Copyright (C) 2001 IBM
  5. * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  6. * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
  7. *
  8. * These routines maintain argument size conversion between 32bit and 64bit
  9. * environment.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version
  14. * 2 of the License, or (at your option) any later version.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/sched.h>
  18. #include <linux/fs.h>
  19. #include <linux/mm.h>
  20. #include <linux/file.h>
  21. #include <linux/signal.h>
  22. #include <linux/resource.h>
  23. #include <linux/times.h>
  24. #include <linux/smp.h>
  25. #include <linux/sem.h>
  26. #include <linux/msg.h>
  27. #include <linux/shm.h>
  28. #include <linux/poll.h>
  29. #include <linux/personality.h>
  30. #include <linux/stat.h>
  31. #include <linux/mman.h>
  32. #include <linux/in.h>
  33. #include <linux/syscalls.h>
  34. #include <linux/unistd.h>
  35. #include <linux/sysctl.h>
  36. #include <linux/binfmts.h>
  37. #include <linux/security.h>
  38. #include <linux/compat.h>
  39. #include <linux/ptrace.h>
  40. #include <linux/elf.h>
  41. #include <linux/ipc.h>
  42. #include <linux/slab.h>
  43. #include <asm/ptrace.h>
  44. #include <asm/types.h>
  45. #include <asm/uaccess.h>
  46. #include <asm/unistd.h>
  47. #include <asm/time.h>
  48. #include <asm/mmu_context.h>
  49. #include <asm/ppc-pci.h>
  50. #include <asm/syscalls.h>
  51. #include <asm/switch_to.h>
  52. asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
  53. compat_ulong_t __user *outp, compat_ulong_t __user *exp,
  54. compat_uptr_t tvp_x)
  55. {
  56. /* sign extend n */
  57. return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x));
  58. }
  59. /* Note: it is necessary to treat option as an unsigned int,
  60. * with the corresponding cast to a signed int to insure that the
  61. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  62. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  63. */
  64. asmlinkage long compat_sys_sysfs(u32 option, u32 arg1, u32 arg2)
  65. {
  66. return sys_sysfs((int)option, arg1, arg2);
  67. }
  68. #ifdef CONFIG_SYSVIPC
  69. long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr,
  70. u32 fifth)
  71. {
  72. int version;
  73. version = call >> 16; /* hack for backward compatibility */
  74. call &= 0xffff;
  75. switch (call) {
  76. case SEMTIMEDOP:
  77. if (fifth)
  78. /* sign extend semid */
  79. return compat_sys_semtimedop((int)first,
  80. compat_ptr(ptr), second,
  81. compat_ptr(fifth));
  82. /* else fall through for normal semop() */
  83. case SEMOP:
  84. /* struct sembuf is the same on 32 and 64bit :)) */
  85. /* sign extend semid */
  86. return sys_semtimedop((int)first, compat_ptr(ptr), second,
  87. NULL);
  88. case SEMGET:
  89. /* sign extend key, nsems */
  90. return sys_semget((int)first, (int)second, third);
  91. case SEMCTL:
  92. /* sign extend semid, semnum */
  93. return compat_sys_semctl((int)first, (int)second, third,
  94. compat_ptr(ptr));
  95. case MSGSND:
  96. /* sign extend msqid */
  97. return compat_sys_msgsnd((int)first, (int)second, third,
  98. compat_ptr(ptr));
  99. case MSGRCV:
  100. /* sign extend msqid, msgtyp */
  101. return compat_sys_msgrcv((int)first, second, (int)fifth,
  102. third, version, compat_ptr(ptr));
  103. case MSGGET:
  104. /* sign extend key */
  105. return sys_msgget((int)first, second);
  106. case MSGCTL:
  107. /* sign extend msqid */
  108. return compat_sys_msgctl((int)first, second, compat_ptr(ptr));
  109. case SHMAT:
  110. /* sign extend shmid */
  111. return compat_sys_shmat((int)first, second, third, version,
  112. compat_ptr(ptr));
  113. case SHMDT:
  114. return sys_shmdt(compat_ptr(ptr));
  115. case SHMGET:
  116. /* sign extend key_t */
  117. return sys_shmget((int)first, second, third);
  118. case SHMCTL:
  119. /* sign extend shmid */
  120. return compat_sys_shmctl((int)first, second, compat_ptr(ptr));
  121. default:
  122. return -ENOSYS;
  123. }
  124. return -ENOSYS;
  125. }
  126. #endif
  127. /* Note: it is necessary to treat out_fd and in_fd as unsigned ints,
  128. * with the corresponding cast to a signed int to insure that the
  129. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  130. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  131. */
  132. asmlinkage long compat_sys_sendfile(u32 out_fd, u32 in_fd, compat_off_t __user * offset, u32 count)
  133. {
  134. mm_segment_t old_fs = get_fs();
  135. int ret;
  136. off_t of;
  137. off_t __user *up;
  138. if (offset && get_user(of, offset))
  139. return -EFAULT;
  140. /* The __user pointer cast is valid because of the set_fs() */
  141. set_fs(KERNEL_DS);
  142. up = offset ? (off_t __user *) &of : NULL;
  143. ret = sys_sendfile((int)out_fd, (int)in_fd, up, count);
  144. set_fs(old_fs);
  145. if (offset && put_user(of, offset))
  146. return -EFAULT;
  147. return ret;
  148. }
  149. asmlinkage int compat_sys_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, s32 count)
  150. {
  151. mm_segment_t old_fs = get_fs();
  152. int ret;
  153. loff_t lof;
  154. loff_t __user *up;
  155. if (offset && get_user(lof, offset))
  156. return -EFAULT;
  157. /* The __user pointer cast is valid because of the set_fs() */
  158. set_fs(KERNEL_DS);
  159. up = offset ? (loff_t __user *) &lof : NULL;
  160. ret = sys_sendfile64(out_fd, in_fd, up, count);
  161. set_fs(old_fs);
  162. if (offset && put_user(lof, offset))
  163. return -EFAULT;
  164. return ret;
  165. }
  166. /* Note: it is necessary to treat option as an unsigned int,
  167. * with the corresponding cast to a signed int to insure that the
  168. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  169. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  170. */
  171. asmlinkage long compat_sys_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
  172. {
  173. return sys_prctl((int)option,
  174. (unsigned long) arg2,
  175. (unsigned long) arg3,
  176. (unsigned long) arg4,
  177. (unsigned long) arg5);
  178. }
  179. /* Note: it is necessary to treat pid as an unsigned int,
  180. * with the corresponding cast to a signed int to insure that the
  181. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  182. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  183. */
  184. asmlinkage long compat_sys_sched_rr_get_interval(u32 pid, struct compat_timespec __user *interval)
  185. {
  186. struct timespec t;
  187. int ret;
  188. mm_segment_t old_fs = get_fs ();
  189. /* The __user pointer cast is valid because of the set_fs() */
  190. set_fs (KERNEL_DS);
  191. ret = sys_sched_rr_get_interval((int)pid, (struct timespec __user *) &t);
  192. set_fs (old_fs);
  193. if (put_compat_timespec(&t, interval))
  194. return -EFAULT;
  195. return ret;
  196. }
  197. /* Note: it is necessary to treat mode as an unsigned int,
  198. * with the corresponding cast to a signed int to insure that the
  199. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  200. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  201. */
  202. asmlinkage long compat_sys_access(const char __user * filename, u32 mode)
  203. {
  204. return sys_access(filename, (int)mode);
  205. }
  206. /* Note: it is necessary to treat mode as an unsigned int,
  207. * with the corresponding cast to a signed int to insure that the
  208. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  209. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  210. */
  211. asmlinkage long compat_sys_creat(const char __user * pathname, u32 mode)
  212. {
  213. return sys_creat(pathname, (int)mode);
  214. }
  215. /* Note: it is necessary to treat pid and options as unsigned ints,
  216. * with the corresponding cast to a signed int to insure that the
  217. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  218. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  219. */
  220. asmlinkage long compat_sys_waitpid(u32 pid, unsigned int __user * stat_addr, u32 options)
  221. {
  222. return sys_waitpid((int)pid, stat_addr, (int)options);
  223. }
  224. /* Note: it is necessary to treat gidsetsize as an unsigned int,
  225. * with the corresponding cast to a signed int to insure that the
  226. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  227. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  228. */
  229. asmlinkage long compat_sys_getgroups(u32 gidsetsize, gid_t __user *grouplist)
  230. {
  231. return sys_getgroups((int)gidsetsize, grouplist);
  232. }
  233. /* Note: it is necessary to treat pid as an unsigned int,
  234. * with the corresponding cast to a signed int to insure that the
  235. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  236. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  237. */
  238. asmlinkage long compat_sys_getpgid(u32 pid)
  239. {
  240. return sys_getpgid((int)pid);
  241. }
  242. /* Note: it is necessary to treat pid as an unsigned int,
  243. * with the corresponding cast to a signed int to insure that the
  244. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  245. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  246. */
  247. asmlinkage long compat_sys_getsid(u32 pid)
  248. {
  249. return sys_getsid((int)pid);
  250. }
  251. /* Note: it is necessary to treat pid and sig as unsigned ints,
  252. * with the corresponding cast to a signed int to insure that the
  253. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  254. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  255. */
  256. asmlinkage long compat_sys_kill(u32 pid, u32 sig)
  257. {
  258. return sys_kill((int)pid, (int)sig);
  259. }
  260. /* Note: it is necessary to treat mode as an unsigned int,
  261. * with the corresponding cast to a signed int to insure that the
  262. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  263. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  264. */
  265. asmlinkage long compat_sys_mkdir(const char __user * pathname, u32 mode)
  266. {
  267. return sys_mkdir(pathname, (int)mode);
  268. }
  269. long compat_sys_nice(u32 increment)
  270. {
  271. /* sign extend increment */
  272. return sys_nice((int)increment);
  273. }
  274. off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin)
  275. {
  276. /* sign extend n */
  277. return sys_lseek(fd, (int)offset, origin);
  278. }
  279. long compat_sys_truncate(const char __user * path, u32 length)
  280. {
  281. /* sign extend length */
  282. return sys_truncate(path, (int)length);
  283. }
  284. long compat_sys_ftruncate(int fd, u32 length)
  285. {
  286. /* sign extend length */
  287. return sys_ftruncate(fd, (int)length);
  288. }
  289. /* Note: it is necessary to treat bufsiz as an unsigned int,
  290. * with the corresponding cast to a signed int to insure that the
  291. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  292. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  293. */
  294. asmlinkage long compat_sys_readlink(const char __user * path, char __user * buf, u32 bufsiz)
  295. {
  296. return sys_readlink(path, buf, (int)bufsiz);
  297. }
  298. /* Note: it is necessary to treat option as an unsigned int,
  299. * with the corresponding cast to a signed int to insure that the
  300. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  301. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  302. */
  303. asmlinkage long compat_sys_sched_get_priority_max(u32 policy)
  304. {
  305. return sys_sched_get_priority_max((int)policy);
  306. }
  307. /* Note: it is necessary to treat policy as an unsigned int,
  308. * with the corresponding cast to a signed int to insure that the
  309. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  310. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  311. */
  312. asmlinkage long compat_sys_sched_get_priority_min(u32 policy)
  313. {
  314. return sys_sched_get_priority_min((int)policy);
  315. }
  316. /* Note: it is necessary to treat pid as an unsigned int,
  317. * with the corresponding cast to a signed int to insure that the
  318. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  319. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  320. */
  321. asmlinkage long compat_sys_sched_getparam(u32 pid, struct sched_param __user *param)
  322. {
  323. return sys_sched_getparam((int)pid, param);
  324. }
  325. /* Note: it is necessary to treat pid as an unsigned int,
  326. * with the corresponding cast to a signed int to insure that the
  327. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  328. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  329. */
  330. asmlinkage long compat_sys_sched_getscheduler(u32 pid)
  331. {
  332. return sys_sched_getscheduler((int)pid);
  333. }
  334. /* Note: it is necessary to treat pid as an unsigned int,
  335. * with the corresponding cast to a signed int to insure that the
  336. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  337. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  338. */
  339. asmlinkage long compat_sys_sched_setparam(u32 pid, struct sched_param __user *param)
  340. {
  341. return sys_sched_setparam((int)pid, param);
  342. }
  343. /* Note: it is necessary to treat pid and policy as unsigned ints,
  344. * with the corresponding cast to a signed int to insure that the
  345. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  346. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  347. */
  348. asmlinkage long compat_sys_sched_setscheduler(u32 pid, u32 policy, struct sched_param __user *param)
  349. {
  350. return sys_sched_setscheduler((int)pid, (int)policy, param);
  351. }
  352. /* Note: it is necessary to treat len as an unsigned int,
  353. * with the corresponding cast to a signed int to insure that the
  354. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  355. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  356. */
  357. asmlinkage long compat_sys_setdomainname(char __user *name, u32 len)
  358. {
  359. return sys_setdomainname(name, (int)len);
  360. }
  361. /* Note: it is necessary to treat gidsetsize as an unsigned int,
  362. * with the corresponding cast to a signed int to insure that the
  363. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  364. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  365. */
  366. asmlinkage long compat_sys_setgroups(u32 gidsetsize, gid_t __user *grouplist)
  367. {
  368. return sys_setgroups((int)gidsetsize, grouplist);
  369. }
  370. asmlinkage long compat_sys_sethostname(char __user *name, u32 len)
  371. {
  372. /* sign extend len */
  373. return sys_sethostname(name, (int)len);
  374. }
  375. /* Note: it is necessary to treat pid and pgid as unsigned ints,
  376. * with the corresponding cast to a signed int to insure that the
  377. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  378. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  379. */
  380. asmlinkage long compat_sys_setpgid(u32 pid, u32 pgid)
  381. {
  382. return sys_setpgid((int)pid, (int)pgid);
  383. }
  384. long compat_sys_getpriority(u32 which, u32 who)
  385. {
  386. /* sign extend which and who */
  387. return sys_getpriority((int)which, (int)who);
  388. }
  389. long compat_sys_setpriority(u32 which, u32 who, u32 niceval)
  390. {
  391. /* sign extend which, who and niceval */
  392. return sys_setpriority((int)which, (int)who, (int)niceval);
  393. }
  394. long compat_sys_ioprio_get(u32 which, u32 who)
  395. {
  396. /* sign extend which and who */
  397. return sys_ioprio_get((int)which, (int)who);
  398. }
  399. long compat_sys_ioprio_set(u32 which, u32 who, u32 ioprio)
  400. {
  401. /* sign extend which, who and ioprio */
  402. return sys_ioprio_set((int)which, (int)who, (int)ioprio);
  403. }
  404. /* Note: it is necessary to treat newmask as an unsigned int,
  405. * with the corresponding cast to a signed int to insure that the
  406. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  407. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  408. */
  409. asmlinkage long compat_sys_ssetmask(u32 newmask)
  410. {
  411. return sys_ssetmask((int) newmask);
  412. }
  413. asmlinkage long compat_sys_syslog(u32 type, char __user * buf, u32 len)
  414. {
  415. /* sign extend len */
  416. return sys_syslog(type, buf, (int)len);
  417. }
  418. /* Note: it is necessary to treat mask as an unsigned int,
  419. * with the corresponding cast to a signed int to insure that the
  420. * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  421. * and the register representation of a signed int (msr in 64-bit mode) is performed.
  422. */
  423. asmlinkage long compat_sys_umask(u32 mask)
  424. {
  425. return sys_umask((int)mask);
  426. }
  427. unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
  428. unsigned long prot, unsigned long flags,
  429. unsigned long fd, unsigned long pgoff)
  430. {
  431. /* This should remain 12 even if PAGE_SIZE changes */
  432. return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
  433. }
  434. long compat_sys_tgkill(u32 tgid, u32 pid, int sig)
  435. {
  436. /* sign extend tgid, pid */
  437. return sys_tgkill((int)tgid, (int)pid, sig);
  438. }
  439. /*
  440. * long long munging:
  441. * The 32 bit ABI passes long longs in an odd even register pair.
  442. */
  443. compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
  444. u32 reg6, u32 poshi, u32 poslo)
  445. {
  446. return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
  447. }
  448. compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
  449. u32 reg6, u32 poshi, u32 poslo)
  450. {
  451. return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
  452. }
  453. compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count)
  454. {
  455. return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count);
  456. }
  457. asmlinkage int compat_sys_truncate64(const char __user * path, u32 reg4,
  458. unsigned long high, unsigned long low)
  459. {
  460. return sys_truncate(path, (high << 32) | low);
  461. }
  462. asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo,
  463. u32 lenhi, u32 lenlo)
  464. {
  465. return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
  466. ((loff_t)lenhi << 32) | lenlo);
  467. }
  468. asmlinkage int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long high,
  469. unsigned long low)
  470. {
  471. return sys_ftruncate(fd, (high << 32) | low);
  472. }
  473. long ppc32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char __user *buf,
  474. size_t len)
  475. {
  476. return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low,
  477. buf, len);
  478. }
  479. long ppc32_fadvise64(int fd, u32 unused, u32 offset_high, u32 offset_low,
  480. size_t len, int advice)
  481. {
  482. return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low, len,
  483. advice);
  484. }
  485. asmlinkage long compat_sys_add_key(const char __user *_type,
  486. const char __user *_description,
  487. const void __user *_payload,
  488. u32 plen,
  489. u32 ringid)
  490. {
  491. return sys_add_key(_type, _description, _payload, plen, ringid);
  492. }
  493. asmlinkage long compat_sys_request_key(const char __user *_type,
  494. const char __user *_description,
  495. const char __user *_callout_info,
  496. u32 destringid)
  497. {
  498. return sys_request_key(_type, _description, _callout_info, destringid);
  499. }
  500. asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
  501. unsigned offset_hi, unsigned offset_lo,
  502. unsigned nbytes_hi, unsigned nbytes_lo)
  503. {
  504. loff_t offset = ((loff_t)offset_hi << 32) | offset_lo;
  505. loff_t nbytes = ((loff_t)nbytes_hi << 32) | nbytes_lo;
  506. return sys_sync_file_range(fd, offset, nbytes, flags);
  507. }
  508. asmlinkage long compat_sys_fanotify_mark(int fanotify_fd, unsigned int flags,
  509. unsigned mask_hi, unsigned mask_lo,
  510. int dfd, const char __user *pathname)
  511. {
  512. u64 mask = ((u64)mask_hi << 32) | mask_lo;
  513. return sys_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname);
  514. }