On 05/14/2012 08:23 PM, David Gibson wrote:
On Mon, May 14, 2012 at 07:42:00PM -0500, Anthony Liguori wrote:
On 05/09/2012 11:48 PM, Benjamin Herrenschmidt wrote:
From: David Gibson<da...@gibson.dropbear.id.au>
[snip]
@@ -3581,6 +3581,59 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, 
uint8_t *buf,
      }
  }

+void cpu_physical_memory_zero(target_phys_addr_t addr, int len)
+{

I'd think a memset() like interface would be better but...

I can work with that.

We should definitely implement this function in terms of
cpu_physical_memory_write instead of open coding the logic again.

Hrm.  Having solved merge conflicts several times by recopying the
cpu_physical_memory_rw() logic, I can certainly see the attraction in
that.  However, the point of this function is *not* to have to
allocate a temporary buffer, and I don't really see how to combine the
logic without that.

Just use a fixed buffer (uint8_t buffer[512]) and call cpu_physical_memory_rw multiple times with an offset.

Regards,

Anthony Liguori




Reply via email to