source: rtems/c/src/lib/libcpu/powerpc/mpc55xx/misc/copy.S @ 97fa2f1b

4.11
Last change on this file since 97fa2f1b was 97fa2f1b, checked in by Sebastian Huber <sebastian.huber@…>, on Aug 31, 2011 at 3:50:30 PM

2011-08-31 Sebastian Huber <sebastian.huber@…>

  • mpc55xx/include/fsl-mpc551x.h, mpc55xx/include/fsl-mpc555x.h, mpc55xx/include/fsl-mpc556x.h, mpc55xx/include/fsl-mpc567x.h, mpc55xx/include/regs-edma.h, mpc55xx/include/regs-mmu.h: New files.
  • Makefile.am, M preinstall.am: Reflect changes above.
  • mpc55xx/dspi/dspi.c: Update due to API changes.
  • mpc55xx/include/edma.h, mpc55xx/edma/edma.c: Rework to support multiple eDMA modules. Removed complex error interrupt handling.
  • mpc55xx/include/esci.h, mpc55xx/esci/esci.c: Support interrupt mode and printk(). Use configure options.
  • mpc55xx/include/irq.h: More defines. API changes.
  • mpc55xx/include/mpc55xx.h: API changes.
  • mpc55xx/include/reg-defs.h: Added register defines.
  • mpc55xx/include/regs.h: Use new register header files.
  • mpc55xx/include/siu.h: Fixed includes.
  • mpc55xx/misc/fmpll.S, mpc55xx/misc/copy.S, mpc55xx/misc/flash.S: Changed sections. API changes. Support MPC5674F.
  • 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 found in the file
18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
19 */
20
21#include <libcpu/powerpc-utility.h>
22#include <bspopts.h>
23
24        .section ".bsp_start_text", "ax"
25
26/**
27 * @fn int mpc55xx_copy_8( const void *src, void *dest, size_t n)
28 *
29 * @brief Copy @a n bytes from @a src to @a dest with 8 byte reads and writes.
30 *
31 * The memory areas should not overlap.  The addresses @a src and @a dest have
32 * to be aligned on 8 byte boundaries.  The size @a n must be evenly divisible by 8.
33 * The SPE operations @b evxor, @b evlddx and @b evstddx will be used.
34 */
35#if       ((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517))
36GLOBAL_FUNCTION mpc55xx_copy_8
37#endif /* ((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517)) */
38GLOBAL_FUNCTION mpc55xx_copy_4
39        /* Loop counter = data size / 4 */
40        srwi. r5, r5, 2
41        beqlr
42        mtctr r5
43        xor   r5,r5,r5
44copy_data4:
45        lwzx  r6, r5, r3
46        stwx  r6, r5, r4
47        addi r5, r5, 4
48        bdnz copy_data4
49
50        /* Return */
51        blr
52
53#if  !((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517))
54/**
55 * @fn int mpc55xx_copy_8( const void *src, void *dest, size_t n)
56 *
57 * @brief Copy @a n bytes from @a src to @a dest with 8 byte reads and writes.
58 *
59 * The memory areas should not overlap.  The addresses @a src and @a dest have
60 * to be aligned on 8 byte boundaries.  The size @a n must be evenly divisible by 8.
61 * The SPE operations @b evxor, @b evlddx and @b evstddx will be used.
62 */
63GLOBAL_FUNCTION mpc55xx_copy_8
64        /* Loop counter = data size / 8 */
65        srwi. r5, r5, 3
66        beqlr
67        mtctr r5
68
69        /* Set offset */
70        evxor r5, r5, r5
71
72copy_data:
73        evlddx r6, r3, r5
74        evstddx r6, r4, r5
75        addi r5, r5, 8
76        bdnz copy_data
77
78        /* Return */
79        blr
80#endif /*!((MPC55XX_CHIP_TYPE>=5510) && (MPC55XX_CHIP_TYPE<=5517))*/
Note: See TracBrowser for help on using the repository browser.