bugs.h 944 B

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