From 38bf20931afe761fccda6e1eb91d64c7498ed9c9 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Thu, 5 Nov 2015 09:32:51 -0500 Subject: fw_cfg: add generic non-DMA read method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce fw_cfg_data_read(), a generic read method which works on all access widths (1 through 8 bytes, inclusive), and can be used during both IOPort and MMIO read accesses. To maintain legibility, only fw_cfg_data_mem_read() (the MMIO data read method) is replaced by this patch. The new method essentially unwinds the fw_cfg_data_mem_read() + fw_cfg_read() combo, but without unnecessarily repeating all the validity checks performed by the latter on each byte being read. This patch also modifies the trace_fw_cfg_read prototype to accept a 64-bit value argument, allowing it to work properly with the new read method, but also remain backward compatible with existing call sites. Cc: Laszlo Ersek Cc: Gerd Hoffmann Cc: Marc MarĂ­ Signed-off-by: Gabriel Somlo Reviewed-by: Laszlo Ersek Message-id: 1446733972-1602-6-git-send-email-somlo@cmu.edu Signed-off-by: Gerd Hoffmann --- trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'trace-events') diff --git a/trace-events b/trace-events index 2fce98e762..7fc4d114c9 100644 --- a/trace-events +++ b/trace-events @@ -196,7 +196,7 @@ ecc_diag_mem_readb(uint64_t addr, uint32_t ret) "Read diagnostic %"PRId64"= %02x # hw/nvram/fw_cfg.c fw_cfg_select(void *s, uint16_t key, int ret) "%p key %d = %d" -fw_cfg_read(void *s, uint8_t ret) "%p = %d" +fw_cfg_read(void *s, uint64_t ret) "%p = %"PRIx64 fw_cfg_add_file(void *s, int index, char *name, size_t len) "%p #%d: %s (%zd bytes)" # hw/block/hd-geometry.c -- cgit v1.2.3