kern_util.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. extern int do_signal(void);
  18. extern void interrupt_end(void);
  19. extern void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs);
  20. extern unsigned long segv(struct faultinfo fi, unsigned long ip,
  21. int is_user, struct uml_pt_regs *regs);
  22. extern int handle_page_fault(unsigned long address, unsigned long ip,
  23. int is_write, int is_user, int *code_out);
  24. extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs);
  25. extern int smp_sigio_handler(void);
  26. extern void initial_thread_cb(void (*proc)(void *), void *arg);
  27. extern int is_syscall(unsigned long addr);
  28. extern void timer_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
  29. extern int start_uml(void);
  30. extern void paging_init(void);
  31. extern void uml_cleanup(void);
  32. extern void do_uml_exitcalls(void);
  33. /*
  34. * Are we disallowed to sleep? Used to choose between GFP_KERNEL and
  35. * GFP_ATOMIC.
  36. */
  37. extern int __cant_sleep(void);
  38. extern int get_current_pid(void);
  39. extern int copy_from_user_proc(void *to, void *from, int size);
  40. extern int cpu(void);
  41. extern char *uml_strdup(const char *string);
  42. extern unsigned long to_irq_stack(unsigned long *mask_out);
  43. extern unsigned long from_irq_stack(int nested);
  44. extern void syscall_trace(struct uml_pt_regs *regs, int entryexit);
  45. extern int singlestepping(void *t);
  46. extern void segv_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
  47. extern void bus_handler(int sig, struct siginfo *si, struct uml_pt_regs *regs);
  48. extern void winch(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
  49. extern void fatal_sigsegv(void) __attribute__ ((noreturn));
  50. #endif