aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-05-28 00:13:17 -0400
committerVineet Gupta <vgupta@synopsys.com>2013-06-22 09:53:22 -0400
commit2fa919045b72ec892e17d56f888e6af4260b7629 (patch)
tree1f0f89110514c07939666d6b1f225b3e8dff6be3 /arch/arc
parent283237a04fd332bddc2ac298e6ad7d23a1fc4b99 (diff)
ARC: pt_regs update #2: Remove unused gutter at start of pt_regs
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/include/asm/entry.h16
-rw-r--r--arch/arc/include/asm/ptrace.h6
-rw-r--r--arch/arc/include/uapi/asm/ptrace.h11
-rw-r--r--arch/arc/kernel/ptrace.c8
4 files changed, 15 insertions, 26 deletions
diff --git a/arch/arc/include/asm/entry.h b/arch/arc/include/asm/entry.h
index 2b274fa9c5a7..5ff7b8dd3d5b 100644
--- a/arch/arc/include/asm/entry.h
+++ b/arch/arc/include/asm/entry.h
@@ -432,9 +432,6 @@
432 st.a r9, [sp, -4] 432 st.a r9, [sp, -4]
433 lr r9, [erbta] 433 lr r9, [erbta]
434 st.a r9, [sp, -4] 434 st.a r9, [sp, -4]
435
436 /* move up by 1 word to "create" pt_regs->"stack_place_holder" */
437 sub sp, sp, 4
438.endm 435.endm
439 436
440/*-------------------------------------------------------------- 437/*--------------------------------------------------------------
@@ -474,9 +471,6 @@
474 * by hardware and that is not good. 471 * by hardware and that is not good.
475 *-------------------------------------------------------------*/ 472 *-------------------------------------------------------------*/
476.macro RESTORE_ALL_SYS 473.macro RESTORE_ALL_SYS
477
478 add sp, sp, 4 /* hop over unused "pt_regs->stack_place_holder" */
479
480 ld.ab r9, [sp, 4] 474 ld.ab r9, [sp, 4]
481 sr r9, [erbta] 475 sr r9, [erbta]
482 ld.ab r9, [sp, 4] 476 ld.ab r9, [sp, 4]
@@ -530,9 +524,6 @@
530 st.a r9, [sp, -4] 524 st.a r9, [sp, -4]
531 lr r9, [bta_l1] 525 lr r9, [bta_l1]
532 st.a r9, [sp, -4] 526 st.a r9, [sp, -4]
533
534 /* move up by 1 word to "create" pt_regs->"stack_place_holder" */
535 sub sp, sp, 4
536.endm 527.endm
537 528
538.macro SAVE_ALL_INT2 529.macro SAVE_ALL_INT2
@@ -561,9 +552,6 @@
561 st.a r9, [sp, -4] 552 st.a r9, [sp, -4]
562 lr r9, [bta_l2] 553 lr r9, [bta_l2]
563 st.a r9, [sp, -4] 554 st.a r9, [sp, -4]
564
565 /* move up by 1 word to "create" pt_regs->"stack_place_holder" */
566 sub sp, sp, 4
567.endm 555.endm
568 556
569/*-------------------------------------------------------------- 557/*--------------------------------------------------------------
@@ -577,8 +565,6 @@
577 *-------------------------------------------------------------*/ 565 *-------------------------------------------------------------*/
578 566
579.macro RESTORE_ALL_INT1 567.macro RESTORE_ALL_INT1
580 add sp, sp, 4 /* hop over unused "pt_regs->stack_place_holder" */
581
582 ld.ab r9, [sp, 4] /* Actual reg file */ 568 ld.ab r9, [sp, 4] /* Actual reg file */
583 sr r9, [bta_l1] 569 sr r9, [bta_l1]
584 ld.ab r9, [sp, 4] 570 ld.ab r9, [sp, 4]
@@ -601,8 +587,6 @@
601.endm 587.endm
602 588
603.macro RESTORE_ALL_INT2 589.macro RESTORE_ALL_INT2
604 add sp, sp, 4 /* hop over unused "pt_regs->stack_place_holder" */
605
606 ld.ab r9, [sp, 4] 590 ld.ab r9, [sp, 4]
607 sr r9, [bta_l2] 591 sr r9, [bta_l2]
608 ld.ab r9, [sp, 4] 592 ld.ab r9, [sp, 4]
diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h
index f82a3a2201b5..7491bb7428bd 100644
--- a/arch/arc/include/asm/ptrace.h
+++ b/arch/arc/include/asm/ptrace.h
@@ -17,12 +17,6 @@
17/* THE pt_regs: Defines how regs are saved during entry into kernel */ 17/* THE pt_regs: Defines how regs are saved during entry into kernel */
18 18
19struct pt_regs { 19struct pt_regs {
20 /*
21 * 1 word gutter after reg-file has been saved
22 * Technically not needed, Since SP always points to a "full" location
23 * (vs. "empty"). But pt_regs is shared with tools....
24 */
25 long res;
26 20
27 /* Real registers */ 21 /* Real registers */
28 long bta; /* bta_l1, bta_l2, erbta */ 22 long bta; /* bta_l1, bta_l2, erbta */
diff --git a/arch/arc/include/uapi/asm/ptrace.h b/arch/arc/include/uapi/asm/ptrace.h
index 30333cec0fef..e0e8403f181f 100644
--- a/arch/arc/include/uapi/asm/ptrace.h
+++ b/arch/arc/include/uapi/asm/ptrace.h
@@ -20,16 +20,19 @@
20 * 20 *
21 * This is to decouple pt_regs from user-space ABI, to be able to change it 21 * This is to decouple pt_regs from user-space ABI, to be able to change it
22 * w/o affecting the ABI. 22 * w/o affecting the ABI.
23 * Although the layout (initial padding) is similar to pt_regs to have some 23 *
24 * optimizations when copying pt_regs to/from user_regs_struct. 24 * The intermediate pad,pad2 are relics of initial layout based on pt_regs
25 * for optimizations when copying pt_regs to/from user_regs_struct.
26 * We no longer need them, but can't be changed as they are part of ABI now.
25 * 27 *
26 * Also, sigcontext only care about the scratch regs as that is what we really 28 * Also, sigcontext only care about the scratch regs as that is what we really
27 * save/restore for signal handling. 29 * save/restore for signal handling. However gdb also uses the same struct
30 * hence callee regs need to be in there too.
28*/ 31*/
29struct user_regs_struct { 32struct user_regs_struct {
30 33
34 long pad;
31 struct { 35 struct {
32 long pad;
33 long bta, lp_start, lp_end, lp_count; 36 long bta, lp_start, lp_end, lp_count;
34 long status32, ret, blink, fp, gp; 37 long status32, ret, blink, fp, gp;
35 long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0; 38 long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0;
diff --git a/arch/arc/kernel/ptrace.c b/arch/arc/kernel/ptrace.c
index c6a81c58d0f3..6e467e3585b0 100644
--- a/arch/arc/kernel/ptrace.c
+++ b/arch/arc/kernel/ptrace.c
@@ -40,6 +40,13 @@ static int genregs_get(struct task_struct *target,
40 offsetof(struct user_regs_struct, LOC), \ 40 offsetof(struct user_regs_struct, LOC), \
41 offsetof(struct user_regs_struct, LOC) + 4); 41 offsetof(struct user_regs_struct, LOC) + 4);
42 42
43#define REG_O_ZERO(LOC) \
44 if (!ret) \
45 ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf, \
46 offsetof(struct user_regs_struct, LOC), \
47 offsetof(struct user_regs_struct, LOC) + 4);
48
49 REG_O_ZERO(pad);
43 REG_O_CHUNK(scratch, callee, ptregs); 50 REG_O_CHUNK(scratch, callee, ptregs);
44 REG_O_CHUNK(callee, efa, cregs); 51 REG_O_CHUNK(callee, efa, cregs);
45 REG_O_CHUNK(efa, stop_pc, &target->thread.fault_address); 52 REG_O_CHUNK(efa, stop_pc, &target->thread.fault_address);
@@ -88,6 +95,7 @@ static int genregs_set(struct task_struct *target,
88 offsetof(struct user_regs_struct, LOC), \ 95 offsetof(struct user_regs_struct, LOC), \
89 offsetof(struct user_regs_struct, LOC) + 4); 96 offsetof(struct user_regs_struct, LOC) + 4);
90 97
98 REG_IGNORE_ONE(pad);
91 /* TBD: disallow updates to STATUS32, orig_r8 etc*/ 99 /* TBD: disallow updates to STATUS32, orig_r8 etc*/
92 REG_IN_CHUNK(scratch, callee, ptregs); /* pt_regs[bta..orig_r8] */ 100 REG_IN_CHUNK(scratch, callee, ptregs); /* pt_regs[bta..orig_r8] */
93 REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */ 101 REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */