kern_util.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __KERN_UTIL_H__
  6. #define __KERN_UTIL_H__
  7. #include <sysdep/ptrace.h>
  8. #include <sysdep/faultinfo.h>
  9. struct siginfo;
  10. extern int uml_exitcode;
  11. extern int ncpus;
  12. extern int kmalloc_ok;
  13. #define UML_ROUND_UP(addr) \
  14. ((((unsigned long) addr) + PAGE_SIZE - 1) & PAGE_MASK)
  15. extern unsigned long alloc_stack(int order, int atomic);
  16. extern void free_stack(unsigned long stack, int order);
  17. struct pt_regs;
  18. extern void do_signal(struct pt_regs *regs);
  19. extern void interrupt_end(void);
  20. extern void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs);
  21. extern unsigned long segv(struct faultinfo fi, unsigned long ip,
  22. int is_user, struct uml_pt_regs *regs);
  23. extern int handle_page_fault(unsigned long address, unsigned long ip,
  24. int is_write, int is_user, int *code_out);
  25. extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs);
  26. extern int smp_sigio_handler(void);
  27. extern void initial_thread_cb(void (*proc)(void *), void *arg);
  28. extern int is_syscall(unsigned long addr);
  29. extern void timer_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
  30. extern int start_uml(void);
  31. extern void paging_init(void);
  32. extern void uml_cleanup(void);
  33. extern void do_uml_exitcalls(void);
  34. /*
  35. * Are we disallowed to sleep? Used to choose between GFP_KERNEL and
  36. * GFP_ATOMIC.
  37. */
  38. extern int __cant_sleep(void);
  39. extern int get_current_pid(void);
  40. extern int copy_from_user_proc(void *to, void *from, int size);
  41. extern int cpu(void);
  42. extern char *uml_strdup(const char *string);
  43. extern unsigned long to_irq_stack(unsigned long *mask_out);
  44. extern unsigned long from_irq_stack(int nested);
  45. extern void syscall_trace(struct uml_pt_regs *regs, int entryexit);
  46. extern int singlestepping(void *t);
  47. extern void segv_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
  48. extern void bus_handler(int sig, struct siginfo *si, struct uml_pt_regs *regs);
  49. extern void winch(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
  50. extern void fatal_sigsegv(void) __attribute__ ((noreturn));
  51. #endif