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
[];
26 extern void (*sig_info
[])(int, union uml_pt_regs
*);
28 extern unsigned long low_physmem
;
29 extern unsigned long high_physmem
;
30 extern unsigned long uml_physmem
;
31 extern unsigned long uml_reserved
;
32 extern unsigned long end_vm
;
33 extern unsigned long start_vm
;
34 extern unsigned long highmem
;
36 extern char host_info
[];
38 extern char saved_command_line
[];
40 extern unsigned long _stext
, _etext
, _sdata
, _edata
, __bss_start
, _end
;
41 extern unsigned long _unprotected_end
;
42 extern unsigned long brk_start
;
44 extern int pty_output_sigio
;
45 extern int pty_close_sigio
;
47 extern void *add_signal_handler(int sig
, void (*handler
)(int));
48 extern int linux_main(int argc
, char **argv
);
49 extern void set_cmdline(char *cmd
);
50 extern void input_cb(void (*proc
)(void *), void *arg
, int arg_len
);
51 extern int get_pty(void);
52 extern void *um_kmalloc(int size
);
53 extern int switcheroo(int fd
, int prot
, void *from
, void *to
, int size
);
54 extern void do_exec(int old_pid
, int new_pid
);
55 extern void tracer_panic(char *msg
, ...);
56 extern int detach(int pid
, int sig
);
57 extern int attach(int pid
);
58 extern void kill_child_dead(int pid
);
59 extern int cont(int pid
);
60 extern void check_sigio(void);
61 extern void write_sigio_workaround(void);
62 extern void arch_check_bugs(void);
63 extern int cpu_feature(char *what
, char *buf
, int len
);
64 extern int arch_handle_signal(int sig
, union uml_pt_regs
*regs
);
65 extern int arch_fixup(unsigned long address
, void *sc_ptr
);
66 extern void arch_init_thread(void);
67 extern int raw(int fd
);