Update glibc for NaCl's new executable load address
[glibc/nacl-glibc.git] / sysdeps / nacl / nacl_syscalls.h
blobe6731146bad72cb1886894f3da2824c7ed2db84d
1 /*
2 * Copyright 2008, Google Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
14 * distribution.
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * NaCl kernel / service run-time system call numbers
36 #ifndef NATIVE_CLIENT_SERVICE_RUNTIME_INCLUDE_BITS_NACL_SYSCALLS_H_
37 #define NATIVE_CLIENT_SERVICE_RUNTIME_INCLUDE_BITS_NACL_SYSCALLS_H_
39 /* intentionally not using zero */
42 * TODO: these identifiers should be NACL_ABI_SYS_<name>.
45 #define NACL_sys_null 1
47 #define NACL_sys_open 10
48 #define NACL_sys_close 11
49 #define NACL_sys_read 12
50 #define NACL_sys_write 13
51 #define NACL_sys_lseek 14
52 #define NACL_sys_ioctl 15
53 #define NACL_sys_stat 16
54 #define NACL_sys_fstat 17
55 #define NACL_sys_chmod 18
56 /* no fchmod emulation on windows */
58 #define NACL_sys_sysbrk 20
59 #define NACL_sys_mmap 21
60 #define NACL_sys_munmap 22
62 #define NACL_sys_getdents 23
64 #define NACL_sys_exit 30
65 #define NACL_sys_getpid 31
66 #define NACL_sys_sched_yield 32
67 #define NACL_sys_sysconf 33
69 #define NACL_sys_gettimeofday 40
70 #define NACL_sys_clock 41
72 #define NACL_sys_multimedia_init 50
73 #define NACL_sys_multimedia_shutdown 51
74 #define NACL_sys_video_init 52
75 #define NACL_sys_video_shutdown 53
76 #define NACL_sys_video_update 54
77 #define NACL_sys_video_poll_event 55
78 #define NACL_sys_audio_init 56
79 #define NACL_sys_audio_shutdown 57
80 #define NACL_sys_audio_stream 58
82 #define NACL_sys_imc_makeboundsock 60
83 #define NACL_sys_imc_accept 61
84 #define NACL_sys_imc_connect 62
85 #define NACL_sys_imc_sendmsg 63
86 #define NACL_sys_imc_recvmsg 64
87 #define NACL_sys_imc_mem_obj_create 65
88 #define NACL_sys_imc_socketpair 66
90 #define NACL_sys_mutex_create 70
91 #define NACL_sys_mutex_lock 71
92 #define NACL_sys_mutex_trylock 72
93 #define NACL_sys_mutex_unlock 73
94 #define NACL_sys_cond_create 74
95 #define NACL_sys_cond_wait 75
96 #define NACL_sys_cond_signal 76
97 #define NACL_sys_cond_broadcast 77
98 #define NACL_sys_cond_timed_wait_abs 79
100 #define NACL_sys_thread_create 80
101 #define NACL_sys_thread_exit 81
102 #define NACL_sys_tls_init 82
104 #define NACL_sys_srpc_get_fd 90
106 #define NACL_sys_sem_create 100
107 #define NACL_sys_sem_wait 101
108 #define NACL_sys_sem_post 102
109 #define NACL_sys_sem_get_value 103
111 #define NACL_MAX_SYSCALLS 110
114 #define NACL_SYSCALL_ADDR(syscall_number) \
115 (0x10000 + ((syscall_number) * 32))
118 struct NaClImcMsgIoVec {
119 void *base;
120 size_t length;
123 struct NaClImcMsgHdr {
124 struct NaClImcMsgIoVec *iov;
125 size_t iov_length;
126 int *descv;
127 size_t desc_length;
128 int flags;
132 #endif /* NATIVE_CLIENT_SERVICE_RUNTIME_INCLUDE_BITS_NACL_SYSCALLS_H_ */