2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
6 #ifndef __USER_UTIL_H__
7 #define __USER_UTIL_H__
9 #include "sysdep/ptrace.h"
11 #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR))
15 extern int grantpt(int __fd
);
16 extern int unlockpt(int __fd
);
17 extern char *ptsname(int __fd
);
24 extern struct cpu_task cpu_tasks
[];
27 void (*handler
)(int, union uml_pt_regs
*);
31 extern struct signal_info sig_info
[];
33 extern unsigned long low_physmem
;
34 extern unsigned long high_physmem
;
35 extern unsigned long uml_physmem
;
36 extern unsigned long uml_reserved
;
37 extern unsigned long end_vm
;
38 extern unsigned long start_vm
;
39 extern unsigned long highmem
;
41 extern char host_info
[];
43 extern char saved_command_line
[];
44 extern char command_line
[];
48 extern unsigned long _stext
, _etext
, _sdata
, _edata
, __bss_start
, _end
;
49 extern unsigned long _unprotected_end
;
50 extern unsigned long brk_start
;
52 extern int pty_output_sigio
;
53 extern int pty_close_sigio
;
55 extern void stop(void);
56 extern void stack_protections(unsigned long address
);
57 extern void task_protections(unsigned long address
);
58 extern int wait_for_stop(int pid
, int sig
, int cont_type
, void *relay
);
59 extern void *add_signal_handler(int sig
, void (*handler
)(int));
60 extern int start_fork_tramp(void *arg
, unsigned long temp_stack
,
61 int clone_flags
, int (*tramp
)(void *));
62 extern int linux_main(int argc
, char **argv
);
63 extern void set_cmdline(char *cmd
);
64 extern void input_cb(void (*proc
)(void *), void *arg
, int arg_len
);
65 extern int get_pty(void);
66 extern void *um_kmalloc(int size
);
67 extern int switcheroo(int fd
, int prot
, void *from
, void *to
, int size
);
68 extern void setup_machinename(char *machine_out
);
69 extern void setup_hostinfo(void);
70 extern void add_arg(char *arg
);
71 extern void init_new_thread_stack(void *sig_stack
, void (*usr1_handler
)(int));
72 extern void init_new_thread_signals(int altstack
);
73 extern void do_exec(int old_pid
, int new_pid
);
74 extern void tracer_panic(char *msg
, ...);
75 extern char *get_umid(int only_if_set
);
76 extern void do_longjmp(void *p
, int val
);
77 extern int detach(int pid
, int sig
);
78 extern int attach(int pid
);
79 extern void kill_child_dead(int pid
);
80 extern int cont(int pid
);
81 extern void check_ptrace(void);
82 extern void check_sigio(void);
83 extern int run_kernel_thread(int (*fn
)(void *), void *arg
, void **jmp_ptr
);
84 extern void write_sigio_workaround(void);
85 extern void arch_check_bugs(void);
86 extern int cpu_feature(char *what
, char *buf
, int len
);
87 extern int arch_handle_signal(int sig
, union uml_pt_regs
*regs
);
88 extern int arch_fixup(unsigned long address
, void *sc_ptr
);
89 extern void forward_pending_sigio(int target
);
90 extern int can_do_skas(void);
91 extern void arch_init_thread(void);
92 extern int setjmp_wrapper(void (*proc
)(void *, void *), ...);
93 extern int raw(int fd
);
98 * Overrides for Emacs so that we follow Linus's tabbing style.
99 * Emacs will notice this stuff at the end of the file and automatically
100 * adjust the settings for this buffer only. This must remain at the end
102 * ---------------------------------------------------------------------------
104 * c-file-style: "linux"