From: Kaushik Phatak <Kaushik.Phatak@kpitcummins.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Joel Brobecker <brobecker@adacore.com>
Subject: [RFA] New port: CR16: BFD Changes required by the gdb port
Date: Mon, 26 Nov 2012 07:04:00 -0000 [thread overview]
Message-ID: <C6CA53A2A46BA7469348BDBD663AB65848541C0B@KCHJEXMB02.kpit.com> (raw)
Hi,
Please find below a patch for CR16 BFD related changes required by the
new CR16 gdb port. The gdb port was pre-approved last week,
http://sourceware.org/ml/gdb-patches/2012-11/msg00600.html
The below changes are needed so that the cr16-tdep code can easily access
the disassembler functions. Kindly review the same and let me know
if these changes are ok.
Thanks,
Kaushik
2012-11-26 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
opcodes/ChangeLog
* cr16-dis.c (match_opcode,make_instruction: Remove static declaration.
(dwordU,wordU): Moved typedefs to opcode/cr16.h
bfd/Changelog
* config.bfd (cr16*-*-uclinux*): New target support.
include/opcode/ChangeLog
* cr16.h (dwordU,wordU): Moved typedefs from cr16-dis.c
(make_instruction,match_opcode): Added function prototypes.
(words,allWords,currInsn): Declare as extern.
diff -uprN ./gdb_src.orig/opcodes/cr16-dis.c ./gdb_src/opcodes/cr16-dis.c
--- ./gdb_src.orig/opcodes/cr16-dis.c 2012-05-17 20:43:25.000000000 +0530
+++ ./gdb_src/opcodes/cr16-dis.c 2012-11-26 11:21:43.000000000 +0530
@@ -36,9 +36,6 @@
/* Set Bit Mask - a mask to set all bits starting from offset 'offs'. */
#define SBM(offs) ((((1 << (32 - offs)) -1) << (offs)))
-typedef unsigned long dwordU;
-typedef unsigned short wordU;
-
typedef struct
{
dwordU val;
@@ -317,7 +314,7 @@ build_mask (void)
/* Search for a matching opcode. Return 1 for success, 0 for failure. */
-static int
+int
match_opcode (void)
{
unsigned long mask;
@@ -734,7 +731,7 @@ print_arguments (ins *currentInsn, bfd_v
/* Build the instruction's arguments. */
-static void
+void
make_instruction (void)
{
int i;
--- ./gdb_src.orig/bfd/config.bfd 2012-05-15 18:25:34.000000000 +0530
+++ ./gdb_src/bfd/config.bfd 2012-10-23 15:09:08.000000000 +0530
@@ -345,6 +345,11 @@ case "${targ}" in
targ_underscore=yes
;;
+ cr16*-*-uclinux*)
+ targ_defvec=bfd_elf32_cr16_vec
+ targ_underscore=yes
+ ;;
+
cr16c-*-elf*)
targ_defvec=bfd_elf32_cr16c_vec
targ_underscore=yes
--- ./gdb_src.orig/include/opcode/cr16.h 2010-04-15 15:56:09.000000000 +0530
+++ ./gdb_src/include/opcode/cr16.h 2012-11-16 12:43:59.000000000 +0530
@@ -435,4 +435,17 @@ extern const inst *instruction;
typedef long long int LONGLONG;
typedef unsigned long long ULONGLONG;
+/* Data types for opcode handling. */
+typedef unsigned long dwordU;
+typedef unsigned short wordU;
+
+/* Globals to store opcode data and build the instruction. */
+extern wordU words[3];
+extern ULONGLONG allWords;
+extern ins currInsn;
+
+/* Prototypes for function in cr16-dis.c. */
+void make_instruction (void);
+int match_opcode (void);
+
#endif /* _CR16_H_ */
next reply other threads:[~2012-11-26 7:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 7:04 Kaushik Phatak [this message]
2012-12-14 18:52 ` Pedro Alves
2012-12-28 12:18 ` Kaushik Phatak
2013-01-02 13:14 ` nick clifton
2013-01-03 11:16 ` Kaushik Phatak
2013-01-07 15:11 ` nick clifton
2013-01-08 11:24 ` Kaushik Phatak
2013-01-08 17:54 ` Pedro Alves
2013-01-15 9:24 ` Kaushik Phatak
2013-01-02 14:19 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C6CA53A2A46BA7469348BDBD663AB65848541C0B@KCHJEXMB02.kpit.com \
--to=kaushik.phatak@kpitcummins.com \
--cc=binutils@sourceware.org \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox