kern_util.h 2.0 KB
Newer Older
1
/*
J
Jeff Dike 已提交
2
 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
L
Linus Torvalds 已提交
3 4 5 6 7 8 9
 * Licensed under the GPL
 */

#ifndef __KERN_UTIL_H__
#define __KERN_UTIL_H__

#include "sysdep/ptrace.h"
10
#include "sysdep/faultinfo.h"
L
Linus Torvalds 已提交
11 12 13 14 15 16

extern int ncpus;
extern int kmalloc_ok;
extern int nsyscalls;

#define UML_ROUND_UP(addr) \
J
Jeff Dike 已提交
17
	((((unsigned long) addr) + PAGE_SIZE - 1) & PAGE_MASK)
L
Linus Torvalds 已提交
18 19

extern unsigned long alloc_stack(int order, int atomic);
J
Jeff Dike 已提交
20 21
extern void free_stack(unsigned long stack, int order);

L
Linus Torvalds 已提交
22
extern int do_signal(void);
J
Jeff Dike 已提交
23 24 25 26
extern void copy_sc(struct uml_pt_regs *regs, void *from);
extern void interrupt_end(void);
extern void relay_signal(int sig, struct uml_pt_regs *regs);

27
extern unsigned long segv(struct faultinfo fi, unsigned long ip,
28
			  int is_user, struct uml_pt_regs *regs);
L
Linus Torvalds 已提交
29 30
extern int handle_page_fault(unsigned long address, unsigned long ip,
			     int is_write, int is_user, int *code_out);
J
Jeff Dike 已提交
31

32
extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs);
L
Linus Torvalds 已提交
33
extern int smp_sigio_handler(void);
J
Jeff Dike 已提交
34
extern void initial_thread_cb(void (*proc)(void *), void *arg);
L
Linus Torvalds 已提交
35
extern int is_syscall(unsigned long addr);
J
Jeff Dike 已提交
36
extern void timer_handler(int sig, struct uml_pt_regs *regs);
37

J
Jeff Dike 已提交
38 39 40 41
extern void timer_handler(int sig, struct uml_pt_regs *regs);

extern int start_uml(void);
extern void paging_init(void);
42

J
Jeff Dike 已提交
43 44
extern void uml_cleanup(void);
extern void do_uml_exitcalls(void);
45

J
Jeff Dike 已提交
46 47 48 49
/*
 * Are we disallowed to sleep? Used to choose between GFP_KERNEL and
 * GFP_ATOMIC.
 */
50
extern int __cant_sleep(void);
J
Jeff Dike 已提交
51 52 53 54 55
extern void *get_current(void);
extern int copy_from_user_proc(void *to, void *from, int size);
extern int cpu(void);
extern char *uml_strdup(const char *string);

J
Jeff Dike 已提交
56
extern unsigned long to_irq_stack(unsigned long *mask_out);
J
Jeff Dike 已提交
57 58 59 60 61 62 63 64
extern unsigned long from_irq_stack(int nested);

extern void syscall_trace(struct uml_pt_regs *regs, int entryexit);
extern int singlestepping(void *t);

extern void segv_handler(int sig, struct uml_pt_regs *regs);
extern void bus_handler(int sig, struct uml_pt_regs *regs);
extern void winch(int sig, struct uml_pt_regs *regs);
65
extern void fatal_sigsegv(void) __attribute__ ((noreturn));
J
Jeff Dike 已提交
66 67


L
Linus Torvalds 已提交
68
#endif