diff options
Diffstat (limited to 'firmware/common/memset.S')
-rw-r--r-- | firmware/common/memset.S | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/firmware/common/memset.S b/firmware/common/memset.S index 038915c475..bce8936089 100644 --- a/firmware/common/memset.S +++ b/firmware/common/memset.S | |||
@@ -16,10 +16,12 @@ | |||
16 | * KIND, either express or implied. | 16 | * KIND, either express or implied. |
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "config.h" | ||
19 | 20 | ||
20 | .section .icode,"ax",@progbits | 21 | .section .icode,"ax",@progbits |
21 | 22 | ||
22 | .align 2 | 23 | .align 2 |
24 | #if CONFIG_CPU == SH7034 | ||
23 | .global _memset | 25 | .global _memset |
24 | .type _memset,@function | 26 | .type _memset,@function |
25 | 27 | ||
@@ -105,4 +107,26 @@ _memset: | |||
105 | 107 | ||
106 | .end: | 108 | .end: |
107 | .size _memset,.end-_memset | 109 | .size _memset,.end-_memset |
110 | #elif CONFIG_CPU == MCF5249 | ||
111 | .global memset | ||
112 | .type memset,@function | ||
108 | 113 | ||
114 | /* Fills a memory region with specified byte value | ||
115 | * This version is not optimized at all | ||
116 | */ | ||
117 | memset: | ||
118 | move.l (4,%sp),%a0 /* Start address */ | ||
119 | move.l (8,%sp),%d0 /* Value */ | ||
120 | move.l (12,%sp),%d1 /* Length */ | ||
121 | lea.l (%d1,%a0),%a1 /* a1 = a0+d1 */ | ||
122 | |||
123 | bra.b .byteloopend | ||
124 | |||
125 | .byteloop: | ||
126 | move.b %d0,(%a0)+ | ||
127 | .byteloopend: | ||
128 | cmp.l %a0,%a1 | ||
129 | bne.b .byteloop | ||
130 | |||
131 | rts | ||
132 | #endif | ||