We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d63921 commit 3e66498Copy full SHA for 3e66498
arch/sim/src/sim/sim_copyfullstate.c
@@ -27,6 +27,7 @@
27
#include <nuttx/config.h>
28
29
#include <stdint.h>
30
+#include <string.h>
31
#include <arch/irq.h>
32
33
#include "sim_internal.h"
@@ -45,18 +46,13 @@
45
46
47
void sim_copyfullstate(xcpt_reg_t *dest, xcpt_reg_t *src)
48
{
- int i;
49
-
50
/* In the sim model, the state is copied from the stack to the TCB,
51
* but only a reference is passed to get the state from the TCB. So the
52
* following check avoids copying the TCB save area onto itself:
53
*/
54
55
if (src != dest)
56
57
- for (i = 0; i < XCPTCONTEXT_REGS; i++)
58
- {
59
- *dest++ = *src++;
60
- }
+ memmove(dest, src, XCPTCONTEXT_REGS * sizeof(xcpt_reg_t));
61
}
62
0 commit comments