mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 03:11:09 +00:00
memory: add memory_region_set_size
Add API to change MR size. Will be used internally for RAM resize. Backports commit e7af4c67300b3f9382e96f7a6741a5992116b2d2 from qemu
This commit is contained in:
parent
73c55b2eb3
commit
dce38dd8eb
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_aarch64
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_aarch64
|
||||
#define memory_region_set_readonly memory_region_set_readonly_aarch64
|
||||
#define memory_region_set_size memory_region_set_size_aarch64
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_aarch64
|
||||
#define memory_region_size memory_region_size_aarch64
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_aarch64
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_aarch64eb
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_aarch64eb
|
||||
#define memory_region_set_readonly memory_region_set_readonly_aarch64eb
|
||||
#define memory_region_set_size memory_region_set_size_aarch64eb
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_aarch64eb
|
||||
#define memory_region_size memory_region_size_aarch64eb
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_aarch64eb
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_arm
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_arm
|
||||
#define memory_region_set_readonly memory_region_set_readonly_arm
|
||||
#define memory_region_set_size memory_region_set_size_arm
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_arm
|
||||
#define memory_region_size memory_region_size_arm
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_arm
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_armeb
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_armeb
|
||||
#define memory_region_set_readonly memory_region_set_readonly_armeb
|
||||
#define memory_region_set_size memory_region_set_size_armeb
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_armeb
|
||||
#define memory_region_size memory_region_size_armeb
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_armeb
|
||||
|
|
|
@ -2115,6 +2115,7 @@ symbols = (
|
|||
'memory_region_set_enabled',
|
||||
'memory_region_set_global_locking',
|
||||
'memory_region_set_readonly',
|
||||
'memory_region_set_size',
|
||||
'memory_region_set_skip_dump',
|
||||
'memory_region_size',
|
||||
'memory_region_test_and_clear_dirty',
|
||||
|
|
|
@ -713,6 +713,16 @@ void memory_region_set_enabled(MemoryRegion *mr, bool enabled);
|
|||
*/
|
||||
void memory_region_set_address(MemoryRegion *mr, hwaddr addr);
|
||||
|
||||
/*
|
||||
* memory_region_set_size: dynamically update the size of a region.
|
||||
*
|
||||
* Dynamically updates the size of a region.
|
||||
*
|
||||
* @mr: the region to be updated
|
||||
* @size: used size of the region.
|
||||
*/
|
||||
void memory_region_set_size(MemoryRegion *mr, uint64_t size);
|
||||
|
||||
/*
|
||||
* memory_region_set_alias_offset: dynamically update a memory alias's offset
|
||||
*
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_m68k
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_m68k
|
||||
#define memory_region_set_readonly memory_region_set_readonly_m68k
|
||||
#define memory_region_set_size memory_region_set_size_m68k
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_m68k
|
||||
#define memory_region_size memory_region_size_m68k
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_m68k
|
||||
|
|
|
@ -1475,6 +1475,22 @@ void memory_region_set_enabled(MemoryRegion *mr, bool enabled)
|
|||
memory_region_transaction_commit(mr->uc);
|
||||
}
|
||||
|
||||
void memory_region_set_size(MemoryRegion *mr, uint64_t size)
|
||||
{
|
||||
Int128 s = int128_make64(size);
|
||||
|
||||
if (size == UINT64_MAX) {
|
||||
s = int128_2_64();
|
||||
}
|
||||
if (int128_eq(s, mr->size)) {
|
||||
return;
|
||||
}
|
||||
memory_region_transaction_begin(mr->uc);
|
||||
mr->size = s;
|
||||
mr->uc->memory_region_update_pending = true;
|
||||
memory_region_transaction_commit(mr->uc);
|
||||
}
|
||||
|
||||
static void memory_region_readd_subregion(MemoryRegion *mr)
|
||||
{
|
||||
MemoryRegion *container = mr->container;
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_mips
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_mips
|
||||
#define memory_region_set_readonly memory_region_set_readonly_mips
|
||||
#define memory_region_set_size memory_region_set_size_mips
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_mips
|
||||
#define memory_region_size memory_region_size_mips
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_mips
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_mips64
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_mips64
|
||||
#define memory_region_set_readonly memory_region_set_readonly_mips64
|
||||
#define memory_region_set_size memory_region_set_size_mips64
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_mips64
|
||||
#define memory_region_size memory_region_size_mips64
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_mips64
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_mips64el
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_mips64el
|
||||
#define memory_region_set_readonly memory_region_set_readonly_mips64el
|
||||
#define memory_region_set_size memory_region_set_size_mips64el
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_mips64el
|
||||
#define memory_region_size memory_region_size_mips64el
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_mips64el
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_mipsel
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_mipsel
|
||||
#define memory_region_set_readonly memory_region_set_readonly_mipsel
|
||||
#define memory_region_set_size memory_region_set_size_mipsel
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_mipsel
|
||||
#define memory_region_size memory_region_size_mipsel
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_mipsel
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_powerpc
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_powerpc
|
||||
#define memory_region_set_readonly memory_region_set_readonly_powerpc
|
||||
#define memory_region_set_size memory_region_set_size_powerpc
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_powerpc
|
||||
#define memory_region_size memory_region_size_powerpc
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_powerpc
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_sparc
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_sparc
|
||||
#define memory_region_set_readonly memory_region_set_readonly_sparc
|
||||
#define memory_region_set_size memory_region_set_size_sparc
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_sparc
|
||||
#define memory_region_size memory_region_size_sparc
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_sparc
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_sparc64
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_sparc64
|
||||
#define memory_region_set_readonly memory_region_set_readonly_sparc64
|
||||
#define memory_region_set_size memory_region_set_size_sparc64
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_sparc64
|
||||
#define memory_region_size memory_region_size_sparc64
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_sparc64
|
||||
|
|
|
@ -2109,6 +2109,7 @@
|
|||
#define memory_region_set_enabled memory_region_set_enabled_x86_64
|
||||
#define memory_region_set_global_locking memory_region_set_global_locking_x86_64
|
||||
#define memory_region_set_readonly memory_region_set_readonly_x86_64
|
||||
#define memory_region_set_size memory_region_set_size_x86_64
|
||||
#define memory_region_set_skip_dump memory_region_set_skip_dump_x86_64
|
||||
#define memory_region_size memory_region_size_x86_64
|
||||
#define memory_region_test_and_clear_dirty memory_region_test_and_clear_dirty_x86_64
|
||||
|
|
Loading…
Reference in a new issue