diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-07-08 20:30:03 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-07-08 20:30:03 +0000 |
commit | 5a3e4e5b14c2e870e13497d4b145d7e7c4d3327b (patch) | |
tree | 0776d4b7c064d0d521d247af272c6c4ffeb35d58 /sys/arch/alpha | |
parent | 9becd4b1d520f960c8cae483abb795ce3f25669b (diff) |
Fix copyright. Remove unused cruft. Natural reg ordering. SP setting from
Theo.
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r-- | sys/arch/alpha/alpha/db_interface.c | 96 |
1 files changed, 34 insertions, 62 deletions
diff --git a/sys/arch/alpha/alpha/db_interface.c b/sys/arch/alpha/alpha/db_interface.c index 444b70c42ca..31d3aa988a5 100644 --- a/sys/arch/alpha/alpha/db_interface.c +++ b/sys/arch/alpha/alpha/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.2 1997/07/06 17:19:25 niklas Exp $ */ +/* $OpenBSD: db_interface.c,v 1.3 1997/07/08 20:30:02 niklas Exp $ */ /* * Copyright (c) 1997 Niklas Hallqvist. All rights reserverd. @@ -13,23 +13,20 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * This product includes software developed by Niklas Hallqvist. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> @@ -55,6 +52,19 @@ void kdbprinttrap __P((int, int)); struct db_variable db_regs[] = { { "v0", (long *)&ddb_regs.tf_regs[FRAME_V0], FCN_NULL, }, + { "a0", (long *)&ddb_regs.tf_regs[FRAME_A0], FCN_NULL, }, + { "a1", (long *)&ddb_regs.tf_regs[FRAME_A1], FCN_NULL, }, + { "a2", (long *)&ddb_regs.tf_regs[FRAME_A2], FCN_NULL, }, + { "a3", (long *)&ddb_regs.tf_regs[FRAME_A3], FCN_NULL, }, + { "a4", (long *)&ddb_regs.tf_regs[FRAME_A4], FCN_NULL, }, + { "a5", (long *)&ddb_regs.tf_regs[FRAME_A5], FCN_NULL, }, + { "s0", (long *)&ddb_regs.tf_regs[FRAME_S0], FCN_NULL, }, + { "s1", (long *)&ddb_regs.tf_regs[FRAME_S1], FCN_NULL, }, + { "s2", (long *)&ddb_regs.tf_regs[FRAME_S2], FCN_NULL, }, + { "s3", (long *)&ddb_regs.tf_regs[FRAME_S3], FCN_NULL, }, + { "s4", (long *)&ddb_regs.tf_regs[FRAME_S4], FCN_NULL, }, + { "s5", (long *)&ddb_regs.tf_regs[FRAME_S5], FCN_NULL, }, + { "s6", (long *)&ddb_regs.tf_regs[FRAME_S6], FCN_NULL, }, { "t0", (long *)&ddb_regs.tf_regs[FRAME_T0], FCN_NULL, }, { "t1", (long *)&ddb_regs.tf_regs[FRAME_T1], FCN_NULL, }, { "t2", (long *)&ddb_regs.tf_regs[FRAME_T2], FCN_NULL, }, @@ -63,30 +73,17 @@ struct db_variable db_regs[] = { { "t5", (long *)&ddb_regs.tf_regs[FRAME_T5], FCN_NULL, }, { "t6", (long *)&ddb_regs.tf_regs[FRAME_T6], FCN_NULL, }, { "t7", (long *)&ddb_regs.tf_regs[FRAME_T7], FCN_NULL, }, - { "s0", (long *)&ddb_regs.tf_regs[FRAME_S0], FCN_NULL, }, - { "s1", (long *)&ddb_regs.tf_regs[FRAME_S1], FCN_NULL, }, - { "s2", (long *)&ddb_regs.tf_regs[FRAME_S2], FCN_NULL, }, - { "s3", (long *)&ddb_regs.tf_regs[FRAME_S3], FCN_NULL, }, - { "s4", (long *)&ddb_regs.tf_regs[FRAME_S4], FCN_NULL, }, - { "s5", (long *)&ddb_regs.tf_regs[FRAME_S5], FCN_NULL, }, - { "s6", (long *)&ddb_regs.tf_regs[FRAME_S6], FCN_NULL, }, - { "a3", (long *)&ddb_regs.tf_regs[FRAME_A3], FCN_NULL, }, - { "a4", (long *)&ddb_regs.tf_regs[FRAME_A4], FCN_NULL, }, - { "a5", (long *)&ddb_regs.tf_regs[FRAME_A5], FCN_NULL, }, { "t8", (long *)&ddb_regs.tf_regs[FRAME_T8], FCN_NULL, }, { "t9", (long *)&ddb_regs.tf_regs[FRAME_T9], FCN_NULL, }, { "t10", (long *)&ddb_regs.tf_regs[FRAME_T10], FCN_NULL, }, { "t11", (long *)&ddb_regs.tf_regs[FRAME_T11], FCN_NULL, }, - { "ra", (long *)&ddb_regs.tf_regs[FRAME_RA], FCN_NULL, }, { "t12", (long *)&ddb_regs.tf_regs[FRAME_T12], FCN_NULL, }, { "at", (long *)&ddb_regs.tf_regs[FRAME_AT], FCN_NULL, }, - { "sp", (long *)&ddb_regs.tf_regs[FRAME_SP], FCN_NULL, }, - { "ps", (long *)&ddb_regs.tf_regs[FRAME_PS], FCN_NULL, }, - { "pc", (long *)&ddb_regs.tf_regs[FRAME_PC], FCN_NULL, }, { "gp", (long *)&ddb_regs.tf_regs[FRAME_GP], FCN_NULL, }, - { "a0", (long *)&ddb_regs.tf_regs[FRAME_A0], FCN_NULL, }, - { "a1", (long *)&ddb_regs.tf_regs[FRAME_A1], FCN_NULL, }, - { "a2", (long *)&ddb_regs.tf_regs[FRAME_A2], FCN_NULL, }, + { "pc", (long *)&ddb_regs.tf_regs[FRAME_PC], FCN_NULL, }, + { "ps", (long *)&ddb_regs.tf_regs[FRAME_PS], FCN_NULL, }, + { "ra", (long *)&ddb_regs.tf_regs[FRAME_RA], FCN_NULL, }, + { "sp", (long *)&ddb_regs.tf_regs[FRAME_SP], FCN_NULL, }, }; struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); @@ -171,16 +168,9 @@ kdb_trap(type, code, regs) /* XXX Should switch to kdb`s own stack here. */ + db_printf("db_regs at %p\n", regs); ddb_regs = *regs; -#if 0 /* XXX leave this until later */ - if (KERNELMODE(regs->tf_cs, regs->tf_eflags)) { - /* - * Kernel mode - esp and ss not saved - */ - ddb_regs.tf_esp = (int)®s->tf_esp; /* kernel stack pointer */ - asm("movw %%ss,%w0" : "=r" (ddb_regs.tf_ss)); - } -#endif + ddb_regs.tf_regs[FRAME_SP] = (u_long)regs + FRAME_SW_SIZE*8; s = splhigh(); db_active++; @@ -190,25 +180,7 @@ kdb_trap(type, code, regs) db_active--; splx(s); -#if 0 /* XXX save until later... */ - regs->tf_es = ddb_regs.tf_es; - regs->tf_ds = ddb_regs.tf_ds; - regs->tf_edi = ddb_regs.tf_edi; - regs->tf_esi = ddb_regs.tf_esi; - regs->tf_ebp = ddb_regs.tf_ebp; - regs->tf_ebx = ddb_regs.tf_ebx; - regs->tf_edx = ddb_regs.tf_edx; - regs->tf_ecx = ddb_regs.tf_ecx; - regs->tf_eax = ddb_regs.tf_eax; - regs->tf_eip = ddb_regs.tf_eip; - regs->tf_cs = ddb_regs.tf_cs; - regs->tf_eflags = ddb_regs.tf_eflags; - if (!KERNELMODE(regs->tf_cs, regs->tf_eflags)) { - /* ring transit - saved esp and ss valid */ - regs->tf_esp = ddb_regs.tf_esp; - regs->tf_ss = ddb_regs.tf_ss; - } -#endif + /* XXX set regs from ddb_regs here */ return (1); } |