From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL 3/8] m68k: Add NeXTcube machine
Date: Wed, 18 Sep 2019 11:27:04 +0200 [thread overview]
Message-ID: <a2777e04-be95-b0a1-7ada-e2624823a585@redhat.com> (raw)
In-Reply-To: <CAFEAcA-cDGV-=dDTOcTZv+a5ffd5gq9YVPnbKS3e9vi-QkndOw@mail.gmail.com>
On 16/09/2019 12.48, Peter Maydell wrote:
> On Sat, 7 Sep 2019 at 16:47, Thomas Huth <huth@tuxfamily.org> wrote:
>>
>> It is still quite incomplete (no SCSI, no floppy emulation, no network,
>> etc.), but the firmware already shows up the debug monitor prompt in the
>> framebuffer display, so at least the very basics are already working.
>>
>> This code has been taken from Bryce Lanham's GSoC 2011 NeXT branch at
>>
>> https://github.com/blanham/qemu-NeXT/blob/next-cube/hw/next-cube.c
>>
>> and altered quite a bit to fit the latest interface and coding conventions
>> of the current QEMU.
>>
>> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Message-Id: <20190831074519.32613-4-huth@tuxfamily.org>
>> Signed-off-by: Thomas Huth <huth@tuxfamily.org
>
> Hi; Coverity spotted an issue in this function
> (CID 1405664):
>
>
>> +static void nextscr2_write(NeXTState *s, uint32_t val, int size)
>> +{
>> + static int led;
>> + static int phase;
>> + static uint8_t old_scr2;
>> + static uint8_t rtc_command;
>> + static uint8_t rtc_value;
>> + static uint8_t rtc_status = 0x90;
>> + static uint8_t rtc_return;
>> + uint8_t scr2_2;
>> +
>
>
>> + /* read the status 0x31 */
>> + if (rtc_command == 0x31) {
>> + scr2_2 = scr2_2 & (~SCR2_RTDATA);
>> + /* for now 0x00 */
>> + if (0x00 & (0x80 >> (phase - 8))) {
>
> 0 & anything can never be true, so the line below here is dead code.
Right. I'm going to have a closer look at this at the weekend, to see
what's the best way to fix it or whether it should simply be removed.
>> + scr2_2 |= SCR2_RTDATA;
>> + }
>> + rtc_return = (rtc_return << 1) |
>> + ((scr2_2 & SCR2_RTDATA) ? 1 : 0);
>> + }
>> +
>
> Incidentally, I see that this file has quite a lot of
> what seems to be essentially device emulation code in it
> (a bunch of IO MemoryRegions defined locally) -- ideally
> these could be split out into proper device objects at
> some point.
Yeah, it's all old code from 2011 ... I'll keep this in mind for future
clean-ups!
Thanks,
Thomas
next prev parent reply other threads:[~2019-09-18 9:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-07 15:47 [Qemu-devel] [PULL 0/8] Add the m68k next-cube machine Thomas Huth
2019-09-07 15:47 ` [Qemu-devel] [PULL 1/8] m68k: Add NeXTcube framebuffer device emulation Thomas Huth
2019-09-07 15:47 ` [Qemu-devel] [PULL 2/8] m68k: Add NeXTcube keyboard device Thomas Huth
2019-09-07 15:47 ` [Qemu-devel] [PULL 3/8] m68k: Add NeXTcube machine Thomas Huth
2019-09-16 10:48 ` Peter Maydell
2019-09-18 9:27 ` Thomas Huth [this message]
2019-09-07 15:47 ` [Qemu-devel] [PULL 4/8] escc: introduce a selector for the register bit Thomas Huth
2019-09-07 15:47 ` [Qemu-devel] [PULL 5/8] m68k: Add serial controller to the NeXTcube machine Thomas Huth
2019-09-07 15:47 ` [Qemu-devel] [PULL 6/8] m68k: Add an entry for the NeXTcube machine to the MAINTAINERS file Thomas Huth
2019-09-07 15:47 ` [Qemu-devel] [PULL 7/8] tests/acceptance: Add test of NeXTcube framebuffer using OCR Thomas Huth
2019-09-10 12:02 ` Peter Maydell
2019-09-10 12:07 ` Thomas Huth
2019-09-10 12:58 ` Philippe Mathieu-Daudé
2019-09-07 15:47 ` [Qemu-devel] [PULL 8/8] .travis.yml: Let the avocado job run the NeXTcube tests Thomas Huth
2019-09-09 14:43 ` [Qemu-devel] [PULL 0/8] Add the m68k next-cube machine Peter Maydell
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=a2777e04-be95-b0a1-7ada-e2624823a585@redhat.com \
--to=thuth@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).