From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4966 invoked by alias); 29 Nov 2012 09:16:14 -0000 Received: (qmail 4954 invoked by uid 22791); 29 Nov 2012 09:16:12 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 09:16:05 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Te0E0-0003uL-JP from Yao_Qi@mentor.com ; Thu, 29 Nov 2012 01:16:04 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 29 Nov 2012 01:16:04 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Thu, 29 Nov 2012 01:16:03 -0800 Message-ID: <50B727B8.7040103@codesourcery.com> Date: Thu, 29 Nov 2012 09:16:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Jon Beniston CC: Subject: Re: Memory-mapped peripheral registers, remote protocol and memory maps References: <004701cdcd9d$e487ff90$ad97feb0$@beniston.com> In-Reply-To: <004701cdcd9d$e487ff90$ad97feb0$@beniston.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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: 2012-11/txt/msg00089.txt.bz2 On 11/29/2012 03:23 AM, Jon Beniston wrote: > How is the access of memory-mapped peripheral registers handled over the > remote protocol? By this, I mean how can you force a 32-bit read/write, > rather than 4 byte accesses, to read/write a 32-bit memory-mapper register? > > I can see that you can define memory regions with the mem command, and set > the memory access size to 32, but how does this map over the remote > protocol? The remote protocol documentation for the 'm' packet says: "The > stub need not use any particular size or alignment when gathering data from > memory for the response; even if addr is word-aligned and length is a > multiple of the word size, the stub is free to use byte accesses, or not. > For this reason, this packet may not be suitable for accessing memory-mapped > I/O devices.". Is there another packet that is suitable? It doesn't look > like the code in remote.c uses this attribute. I don't understand your problem. Anything wrong when you use 'm' packet to read the content of memory-mapped register? Supposing a 32-bit register is mapped at address 0x00d000, packet 'm 0x0x00d000 4' should be able read the contents of this register. Your stub should know where each register is mapped, and when gets a 'm' packet, get the content of register by some way, and reply it to GDB. In this way, the memory-mapped registers are transparent to GDB, and user has to access them via address. -- Yao (齐尧)