source: rtems/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc-code-copy.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 770 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup powerpc_shared
5 *
6 * @brief Code copy implementation.
7 */
8
9/*
10 * Copyright (c) 2009
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.org/license/LICENSE.
20 */
21
22#include <string.h>
23
24#include <rtems.h>
25
26#include <libcpu/powerpc-utility.h>
27
28void ppc_code_copy(void *dest, const void *src, size_t n)
29{
30  if (memcmp(dest, src, n) != 0) {
31    memcpy(dest, src, n);
32
33    rtems_cache_flush_multiple_data_lines(dest, n);
34    ppc_synchronize_data();
35
36    rtems_cache_invalidate_multiple_instruction_lines(dest, n);
37    ppc_synchronize_instructions();
38  }
39}
Note: See TracBrowser for help on using the repository browser.