/*1* Copyright (C) 2004-2006 Atmel Corporation2*3* Based on linux/arch/arm/lib/memset.S4* Copyright (C) 1995-2000 Russell King5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License version 2 as8* published by the Free Software Foundation.9*10* ASM optimised string functions11*/12#include <asm/asm.h>1314/*15* r12: void *b16* r11: int c17* r10: size_t len18*19* Returns b in r1220*/21.text22.global memset23.type memset, @function24.align 525memset:26mov r9, r1227mov r8, r1228or r11, r11, r11 << 829andl r9, 3, COH30brne 1f31322: or r11, r11, r11 << 1633sub r10, 434brlt 5f3536/* Let's do some real work */374: st.w r8++, r1138sub r10, 439brge 4b4041/*42* When we get here, we've got less than 4 bytes to set. r1043* might be negative.44*/455: sub r10, -446reteq r124748/* Fastpath ends here, exactly 32 bytes from memset */4950/* Handle unaligned count or pointer */51bld r10, 152brcc 6f53st.b r8++, r1154st.b r8++, r1155bld r10, 056retcc r12576: st.b r8++, r1158retal r125960/* Handle unaligned pointer */611: sub r10, 462brlt 5b63add r10, r964lsl r9, 165add pc, r966st.b r8++, r1167st.b r8++, r1168st.b r8++, r1169rjmp 2b7071.size memset, . - memset727374