summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-01-16 00:33:15 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-01-16 00:33:15 +0000
commit7ae327fffcb6304c7ad0eeff379668ddbba85486 (patch)
treef60b9dde13e7e286898255ce192a1ceea2df17b2
parent10b8431a8e91a8c6a3e9ffcb41ce6570d9c0b045 (diff)
optimize accessing the md_regs through use of local vars
-rw-r--r--sys/arch/hppa/hppa/process_machdep.c142
1 files changed, 73 insertions, 69 deletions
diff --git a/sys/arch/hppa/hppa/process_machdep.c b/sys/arch/hppa/hppa/process_machdep.c
index 3c6dec881ee..3fcff9e3cc6 100644
--- a/sys/arch/hppa/hppa/process_machdep.c
+++ b/sys/arch/hppa/hppa/process_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process_machdep.c,v 1.8 2003/01/15 22:07:06 mickey Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.9 2003/01/16 00:33:14 mickey Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
@@ -44,40 +44,42 @@ process_read_regs(p, regs)
struct proc *p;
struct reg *regs;
{
- regs->r_regs[ 0] = p->p_md.md_regs->tf_sar;
- regs->r_regs[ 1] = p->p_md.md_regs->tf_r1;
- regs->r_regs[ 2] = p->p_md.md_regs->tf_rp;
- regs->r_regs[ 3] = p->p_md.md_regs->tf_r3;
- regs->r_regs[ 4] = p->p_md.md_regs->tf_r4;
- regs->r_regs[ 5] = p->p_md.md_regs->tf_r5;
- regs->r_regs[ 6] = p->p_md.md_regs->tf_r6;
- regs->r_regs[ 7] = p->p_md.md_regs->tf_r7;
- regs->r_regs[ 8] = p->p_md.md_regs->tf_r8;
- regs->r_regs[ 9] = p->p_md.md_regs->tf_r9;
- regs->r_regs[10] = p->p_md.md_regs->tf_r10;
- regs->r_regs[11] = p->p_md.md_regs->tf_r11;
- regs->r_regs[12] = p->p_md.md_regs->tf_r12;
- regs->r_regs[13] = p->p_md.md_regs->tf_r13;
- regs->r_regs[14] = p->p_md.md_regs->tf_r14;
- regs->r_regs[15] = p->p_md.md_regs->tf_r15;
- regs->r_regs[16] = p->p_md.md_regs->tf_r16;
- regs->r_regs[17] = p->p_md.md_regs->tf_r17;
- regs->r_regs[18] = p->p_md.md_regs->tf_r18;
- regs->r_regs[19] = p->p_md.md_regs->tf_t4;
- regs->r_regs[20] = p->p_md.md_regs->tf_t3;
- regs->r_regs[21] = p->p_md.md_regs->tf_t2;
- regs->r_regs[22] = p->p_md.md_regs->tf_t1;
- regs->r_regs[23] = p->p_md.md_regs->tf_arg3;
- regs->r_regs[24] = p->p_md.md_regs->tf_arg2;
- regs->r_regs[25] = p->p_md.md_regs->tf_arg1;
- regs->r_regs[26] = p->p_md.md_regs->tf_arg0;
- regs->r_regs[27] = p->p_md.md_regs->tf_dp;
- regs->r_regs[28] = p->p_md.md_regs->tf_ret0;
- regs->r_regs[29] = p->p_md.md_regs->tf_ret1;
- regs->r_regs[30] = p->p_md.md_regs->tf_sp;
- regs->r_regs[31] = p->p_md.md_regs->tf_r31;
- regs->r_pc = p->p_md.md_regs->tf_iioq_head;
- regs->r_npc = p->p_md.md_regs->tf_iioq_tail;
+ struct trapframe *tf = p->p_md.md_regs;
+
+ regs->r_regs[ 0] = tf->tf_sar;
+ regs->r_regs[ 1] = tf->tf_r1;
+ regs->r_regs[ 2] = tf->tf_rp;
+ regs->r_regs[ 3] = tf->tf_r3;
+ regs->r_regs[ 4] = tf->tf_r4;
+ regs->r_regs[ 5] = tf->tf_r5;
+ regs->r_regs[ 6] = tf->tf_r6;
+ regs->r_regs[ 7] = tf->tf_r7;
+ regs->r_regs[ 8] = tf->tf_r8;
+ regs->r_regs[ 9] = tf->tf_r9;
+ regs->r_regs[10] = tf->tf_r10;
+ regs->r_regs[11] = tf->tf_r11;
+ regs->r_regs[12] = tf->tf_r12;
+ regs->r_regs[13] = tf->tf_r13;
+ regs->r_regs[14] = tf->tf_r14;
+ regs->r_regs[15] = tf->tf_r15;
+ regs->r_regs[16] = tf->tf_r16;
+ regs->r_regs[17] = tf->tf_r17;
+ regs->r_regs[18] = tf->tf_r18;
+ regs->r_regs[19] = tf->tf_t4;
+ regs->r_regs[20] = tf->tf_t3;
+ regs->r_regs[21] = tf->tf_t2;
+ regs->r_regs[22] = tf->tf_t1;
+ regs->r_regs[23] = tf->tf_arg3;
+ regs->r_regs[24] = tf->tf_arg2;
+ regs->r_regs[25] = tf->tf_arg1;
+ regs->r_regs[26] = tf->tf_arg0;
+ regs->r_regs[27] = tf->tf_dp;
+ regs->r_regs[28] = tf->tf_ret0;
+ regs->r_regs[29] = tf->tf_ret1;
+ regs->r_regs[30] = tf->tf_sp;
+ regs->r_regs[31] = tf->tf_r31;
+ regs->r_pc = tf->tf_iioq_head;
+ regs->r_npc = tf->tf_iioq_tail;
return (0);
}
@@ -103,40 +105,42 @@ process_write_regs(p, regs)
struct proc *p;
struct reg *regs;
{
- p->p_md.md_regs->tf_sar = regs->r_regs[ 0];
- p->p_md.md_regs->tf_r1 = regs->r_regs[ 1];
- p->p_md.md_regs->tf_rp = regs->r_regs[ 2];
- p->p_md.md_regs->tf_r3 = regs->r_regs[ 3];
- p->p_md.md_regs->tf_r4 = regs->r_regs[ 4];
- p->p_md.md_regs->tf_r5 = regs->r_regs[ 5];
- p->p_md.md_regs->tf_r6 = regs->r_regs[ 6];
- p->p_md.md_regs->tf_r7 = regs->r_regs[ 7];
- p->p_md.md_regs->tf_r8 = regs->r_regs[ 8];
- p->p_md.md_regs->tf_r9 = regs->r_regs[ 9];
- p->p_md.md_regs->tf_r10 = regs->r_regs[10];
- p->p_md.md_regs->tf_r11 = regs->r_regs[11];
- p->p_md.md_regs->tf_r12 = regs->r_regs[12];
- p->p_md.md_regs->tf_r13 = regs->r_regs[13];
- p->p_md.md_regs->tf_r14 = regs->r_regs[14];
- p->p_md.md_regs->tf_r15 = regs->r_regs[15];
- p->p_md.md_regs->tf_r16 = regs->r_regs[16];
- p->p_md.md_regs->tf_r17 = regs->r_regs[17];
- p->p_md.md_regs->tf_r18 = regs->r_regs[18];
- p->p_md.md_regs->tf_t4 = regs->r_regs[19];
- p->p_md.md_regs->tf_t3 = regs->r_regs[20];
- p->p_md.md_regs->tf_t2 = regs->r_regs[21];
- p->p_md.md_regs->tf_t1 = regs->r_regs[22];
- p->p_md.md_regs->tf_arg3 = regs->r_regs[23];
- p->p_md.md_regs->tf_arg2 = regs->r_regs[24];
- p->p_md.md_regs->tf_arg1 = regs->r_regs[25];
- p->p_md.md_regs->tf_arg0 = regs->r_regs[26];
- p->p_md.md_regs->tf_dp = regs->r_regs[27];
- p->p_md.md_regs->tf_ret0 = regs->r_regs[28];
- p->p_md.md_regs->tf_ret1 = regs->r_regs[29];
- p->p_md.md_regs->tf_sp = regs->r_regs[30];
- p->p_md.md_regs->tf_r31 = regs->r_regs[31];
- p->p_md.md_regs->tf_iioq_head = regs->r_pc | 3;
- p->p_md.md_regs->tf_iioq_tail = regs->r_npc | 3;
+ struct trapframe *tf = p->p_md.md_regs;
+
+ tf->tf_sar = regs->r_regs[ 0];
+ tf->tf_r1 = regs->r_regs[ 1];
+ tf->tf_rp = regs->r_regs[ 2];
+ tf->tf_r3 = regs->r_regs[ 3];
+ tf->tf_r4 = regs->r_regs[ 4];
+ tf->tf_r5 = regs->r_regs[ 5];
+ tf->tf_r6 = regs->r_regs[ 6];
+ tf->tf_r7 = regs->r_regs[ 7];
+ tf->tf_r8 = regs->r_regs[ 8];
+ tf->tf_r9 = regs->r_regs[ 9];
+ tf->tf_r10 = regs->r_regs[10];
+ tf->tf_r11 = regs->r_regs[11];
+ tf->tf_r12 = regs->r_regs[12];
+ tf->tf_r13 = regs->r_regs[13];
+ tf->tf_r14 = regs->r_regs[14];
+ tf->tf_r15 = regs->r_regs[15];
+ tf->tf_r16 = regs->r_regs[16];
+ tf->tf_r17 = regs->r_regs[17];
+ tf->tf_r18 = regs->r_regs[18];
+ tf->tf_t4 = regs->r_regs[19];
+ tf->tf_t3 = regs->r_regs[20];
+ tf->tf_t2 = regs->r_regs[21];
+ tf->tf_t1 = regs->r_regs[22];
+ tf->tf_arg3 = regs->r_regs[23];
+ tf->tf_arg2 = regs->r_regs[24];
+ tf->tf_arg1 = regs->r_regs[25];
+ tf->tf_arg0 = regs->r_regs[26];
+ tf->tf_dp = regs->r_regs[27];
+ tf->tf_ret0 = regs->r_regs[28];
+ tf->tf_ret1 = regs->r_regs[29];
+ tf->tf_sp = regs->r_regs[30];
+ tf->tf_r31 = regs->r_regs[31];
+ tf->tf_iioq_head = regs->r_pc | 3;
+ tf->tf_iioq_tail = regs->r_npc | 3;
return (0);
}