aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/os.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/include/os.h')
-rw-r--r--arch/um/include/os.h41
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)
128extern int os_stat_file(const char *file_name, struct uml_stat *buf); 127extern int os_stat_file(const char *file_name, struct uml_stat *buf);
129extern int os_stat_fd(const int fd, struct uml_stat *buf); 128extern int os_stat_fd(const int fd, struct uml_stat *buf);
130extern int os_access(const char *file, int mode); 129extern int os_access(const char *file, int mode);
131extern int os_get_exec_close(int fd, int *close_on_exec);
132extern int os_set_exec_close(int fd); 130extern int os_set_exec_close(int fd);
133extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg); 131extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg);
134extern int os_get_ifname(int fd, char *namebuf); 132extern int os_get_ifname(int fd, char *namebuf);
135extern int os_set_slip(int fd); 133extern int os_set_slip(int fd);
136extern int os_set_owner(int fd, int pid);
137extern int os_mode_fd(int fd, int mode); 134extern int os_mode_fd(int fd, int mode);
138 135
139extern int os_seek_file(int fd, unsigned long long offset); 136extern int os_seek_file(int fd, unsigned long long offset);
140extern int os_open_file(char *file, struct openflags flags, int mode); 137extern int os_open_file(const char *file, struct openflags flags, int mode);
141extern int os_read_file(int fd, void *buf, int len); 138extern int os_read_file(int fd, void *buf, int len);
142extern int os_write_file(int fd, const void *buf, int count); 139extern int os_write_file(int fd, const void *buf, int count);
143extern int os_file_size(char *file, unsigned long long *size_out); 140extern int os_file_size(const char *file, unsigned long long *size_out);
144extern int os_file_modtime(char *file, unsigned long *modtime); 141extern int os_file_modtime(const char *file, unsigned long *modtime);
145extern int os_pipe(int *fd, int stream, int close_on_exec); 142extern int os_pipe(int *fd, int stream, int close_on_exec);
146extern int os_set_fd_async(int fd, int owner); 143extern int os_set_fd_async(int fd);
147extern int os_clear_fd_async(int fd); 144extern int os_clear_fd_async(int fd);
148extern int os_set_fd_block(int fd, int blocking); 145extern int os_set_fd_block(int fd, int blocking);
149extern int os_accept_connection(int fd); 146extern int os_accept_connection(int fd);
150extern int os_create_unix_socket(char *file, int len, int close_on_exec); 147extern int os_create_unix_socket(const char *file, int len, int close_on_exec);
151extern int os_shutdown_socket(int fd, int r, int w); 148extern int os_shutdown_socket(int fd, int r, int w);
152extern void os_close_file(int fd); 149extern void os_close_file(int fd);
153extern int os_rcv_fd(int fd, int *helper_pid_out); 150extern int os_rcv_fd(int fd, int *helper_pid_out);
154extern int create_unix_socket(char *file, int len, int close_on_exec); 151extern int create_unix_socket(char *file, int len, int close_on_exec);
155extern int os_connect_socket(char *name); 152extern int os_connect_socket(const char *name);
156extern int os_file_type(char *file); 153extern int os_file_type(char *file);
157extern int os_file_mode(char *file, struct openflags *mode_out); 154extern int os_file_mode(const char *file, struct openflags *mode_out);
158extern int os_lock_file(int fd, int excl); 155extern int os_lock_file(int fd, int excl);
159extern void os_flush_stdout(void); 156extern void os_flush_stdout(void);
160extern int os_stat_filesystem(char *path, long *bsize_out, 157extern 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 */
170extern void os_early_checks(void); 167extern void os_early_checks(void);
171extern int can_do_skas(void); 168extern void can_do_skas(void);
172extern void os_check_bugs(void); 169extern void os_check_bugs(void);
173extern void check_host_supports_tls(int *supports_tls, int *tls_min); 170extern 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 */
180extern int create_mem_file(unsigned long long len); 173extern 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[]);
214extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv); 207extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv);
215extern int run_helper_thread(int (*proc)(void *), void *arg, 208extern 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);
217extern int helper_wait(int pid, int nohang, char *pname); 210extern int helper_wait(int pid);
218 211
219 212
220/* tls.c */ 213/* tls.c */
@@ -237,16 +230,12 @@ extern void unblock_signals(void);
237extern int get_signals(void); 230extern int get_signals(void);
238extern int set_signals(int enable); 231extern int set_signals(int enable);
239 232
240/* trap.c */
241extern void os_fill_handlinfo(struct kern_handlers h);
242
243/* util.c */ 233/* util.c */
244extern void stack_protections(unsigned long address); 234extern void stack_protections(unsigned long address);
245extern int raw(int fd); 235extern int raw(int fd);
246extern void setup_machinename(char *machine_out); 236extern void setup_machinename(char *machine_out);
247extern void setup_hostinfo(char *buf, int len); 237extern void setup_hostinfo(char *buf, int len);
248extern int setjmp_wrapper(void (*proc)(void *, void *), ...); 238extern void os_dump_core(void) __attribute__ ((noreturn));
249extern void os_dump_core(void);
250 239
251/* time.c */ 240/* time.c */
252extern void idle_sleep(unsigned long long nsecs); 241extern void idle_sleep(unsigned long long nsecs);
@@ -275,11 +264,9 @@ extern int protect(struct mm_id * mm_idp, unsigned long addr,
275extern int is_skas_winch(int pid, int fd, void *data); 264extern int is_skas_winch(int pid, int fd, void *data);
276extern int start_userspace(unsigned long stub_stack); 265extern int start_userspace(unsigned long stub_stack);
277extern int copy_context_skas0(unsigned long stack, int pid); 266extern int copy_context_skas0(unsigned long stack, int pid);
278extern void save_registers(int pid, struct uml_pt_regs *regs);
279extern void restore_registers(int pid, struct uml_pt_regs *regs);
280extern void userspace(struct uml_pt_regs *regs); 267extern void userspace(struct uml_pt_regs *regs);
281extern void map_stub_pages(int fd, unsigned long code, 268extern int map_stub_pages(int fd, unsigned long code, unsigned long data,
282 unsigned long data, unsigned long stack); 269 unsigned long stack);
283extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void)); 270extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void));
284extern void switch_threads(jmp_buf *me, jmp_buf *you); 271extern void switch_threads(jmp_buf *me, jmp_buf *you);
285extern int start_idle_thread(void *stack, jmp_buf *switch_buf); 272extern 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,
298extern int os_get_pollfd(int i); 285extern int os_get_pollfd(int i);
299extern void os_set_pollfd(int i, int fd); 286extern void os_set_pollfd(int i, int fd);
300extern void os_set_ioignore(void); 287extern void os_set_ioignore(void);
301extern void init_irq_signals(int on_sigstack);
302 288
303/* sigio.c */ 289/* sigio.c */
304extern int add_sigio_fd(int fd); 290extern int add_sigio_fd(int fd);
305extern int ignore_sigio_fd(int fd); 291extern int ignore_sigio_fd(int fd);
306extern void maybe_sigio_broken(int fd, int read); 292extern void maybe_sigio_broken(int fd, int read);
307 293
308/* skas/trap */
309extern void sig_handler_common_skas(int sig, void *sc_ptr);
310
311/* sys-x86_64/prctl.c */ 294/* sys-x86_64/prctl.c */
312extern int os_arch_prctl(int pid, int code, unsigned long *addr); 295extern int os_arch_prctl(int pid, int code, unsigned long *addr);
313 296