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

4.104.115
Last change on this file since 359e537 was 359e537, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/09 at 05:09:41

Whitespace removal.

  • 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.com/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.