1/* SPDX-License-Identifier: GPL-2.0-only */ 2 3#if ENV_SEPARATE_DATA_AND_BSS 4 5/* 6 * Copy .data section content to Cache-As-Ram. 7 * This code can be included from 32 bits or 64 bits code. It also preserves 8 * registers. 9 */ 10copy_data_section: 11#if ENV_X86_64 12 push %rcx 13 push %rdi 14 push %rsi 15#else 16 pushl %ecx 17 pushl %edi 18 pushl %esi 19#endif 20 21 movl $(_edata), %ecx 22 movl $(_data), %edi 23 sub %edi, %ecx 24 movl $(_data_load),%esi 25 shrl $2, %ecx 26 rep movsl 27 28#if ENV_X86_64 29 pop %rsi 30 pop %rdi 31 pop %rcx 32#else 33 popl %esi 34 popl %edi 35 popl %ecx 36#endif 37 38#endif /* ENV_SEPARATE_DATA_AND_BSS */ 39