4.104.115
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 | |
---|
28 | void 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.