From patchwork Fri Sep 25 12:06:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bennett X-Patchwork-Id: 8849 Received: (qmail 34630 invoked by alias); 25 Sep 2015 12:06:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 34608 invoked by uid 89); 25 Sep 2015 12:06:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, MIME_BASE64_BLANKS, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Sep 2015 12:06:39 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id BF8207C78E73; Fri, 25 Sep 2015 13:06:30 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 25 Sep 2015 13:06:32 +0100 Received: from LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9]) by LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9%17]) with mapi id 14.03.0210.002; Fri, 25 Sep 2015 13:06:32 +0100 From: Andrew Bennett To: Mike Frysinger CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH] Add micromips support to the MIPS simulator Date: Fri, 25 Sep 2015 12:06:31 +0000 Message-ID: <0DA23CC379F5F945ACB41CF394B9827721126A60@LEMAIL01.le.imgtec.org> References: <0DA23CC379F5F945ACB41CF394B9827720F51185@LEMAIL01.le.imgtec.org> <20150224054441.GA6655@vapier> <0DA23CC379F5F945ACB41CF394B98277211129DE@LEMAIL01.le.imgtec.org> <20150917044236.GB6834@vapier.lan> In-Reply-To: <20150917044236.GB6834@vapier.lan> MIME-Version: 1.0 X-IsSubscribed: yes > > No, they are required for some of the macros used in the file so they need > to > > stay in. > > this needs to be documented as to why. other ports don't need this, and > it sounds like something wrong with the mips port that should be fixed at > some point. The definitions come from the *_support.h files generated by igen and are required because they are used in some of the macros in the micromipsrun.c file. Unfortunately we can not just blindly include the *_support.h files to get these definitions because some of the defines in these files are specific for a particular configuration of the simulator for example instruction word size is 16 bits for micromips16 and 32 bits for micromips32. This means we could break future code changes by doing this, so a safer approach is to just extract the defines that we need to get the file to compile. I have added a comment above the defines which explains this. The diff from my previous patch is below. Ok to commit? Many thanks, Andrew diff --git a/sim/mips/micromipsrun.c b/sim/mips/micromipsrun.c index 7dd10d7..c39138b 100644 --- a/sim/mips/micromipsrun.c +++ b/sim/mips/micromipsrun.c @@ -26,6 +26,14 @@ #include "bfd.h" #include "sim-engine.h" +/* These definitions come from the *_support.h files generated by igen and are + required because they are used in some of the macros in the code below. + Unfortunately we can not just blindly include the *_support.h files to get + these definitions because some of the defines in these files are specific + for a particular configuration of the simulator for example instruction word + size is 16 bits for micromips16 and 32 bits for micromips32. This means we + could break future code changes by doing this, so a safer approach is to just + extract the defines that we need to get this file to compile. */ #define SD sd #define CPU cpu