1 /*
2  * Copyright (c) 2013, Google, Inc. All rights reserved
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files
6  * (the "Software"), to deal in the Software without restriction,
7  * including without limitation the rights to use, copy, modify, merge,
8  * publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 
24 /* DEF_SYSCALL(syscall_nr, syscall_name, return type, nr_args, [argument list])
25  *
26  * Please keep this table sorted by syscall number.
27  * Please keep each syscall def on a single line, this file is parsed by
28  * scripts.
29  */
30 
31 /* clang-format off */
32 
33 DEF_SYSCALL(0x1, writev, long, 3, uint32_t fd, const struct iovec *iov, uint32_t iovcnt)
34 DEF_SYSCALL(0x2, brk, void*, 1, void* brk)
35 DEF_SYSCALL(0x3, exit_etc, long, 2, int32_t status, uint32_t flags)
36 DEF_SYSCALL(0x4, readv, long, 3, uint32_t fd, const struct iovec *iov, uint32_t iovcnt)
37 DEF_SYSCALL(0x5, ioctl, long, 3, uint32_t fd, uint32_t req, void *buf)
38 DEF_SYSCALL(0x6, nanosleep, long, 3, uint32_t clock_id, uint32_t flags, uint64_t sleep_time)
39 DEF_SYSCALL(0x7, gettime, long, 3, uint32_t clock_id, uint32_t flags, int64_t *time)
40 DEF_SYSCALL(0x8, mmap, long, 4, void *uaddr, uint32_t size, uint32_t flags, int32_t handle)
41 DEF_SYSCALL(0x9, munmap, long, 2, void *uaddr, uint32_t size)
42 DEF_SYSCALL(0xa, prepare_dma, long, 4, void *uaddr, uint32_t size, uint32_t flags, struct dma_pmem *pmem)
43 DEF_SYSCALL(0xb, finish_dma, long, 3, void *uaddr, uint32_t size, uint32_t flags)
44 DEF_SYSCALL(0xc, set_user_tls, long, 1, void *uaddr)
45 DEF_SYSCALL(0xd, dup, long, 1, int32_t handle)
46 
47 /* IPC connection establishement syscalls */
48 DEF_SYSCALL(0x10, port_create, long, 4, const char *path, uint32_t num_recv_bufs, uint32_t recv_buf_size, uint32_t flags)
49 DEF_SYSCALL(0x11, connect, long, 2, const char *path, uint32_t flags)
50 DEF_SYSCALL(0x12, accept, long, 2, int32_t handle, struct uuid *peer_uuid)
51 DEF_SYSCALL(0x13, close, long, 1, int32_t handle)
52 DEF_SYSCALL(0x14, set_cookie, long, 2, int32_t handle, void *cookie)
53 DEF_SYSCALL(0x15, handle_set_create, long, 0)
54 DEF_SYSCALL(0x16, handle_set_ctrl, long, 3, int32_t handle, uint32_t cmd, struct uevent *evt)
55 
56 /* handle polling related syscalls */
57 DEF_SYSCALL(0x18, wait, long, 3, int32_t handle, struct uevent *event, uint32_t timeout_msecs)
58 DEF_SYSCALL(0x19, wait_any, long, 2, struct uevent *event, uint32_t timeout_msecs)
59 
60 /* message send/recv syscalls */
61 DEF_SYSCALL(0x20, get_msg, long, 2, int32_t handle, struct ipc_msg_info *msg_info)
62 DEF_SYSCALL(0x21, read_msg, long, 4, int32_t handle, uint32_t msg_id, uint32_t offset, struct ipc_msg *msg)
63 DEF_SYSCALL(0x22, put_msg, long, 2, int32_t handle, uint32_t msg_id)
64 DEF_SYSCALL(0x23, send_msg, long, 2, int32_t handle, struct ipc_msg *msg)
65 
66 /* memref */
67 DEF_SYSCALL(0x40, memref_create, long, 3, void *uaddr, uint32_t size, uint32_t mmap_prot)
68