Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This is included by init/main.c to check for architecture-dependent bugs. |
| 3 | * |
Maciej W. Rozycki | 20d60d9 | 2007-10-23 12:43:11 +0100 | [diff] [blame] | 4 | * Copyright (C) 2007 Maciej W. Rozycki |
| 5 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * Needs: |
| 7 | * void check_bugs(void); |
| 8 | */ |
| 9 | #ifndef _ASM_BUGS_H |
| 10 | #define _ASM_BUGS_H |
| 11 | |
Maciej W. Rozycki | 20d60d9 | 2007-10-23 12:43:11 +0100 | [diff] [blame] | 12 | #include <linux/bug.h> |
Ralf Baechle | 3855157 | 2005-04-13 17:36:49 +0000 | [diff] [blame] | 13 | #include <linux/delay.h> |
Maciej W. Rozycki | 20d60d9 | 2007-10-23 12:43:11 +0100 | [diff] [blame] | 14 | |
Ralf Baechle | f03da6e | 2005-04-13 13:37:32 +0000 | [diff] [blame] | 15 | #include <asm/cpu.h> |
| 16 | #include <asm/cpu-info.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
Maciej W. Rozycki | 20d60d9 | 2007-10-23 12:43:11 +0100 | [diff] [blame] | 18 | extern int daddiu_bug; |
| 19 | |
| 20 | extern void check_bugs64_early(void); |
| 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | extern void check_bugs32(void); |
| 23 | extern void check_bugs64(void); |
| 24 | |
Maciej W. Rozycki | 20d60d9 | 2007-10-23 12:43:11 +0100 | [diff] [blame] | 25 | static inline void check_bugs_early(void) |
| 26 | { |
| 27 | #ifdef CONFIG_64BIT |
| 28 | check_bugs64_early(); |
| 29 | #endif |
| 30 | } |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | static inline void check_bugs(void) |
| 33 | { |
Ralf Baechle | f03da6e | 2005-04-13 13:37:32 +0000 | [diff] [blame] | 34 | unsigned int cpu = smp_processor_id(); |
| 35 | |
| 36 | cpu_data[cpu].udelay_val = loops_per_jiffy; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | check_bugs32(); |
Ralf Baechle | 875d43e | 2005-09-03 15:56:16 -0700 | [diff] [blame] | 38 | #ifdef CONFIG_64BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | check_bugs64(); |
| 40 | #endif |
| 41 | } |
| 42 | |
Maciej W. Rozycki | 20d60d9 | 2007-10-23 12:43:11 +0100 | [diff] [blame] | 43 | static inline int r4k_daddiu_bug(void) |
| 44 | { |
| 45 | #ifdef CONFIG_64BIT |
| 46 | WARN_ON(daddiu_bug < 0); |
| 47 | return daddiu_bug != 0; |
| 48 | #else |
| 49 | return 0; |
| 50 | #endif |
| 51 | } |
| 52 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | #endif /* _ASM_BUGS_H */ |