This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] OpenRISC support for opcodes



Hi!

Here's a patch that add support for OpenRISC to opcodes.  The openrisc-*
files need to be generated from src/cgen/openrisc.cpu.

I will post a patch for "ld" and "gas" within some days, it just needs some
more work before it can be contributed.


/src/include:
2001-04-24  Johan Rydberg  <jrydberg@opencores.org>

        * dis-asm.h (print_insn_openrisc): Add prototype.

/src/opcodes:
2001-04-24  Johan Rydberg  <jrydberg@opencores.org>

        * Makefile.am: Add OpenRISC target.
        * Makefile.in: Regenerated.

        * disassemble.c (disassembler): Recognize the OpenRISC disassembly.

        * configure.in (bfd_openrisc_arch): Add target.
        * configure: Regenerated.

        * openrisc-asm.c: New file.
        * openrisc-desc.c: Likewise.
        * openrisc-desc.h: Likewise.
        * openrisc-dis.c: Likewise.
        * openrisc-ibld.c: Likewise.
        * openrisc-opc.c: Likewise.
        * openrisc-opc.h: Likewise.

/src/binutils:
2001-04-24  Johan Rydberg  <jrydberg@opencores.org>

        * NEWS: Announce support for OpenRISC.
Index: include/dis-asm.h
===================================================================
RCS file: /cvs/src/src/include/dis-asm.h,v
retrieving revision 1.23
diff -u -r1.23 dis-asm.h
--- dis-asm.h	2001/03/14 02:27:43	1.23
+++ dis-asm.h	2001/04/24 16:26:57
@@ -210,6 +210,7 @@
 extern int print_insn_mn10200		PARAMS ((bfd_vma, disassemble_info*));
 extern int print_insn_mn10300		PARAMS ((bfd_vma, disassemble_info*));
 extern int print_insn_ns32k		PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_openrisc		PARAMS ((bfd_vma, disassemble_info*));
 extern int print_insn_pdp11		PARAMS ((bfd_vma, disassemble_info*));
 extern int print_insn_big_powerpc	PARAMS ((bfd_vma, disassemble_info*));
 extern int print_insn_little_powerpc	PARAMS ((bfd_vma, disassemble_info*));
Index: opcodes/Makefile.am
===================================================================
RCS file: /cvs/src/src/opcodes/Makefile.am,v
retrieving revision 1.30
diff -u -r1.30 Makefile.am
--- Makefile.am	2001/02/27 06:43:56	1.30
+++ Makefile.am	2001/04/24 16:26:58
@@ -26,6 +26,7 @@
 	h8500-opc.h \
 	m32r-desc.h m32r-opc.h \
 	mcore-opc.h \
+	openrisc-desc.h openrisc-opc.h \
 	sh-opc.h \
 	sysdep.h \
 	ia64-asmtab.h \
@@ -97,6 +98,11 @@
 	m10300-dis.c \
 	m10300-opc.c \
 	ns32k-dis.c \
+	openrisc-asm.c \
+	openrisc-desc.c \
+	openrisc-dis.c \
+	openrisc-ibld.c \
+	openrisc-opc.c \
 	pdp11-dis.c \
 	pdp11-opc.c \
 	pj-dis.c \
@@ -173,6 +179,11 @@
 	mips-opc.lo \
 	mips16-opc.lo \
 	ns32k-dis.lo \
+	openrisc-asm.lo \
+	openrisc-desc.lo \
+	openrisc-dis.lo \
+	openrisc-ibld.lo \
+	openrisc-opc.lo \
 	pdp11-dis.lo \
 	pdp11-opc.lo \
 	pj-dis.lo \
@@ -236,7 +247,7 @@
 	$(SHELL) ./config.status --recheck
 
 CLEANFILES = \
-	stamp-m32r stamp-fr30 \
+	stamp-m32r stamp-fr30 stamp-openrisc \
 	libopcodes.a stamp-lib dep.sed DEP DEPA DEP1 DEP2
 
 
@@ -254,9 +265,11 @@
 if CGEN_MAINT
 M32R_DEPS = stamp-m32r
 FR30_DEPS = stamp-fr30
+OPENRISC_DEPS = stamp-openrisc
 else
 M32R_DEPS =
 FR30_DEPS =
+OPENRISC_DEPS = 
 endif
 
 run-cgen:
@@ -277,6 +290,11 @@
 stamp-fr30: $(CGENDEPS) $(CGENDIR)/fr30.cpu $(CGENDIR)/fr30.opc
 	$(MAKE) run-cgen arch=fr30 prefix=fr30 options= extrafiles=
 
+$(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(srcdir)/openrisc-opc.c $(srcdir)/openrisc-ibld.c $(srcdir)/openrisc-asm.c $(srcdir)/openrisc-dis.c: $(OPENRISC_DEPS)
+	@true
+stamp-openrisc: $(CGENDEPS) $(CGENDIR)/openrisc.cpu $(CGENDIR)/openrisc.opc
+	$(MAKE) run-cgen arch=openrisc prefix=openrisc options= extrafiles=
+
 ia64-gen: ia64-gen.o
 	$(LINK) ia64-gen.o $(LIBIBERTY)
 
@@ -480,6 +498,21 @@
 ns32k-dis.lo: ns32k-dis.c $(BFD_H) $(INCDIR)/ansidecl.h \
   sysdep.h config.h $(INCDIR)/dis-asm.h $(INCDIR)/opcode/ns32k.h \
   opintl.h
+openrisc-asm.lo: openrisc-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+  $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h $(INCDIR)/opcode/cgen.h \
+  openrisc-opc.h opintl.h
+openrisc-desc.lo: openrisc-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+  $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h $(INCDIR)/opcode/cgen.h \
+  openrisc-opc.h opintl.h $(INCDIR)/libiberty.h
+openrisc-dis.lo: openrisc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+  $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h \
+  $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h
+openrisc-ibld.lo: openrisc-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+  $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h \
+  $(INCDIR)/opcode/cgen.h openrisc-opc.h opintl.h
+openrisc-opc.lo: openrisc-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+  $(BFD_H) $(INCDIR)/symcat.h openrisc-desc.h $(INCDIR)/opcode/cgen.h \
+  openrisc-opc.h $(INCDIR)/libiberty.h
 pdp11-dis.lo: pdp11-dis.c $(INCDIR)/dis-asm.h $(BFD_H) \
   $(INCDIR)/ansidecl.h $(INCDIR)/opcode/pdp11.h
 pdp11-opc.lo: pdp11-opc.c $(INCDIR)/opcode/pdp11.h
Index: opcodes/configure.in
===================================================================
RCS file: /cvs/src/src/opcodes/configure.in,v
retrieving revision 1.19
diff -u -r1.19 configure.in
--- configure.in	2001/03/20 18:24:30	1.19
+++ configure.in	2001/04/24 16:26:58
@@ -195,6 +195,7 @@
 	bfd_mn10200_arch)	ta="$ta m10200-dis.lo m10200-opc.lo" ;;
 	bfd_mn10300_arch)	ta="$ta m10300-dis.lo m10300-opc.lo" ;;
 	bfd_ns32k_arch)		ta="$ta ns32k-dis.lo" ;;
+	bfd_openrisc_arch)	ta="$ta openrisc-asm.lo openrisc-desc.lo openrisc-dis.lo openrisc-ibld.lo openrisc-opc.lo" using_cgen=yes ;;
 	bfd_pdp11_arch)		ta="$ta pdp11-dis.lo pdp11-opc.lo" ;;
 	bfd_pj_arch)	        ta="$ta pj-dis.lo pj-opc.lo" ;;
 	bfd_powerpc_arch)	ta="$ta ppc-dis.lo ppc-opc.lo" ;;
Index: opcodes/disassemble.c
===================================================================
RCS file: /cvs/src/src/opcodes/disassemble.c,v
retrieving revision 1.24
diff -u -r1.24 disassemble.c
--- disassemble.c	2001/03/13 22:58:34	1.24
+++ disassemble.c	2001/04/24 16:26:58
@@ -47,6 +47,7 @@
 #define ARCH_mn10200
 #define ARCH_mn10300
 #define ARCH_ns32k
+#define ARCH_openrisc
 #define ARCH_pdp11
 #define ARCH_pj
 #define ARCH_powerpc
@@ -224,6 +225,11 @@
 #ifdef ARCH_mn10300
     case bfd_arch_mn10300:
       disassemble = print_insn_mn10300;
+      break;
+#endif
+#ifdef ARCH_openrisc
+    case bfd_arch_openrisc:
+      disassemble = print_insn_openrisc;
       break;
 #endif
 #ifdef ARCH_pdp11
Index: binutils/NEWS
===================================================================
RCS file: /cvs/src/src/binutils/NEWS,v
retrieving revision 1.13
diff -u -r1.13 NEWS
--- NEWS	2001/03/13 00:08:35	1.13
+++ NEWS	2001/04/24 16:26:58
@@ -1,5 +1,7 @@
 -*- text -*-
 
+* Support for OpenRISC by Johan Rydberg.
+
 * New command line switch to objcopy -B (or --binary-architecture) which sets
   the archiceture of the output file to the given argument.  This option only
   makes sense, if the input target is binary.  Otherwise it is ignored.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]