-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
monitor: Add support for write command #1589
base: master
Are you sure you want to change the base?
Changes from all commits
1457044
f13bfe3
206596b
7a22cac
5533e88
199445f
bf0193b
b96f564
30eea59
6d275c5
203597b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,16 @@ | |
#include "qom/object.h" | ||
#include "trace.h" | ||
|
||
#include "exec/address-spaces.h" | ||
#include "exec/memory-internal.h" | ||
#include "exec/ram_addr.h" | ||
#include "hw/boards.h" | ||
#include "hw/core/cpu.h" | ||
#include "migration/vmstate.h" | ||
#include "qemu/accel.h" | ||
#include "sysemu/kvm.h" | ||
#include "sysemu/runstate.h" | ||
#include "sysemu/tcg.h" | ||
#include "qemu/accel.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above re header order |
||
#include "hw/boards.h" | ||
#include "migration/vmstate.h" | ||
#include "exec/address-spaces.h" | ||
|
||
//#define DEBUG_UNASSIGNED | ||
|
||
|
@@ -3595,6 +3596,28 @@ void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled) | |
} | ||
} | ||
|
||
|
||
void ram_write(hwaddr addr, void *ptr, hwaddr len, int is_physical) | ||
{ | ||
MemoryRegion *sm = get_system_memory(); | ||
MemoryRegion *mr; | ||
uint8_t *buf = ptr; | ||
CPUState *cs = qemu_get_cpu(0); | ||
if (is_physical) { | ||
QTAILQ_FOREACH (mr, &sm->subregions, subregions_link) { | ||
if (strcmp(memory_region_name(mr), "xbox.ram") == 0) { | ||
uint8_t *ram_ptr = qemu_map_ram_ptr(mr->ram_block, addr); | ||
memcpy(ram_ptr, buf, len); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there not an existing physical memory write function somewhere? Anyway, we should check here that we don't accidentally write out of bounds |
||
break; | ||
} | ||
} | ||
} else { | ||
if (cpu_memory_rw_debug(cs, addr, buf, len, 1) < 0) { | ||
qemu_printf("Cannot access memory\n"); | ||
} | ||
} | ||
} | ||
|
||
void memory_region_init_ram(MemoryRegion *mr, | ||
Object *owner, | ||
const char *name, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert any non-essential changes to this header order