syscall_table.S 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. /* System Call Table
  2. *
  3. * Copyright (C) 1999-2004 Matthew Wilcox <willy at parisc-linux.org>
  4. * Copyright (C) 2000-2001 John Marvin <jsm at parisc-linux.org>
  5. * Copyright (C) 2000 Alan Modra <amodra at parisc-linux.org>
  6. * Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
  7. * Copyright (C) 2000 Philipp Rumpf <prumpf with tux.org>
  8. * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
  9. * Copyright (C) 2000 David Huggins-Daines <dhd with pobox.org>
  10. * Copyright (C) 2000 Grant Grundler <grundler at parisc-linux.org>
  11. * Copyright (C) 2001 Richard Hirst <rhirst with parisc-linux.org>
  12. * Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org>
  13. * Copyright (C) 2001-2007 Helge Deller <deller at parisc-linux.org>
  14. * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org>
  15. * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
  16. * Copyright (C) 2005-2006 Kyle McMartin <kyle at parisc-linux.org>
  17. *
  18. * This program is free software; you can redistribute it and/or modify
  19. * it under the terms of the GNU General Public License as published by
  20. * the Free Software Foundation; either version 2 of the License, or
  21. * (at your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program; if not, write to the Free Software
  30. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  31. */
  32. #if defined(CONFIG_64BIT) && !defined(SYSCALL_TABLE_64BIT)
  33. /* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and
  34. * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific
  35. * implementation is required on wide palinux. Use ENTRY_COMP where
  36. * the compatibility layer has a useful 32-bit implementation.
  37. */
  38. #define ENTRY_SAME(_name_) .dword sys_##_name_
  39. #define ENTRY_DIFF(_name_) .dword sys32_##_name_
  40. #define ENTRY_UHOH(_name_) .dword sys32_##unimplemented
  41. #define ENTRY_OURS(_name_) .dword parisc_##_name_
  42. #define ENTRY_COMP(_name_) .dword compat_sys_##_name_
  43. #elif defined(CONFIG_64BIT) && defined(SYSCALL_TABLE_64BIT)
  44. #define ENTRY_SAME(_name_) .dword sys_##_name_
  45. #define ENTRY_DIFF(_name_) .dword sys_##_name_
  46. #define ENTRY_UHOH(_name_) .dword sys_##_name_
  47. #define ENTRY_OURS(_name_) .dword sys_##_name_
  48. #define ENTRY_COMP(_name_) .dword sys_##_name_
  49. #else
  50. #define ENTRY_SAME(_name_) .word sys_##_name_
  51. #define ENTRY_DIFF(_name_) .word sys_##_name_
  52. #define ENTRY_UHOH(_name_) .word sys_##_name_
  53. #define ENTRY_OURS(_name_) .word parisc_##_name_
  54. #define ENTRY_COMP(_name_) .word sys_##_name_
  55. #endif
  56. 90: ENTRY_SAME(restart_syscall) /* 0 */
  57. 91: ENTRY_SAME(exit)
  58. ENTRY_SAME(fork_wrapper)
  59. ENTRY_SAME(read)
  60. ENTRY_SAME(write)
  61. ENTRY_COMP(open) /* 5 */
  62. ENTRY_SAME(close)
  63. ENTRY_SAME(waitpid)
  64. ENTRY_SAME(creat)
  65. ENTRY_SAME(link)
  66. ENTRY_SAME(unlink) /* 10 */
  67. ENTRY_COMP(execve)
  68. ENTRY_SAME(chdir)
  69. /* See comments in kernel/time.c!!! Maybe we don't need this? */
  70. ENTRY_COMP(time)
  71. ENTRY_SAME(mknod)
  72. ENTRY_SAME(chmod) /* 15 */
  73. ENTRY_SAME(lchown)
  74. ENTRY_SAME(socket)
  75. /* struct stat is MAYBE identical wide and narrow ?? */
  76. ENTRY_COMP(newstat)
  77. ENTRY_COMP(lseek)
  78. ENTRY_SAME(getpid) /* 20 */
  79. /* the 'void * data' parameter may need re-packing in wide */
  80. ENTRY_COMP(mount)
  81. /* concerned about struct sockaddr in wide/narrow */
  82. /* ---> I think sockaddr is OK unless the compiler packs the struct */
  83. /* differently to align the char array */
  84. ENTRY_SAME(bind)
  85. ENTRY_SAME(setuid)
  86. ENTRY_SAME(getuid)
  87. ENTRY_COMP(stime) /* 25 */
  88. ENTRY_COMP(ptrace)
  89. ENTRY_SAME(alarm)
  90. /* see stat comment */
  91. ENTRY_COMP(newfstat)
  92. ENTRY_SAME(pause)
  93. /* struct utimbuf uses time_t which might vary */
  94. ENTRY_COMP(utime) /* 30 */
  95. /* struct sockaddr... */
  96. ENTRY_SAME(connect)
  97. ENTRY_SAME(listen)
  98. ENTRY_SAME(access)
  99. ENTRY_SAME(nice)
  100. /* struct sockaddr... */
  101. ENTRY_SAME(accept) /* 35 */
  102. ENTRY_SAME(sync)
  103. ENTRY_SAME(kill)
  104. ENTRY_SAME(rename)
  105. ENTRY_SAME(mkdir)
  106. ENTRY_SAME(rmdir) /* 40 */
  107. ENTRY_SAME(dup)
  108. ENTRY_SAME(pipe)
  109. ENTRY_COMP(times)
  110. /* struct sockaddr... */
  111. ENTRY_SAME(getsockname)
  112. /* it seems possible brk() could return a >4G pointer... */
  113. ENTRY_SAME(brk) /* 45 */
  114. ENTRY_SAME(setgid)
  115. ENTRY_SAME(getgid)
  116. ENTRY_SAME(signal)
  117. ENTRY_SAME(geteuid)
  118. ENTRY_SAME(getegid) /* 50 */
  119. ENTRY_SAME(acct)
  120. ENTRY_SAME(umount)
  121. /* struct sockaddr... */
  122. ENTRY_SAME(getpeername)
  123. ENTRY_COMP(ioctl)
  124. ENTRY_COMP(fcntl) /* 55 */
  125. ENTRY_SAME(socketpair)
  126. ENTRY_SAME(setpgid)
  127. ENTRY_SAME(send)
  128. ENTRY_SAME(newuname)
  129. ENTRY_SAME(umask) /* 60 */
  130. ENTRY_SAME(chroot)
  131. ENTRY_COMP(ustat)
  132. ENTRY_SAME(dup2)
  133. ENTRY_SAME(getppid)
  134. ENTRY_SAME(getpgrp) /* 65 */
  135. ENTRY_SAME(setsid)
  136. ENTRY_SAME(pivot_root)
  137. /* I don't like this */
  138. ENTRY_UHOH(sgetmask)
  139. ENTRY_UHOH(ssetmask)
  140. ENTRY_SAME(setreuid) /* 70 */
  141. ENTRY_SAME(setregid)
  142. ENTRY_SAME(mincore)
  143. ENTRY_COMP(sigpending)
  144. ENTRY_SAME(sethostname)
  145. /* Following 3 have linux-common-code structs containing longs -( */
  146. ENTRY_COMP(setrlimit) /* 75 */
  147. ENTRY_COMP(getrlimit)
  148. ENTRY_COMP(getrusage)
  149. /* struct timeval and timezone are maybe?? consistent wide and narrow */
  150. ENTRY_COMP(gettimeofday)
  151. ENTRY_COMP(settimeofday)
  152. ENTRY_SAME(getgroups) /* 80 */
  153. ENTRY_SAME(setgroups)
  154. /* struct socketaddr... */
  155. ENTRY_SAME(sendto)
  156. ENTRY_SAME(symlink)
  157. /* see stat comment */
  158. ENTRY_COMP(newlstat)
  159. ENTRY_SAME(readlink) /* 85 */
  160. ENTRY_SAME(ni_syscall) /* was uselib */
  161. ENTRY_SAME(swapon)
  162. ENTRY_SAME(reboot)
  163. ENTRY_SAME(mmap2)
  164. ENTRY_SAME(mmap) /* 90 */
  165. ENTRY_SAME(munmap)
  166. ENTRY_COMP(truncate)
  167. ENTRY_COMP(ftruncate)
  168. ENTRY_SAME(fchmod)
  169. ENTRY_SAME(fchown) /* 95 */
  170. ENTRY_SAME(getpriority)
  171. ENTRY_SAME(setpriority)
  172. ENTRY_SAME(recv)
  173. ENTRY_COMP(statfs)
  174. ENTRY_COMP(fstatfs) /* 100 */
  175. ENTRY_SAME(stat64)
  176. ENTRY_SAME(ni_syscall) /* was socketcall */
  177. ENTRY_SAME(syslog)
  178. /* even though manpage says struct timeval contains longs, ours has
  179. * time_t and suseconds_t -- both of which are safe wide/narrow */
  180. ENTRY_COMP(setitimer)
  181. ENTRY_COMP(getitimer) /* 105 */
  182. ENTRY_SAME(capget)
  183. ENTRY_SAME(capset)
  184. ENTRY_OURS(pread64)
  185. ENTRY_OURS(pwrite64)
  186. ENTRY_SAME(getcwd) /* 110 */
  187. ENTRY_SAME(vhangup)
  188. ENTRY_SAME(fstat64)
  189. ENTRY_SAME(vfork_wrapper)
  190. /* struct rusage contains longs... */
  191. ENTRY_COMP(wait4)
  192. ENTRY_SAME(swapoff) /* 115 */
  193. ENTRY_COMP(sysinfo)
  194. ENTRY_SAME(shutdown)
  195. ENTRY_SAME(fsync)
  196. ENTRY_SAME(madvise)
  197. ENTRY_SAME(clone_wrapper) /* 120 */
  198. ENTRY_SAME(setdomainname)
  199. ENTRY_COMP(sendfile)
  200. /* struct sockaddr... */
  201. ENTRY_SAME(recvfrom)
  202. /* struct timex contains longs */
  203. ENTRY_COMP(adjtimex)
  204. ENTRY_SAME(mprotect) /* 125 */
  205. /* old_sigset_t forced to 32 bits. Beware glibc sigset_t */
  206. ENTRY_COMP(sigprocmask)
  207. ENTRY_SAME(ni_syscall) /* create_module */
  208. ENTRY_SAME(init_module)
  209. ENTRY_SAME(delete_module)
  210. ENTRY_SAME(ni_syscall) /* 130: get_kernel_syms */
  211. /* time_t inside struct dqblk */
  212. ENTRY_SAME(quotactl)
  213. ENTRY_SAME(getpgid)
  214. ENTRY_SAME(fchdir)
  215. ENTRY_SAME(bdflush)
  216. ENTRY_SAME(sysfs) /* 135 */
  217. ENTRY_OURS(personality)
  218. ENTRY_SAME(ni_syscall) /* for afs_syscall */
  219. ENTRY_SAME(setfsuid)
  220. ENTRY_SAME(setfsgid)
  221. /* I think this might work */
  222. ENTRY_SAME(llseek) /* 140 */
  223. ENTRY_COMP(getdents)
  224. /* it is POSSIBLE that select will be OK because even though fd_set
  225. * contains longs, the macros and sizes are clever. */
  226. ENTRY_COMP(select)
  227. ENTRY_SAME(flock)
  228. ENTRY_SAME(msync)
  229. /* struct iovec contains pointers */
  230. ENTRY_COMP(readv) /* 145 */
  231. ENTRY_COMP(writev)
  232. ENTRY_SAME(getsid)
  233. ENTRY_SAME(fdatasync)
  234. /* struct __sysctl_args is a mess */
  235. ENTRY_COMP(sysctl)
  236. ENTRY_SAME(mlock) /* 150 */
  237. ENTRY_SAME(munlock)
  238. ENTRY_SAME(mlockall)
  239. ENTRY_SAME(munlockall)
  240. /* struct sched_param is ok for now */
  241. ENTRY_SAME(sched_setparam)
  242. ENTRY_SAME(sched_getparam) /* 155 */
  243. ENTRY_SAME(sched_setscheduler)
  244. ENTRY_SAME(sched_getscheduler)
  245. ENTRY_SAME(sched_yield)
  246. ENTRY_SAME(sched_get_priority_max)
  247. ENTRY_SAME(sched_get_priority_min) /* 160 */
  248. ENTRY_COMP(sched_rr_get_interval)
  249. ENTRY_COMP(nanosleep)
  250. ENTRY_SAME(mremap)
  251. ENTRY_SAME(setresuid)
  252. ENTRY_SAME(getresuid) /* 165 */
  253. ENTRY_COMP(sigaltstack)
  254. ENTRY_SAME(ni_syscall) /* query_module */
  255. ENTRY_SAME(poll)
  256. /* structs contain pointers and an in_addr... */
  257. ENTRY_SAME(ni_syscall) /* was nfsservctl */
  258. ENTRY_SAME(setresgid) /* 170 */
  259. ENTRY_SAME(getresgid)
  260. ENTRY_SAME(prctl)
  261. /* signals need a careful review */
  262. ENTRY_SAME(rt_sigreturn_wrapper)
  263. ENTRY_COMP(rt_sigaction)
  264. ENTRY_COMP(rt_sigprocmask) /* 175 */
  265. ENTRY_COMP(rt_sigpending)
  266. ENTRY_COMP(rt_sigtimedwait)
  267. /* even though the struct siginfo_t is different, it appears like
  268. * all the paths use values which should be same wide and narrow.
  269. * Also the struct is padded to 128 bytes which means we don't have
  270. * to worry about faulting trying to copy in a larger 64-bit
  271. * struct from a 32-bit user-space app.
  272. */
  273. ENTRY_COMP(rt_sigqueueinfo)
  274. ENTRY_COMP(rt_sigsuspend)
  275. ENTRY_SAME(chown) /* 180 */
  276. /* setsockopt() used by iptables: SO_SET_REPLACE/SO_SET_ADD_COUNTERS */
  277. ENTRY_COMP(setsockopt)
  278. ENTRY_COMP(getsockopt)
  279. ENTRY_COMP(sendmsg)
  280. ENTRY_COMP(recvmsg)
  281. ENTRY_SAME(semop) /* 185 */
  282. ENTRY_SAME(semget)
  283. ENTRY_COMP(semctl)
  284. ENTRY_COMP(msgsnd)
  285. ENTRY_COMP(msgrcv)
  286. ENTRY_SAME(msgget) /* 190 */
  287. ENTRY_COMP(msgctl)
  288. ENTRY_COMP(shmat)
  289. ENTRY_SAME(shmdt)
  290. ENTRY_SAME(shmget)
  291. ENTRY_COMP(shmctl) /* 195 */
  292. ENTRY_SAME(ni_syscall) /* streams1 */
  293. ENTRY_SAME(ni_syscall) /* streams2 */
  294. ENTRY_SAME(lstat64)
  295. ENTRY_OURS(truncate64)
  296. ENTRY_OURS(ftruncate64) /* 200 */
  297. ENTRY_SAME(getdents64)
  298. ENTRY_COMP(fcntl64)
  299. ENTRY_SAME(ni_syscall) /* attrctl -- dead */
  300. ENTRY_SAME(ni_syscall) /* acl_get -- dead */
  301. ENTRY_SAME(ni_syscall) /* 205 (acl_set -- dead) */
  302. ENTRY_SAME(gettid)
  303. ENTRY_OURS(readahead)
  304. ENTRY_SAME(tkill)
  305. ENTRY_COMP(sendfile64)
  306. ENTRY_COMP(futex) /* 210 */
  307. ENTRY_COMP(sched_setaffinity)
  308. ENTRY_COMP(sched_getaffinity)
  309. ENTRY_SAME(ni_syscall) /* set_thread_area */
  310. ENTRY_SAME(ni_syscall) /* get_thread_area */
  311. ENTRY_COMP(io_setup) /* 215 */
  312. ENTRY_SAME(io_destroy)
  313. ENTRY_COMP(io_getevents)
  314. ENTRY_COMP(io_submit)
  315. ENTRY_SAME(io_cancel)
  316. ENTRY_SAME(alloc_hugepages) /* 220 */
  317. ENTRY_SAME(free_hugepages)
  318. ENTRY_SAME(exit_group)
  319. ENTRY_COMP(lookup_dcookie)
  320. ENTRY_SAME(epoll_create)
  321. ENTRY_SAME(epoll_ctl) /* 225 */
  322. ENTRY_SAME(epoll_wait)
  323. ENTRY_SAME(remap_file_pages)
  324. ENTRY_COMP(semtimedop)
  325. ENTRY_COMP(mq_open)
  326. ENTRY_SAME(mq_unlink) /* 230 */
  327. ENTRY_COMP(mq_timedsend)
  328. ENTRY_COMP(mq_timedreceive)
  329. ENTRY_COMP(mq_notify)
  330. ENTRY_COMP(mq_getsetattr)
  331. ENTRY_COMP(waitid) /* 235 */
  332. ENTRY_OURS(fadvise64_64)
  333. ENTRY_SAME(set_tid_address)
  334. ENTRY_SAME(setxattr)
  335. ENTRY_SAME(lsetxattr)
  336. ENTRY_SAME(fsetxattr) /* 240 */
  337. ENTRY_SAME(getxattr)
  338. ENTRY_SAME(lgetxattr)
  339. ENTRY_SAME(fgetxattr)
  340. ENTRY_SAME(listxattr)
  341. ENTRY_SAME(llistxattr) /* 245 */
  342. ENTRY_SAME(flistxattr)
  343. ENTRY_SAME(removexattr)
  344. ENTRY_SAME(lremovexattr)
  345. ENTRY_SAME(fremovexattr)
  346. ENTRY_COMP(timer_create) /* 250 */
  347. ENTRY_COMP(timer_settime)
  348. ENTRY_COMP(timer_gettime)
  349. ENTRY_SAME(timer_getoverrun)
  350. ENTRY_SAME(timer_delete)
  351. ENTRY_COMP(clock_settime) /* 255 */
  352. ENTRY_COMP(clock_gettime)
  353. ENTRY_COMP(clock_getres)
  354. ENTRY_COMP(clock_nanosleep)
  355. ENTRY_SAME(tgkill)
  356. ENTRY_COMP(mbind) /* 260 */
  357. ENTRY_COMP(get_mempolicy)
  358. ENTRY_COMP(set_mempolicy)
  359. ENTRY_SAME(ni_syscall) /* 263: reserved for vserver */
  360. ENTRY_SAME(add_key)
  361. ENTRY_SAME(request_key) /* 265 */
  362. ENTRY_SAME(keyctl)
  363. ENTRY_SAME(ioprio_set)
  364. ENTRY_SAME(ioprio_get)
  365. ENTRY_SAME(inotify_init)
  366. ENTRY_SAME(inotify_add_watch) /* 270 */
  367. ENTRY_SAME(inotify_rm_watch)
  368. ENTRY_SAME(migrate_pages)
  369. ENTRY_COMP(pselect6)
  370. ENTRY_COMP(ppoll)
  371. ENTRY_COMP(openat) /* 275 */
  372. ENTRY_SAME(mkdirat)
  373. ENTRY_SAME(mknodat)
  374. ENTRY_SAME(fchownat)
  375. ENTRY_COMP(futimesat)
  376. ENTRY_SAME(fstatat64) /* 280 */
  377. ENTRY_SAME(unlinkat)
  378. ENTRY_SAME(renameat)
  379. ENTRY_SAME(linkat)
  380. ENTRY_SAME(symlinkat)
  381. ENTRY_SAME(readlinkat) /* 285 */
  382. ENTRY_SAME(fchmodat)
  383. ENTRY_SAME(faccessat)
  384. ENTRY_SAME(unshare)
  385. ENTRY_COMP(set_robust_list)
  386. ENTRY_COMP(get_robust_list) /* 290 */
  387. ENTRY_SAME(splice)
  388. ENTRY_OURS(sync_file_range)
  389. ENTRY_SAME(tee)
  390. ENTRY_COMP(vmsplice)
  391. ENTRY_COMP(move_pages) /* 295 */
  392. ENTRY_SAME(getcpu)
  393. ENTRY_COMP(epoll_pwait)
  394. ENTRY_COMP(statfs64)
  395. ENTRY_COMP(fstatfs64)
  396. ENTRY_COMP(kexec_load) /* 300 */
  397. ENTRY_COMP(utimensat)
  398. ENTRY_COMP(signalfd)
  399. ENTRY_SAME(ni_syscall) /* was timerfd */
  400. ENTRY_SAME(eventfd)
  401. ENTRY_OURS(fallocate) /* 305 */
  402. ENTRY_SAME(timerfd_create)
  403. ENTRY_COMP(timerfd_settime)
  404. ENTRY_COMP(timerfd_gettime)
  405. ENTRY_COMP(signalfd4)
  406. ENTRY_SAME(eventfd2) /* 310 */
  407. ENTRY_SAME(epoll_create1)
  408. ENTRY_SAME(dup3)
  409. ENTRY_SAME(pipe2)
  410. ENTRY_SAME(inotify_init1)
  411. ENTRY_COMP(preadv) /* 315 */
  412. ENTRY_COMP(pwritev)
  413. ENTRY_COMP(rt_tgsigqueueinfo)
  414. ENTRY_SAME(perf_event_open)
  415. ENTRY_COMP(recvmmsg)
  416. ENTRY_SAME(accept4) /* 320 */
  417. ENTRY_SAME(prlimit64)
  418. ENTRY_SAME(fanotify_init)
  419. ENTRY_DIFF(fanotify_mark)
  420. ENTRY_COMP(clock_adjtime)
  421. ENTRY_SAME(name_to_handle_at) /* 325 */
  422. ENTRY_COMP(open_by_handle_at)
  423. ENTRY_SAME(syncfs)
  424. ENTRY_SAME(setns)
  425. ENTRY_COMP(sendmmsg)
  426. ENTRY_COMP(process_vm_readv) /* 330 */
  427. ENTRY_COMP(process_vm_writev)
  428. ENTRY_SAME(kcmp)
  429. ENTRY_SAME(finit_module)
  430. ENTRY_SAME(sched_setattr)
  431. ENTRY_SAME(sched_getattr) /* 335 */
  432. ENTRY_COMP(utimes)
  433. ENTRY_SAME(renameat2)
  434. ENTRY_SAME(seccomp)
  435. ENTRY_SAME(getrandom)
  436. ENTRY_SAME(memfd_create) /* 340 */
  437. ENTRY_SAME(bpf)
  438. ENTRY_COMP(execveat)
  439. .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b))
  440. .error "size of syscall table does not fit value of __NR_Linux_syscalls"
  441. .endif
  442. #undef ENTRY_SAME
  443. #undef ENTRY_DIFF
  444. #undef ENTRY_UHOH
  445. #undef ENTRY_COMP
  446. #undef ENTRY_OURS