blob: bb505e01d9942140ece4e25f43589d1949a03ec7 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
13extern int mode_tt;
14
15extern int grantpt(int __fd);
16extern int unlockpt(int __fd);
17extern char *ptsname(int __fd);
18
19struct cpu_task {
20 int pid;
21 void *task;
22};
23
24extern struct cpu_task cpu_tasks[];
25
26struct signal_info {
27 void (*handler)(int, union uml_pt_regs *);
28 int is_irq;
29};
30
31extern struct signal_info sig_info[];
32
33extern unsigned long low_physmem;
34extern unsigned long high_physmem;
35extern unsigned long uml_physmem;
36extern unsigned long uml_reserved;
37extern unsigned long end_vm;
38extern unsigned long start_vm;
39extern unsigned long highmem;
40
41extern char host_info[];
42
43extern char saved_command_line[];
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
45extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
46extern unsigned long _unprotected_end;
47extern unsigned long brk_start;
48
49extern int pty_output_sigio;
50extern int pty_close_sigio;
51
52extern void stop(void);
53extern void stack_protections(unsigned long address);
54extern void task_protections(unsigned long address);
55extern int wait_for_stop(int pid, int sig, int cont_type, void *relay);
56extern void *add_signal_handler(int sig, void (*handler)(int));
Linus Torvalds1da177e2005-04-16 15:20:36 -070057extern int linux_main(int argc, char **argv);
58extern void set_cmdline(char *cmd);
59extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
60extern int get_pty(void);
61extern void *um_kmalloc(int size);
62extern int switcheroo(int fd, int prot, void *from, void *to, int size);
63extern void setup_machinename(char *machine_out);
64extern void setup_hostinfo(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070065extern void do_exec(int old_pid, int new_pid);
66extern void tracer_panic(char *msg, ...);
67extern char *get_umid(int only_if_set);
68extern void do_longjmp(void *p, int val);
69extern int detach(int pid, int sig);
70extern int attach(int pid);
71extern void kill_child_dead(int pid);
72extern int cont(int pid);
Linus Torvalds1da177e2005-04-16 15:20:36 -070073extern void check_sigio(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070074extern void write_sigio_workaround(void);
75extern void arch_check_bugs(void);
76extern int cpu_feature(char *what, char *buf, int len);
77extern int arch_handle_signal(int sig, union uml_pt_regs *regs);
78extern int arch_fixup(unsigned long address, void *sc_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070079extern void arch_init_thread(void);
80extern int setjmp_wrapper(void (*proc)(void *, void *), ...);
81extern 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 */