diff options
author | imp <imp@FreeBSD.org> | 2013-04-23 09:38:18 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2013-04-23 09:38:18 +0000 |
commit | b6d3001ad95f625e28beab8d70ee3dda101fc0c9 (patch) | |
tree | 7ba7de3b30a8314f3d076118ab43a8f033bf2de4 /sys/mips | |
parent | e04d23c5df0966fb23528fe546616c55361dd54f (diff) | |
download | FreeBSD-src-b6d3001ad95f625e28beab8d70ee3dda101fc0c9.zip FreeBSD-src-b6d3001ad95f625e28beab8d70ee3dda101fc0c9.tar.gz |
Update trapframe to be consistent with the changes made to regnum.h. This
should fix the booting problems people have been seeing.
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/include/frame.h | 13 | ||||
-rw-r--r-- | sys/mips/include/regnum.h | 8 | ||||
-rw-r--r-- | sys/mips/mips/db_interface.c | 11 | ||||
-rw-r--r-- | sys/mips/mips/trap.c | 33 | ||||
-rw-r--r-- | sys/mips/mips/vm_machdep.c | 11 |
5 files changed, 62 insertions, 14 deletions
diff --git a/sys/mips/include/frame.h b/sys/mips/include/frame.h index 05ceabd..c04888e 100644 --- a/sys/mips/include/frame.h +++ b/sys/mips/include/frame.h @@ -37,6 +37,8 @@ #ifndef _MACHINE_FRAME_H_ #define _MACHINE_FRAME_H_ +/* Note: This must also match regnum.h and regdef.h */ + struct trapframe { register_t zero; register_t ast; @@ -46,6 +48,16 @@ struct trapframe { register_t a1; register_t a2; register_t a3; +#if defined(__mips_n32) || defined(__mips_n64) + register_t a4; + register_t a5; + register_t a6; + register_t a7; + register_t t0; + register_t t1; + register_t t2; + register_t t3; +#else register_t t0; register_t t1; register_t t2; @@ -54,6 +66,7 @@ struct trapframe { register_t t5; register_t t6; register_t t7; +#endif register_t s0; register_t s1; register_t s2; diff --git a/sys/mips/include/regnum.h b/sys/mips/include/regnum.h index f94ed6c..67538e5 100644 --- a/sys/mips/include/regnum.h +++ b/sys/mips/include/regnum.h @@ -87,10 +87,10 @@ #define T1 9 #define T2 10 #define T3 11 -#define TA0 12 -#define TA1 13 -#define TA2 14 -#define TA3 15 +#define T4 12 +#define T5 13 +#define T6 14 +#define T7 15 #endif #define S0 16 #define S1 17 diff --git a/sys/mips/mips/db_interface.c b/sys/mips/mips/db_interface.c index 7ab1ec6..de7fe18 100644 --- a/sys/mips/mips/db_interface.c +++ b/sys/mips/mips/db_interface.c @@ -77,6 +77,16 @@ struct db_variable db_regs[] = { { "a1", DB_OFFSET(a1), db_frame }, { "a2", DB_OFFSET(a2), db_frame }, { "a3", DB_OFFSET(a3), db_frame }, +#if defined(__mips_n32) || defined(__mips_n64) + { "a4", DB_OFFSET(a4), db_frame }, + { "a5", DB_OFFSET(a5), db_frame }, + { "a6", DB_OFFSET(a6), db_frame }, + { "a7", DB_OFFSET(a7), db_frame }, + { "t0", DB_OFFSET(t0), db_frame }, + { "t1", DB_OFFSET(t1), db_frame }, + { "t2", DB_OFFSET(t2), db_frame }, + { "t3", DB_OFFSET(t3), db_frame }, +#else { "t0", DB_OFFSET(t0), db_frame }, { "t1", DB_OFFSET(t1), db_frame }, { "t2", DB_OFFSET(t2), db_frame }, @@ -85,6 +95,7 @@ struct db_variable db_regs[] = { { "t5", DB_OFFSET(t5), db_frame }, { "t6", DB_OFFSET(t6), db_frame }, { "t7", DB_OFFSET(t7), db_frame }, +#endif { "s0", DB_OFFSET(s0), db_frame }, { "s1", DB_OFFSET(s1), db_frame }, { "s2", DB_OFFSET(s2), db_frame }, diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c index 5b4e0aa..7b98a47 100644 --- a/sys/mips/mips/trap.c +++ b/sys/mips/mips/trap.c @@ -363,10 +363,10 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) /* * Non-o32 ABIs support more arguments in registers. */ - sa->args[3] = locr0->t4; - sa->args[4] = locr0->t5; - sa->args[5] = locr0->t6; - sa->args[6] = locr0->t7; + sa->args[3] = locr0->t0; + sa->args[4] = locr0->t1; + sa->args[5] = locr0->t2; + sa->args[6] = locr0->t3; nsaved += 4; #ifdef COMPAT_FREEBSD32 } @@ -389,10 +389,10 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) /* * Non-o32 ABIs support more arguments in registers. */ - sa->args[4] = locr0->t4; - sa->args[5] = locr0->t5; - sa->args[6] = locr0->t6; - sa->args[7] = locr0->t7; + sa->args[4] = locr0->t0; + sa->args[5] = locr0->t1; + sa->args[6] = locr0->t2; + sa->args[7] = locr0->t3; nsaved += 4; #ifdef COMPAT_FREEBSD32 } @@ -1294,12 +1294,19 @@ log_frame_dump(struct trapframe *frame) log(LOG_ERR, "\ta0: %#jx\ta1: %#jx\ta2: %#jx\ta3: %#jx\n", (intmax_t)frame->a0, (intmax_t)frame->a1, (intmax_t)frame->a2, (intmax_t)frame->a3); +#if defined(__mips_n32) || defined(__mips_n64) + log(LOG_ERR, "\ta4: %#jx\ta5: %#jx\ta6: %#jx\ta6: %#jx\n", + (intmax_t)frame->a4, (intmax_t)frame->a5, (intmax_t)frame->a6, (intmax_t)frame->a7); + + log(LOG_ERR, "\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", + (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); +#else log(LOG_ERR, "\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); log(LOG_ERR, "\tt4: %#jx\tt5: %#jx\tt6: %#jx\tt7: %#jx\n", (intmax_t)frame->t4, (intmax_t)frame->t5, (intmax_t)frame->t6, (intmax_t)frame->t7); - +#endif log(LOG_ERR, "\tt8: %#jx\tt9: %#jx\ts0: %#jx\ts1: %#jx\n", (intmax_t)frame->t8, (intmax_t)frame->t9, (intmax_t)frame->s0, (intmax_t)frame->s1); @@ -1334,13 +1341,19 @@ trap_frame_dump(struct trapframe *frame) printf("\ta0: %#jx\ta1: %#jx\ta2: %#jx\ta3: %#jx\n", (intmax_t)frame->a0, (intmax_t)frame->a1, (intmax_t)frame->a2, (intmax_t)frame->a3); +#if defined(__mips_n32) || defined(__mips_n64) + printf("\ta4: %#jx\ta5: %#jx\ta6: %#jx\ta7: %#jx\n", + (intmax_t)frame->a4, (intmax_t)frame->a5, (intmax_t)frame->a6, (intmax_t)frame->a7); printf("\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); +#else + printf("\tt0: %#jx\tt1: %#jx\tt2: %#jx\tt3: %#jx\n", + (intmax_t)frame->t0, (intmax_t)frame->t1, (intmax_t)frame->t2, (intmax_t)frame->t3); printf("\tt4: %#jx\tt5: %#jx\tt6: %#jx\tt7: %#jx\n", (intmax_t)frame->t4, (intmax_t)frame->t5, (intmax_t)frame->t6, (intmax_t)frame->t7); - +#endif printf("\tt8: %#jx\tt9: %#jx\ts0: %#jx\ts1: %#jx\n", (intmax_t)frame->t8, (intmax_t)frame->t9, (intmax_t)frame->s0, (intmax_t)frame->s1); diff --git a/sys/mips/mips/vm_machdep.c b/sys/mips/mips/vm_machdep.c index 76a520f..d3b6fd1 100644 --- a/sys/mips/mips/vm_machdep.c +++ b/sys/mips/mips/vm_machdep.c @@ -613,6 +613,16 @@ dump_trapframe(struct trapframe *trapframe) DB_PRINT_REG(trapframe, a1); DB_PRINT_REG(trapframe, a2); DB_PRINT_REG(trapframe, a3); +#if defined(__mips_n32) || defined(__mips_n64) + DB_PRINT_REG(trapframe, a4); + DB_PRINT_REG(trapframe, a5); + DB_PRINT_REG(trapframe, a6); + DB_PRINT_REG(trapframe, a7); + DB_PRINT_REG(trapframe, t0); + DB_PRINT_REG(trapframe, t1); + DB_PRINT_REG(trapframe, t2); + DB_PRINT_REG(trapframe, t3); +#else DB_PRINT_REG(trapframe, t0); DB_PRINT_REG(trapframe, t1); DB_PRINT_REG(trapframe, t2); @@ -621,6 +631,7 @@ dump_trapframe(struct trapframe *trapframe) DB_PRINT_REG(trapframe, t5); DB_PRINT_REG(trapframe, t6); DB_PRINT_REG(trapframe, t7); +#endif DB_PRINT_REG(trapframe, s0); DB_PRINT_REG(trapframe, s1); DB_PRINT_REG(trapframe, s2); |