X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-m32r%2Fassembler.h;h=1a1aa17edd33fe737d1035676d756421b93a1fe8;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=bdb52a5478307a8831fa4766679f0357fe282719;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/include/asm-m32r/assembler.h b/include/asm-m32r/assembler.h index bdb52a547..1a1aa17ed 100644 --- a/include/asm-m32r/assembler.h +++ b/include/asm-m32r/assembler.h @@ -1,20 +1,33 @@ #ifndef _ASM_M32R_ASSEMBLER_H #define _ASM_M32R_ASSEMBLER_H -/* $Id$ */ - /* * linux/asm-m32r/assembler.h * - * This file contains M32R architecture specific defines. + * Copyright (C) 2004 Hirokazu Takata * - * Do not include any C declarations in this file - it is included by - * assembler source. + * This file contains M32R architecture specific macro definitions. */ #include +#ifndef __STR +#ifdef __ASSEMBLY__ +#define __STR(x) x +#else +#define __STR(x) #x +#endif +#endif /* __STR */ + +#ifdef CONFIG_SMP +#define M32R_LOCK __STR(lock) +#define M32R_UNLOCK __STR(unlock) +#else +#define M32R_LOCK __STR(ld) +#define M32R_UNLOCK __STR(st) +#endif +#ifdef __ASSEMBLY__ #undef ENTRY #define ENTRY(name) ENTRY_M name .macro ENTRY_M name @@ -22,12 +35,13 @@ ALIGN \name: .endm +#endif -/* - * LDIMM: load immediate value - * - * STI: enable interruption - * CLI: disable interruption + +/** + * LDIMM - load immediate value + * STI - enable interruption + * CLI - disable interruption */ #ifdef __ASSEMBLY__ @@ -38,7 +52,7 @@ or3 \reg, \reg, #low(\x) .endm -#if !defined(CONFIG_CHIP_M32102) +#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104)) #define STI(reg) STI_M reg .macro STI_M reg setpsw #0x40 -> nop @@ -50,7 +64,7 @@ clrpsw #0x40 -> nop ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1). .endm -#else /* CONFIG_CHIP_M32102 */ +#else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ #define STI(reg) STI_M reg .macro STI_M reg mvfc \reg, psw @@ -95,6 +109,9 @@ push r13 mvfachi r13 push r13 + ldi r13, #0 + push r13 ; dummy push acc1h + push r13 ; dummy push acc1l #else #error unknown isa configuration #endif @@ -142,6 +159,8 @@ pop r13 mvtaclo r13, a1 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) + pop r13 ; dummy pop acc1h + pop r13 ; dummy pop acc1l pop r13 mvtachi r13 pop r13 @@ -177,12 +196,12 @@ and \reg, sp .endm -#if !defined(CONFIG_CHIP_M32102) +#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104)) .macro SWITCH_TO_KERNEL_STACK ; switch to kernel stack (spi) clrpsw #0x80 -> nop .endm -#else /* CONFIG_CHIP_M32102 */ +#else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ .macro SWITCH_TO_KERNEL_STACK push r0 ; save r0 for working mvfc r0, psw @@ -204,9 +223,8 @@ .fillinsn 2: .endm -#endif /* CONFIG_CHIP_M32102 */ +#endif /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ #endif /* __ASSEMBLY__ */ #endif /* _ASM_M32R_ASSEMBLER_H */ -