From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12812 invoked by alias); 26 Nov 2012 07:04:48 -0000 Received: (qmail 12790 invoked by uid 22791); 26 Nov 2012 07:04:40 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from tx2ehsobe004.messaging.microsoft.com (HELO tx2outboundpool.messaging.microsoft.com) (65.55.88.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Nov 2012 07:04:22 +0000 Received: from mail228-tx2-R.bigfish.com (10.9.14.246) by TX2EHSOBE012.bigfish.com (10.9.40.32) with Microsoft SMTP Server id 14.1.225.23; Mon, 26 Nov 2012 07:04:21 +0000 Received: from mail228-tx2 (localhost [127.0.0.1]) by mail228-tx2-R.bigfish.com (Postfix) with ESMTP id 87906380147; Mon, 26 Nov 2012 07:04:21 +0000 (UTC) X-Forefront-Antispam-Report: CIP:59.163.77.45;KIP:(null);UIP:(null);IPV:NLI;H:KCHJEXHC01.kpit.com;RD:59.163.77.45.static.vsnl.net.in;EFVD:NLI X-SpamScore: 1 X-BigFish: VPS1(zz936eI154dI4015Izz1de0h1202h1d1ah1d2ahzz177df4h17326ah8275bh8275dhz2dh2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh162dh1631h15d0l1155h) Received: from mail228-tx2 (localhost.localdomain [127.0.0.1]) by mail228-tx2 (MessageSwitch) id 1353913459134887_3451; Mon, 26 Nov 2012 07:04:19 +0000 (UTC) Received: from TX2EHSMHS042.bigfish.com (unknown [10.9.14.240]) by mail228-tx2.bigfish.com (Postfix) with ESMTP id 1EB6CBC00B7; Mon, 26 Nov 2012 07:04:19 +0000 (UTC) Received: from KCHJEXHC01.kpit.com (59.163.77.45) by TX2EHSMHS042.bigfish.com (10.9.99.142) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 26 Nov 2012 07:04:18 +0000 Received: from KCHJEXMB02.kpit.com ([169.254.2.206]) by KCHJEXHC01.kpit.com ([172.10.15.73]) with mapi id 14.02.0247.003; Mon, 26 Nov 2012 12:33:12 +0530 From: Kaushik Phatak To: "binutils@sourceware.org" CC: "gdb-patches@sourceware.org" , Joel Brobecker Subject: [RFA] New port: CR16: BFD Changes required by the gdb port Date: Mon, 26 Nov 2012 07:04:00 -0000 Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: kpitcummins.com Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00639.txt.bz2 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 opcodes/ChangeLog * cr16-dis.c (match_opcode,make_instruction: Remove static declaration. (dwordU,wordU): Moved typedefs to opcode/cr16.h bfd/Changelog=09 * config.bfd (cr16*-*-uclinux*): New target support.=09 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. =09 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))) =20 -typedef unsigned long dwordU; -typedef unsigned short wordU; - typedef struct { dwordU val; @@ -317,7 +314,7 @@ build_mask (void) =20 /* Search for a matching opcode. Return 1 for success, 0 for failure. */ =20 -static int +int match_opcode (void) { unsigned long mask; @@ -734,7 +731,7 @@ print_arguments (ins *currentInsn, bfd_v =20 /* Build the instruction's arguments. */ =20 -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=3Dyes ;; =20 + cr16*-*-uclinux*) + targ_defvec=3Dbfd_elf32_cr16_vec + targ_underscore=3Dyes + ;; + cr16c-*-elf*) targ_defvec=3Dbfd_elf32_cr16c_vec targ_underscore=3Dyes --- ./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; =20 +/* 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_ */