public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Jon Beniston <jon@beniston.com>
Cc: <gdb@sourceware.org>
Subject: Re: Memory-mapped peripheral registers, remote protocol and memory maps
Date: Thu, 29 Nov 2012 09:16:00 -0000	[thread overview]
Message-ID: <50B727B8.7040103@codesourcery.com> (raw)
In-Reply-To: <004701cdcd9d$e487ff90$ad97feb0$@beniston.com>

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 (齐尧)

  reply	other threads:[~2012-11-29  9:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28 19:24 Jon Beniston
2012-11-29  9:16 ` Yao Qi [this message]
2012-11-29 11:23   ` Jon Beniston
2012-11-29 15:51     ` Yao Qi
2012-11-29 16:32   ` Jon Beniston
2012-11-29 17:23     ` Paul_Koning
2012-11-29 17:57       ` Jon Beniston

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=50B727B8.7040103@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb@sourceware.org \
    --cc=jon@beniston.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).