qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Artyom Tarasenko <atar4qemu@gmail.com>
To: Stefan Weil <weil@mail.berlios.de>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/3] cpu-common: Modify cpu_physical_memory_read and cpu_physical_memory_write
Date: Sun, 10 Apr 2011 14:37:32 +0200	[thread overview]
Message-ID: <BANLkTinfWZJNQFGsmU96RrkLqZ30D5pb-w@mail.gmail.com> (raw)
In-Reply-To: <1301170017-12368-1-git-send-email-weil@mail.berlios.de>

On Sat, Mar 26, 2011 at 9:06 PM, Stefan Weil <weil@mail.berlios.de> wrote:
> A lot of calls don't operate on bytes but on words or on structured data.
> So instead of a pointer to uint8_t, a void pointer is the better choice.

Wouldn't it make the endianness conversions more complex? uint8_t[]
has a very obvious byte order,
structured data doesn't.

> This allows removing many type casts.
>
> (Some very early implementations of memcpy used char pointers
> which were replaced by void pointers for the same reason).
>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  cpu-common.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cpu-common.h b/cpu-common.h
> index ef4e8da..f44a2b0 100644
> --- a/cpu-common.h
> +++ b/cpu-common.h
> @@ -68,12 +68,12 @@ void cpu_unregister_io_memory(int table_address);
>  void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
>                             int len, int is_write);
>  static inline void cpu_physical_memory_read(target_phys_addr_t addr,
> -                                            uint8_t *buf, int len)
> +                                            void *buf, int len)
>  {
>     cpu_physical_memory_rw(addr, buf, len, 0);
>  }
>  static inline void cpu_physical_memory_write(target_phys_addr_t addr,
> -                                             const uint8_t *buf, int len)
> +                                             const void *buf, int len)
>  {
>     cpu_physical_memory_rw(addr, (uint8_t *)buf, len, 1);
>  }
> --
> 1.7.2.5
>
>
>



-- 
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/

      parent reply	other threads:[~2011-04-10 12:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26 20:06 [Qemu-devel] [PATCH 1/3] cpu-common: Modify cpu_physical_memory_read and cpu_physical_memory_write Stefan Weil
2011-03-26 20:06 ` [Qemu-devel] [PATCH 2/3] exec: Remove a type cast which is no longer needed Stefan Weil
2011-04-09 22:37   ` Aurelien Jarno
2011-03-26 20:06 ` [Qemu-devel] [PATCH 3/3] exec: Remove some type casts which are " Stefan Weil
2011-03-26 20:11   ` [Qemu-devel] [PATCH 3/3] monitor: " Stefan Weil
2011-04-09 22:37     ` Aurelien Jarno
2011-04-09 22:37 ` [Qemu-devel] [PATCH 1/3] cpu-common: Modify cpu_physical_memory_read and cpu_physical_memory_write Aurelien Jarno
2011-04-10  6:16   ` Stefan Weil
2011-04-10 12:53     ` Aurelien Jarno
2011-04-10 15:28       ` [Qemu-devel] [PATCH 1/3 v2] " Stefan Weil
2011-04-10 12:37 ` Artyom Tarasenko [this message]

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=BANLkTinfWZJNQFGsmU96RrkLqZ30D5pb-w@mail.gmail.com \
    --to=atar4qemu@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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).