From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26330 invoked by alias); 10 Nov 2008 20:28:09 -0000 Received: (qmail 26205 invoked by uid 22791); 10 Nov 2008 20:28:08 -0000 X-Spam-Check-By: sourceware.org Received: from mail.oarcorp.com (HELO OARmail.OARCORP.com) (216.186.189.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 10 Nov 2008 20:27:14 +0000 Received: from [192.168.1.3] (192.168.1.3) by OARmail.OARCORP.com (192.168.2.2) with Microsoft SMTP Server (TLS) id 8.1.311.2; Mon, 10 Nov 2008 14:23:43 -0600 Message-ID: <4918991E.8030101@oarcorp.com> Date: Mon, 10 Nov 2008 20:28:00 -0000 From: Joel Sherrill User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Doug Evans CC: "gdb-patches@sourceware.org" Subject: Re: Add SystemV IPC drivers to PSIM References: <4911CFB1.40006@oarcorp.com> <49148DF5.2060301@oarcorp.com> <20081107190039.GA25908@caradoc.them.org> <4914ABC8.7030908@oarcorp.com> In-Reply-To: Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00074.txt.bz2 Doug Evans wrote: > On Fri, Nov 7, 2008 at 12:57 PM, Joel Sherrill > wrote: > >> Daniel Jacobowitz wrote: >> >>> On Fri, Nov 07, 2008 at 12:50:29PM -0600, Joel Sherrill wrote: >>> >>> >>>> Most of it is boilerplate for adding a device. Looking >>>> at the ChangeLog, Andrew hasn't done anything >>>> except commit someone else's patch in a few years. >>>> Is anyone other than Andrew capable of reviewing it? >>>> >>>> >>> You might try asking H-P (Hans-Peter Nilsson ). >>> Beyond that, I'm not sure what to say; no one is really taking care of >>> these simulators recently. >>> >>> >>> >> Thanks. I have emailed him. >> >> Hopefully we can turn up someone. If not, what's next? >> We are using these patches in the RTEMS GDB RPMs and >> reporting test results to gcc-testresults regularly with these >> simulators. >> > > Hi. Once upon a time I hacked in the sim tree. What kind of review > is needed? I looked over the patch. It's pretty self-contained so > the risk is pretty low, and I trust you. :-) > > For reference: http://sourceware.org/ml/gdb/2008-09/msg00047.html > > The coding style seems to follow the psim style with maybe one caveat. > There's very little pretty-alignment like this in psim: > > > Got all the indentation I think. > I can't tell from reading the code what will break if sizeof(int) != > 4. How about a comment? > [lots may break, but why check for it here is what I'm getting at] > Plus could "typing problem" be more specific? > > + if (sizeof(int) != 4) > + error("hw_sem_init_data() typing problem\n"); > l > I don't have an answer for this, but I don't see any other hw*.c > verifying the address either: > You are right. This is unclear and now unnecessary. The problem was that the "registers" on the device must match the size of the integer returned by the native semctl() call for semaphore count. All accesses must be 4 bytes wide in the semaphore access code. But the code that had to deal with this has been updated to explicitly move the semaphore count into an unsigned32 so there is no restriction now. So I removed this. > + /* do we need to worry about out of range addresses? */ > > I think there's a cut-n-paste error in the sem docs. Should the > second 0xc0000000 be 0xfff00000? > I don't completely understand the device configuration syntax, but the > code checks for "value" yet you're using "reg" in the docs. Is that a > problem? [perhaps just more of the same cut-n-paste error of course] > Maybe something like -o '/sim@0xfff00000/value 0' or some such instead > of -o '/sem@0xfff00000/reg 0xfff00000 0x80000' ? > > The syntax is hard to grok. I fixed this to match what I use in my script that runs psim. 0xc0000000 for 12 bytes. > + Configure a UNIX semaphore using key 0x12345678 mapped into psim > + address space at 0xfff00000: > + > + | -o '/sem@0xfff00000/reg 0xfff00000 0x80000' \ > + | -o '/sem@0xfff00000/key 0x12345678' \ > + > + sim/ppc/run -o '/#address-cells 1' \ > + -o '/sem@0xc0000000/reg 0xc0000000 0x80000' \ > + -o '/sem@0xc0000000/key 0x12345678' ../psim-hello/hello > > Other than these nits, it's ok with me (fwiw of course). > Thanks. I think I have gotten these fixed. I will test a bit and resubmit a patch. Thanks. --joel