Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 11 | #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) |
| 12 | |
| 13 | extern int mode_tt; |
| 14 | |
| 15 | extern int grantpt(int __fd); |
| 16 | extern int unlockpt(int __fd); |
| 17 | extern char *ptsname(int __fd); |
| 18 | |
| 19 | struct cpu_task { |
| 20 | int pid; |
| 21 | void *task; |
| 22 | }; |
| 23 | |
| 24 | extern struct cpu_task cpu_tasks[]; |
| 25 | |
| 26 | struct signal_info { |
| 27 | void (*handler)(int, union uml_pt_regs *); |
| 28 | int is_irq; |
| 29 | }; |
| 30 | |
| 31 | extern struct signal_info sig_info[]; |
| 32 | |
| 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; |
| 40 | |
| 41 | extern char host_info[]; |
| 42 | |
| 43 | extern char saved_command_line[]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
| 45 | extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; |
| 46 | extern unsigned long _unprotected_end; |
| 47 | extern unsigned long brk_start; |
| 48 | |
| 49 | extern int pty_output_sigio; |
| 50 | extern int pty_close_sigio; |
| 51 | |
| 52 | extern void stop(void); |
| 53 | extern void stack_protections(unsigned long address); |
| 54 | extern void task_protections(unsigned long address); |
| 55 | extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); |
| 56 | extern void *add_signal_handler(int sig, void (*handler)(int)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | extern int linux_main(int argc, char **argv); |
| 58 | extern void set_cmdline(char *cmd); |
| 59 | extern void input_cb(void (*proc)(void *), void *arg, int arg_len); |
| 60 | extern int get_pty(void); |
| 61 | extern void *um_kmalloc(int size); |
| 62 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); |
| 63 | extern void setup_machinename(char *machine_out); |
| 64 | extern void setup_hostinfo(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | extern void do_exec(int old_pid, int new_pid); |
| 66 | extern void tracer_panic(char *msg, ...); |
| 67 | extern char *get_umid(int only_if_set); |
| 68 | extern void do_longjmp(void *p, int val); |
| 69 | extern int detach(int pid, int sig); |
| 70 | extern int attach(int pid); |
| 71 | extern void kill_child_dead(int pid); |
| 72 | extern int cont(int pid); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | extern void check_sigio(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | extern void write_sigio_workaround(void); |
| 75 | extern void arch_check_bugs(void); |
| 76 | extern int cpu_feature(char *what, char *buf, int len); |
| 77 | extern int arch_handle_signal(int sig, union uml_pt_regs *regs); |
| 78 | extern int arch_fixup(unsigned long address, void *sc_ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | extern void arch_init_thread(void); |
| 80 | extern int setjmp_wrapper(void (*proc)(void *, void *), ...); |
| 81 | extern int raw(int fd); |
| 82 | |
| 83 | #endif |
| 84 | |
| 85 | /* |
| 86 | * Overrides for Emacs so that we follow Linus's tabbing style. |
| 87 | * Emacs will notice this stuff at the end of the file and automatically |
| 88 | * adjust the settings for this buffer only. This must remain at the end |
| 89 | * of the file. |
| 90 | * --------------------------------------------------------------------------- |
| 91 | * Local variables: |
| 92 | * c-file-style: "linux" |
| 93 | * End: |
| 94 | */ |