1 // SPDX-License-Identifier: GPL-2.0+
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
11 * Load/store string instructions: lswi, stswi, lswx, stswx
13 * Several consecutive bytes from a source memory buffer are loaded
14 * left to right into GPRs. After that, the bytes are stored
15 * from the GPRs into a target memory buffer. The contents
16 * of the source and target buffers are then compared.
22 #if CONFIG_POST & CONFIG_SYS_POST_CPU
24 extern void cpu_post_exec_02 (ulong *code, ulong op1, ulong op2);
25 extern void cpu_post_exec_04 (ulong *code, ulong op1, ulong op2, ulong op3,
28 #include <bedbug/regs.h>
29 int cpu_post_test_string (void)
33 int flag = disable_interrupts();
37 char src [31], dst [31];
46 for (i = 0; i < sizeof(src); i ++)
52 cpu_post_exec_02(code, (ulong)src, (ulong)dst);
54 ret = memcmp(src, dst, sizeof(dst)) == 0 ? 0 : -1;
59 char src [95], dst [95];
68 for (i = 0; i < sizeof(src); i ++)
74 cpu_post_exec_04(code, (ulong)src, (ulong)dst, 0, sizeof(src));
76 ret = memcmp(src, dst, sizeof(dst)) == 0 ? 0 : -1;
81 post_log ("Error at string test !\n");