source: rtems/c/src/lib/libcpu/powerpc/mpc55xx/misc/copy.S @ 0e27119

4.11
Last change on this file since 0e27119 was 0e27119, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 11, 2012 at 8:52:18 PM

Use proper 3 line form of license text

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup mpc55xx_asm
5 *
6 * @brief Memory copy functions.
7 */
8
9/*
10 * Copyright (c) 2008
11 * Embedded Brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * rtems@embedded-brains.de
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.com/license/LICENSE.
20 */
21
22#include <libcpu/powerpc-utility.h>
23#include <bspopts.h>
24
25        .section ".bsp_start_text", "ax"
26
27/**
28 * @fn int mpc55xx_copy_8( const void *src, void *dest, size_t n)
29 *
30 * @brief Copy @a n bytes from @a src to @a dest with 8 byte reads and writes.
31 *
32 * The memory areas should not overlap.  The addresses @a src and @a dest have
33 * to be aligned on 8 byte boundaries.  The size @a n must be evenly divisible by 8.
34 * The SPE operations @b evxor, @b evlddx and @b evstddx will be used.
35 */
36#if       ((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517))
37GLOBAL_FUNCTION mpc55xx_copy_8
38#endif /* ((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517)) */
39GLOBAL_FUNCTION mpc55xx_copy_4
40        /* Loop counter = data size / 4 */
41        srwi. r5, r5, 2
42        beqlr
43        mtctr r5
44        xor   r5,r5,r5
45copy_data4:
46        lwzx  r6, r5, r3
47        stwx  r6, r5, r4
48        addi r5, r5, 4
49        bdnz copy_data4
50
51        /* Return */
52        blr
53
54#if  !((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517))
55/**
56 * @fn int mpc55xx_copy_8( const void *src, void *dest, size_t n)
57 *
58 * @brief Copy @a n bytes from @a src to @a dest with 8 byte reads and writes.
59 *
60 * The memory areas should not overlap.  The addresses @a src and @a dest have
61 * to be aligned on 8 byte boundaries.  The size @a n must be evenly divisible by 8.
62 * The SPE operations @b evxor, @b evlddx and @b evstddx will be used.
63 */
64GLOBAL_FUNCTION mpc55xx_copy_8
65        /* Loop counter = data size / 8 */
66        srwi. r5, r5, 3
67        beqlr
68        mtctr r5
69
70        /* Set offset */
71        evxor r5, r5, r5
72
73copy_data:
74        evlddx r6, r3, r5
75        evstddx r6, r4, r5
76        addi r5, r5, 8
77        bdnz copy_data
78
79        /* Return */
80        blr
81#endif /*!((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517))*/
Note: See TracBrowser for help on using the repository browser.