diff libiram/bcopy_words.S @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libiram/bcopy_words.S	Thu Jun 09 00:02:41 2016 +0000
@@ -0,0 +1,23 @@
+/*
+ * bcopy_aligned_words() takes the same arguments as BSD bcopy(),
+ * but requires both addresses and the count to be 32-bit word-aligned,
+ * and assumes that the source and destination memory regions
+ * do not overlap.  Furthermore, the count is expected to be non-zero.
+ *
+ * Arguments:
+ *
+ * R0: source address (word-aligned)
+ * R1: destination address (ditto)
+ * R2: byte count (must be a multiple of 4)
+ */
+
+	.text
+	.code	32
+
+	.globl	bcopy_aligned_words
+bcopy_aligned_words:
+1:	ldr	r3, [r0], #4
+	str	r3, [r1], #4
+	subs	r2, r2, #4
+	bhi	1b
+	bx	lr