Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Copyright (C) 2003 Ralf Baechle |
| 7 | */ |
| 8 | #ifndef _ASM_ASMMACRO_H |
| 9 | #define _ASM_ASMMACRO_H |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame^] | 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #include <linux/config.h> |
| 12 | #include <asm/hazards.h> |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame^] | 13 | |
Ralf Baechle | 875d43e | 2005-09-03 15:56:16 -0700 | [diff] [blame] | 14 | #ifdef CONFIG_32BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <asm/asmmacro-32.h> |
| 16 | #endif |
Ralf Baechle | 875d43e | 2005-09-03 15:56:16 -0700 | [diff] [blame] | 17 | #ifdef CONFIG_64BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <asm/asmmacro-64.h> |
| 19 | #endif |
| 20 | |
| 21 | .macro local_irq_enable reg=t0 |
| 22 | mfc0 \reg, CP0_STATUS |
| 23 | ori \reg, \reg, 1 |
| 24 | mtc0 \reg, CP0_STATUS |
| 25 | irq_enable_hazard |
| 26 | .endm |
| 27 | |
| 28 | .macro local_irq_disable reg=t0 |
| 29 | mfc0 \reg, CP0_STATUS |
| 30 | ori \reg, \reg, 1 |
| 31 | xori \reg, \reg, 1 |
| 32 | mtc0 \reg, CP0_STATUS |
| 33 | irq_disable_hazard |
| 34 | .endm |
| 35 | |
| 36 | #ifdef CONFIG_CPU_SB1 |
| 37 | .macro fpu_enable_hazard |
| 38 | .set push |
| 39 | .set noreorder |
| 40 | .set mips2 |
| 41 | SSNOP |
| 42 | bnezl $0, .+4 |
| 43 | SSNOP |
| 44 | .set pop |
| 45 | .endm |
| 46 | #else |
| 47 | .macro fpu_enable_hazard |
| 48 | .endm |
| 49 | #endif |
| 50 | |
| 51 | #endif /* _ASM_ASMMACRO_H */ |