bugs.h 882 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <asm/cpu.h>
  14. #include <asm/cpu-info.h>
  15. extern int daddiu_bug;
  16. extern void check_bugs64_early(void);
  17. extern void check_bugs32(void);
  18. extern void check_bugs64(void);
  19. static inline void check_bugs_early(void)
  20. {
  21. #ifdef CONFIG_64BIT
  22. check_bugs64_early();
  23. #endif
  24. }
  25. static inline void check_bugs(void)
  26. {
  27. unsigned int cpu = smp_processor_id();
  28. cpu_data[cpu].udelay_val = loops_per_jiffy;
  29. check_bugs32();
  30. #ifdef CONFIG_64BIT
  31. check_bugs64();
  32. #endif
  33. }
  34. static inline int r4k_daddiu_bug(void)
  35. {
  36. #ifdef CONFIG_64BIT
  37. WARN_ON(daddiu_bug < 0);
  38. return daddiu_bug != 0;
  39. #else
  40. return 0;
  41. #endif
  42. }
  43. #endif /* _ASM_BUGS_H */