diff options
Diffstat (limited to 'arch/um/include/os.h')
-rw-r--r-- | arch/um/include/os.h | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index 6f0d1c741bca..0b6b62733303 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
@@ -8,7 +8,6 @@ | |||
8 | 8 | ||
9 | #include <stdarg.h> | 9 | #include <stdarg.h> |
10 | #include "irq_user.h" | 10 | #include "irq_user.h" |
11 | #include "kern_util.h" | ||
12 | #include "longjmp.h" | 11 | #include "longjmp.h" |
13 | #include "mm_id.h" | 12 | #include "mm_id.h" |
14 | #include "sysdep/tls.h" | 13 | #include "sysdep/tls.h" |
@@ -128,33 +127,31 @@ static inline struct openflags of_cloexec(struct openflags flags) | |||
128 | extern int os_stat_file(const char *file_name, struct uml_stat *buf); | 127 | extern int os_stat_file(const char *file_name, struct uml_stat *buf); |
129 | extern int os_stat_fd(const int fd, struct uml_stat *buf); | 128 | extern int os_stat_fd(const int fd, struct uml_stat *buf); |
130 | extern int os_access(const char *file, int mode); | 129 | extern int os_access(const char *file, int mode); |
131 | extern int os_get_exec_close(int fd, int *close_on_exec); | ||
132 | extern int os_set_exec_close(int fd); | 130 | extern int os_set_exec_close(int fd); |
133 | extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg); | 131 | extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg); |
134 | extern int os_get_ifname(int fd, char *namebuf); | 132 | extern int os_get_ifname(int fd, char *namebuf); |
135 | extern int os_set_slip(int fd); | 133 | extern int os_set_slip(int fd); |
136 | extern int os_set_owner(int fd, int pid); | ||
137 | extern int os_mode_fd(int fd, int mode); | 134 | extern int os_mode_fd(int fd, int mode); |
138 | 135 | ||
139 | extern int os_seek_file(int fd, unsigned long long offset); | 136 | extern int os_seek_file(int fd, unsigned long long offset); |
140 | extern int os_open_file(char *file, struct openflags flags, int mode); | 137 | extern int os_open_file(const char *file, struct openflags flags, int mode); |
141 | extern int os_read_file(int fd, void *buf, int len); | 138 | extern int os_read_file(int fd, void *buf, int len); |
142 | extern int os_write_file(int fd, const void *buf, int count); | 139 | extern int os_write_file(int fd, const void *buf, int count); |
143 | extern int os_file_size(char *file, unsigned long long *size_out); | 140 | extern int os_file_size(const char *file, unsigned long long *size_out); |
144 | extern int os_file_modtime(char *file, unsigned long *modtime); | 141 | extern int os_file_modtime(const char *file, unsigned long *modtime); |
145 | extern int os_pipe(int *fd, int stream, int close_on_exec); | 142 | extern int os_pipe(int *fd, int stream, int close_on_exec); |
146 | extern int os_set_fd_async(int fd, int owner); | 143 | extern int os_set_fd_async(int fd); |
147 | extern int os_clear_fd_async(int fd); | 144 | extern int os_clear_fd_async(int fd); |
148 | extern int os_set_fd_block(int fd, int blocking); | 145 | extern int os_set_fd_block(int fd, int blocking); |
149 | extern int os_accept_connection(int fd); | 146 | extern int os_accept_connection(int fd); |
150 | extern int os_create_unix_socket(char *file, int len, int close_on_exec); | 147 | extern int os_create_unix_socket(const char *file, int len, int close_on_exec); |
151 | extern int os_shutdown_socket(int fd, int r, int w); | 148 | extern int os_shutdown_socket(int fd, int r, int w); |
152 | extern void os_close_file(int fd); | 149 | extern void os_close_file(int fd); |
153 | extern int os_rcv_fd(int fd, int *helper_pid_out); | 150 | extern int os_rcv_fd(int fd, int *helper_pid_out); |
154 | extern int create_unix_socket(char *file, int len, int close_on_exec); | 151 | extern int create_unix_socket(char *file, int len, int close_on_exec); |
155 | extern int os_connect_socket(char *name); | 152 | extern int os_connect_socket(const char *name); |
156 | extern int os_file_type(char *file); | 153 | extern int os_file_type(char *file); |
157 | extern int os_file_mode(char *file, struct openflags *mode_out); | 154 | extern int os_file_mode(const char *file, struct openflags *mode_out); |
158 | extern int os_lock_file(int fd, int excl); | 155 | extern int os_lock_file(int fd, int excl); |
159 | extern void os_flush_stdout(void); | 156 | extern void os_flush_stdout(void); |
160 | extern int os_stat_filesystem(char *path, long *bsize_out, | 157 | extern int os_stat_filesystem(char *path, long *bsize_out, |
@@ -168,14 +165,10 @@ extern int os_fchange_dir(int fd); | |||
168 | 165 | ||
169 | /* start_up.c */ | 166 | /* start_up.c */ |
170 | extern void os_early_checks(void); | 167 | extern void os_early_checks(void); |
171 | extern int can_do_skas(void); | 168 | extern void can_do_skas(void); |
172 | extern void os_check_bugs(void); | 169 | extern void os_check_bugs(void); |
173 | extern void check_host_supports_tls(int *supports_tls, int *tls_min); | 170 | extern void check_host_supports_tls(int *supports_tls, int *tls_min); |
174 | 171 | ||
175 | /* Make sure they are clear when running in TT mode. Required by | ||
176 | * SEGV_MAYBE_FIXABLE */ | ||
177 | #define clear_can_do_skas() do { ptrace_faultinfo = proc_mm = 0; } while (0) | ||
178 | |||
179 | /* mem.c */ | 172 | /* mem.c */ |
180 | extern int create_mem_file(unsigned long long len); | 173 | extern int create_mem_file(unsigned long long len); |
181 | 174 | ||
@@ -214,7 +207,7 @@ extern int execvp_noalloc(char *buf, const char *file, char *const argv[]); | |||
214 | extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv); | 207 | extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv); |
215 | extern int run_helper_thread(int (*proc)(void *), void *arg, | 208 | extern int run_helper_thread(int (*proc)(void *), void *arg, |
216 | unsigned int flags, unsigned long *stack_out); | 209 | unsigned int flags, unsigned long *stack_out); |
217 | extern int helper_wait(int pid, int nohang, char *pname); | 210 | extern int helper_wait(int pid); |
218 | 211 | ||
219 | 212 | ||
220 | /* tls.c */ | 213 | /* tls.c */ |
@@ -237,16 +230,12 @@ extern void unblock_signals(void); | |||
237 | extern int get_signals(void); | 230 | extern int get_signals(void); |
238 | extern int set_signals(int enable); | 231 | extern int set_signals(int enable); |
239 | 232 | ||
240 | /* trap.c */ | ||
241 | extern void os_fill_handlinfo(struct kern_handlers h); | ||
242 | |||
243 | /* util.c */ | 233 | /* util.c */ |
244 | extern void stack_protections(unsigned long address); | 234 | extern void stack_protections(unsigned long address); |
245 | extern int raw(int fd); | 235 | extern int raw(int fd); |
246 | extern void setup_machinename(char *machine_out); | 236 | extern void setup_machinename(char *machine_out); |
247 | extern void setup_hostinfo(char *buf, int len); | 237 | extern void setup_hostinfo(char *buf, int len); |
248 | extern int setjmp_wrapper(void (*proc)(void *, void *), ...); | 238 | extern void os_dump_core(void) __attribute__ ((noreturn)); |
249 | extern void os_dump_core(void); | ||
250 | 239 | ||
251 | /* time.c */ | 240 | /* time.c */ |
252 | extern void idle_sleep(unsigned long long nsecs); | 241 | extern void idle_sleep(unsigned long long nsecs); |
@@ -275,11 +264,9 @@ extern int protect(struct mm_id * mm_idp, unsigned long addr, | |||
275 | extern int is_skas_winch(int pid, int fd, void *data); | 264 | extern int is_skas_winch(int pid, int fd, void *data); |
276 | extern int start_userspace(unsigned long stub_stack); | 265 | extern int start_userspace(unsigned long stub_stack); |
277 | extern int copy_context_skas0(unsigned long stack, int pid); | 266 | extern int copy_context_skas0(unsigned long stack, int pid); |
278 | extern void save_registers(int pid, struct uml_pt_regs *regs); | ||
279 | extern void restore_registers(int pid, struct uml_pt_regs *regs); | ||
280 | extern void userspace(struct uml_pt_regs *regs); | 267 | extern void userspace(struct uml_pt_regs *regs); |
281 | extern void map_stub_pages(int fd, unsigned long code, | 268 | extern int map_stub_pages(int fd, unsigned long code, unsigned long data, |
282 | unsigned long data, unsigned long stack); | 269 | unsigned long stack); |
283 | extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void)); | 270 | extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void)); |
284 | extern void switch_threads(jmp_buf *me, jmp_buf *you); | 271 | extern void switch_threads(jmp_buf *me, jmp_buf *you); |
285 | extern int start_idle_thread(void *stack, jmp_buf *switch_buf); | 272 | extern int start_idle_thread(void *stack, jmp_buf *switch_buf); |
@@ -298,16 +285,12 @@ extern void os_free_irq_later(struct irq_fd *active_fds, | |||
298 | extern int os_get_pollfd(int i); | 285 | extern int os_get_pollfd(int i); |
299 | extern void os_set_pollfd(int i, int fd); | 286 | extern void os_set_pollfd(int i, int fd); |
300 | extern void os_set_ioignore(void); | 287 | extern void os_set_ioignore(void); |
301 | extern void init_irq_signals(int on_sigstack); | ||
302 | 288 | ||
303 | /* sigio.c */ | 289 | /* sigio.c */ |
304 | extern int add_sigio_fd(int fd); | 290 | extern int add_sigio_fd(int fd); |
305 | extern int ignore_sigio_fd(int fd); | 291 | extern int ignore_sigio_fd(int fd); |
306 | extern void maybe_sigio_broken(int fd, int read); | 292 | extern void maybe_sigio_broken(int fd, int read); |
307 | 293 | ||
308 | /* skas/trap */ | ||
309 | extern void sig_handler_common_skas(int sig, void *sc_ptr); | ||
310 | |||
311 | /* sys-x86_64/prctl.c */ | 294 | /* sys-x86_64/prctl.c */ |
312 | extern int os_arch_prctl(int pid, int code, unsigned long *addr); | 295 | extern int os_arch_prctl(int pid, int code, unsigned long *addr); |
313 | 296 | ||