Skip to content

Commit

Permalink
m2m-scaler: workaround: do not use get_system_memory call
Browse files Browse the repository at this point in the history
get_system_memory was returning a tuncated pointer (for some unknown
reason). Try to access system_memory global variable direcly instead of
calling the get_system_memory function.

(gdb) p system_memory
$1 = (MemoryRegion *) 0x555556ae16e0
(gdb) p mr
$2 = (MemoryRegion *) 0x56ae16e0
(gdb)
  • Loading branch information
karthikpoduval committed May 17, 2022
1 parent 6689cea commit 00580c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hw/misc/m2m_scaler.c
Expand Up @@ -23,7 +23,7 @@
#include "stb_image_resize.h"

//#define DEBUG_M2M_SCALER 1

extern MemoryRegion *system_memory;
#ifdef DEBUG_M2M_SCALER
#define DPRINTF(fmt, ...) \
do { printf("m2ms: " fmt , ## __VA_ARGS__); } while (0)
Expand Down Expand Up @@ -285,7 +285,7 @@ static void m2m_scaler_realize(DeviceState *dev, Error **errp) {


/* HW can read and write into entire DDR */
address_space_init(&s->dma_as, get_system_memory(), "m2m-scaler-dma");
address_space_init(&s->dma_as, system_memory, "m2m-scaler-dma");

s->stopping = false;

Expand Down
2 changes: 1 addition & 1 deletion softmmu/physmem.c
Expand Up @@ -85,7 +85,7 @@
*/
RAMList ram_list = { .blocks = QLIST_HEAD_INITIALIZER(ram_list.blocks) };

static MemoryRegion *system_memory;
MemoryRegion *system_memory;
static MemoryRegion *system_io;

AddressSpace address_space_io;
Expand Down

0 comments on commit 00580c9

Please sign in to comment.