| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: db_disasm.c,v 1.34 2021/03/16 07:34:44 simonb Exp $ */ | | 1 | /* $NetBSD: db_disasm.c,v 1.35 2021/04/05 06:28:31 simonb Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1991, 1993 | | 4 | * Copyright (c) 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Ralph Campbell. | | 8 | * Ralph Campbell. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -25,27 +25,27 @@ | | | @@ -25,27 +25,27 @@ |
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | * | | 33 | * |
34 | * from: @(#)kadb.c 8.1 (Berkeley) 6/10/93 | | 34 | * from: @(#)kadb.c 8.1 (Berkeley) 6/10/93 |
35 | */ | | 35 | */ |
36 | | | 36 | |
37 | #include <sys/cdefs.h> | | 37 | #include <sys/cdefs.h> |
38 | __KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.34 2021/03/16 07:34:44 simonb Exp $"); | | 38 | __KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.35 2021/04/05 06:28:31 simonb Exp $"); |
39 | | | 39 | |
40 | #include <sys/param.h> | | 40 | #include <sys/param.h> |
41 | #include <sys/cpu.h> | | 41 | #include <sys/cpu.h> |
42 | #include <sys/systm.h> | | 42 | #include <sys/systm.h> |
43 | | | 43 | |
44 | #include <mips/locore.h> | | 44 | #include <mips/locore.h> |
45 | #include <mips/mips_opcode.h> | | 45 | #include <mips/mips_opcode.h> |
46 | #include <mips/reg.h> | | 46 | #include <mips/reg.h> |
47 | | | 47 | |
48 | #include <machine/db_machdep.h> | | 48 | #include <machine/db_machdep.h> |
49 | | | 49 | |
50 | #include <ddb/db_user.h> | | 50 | #include <ddb/db_user.h> |
51 | #include <ddb/db_interface.h> | | 51 | #include <ddb/db_interface.h> |
| @@ -583,27 +583,27 @@ db_disasm_insn(int insn, db_addr_t loc, | | | @@ -583,27 +583,27 @@ db_disasm_insn(int insn, db_addr_t loc, |
583 | reg_name[i.IType.rs], | | 583 | reg_name[i.IType.rs], |
584 | reg_name[i.IType.rt]); | | 584 | reg_name[i.IType.rt]); |
585 | pr_displ: | | 585 | pr_displ: |
586 | print_addr(loc + 4 + ((short)i.IType.imm << 2)); | | 586 | print_addr(loc + 4 + ((short)i.IType.imm << 2)); |
587 | bdslot = true; | | 587 | bdslot = true; |
588 | break; | | 588 | break; |
589 | | | 589 | |
590 | case OP_COP0: | | 590 | case OP_COP0: |
591 | switch (i.RType.rs) { | | 591 | switch (i.RType.rs) { |
592 | case OP_BCx: | | 592 | case OP_BCx: |
593 | case OP_BCy: | | 593 | case OP_BCy: |
594 | | | 594 | |
595 | db_printf("bc0%c\t", | | 595 | db_printf("bc0%c\t", |
596 | "ft"[i.RType.rt & COPz_BC_TF_MASK]); | | 596 | "ft"[i.RType.rt & COPz_BC_TRUE]); |
597 | goto pr_displ; | | 597 | goto pr_displ; |
598 | | | 598 | |
599 | case OP_MT: | | 599 | case OP_MT: |
600 | db_printf("mtc0\t%s,%s", | | 600 | db_printf("mtc0\t%s,%s", |
601 | reg_name[i.RType.rt], | | 601 | reg_name[i.RType.rt], |
602 | c0_reg[i.RType.rd]); | | 602 | c0_reg[i.RType.rd]); |
603 | break; | | 603 | break; |
604 | | | 604 | |
605 | case OP_DMT: | | 605 | case OP_DMT: |
606 | db_printf("dmtc0\t%s,%s", | | 606 | db_printf("dmtc0\t%s,%s", |
607 | reg_name[i.RType.rt], | | 607 | reg_name[i.RType.rt], |
608 | c0_reg[i.RType.rd]); | | 608 | c0_reg[i.RType.rd]); |
609 | break; | | 609 | break; |
| @@ -634,27 +634,27 @@ db_disasm_insn(int insn, db_addr_t loc, | | | @@ -634,27 +634,27 @@ db_disasm_insn(int insn, db_addr_t loc, |
634 | } | | 634 | } |
635 | /* FALLTHROUGH */ | | 635 | /* FALLTHROUGH */ |
636 | | | 636 | |
637 | default: | | 637 | default: |
638 | db_printf("%s", c0_opname[i.FRType.func]); | | 638 | db_printf("%s", c0_opname[i.FRType.func]); |
639 | } | | 639 | } |
640 | break; | | 640 | break; |
641 | | | 641 | |
642 | case OP_COP1: | | 642 | case OP_COP1: |
643 | switch (i.RType.rs) { | | 643 | switch (i.RType.rs) { |
644 | case OP_BCx: | | 644 | case OP_BCx: |
645 | case OP_BCy: | | 645 | case OP_BCy: |
646 | db_printf("bc1%c\t", | | 646 | db_printf("bc1%c\t", |
647 | "ft"[i.RType.rt & COPz_BC_TF_MASK]); | | 647 | "ft"[i.RType.rt & COPz_BC_TRUE]); |
648 | goto pr_displ; | | 648 | goto pr_displ; |
649 | | | 649 | |
650 | case OP_MT: | | 650 | case OP_MT: |
651 | db_printf("mtc1\t%s,f%d", | | 651 | db_printf("mtc1\t%s,f%d", |
652 | reg_name[i.RType.rt], | | 652 | reg_name[i.RType.rt], |
653 | i.RType.rd); | | 653 | i.RType.rd); |
654 | break; | | 654 | break; |
655 | | | 655 | |
656 | case OP_MF: | | 656 | case OP_MF: |
657 | db_printf("mfc1\t%s,f%d", | | 657 | db_printf("mfc1\t%s,f%d", |
658 | reg_name[i.RType.rt], | | 658 | reg_name[i.RType.rt], |
659 | i.RType.rd); | | 659 | i.RType.rd); |
660 | break; | | 660 | break; |
| @@ -698,27 +698,27 @@ db_disasm_insn(int insn, db_addr_t loc, | | | @@ -698,27 +698,27 @@ db_disasm_insn(int insn, db_addr_t loc, |
698 | default: | | 698 | default: |
699 | db_printf("%s.%s\tf%d,f%d,f%d", | | 699 | db_printf("%s.%s\tf%d,f%d,f%d", |
700 | cop1_name[i.FRType.func], | | 700 | cop1_name[i.FRType.func], |
701 | fmt_name[i.FRType.fmt], | | 701 | fmt_name[i.FRType.fmt], |
702 | i.FRType.fd, i.FRType.fs, i.FRType.ft); | | 702 | i.FRType.fd, i.FRType.fs, i.FRType.ft); |
703 | } | | 703 | } |
704 | break; | | 704 | break; |
705 | | | 705 | |
706 | case OP_COP2: | | 706 | case OP_COP2: |
707 | switch (i.RType.rs) { | | 707 | switch (i.RType.rs) { |
708 | case OP_BCx: | | 708 | case OP_BCx: |
709 | case OP_BCy: | | 709 | case OP_BCy: |
710 | db_printf("bc2%c\t", | | 710 | db_printf("bc2%c\t", |
711 | "ft"[i.RType.rt & COPz_BC_TF_MASK]); | | 711 | "ft"[i.RType.rt & COPz_BC_TRUE]); |
712 | goto pr_displ; | | 712 | goto pr_displ; |
713 | | | 713 | |
714 | case OP_MT: | | 714 | case OP_MT: |
715 | db_printf("mtc2\t%s,f%d", | | 715 | db_printf("mtc2\t%s,f%d", |
716 | reg_name[i.RType.rt], | | 716 | reg_name[i.RType.rt], |
717 | i.RType.rd); | | 717 | i.RType.rd); |
718 | break; | | 718 | break; |
719 | | | 719 | |
720 | case OP_MF: | | 720 | case OP_MF: |
721 | db_printf("mfc2\t%s,f%d", | | 721 | db_printf("mfc2\t%s,f%d", |
722 | reg_name[i.RType.rt], | | 722 | reg_name[i.RType.rt], |
723 | i.RType.rd); | | 723 | i.RType.rd); |
724 | break; | | 724 | break; |