From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL8iF-0001Sc-4Y for qemu-devel@nongnu.org; Wed, 05 Mar 2014 05:06:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL8i6-00063Y-NZ for qemu-devel@nongnu.org; Wed, 05 Mar 2014 05:06:07 -0500 Received: from mail-qc0-x22b.google.com ([2607:f8b0:400d:c01::22b]:53787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL8i6-00063Q-JG for qemu-devel@nongnu.org; Wed, 05 Mar 2014 05:05:58 -0500 Received: by mail-qc0-f171.google.com with SMTP id x13so840729qcv.2 for ; Wed, 05 Mar 2014 02:05:58 -0800 (PST) Sender: Paolo Bonzini Message-ID: <5316F701.5020500@redhat.com> Date: Wed, 05 Mar 2014 11:05:53 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1392800720-2765-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1392800720-2765-2-git-send-email-mark.cave-ayland@ilande.co.uk> In-Reply-To: <1392800720-2765-2-git-send-email-mark.cave-ayland@ilande.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv3 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland , qemu-devel@nongnu.org Cc: Blue Swirl , Peter Maydell , Bob Breuer , Artyom Tarasenko , Anthony Liguori Il 19/02/2014 10:05, Mark Cave-Ayland ha scritto: > +#define CG3_REG_SIZE 0x20 > + > +#define CG3_REG_FBC_CTRL 0x10 > +#define CG3_REG_FBC_STATUS 0x11 > +#define CG3_REG_FBC_CURSTART 0x12 > +#define CG3_REG_FBC_CUREND 0x13 > +#define CG3_REG_FBC_VCTRL 0x14 > + > +typedef struct CG3State { ... > + uint8_t regs[16]; ... > + case CG3_REG_FBC_CURSTART ... CG3_REG_SIZE: > + val = s->regs[addr - 0x10]; > + break; > + default: Something weird here, you can access regs[16] if addr == CG3_REG_SIZE. The same happens in the write path. Paolo