forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/h8300/kernel/ptrace.c
....@@ -87,20 +87,15 @@
8787
8888 static int regs_get(struct task_struct *target,
8989 const struct user_regset *regset,
90
- unsigned int pos, unsigned int count,
91
- void *kbuf, void __user *ubuf)
90
+ struct membuf to)
9291 {
9392 int r;
94
- struct user_regs_struct regs;
95
- long *reg = (long *)&regs;
9693
97
- /* build user regs in buffer */
98
- BUILD_BUG_ON(sizeof(regs) % sizeof(long) != 0);
99
- for (r = 0; r < sizeof(regs) / sizeof(long); r++)
100
- *reg++ = h8300_get_reg(target, r);
94
+ BUILD_BUG_ON(sizeof(struct user_regs_struct) % sizeof(long) != 0);
95
+ for (r = 0; r < ELF_NGREG; r++)
96
+ membuf_store(&to, h8300_get_reg(target, r));
10197
102
- return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
103
- &regs, 0, sizeof(regs));
98
+ return 0;
10499 }
105100
106101 static int regs_set(struct task_struct *target,
....@@ -139,7 +134,7 @@
139134 .n = ELF_NGREG,
140135 .size = sizeof(long),
141136 .align = sizeof(long),
142
- .get = regs_get,
137
+ .regset_get = regs_get,
143138 .set = regs_set,
144139 },
145140 };