From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi7wv-0007EQ-UC for qemu-devel@nongnu.org; Wed, 07 May 2014 15:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wi7wm-0004pw-RR for qemu-devel@nongnu.org; Wed, 07 May 2014 15:56:17 -0400 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:46489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi7wm-0004pM-Jp for qemu-devel@nongnu.org; Wed, 07 May 2014 15:56:08 -0400 Received: by mail-ee0-f52.google.com with SMTP id e53so1049214eek.25 for ; Wed, 07 May 2014 12:56:07 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <536A8FD0.6000401@redhat.com> Date: Wed, 07 May 2014 21:56:00 +0200 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> <5316F701.5020500@redhat.com> In-Reply-To: <5316F701.5020500@redhat.com> 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 , Anthony Liguori , Artyom Tarasenko Il 05/03/2014 11:05, Paolo Bonzini ha scritto: > 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. Ping. I cannot fix it without access to the datasheet, though I suspect you want CG3_REG_SIZE - 1. Paolo