bugs.h 905 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * This is included by init/main.c to check for architecture-dependent bugs.
  3. *
  4. * Copyright (C) 2007 Maciej W. Rozycki
  5. *
  6. * Needs:
  7. * void check_bugs(void);
  8. */
  9. #ifndef _ASM_BUGS_H
  10. #define _ASM_BUGS_H
  11. #include <linux/bug.h>
  12. #include <linux/delay.h>
  13. #include <linux/smp.h>
  14. #include <asm/cpu.h>
  15. #include <asm/cpu-info.h>
  16. extern int daddiu_bug;
  17. extern void check_bugs64_early(void);
  18. extern void check_bugs32(void);
  19. extern void check_bugs64(void);
  20. static inline void check_bugs_early(void)
  21. {
  22. #ifdef CONFIG_64BIT
  23. check_bugs64_early();
  24. #endif
  25. }
  26. static inline void check_bugs(void)
  27. {
  28. unsigned int cpu = smp_processor_id();
  29. cpu_data[cpu].udelay_val = loops_per_jiffy;
  30. check_bugs32();
  31. #ifdef CONFIG_64BIT
  32. check_bugs64();
  33. #endif
  34. }
  35. static inline int r4k_daddiu_bug(void)
  36. {
  37. #ifdef CONFIG_64BIT
  38. WARN_ON(daddiu_bug < 0);
  39. return daddiu_bug != 0;
  40. #else
  41. return 0;
  42. #endif
  43. }
  44. #endif /* _ASM_BUGS_H */