[U-Boot] [PATCH v3 3/6] ARM: Add macros.h to be used in assemblerfile.

Peter Pearse peter.pearse at arm.com
Wed Jun 10 14:40:23 CEST 2009


Magnus

	Please ensure when writing ARM macros that any  architecture
specific instructions are

restricted to the correct architecture. 

This patch should be OK, this is just a heads up for any budding macro
writers on the list

Regards

Peter 

> -----Original Message-----
> From: u-boot-bounces at lists.denx.de 
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Magnus Lilja
> Sent: 09 June 2009 19:38
> To: u-boot at lists.denx.de
> Subject: [U-Boot] [PATCH v3 3/6] ARM: Add macros.h to be used 
> in assemblerfile.
> 
> From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
> <plagnioj at jcrosoft.com>
> ---
>  include/asm-arm/macro.h |   57 
> +++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 57 insertions(+), 0 deletions(-)  create 
> mode 100644 include/asm-arm/macro.h
> 
> diff --git a/include/asm-arm/macro.h 
> b/include/asm-arm/macro.h new file mode 100644 index 0000000..a598776
> --- /dev/null
> +++ b/include/asm-arm/macro.h
> @@ -0,0 +1,57 @@
> +/*
> + * include/asm-arm/macro.h
> + *
> + * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD 
> +<plagnioj at jcrosoft.com>
> + *
> + * See file CREDITS for list of people who contributed to this
> + *
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#ifndef __ASM_ARM_MACRO_H__
> +#define __ASM_ARM_MACRO_H__
> +#ifdef __ASSEMBLY__
> +
> +.macro	write32, addr, data
> +	ldr	r4, =\addr
> +	ldr	r5, =\data
> +	str	r5, [r4]
> +.endm
> +
> +.macro	write16, addr, data
> +	ldr	r4, =\addr
> +	ldrh	r5, =\data
> +	strh	r5, [r4]
> +.endm
> +
> +.macro	write8, addr, data
> +	ldr	r4, =\addr
> +	ldrb	r5, =\data
> +	strb	r5, [r4]
> +.endm
> +
> +.macro	wait_timer, time
> +	ldr	r4, =\time
> +1:
> +	nop
> +	subs	r4, r4, #1
> +	bcs	1b
> +.endm
> +
> +#endif /* __ASSEMBLY__ */
> +#endif /* __ASM_ARM_MACRO_H__ */
> --
> 1.5.6
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 




More information about the U-Boot mailing list