Gennady Sharapov | ea2ba7d | 2006-01-08 01:01:31 -0800 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) |
| 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
| 6 | #ifndef __USER_UTIL_H__ |
| 7 | #define __USER_UTIL_H__ |
| 8 | |
| 9 | #include "sysdep/ptrace.h" |
| 10 | |
Paolo 'Blaisorblade' Giarrusso | 3feb885 | 2006-03-31 02:30:25 -0800 | [diff] [blame] | 11 | /* Copied from kernel.h */ |
| 12 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) |
| 15 | |
| 16 | extern int mode_tt; |
| 17 | |
| 18 | extern int grantpt(int __fd); |
| 19 | extern int unlockpt(int __fd); |
| 20 | extern char *ptsname(int __fd); |
| 21 | |
| 22 | struct cpu_task { |
| 23 | int pid; |
| 24 | void *task; |
| 25 | }; |
| 26 | |
| 27 | extern struct cpu_task cpu_tasks[]; |
| 28 | |
Gennady Sharapov | ea2ba7d | 2006-01-08 01:01:31 -0800 | [diff] [blame] | 29 | extern void (*sig_info[])(int, union uml_pt_regs *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | extern unsigned long low_physmem; |
| 32 | extern unsigned long high_physmem; |
| 33 | extern unsigned long uml_physmem; |
| 34 | extern unsigned long uml_reserved; |
| 35 | extern unsigned long end_vm; |
| 36 | extern unsigned long start_vm; |
Jeff Dike | 9902abd | 2006-03-31 02:30:09 -0800 | [diff] [blame] | 37 | extern unsigned long long highmem; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
| 39 | extern char host_info[]; |
| 40 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; |
| 42 | extern unsigned long _unprotected_end; |
| 43 | extern unsigned long brk_start; |
| 44 | |
| 45 | extern int pty_output_sigio; |
| 46 | extern int pty_close_sigio; |
| 47 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | extern void *add_signal_handler(int sig, void (*handler)(int)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | extern int linux_main(int argc, char **argv); |
| 50 | extern void set_cmdline(char *cmd); |
| 51 | extern void input_cb(void (*proc)(void *), void *arg, int arg_len); |
| 52 | extern int get_pty(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | extern void do_exec(int old_pid, int new_pid); |
Paolo 'Blaisorblade' Giarrusso | 9cf85b3 | 2006-04-10 22:53:31 -0700 | [diff] [blame] | 55 | extern void tracer_panic(char *msg, ...) |
| 56 | __attribute__ ((format (printf, 1, 2))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | extern int detach(int pid, int sig); |
| 58 | extern int attach(int pid); |
| 59 | extern void kill_child_dead(int pid); |
| 60 | extern int cont(int pid); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | extern void check_sigio(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | extern void arch_init_thread(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | extern int raw(int fd); |
| 68 | |
| 69 | #endif |