Skip to content

Commit c9d4cb2

Browse files
Dave Martinkees
authored andcommitted
sparc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names
Instead of having the core code guess the note name for each regset, use USER_REGSET_NOTE_TYPE() to pick the correct name from elf.h. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Cc: David S. Miller <davem@davemloft.net> Cc: Andreas Larsson <andreas@gaisler.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Kees Cook <kees@kernel.org> Cc: Akihiko Odaki <akihiko.odaki@daynix.com> Cc: sparclinux@vger.kernel.org Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Link: https://lore.kernel.org/r/20250701135616.29630-20-Dave.Martin@arm.com Signed-off-by: Kees Cook <kees@kernel.org>
1 parent afe74ee commit c9d4cb2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

arch/sparc/kernel/ptrace_32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static const struct user_regset sparc32_regsets[] = {
218218
* PSR, PC, nPC, Y, WIM, TBR
219219
*/
220220
[REGSET_GENERAL] = {
221-
.core_note_type = NT_PRSTATUS,
221+
USER_REGSET_NOTE_TYPE(PRSTATUS),
222222
.n = 38,
223223
.size = sizeof(u32), .align = sizeof(u32),
224224
.regset_get = genregs32_get, .set = genregs32_set
@@ -234,7 +234,7 @@ static const struct user_regset sparc32_regsets[] = {
234234
* FPU QUEUE (64 32-bit ints)
235235
*/
236236
[REGSET_FP] = {
237-
.core_note_type = NT_PRFPREG,
237+
USER_REGSET_NOTE_TYPE(PRFPREG),
238238
.n = 99,
239239
.size = sizeof(u32), .align = sizeof(u32),
240240
.regset_get = fpregs32_get, .set = fpregs32_set

arch/sparc/kernel/ptrace_64.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static const struct user_regset sparc64_regsets[] = {
420420
* TSTATE, TPC, TNPC, Y
421421
*/
422422
[REGSET_GENERAL] = {
423-
.core_note_type = NT_PRSTATUS,
423+
USER_REGSET_NOTE_TYPE(PRSTATUS),
424424
.n = 36,
425425
.size = sizeof(u64), .align = sizeof(u64),
426426
.regset_get = genregs64_get, .set = genregs64_set
@@ -432,7 +432,7 @@ static const struct user_regset sparc64_regsets[] = {
432432
* FPRS
433433
*/
434434
[REGSET_FP] = {
435-
.core_note_type = NT_PRFPREG,
435+
USER_REGSET_NOTE_TYPE(PRFPREG),
436436
.n = 35,
437437
.size = sizeof(u64), .align = sizeof(u64),
438438
.regset_get = fpregs64_get, .set = fpregs64_set
@@ -750,7 +750,7 @@ static const struct user_regset sparc32_regsets[] = {
750750
* PSR, PC, nPC, Y, WIM, TBR
751751
*/
752752
[REGSET_GENERAL] = {
753-
.core_note_type = NT_PRSTATUS,
753+
USER_REGSET_NOTE_TYPE(PRSTATUS),
754754
.n = 38,
755755
.size = sizeof(u32), .align = sizeof(u32),
756756
.regset_get = genregs32_get, .set = genregs32_set
@@ -766,7 +766,7 @@ static const struct user_regset sparc32_regsets[] = {
766766
* FPU QUEUE (64 32-bit ints)
767767
*/
768768
[REGSET_FP] = {
769-
.core_note_type = NT_PRFPREG,
769+
USER_REGSET_NOTE_TYPE(PRFPREG),
770770
.n = 99,
771771
.size = sizeof(u32), .align = sizeof(u32),
772772
.regset_get = fpregs32_get, .set = fpregs32_set

0 commit comments

Comments
 (0)