blob: 06625fefef3387b2aac94471361cf59139042b34 [file] [log] [blame]
Gennady Sharapovea2ba7d2006-01-08 01:01:31 -08001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * 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' Giarrusso3feb8852006-03-31 02:30:25 -080011/* Copied from kernel.h */
12#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR))
15
16extern int mode_tt;
17
18extern int grantpt(int __fd);
19extern int unlockpt(int __fd);
20extern char *ptsname(int __fd);
21
22struct cpu_task {
23 int pid;
24 void *task;
25};
26
27extern struct cpu_task cpu_tasks[];
28
Gennady Sharapovea2ba7d2006-01-08 01:01:31 -080029extern void (*sig_info[])(int, union uml_pt_regs *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31extern unsigned long low_physmem;
32extern unsigned long high_physmem;
33extern unsigned long uml_physmem;
34extern unsigned long uml_reserved;
35extern unsigned long end_vm;
36extern unsigned long start_vm;
Jeff Dike9902abd2006-03-31 02:30:09 -080037extern unsigned long long highmem;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39extern char host_info[];
40
41extern char saved_command_line[];
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
44extern unsigned long _unprotected_end;
45extern unsigned long brk_start;
46
47extern int pty_output_sigio;
48extern int pty_close_sigio;
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050extern void *add_signal_handler(int sig, void (*handler)(int));
Linus Torvalds1da177e2005-04-16 15:20:36 -070051extern int linux_main(int argc, char **argv);
52extern void set_cmdline(char *cmd);
53extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
54extern int get_pty(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070055extern int switcheroo(int fd, int prot, void *from, void *to, int size);
Linus Torvalds1da177e2005-04-16 15:20:36 -070056extern void do_exec(int old_pid, int new_pid);
Paolo 'Blaisorblade' Giarrusso9cf85b32006-04-10 22:53:31 -070057extern void tracer_panic(char *msg, ...)
58 __attribute__ ((format (printf, 1, 2)));
Linus Torvalds1da177e2005-04-16 15:20:36 -070059extern int detach(int pid, int sig);
60extern int attach(int pid);
61extern void kill_child_dead(int pid);
62extern int cont(int pid);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063extern void check_sigio(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070064extern void arch_check_bugs(void);
65extern int cpu_feature(char *what, char *buf, int len);
66extern int arch_handle_signal(int sig, union uml_pt_regs *regs);
67extern int arch_fixup(unsigned long address, void *sc_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070068extern void arch_init_thread(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069extern int raw(int fd);
70
71#endif