mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 05:21:10 +00:00
memory: Get rid of address_space_init_shareable
Since FlatViews are shared now and ASes not, this gets rid of address_space_init_shareable(). This should cause no behavioural change. Backports commit b516572f31c0ea0937cd9d11d9bd72dd83809886 from qemu
This commit is contained in:
parent
34709f52ee
commit
1fd8b64072
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_aarch64
|
||||
#define address_space_init address_space_init_aarch64
|
||||
#define address_space_init_dispatch address_space_init_dispatch_aarch64
|
||||
#define address_space_init_shareable address_space_init_shareable_aarch64
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_aarch64
|
||||
#define address_space_ldl address_space_ldl_aarch64
|
||||
#define address_space_ldl_be address_space_ldl_be_aarch64
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_aarch64eb
|
||||
#define address_space_init address_space_init_aarch64eb
|
||||
#define address_space_init_dispatch address_space_init_dispatch_aarch64eb
|
||||
#define address_space_init_shareable address_space_init_shareable_aarch64eb
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_aarch64eb
|
||||
#define address_space_ldl address_space_ldl_aarch64eb
|
||||
#define address_space_ldl_be address_space_ldl_be_aarch64eb
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_arm
|
||||
#define address_space_init address_space_init_arm
|
||||
#define address_space_init_dispatch address_space_init_dispatch_arm
|
||||
#define address_space_init_shareable address_space_init_shareable_arm
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_arm
|
||||
#define address_space_ldl address_space_ldl_arm
|
||||
#define address_space_ldl_be address_space_ldl_be_arm
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_armeb
|
||||
#define address_space_init address_space_init_armeb
|
||||
#define address_space_init_dispatch address_space_init_dispatch_armeb
|
||||
#define address_space_init_shareable address_space_init_shareable_armeb
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_armeb
|
||||
#define address_space_ldl address_space_ldl_armeb
|
||||
#define address_space_ldl_be address_space_ldl_be_armeb
|
||||
|
|
|
@ -66,7 +66,6 @@ symbols = (
|
|||
'address_space_get_flatview',
|
||||
'address_space_init',
|
||||
'address_space_init_dispatch',
|
||||
'address_space_init_shareable',
|
||||
'address_space_get_iotlb_entry',
|
||||
'address_space_ldl',
|
||||
'address_space_ldl_be',
|
||||
|
|
|
@ -222,9 +222,10 @@ struct AddressSpace {
|
|||
/* All fields are private. */
|
||||
char *name;
|
||||
MemoryRegion *root;
|
||||
int ref_count;
|
||||
bool malloced;
|
||||
|
||||
/* Accessed via RCU. */
|
||||
struct FlatView *current_map;
|
||||
|
||||
struct uc_struct* uc;
|
||||
|
||||
QTAILQ_HEAD(memory_listeners_as, MemoryListener) listeners;
|
||||
|
@ -966,24 +967,6 @@ MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
|
|||
*/
|
||||
void address_space_init(struct uc_struct *uc, AddressSpace *as, MemoryRegion *root, const char *name);
|
||||
|
||||
/**
|
||||
* address_space_init_shareable: return an address space for a memory region,
|
||||
* creating it if it does not already exist
|
||||
*
|
||||
* @root: a #MemoryRegion that routes addresses for the address space
|
||||
* @name: an address space name. The name is only used for debugging
|
||||
* output.
|
||||
*
|
||||
* This function will return a pointer to an existing AddressSpace
|
||||
* which was initialized with the specified MemoryRegion, or it will
|
||||
* create and initialize one if it does not already exist. The ASes
|
||||
* are reference-counted, so the memory will be freed automatically
|
||||
* when the AddressSpace is destroyed via address_space_destroy.
|
||||
*/
|
||||
AddressSpace *address_space_init_shareable(struct uc_struct* uc,
|
||||
MemoryRegion *root,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* address_space_destroy: destroy an address space
|
||||
*
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_m68k
|
||||
#define address_space_init address_space_init_m68k
|
||||
#define address_space_init_dispatch address_space_init_dispatch_m68k
|
||||
#define address_space_init_shareable address_space_init_shareable_m68k
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_m68k
|
||||
#define address_space_ldl address_space_ldl_m68k
|
||||
#define address_space_ldl_be address_space_ldl_be_m68k
|
||||
|
|
|
@ -1884,10 +1884,8 @@ void address_space_init(struct uc_struct *uc, AddressSpace *as, MemoryRegion *ro
|
|||
}
|
||||
|
||||
memory_region_transaction_begin(uc);
|
||||
as->ref_count = 1;
|
||||
as->uc = uc;
|
||||
as->root = root;
|
||||
as->malloced = false;
|
||||
as->current_map = NULL;
|
||||
QTAILQ_INIT(&as->listeners);
|
||||
QTAILQ_INSERT_TAIL(&uc->address_spaces, as, address_spaces_link);
|
||||
|
@ -1898,9 +1896,6 @@ void address_space_init(struct uc_struct *uc, AddressSpace *as, MemoryRegion *ro
|
|||
|
||||
static void do_address_space_destroy(AddressSpace *as)
|
||||
{
|
||||
// Unicorn: commented out
|
||||
bool do_free = as->malloced;
|
||||
|
||||
// TODO(danghvu): why assert fail here?
|
||||
//QTAILQ_FOREACH(listener, &as->uc->memory_listeners, link) {
|
||||
// assert(QTAILQ_EMPTY(&as->listeners));
|
||||
|
@ -1911,30 +1906,12 @@ static void do_address_space_destroy(AddressSpace *as)
|
|||
// Unicorn: commented out
|
||||
//g_free(as->ioeventfds);
|
||||
memory_region_unref(as->root);
|
||||
if (do_free) {
|
||||
g_free(as);
|
||||
}
|
||||
}
|
||||
|
||||
AddressSpace *address_space_init_shareable(struct uc_struct *uc, MemoryRegion *root, const char *name)
|
||||
{
|
||||
AddressSpace *as;
|
||||
|
||||
as = g_malloc0(sizeof *as);
|
||||
address_space_init(uc, as, root, name);
|
||||
as->malloced = true;
|
||||
return as;
|
||||
}
|
||||
|
||||
void address_space_destroy(AddressSpace *as)
|
||||
{
|
||||
MemoryRegion *root = as->root;
|
||||
|
||||
as->ref_count--;
|
||||
if (as->ref_count) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Flush out anything from MemoryListeners listening in on this */
|
||||
memory_region_transaction_begin(as->uc);
|
||||
as->root = NULL;
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_mips
|
||||
#define address_space_init address_space_init_mips
|
||||
#define address_space_init_dispatch address_space_init_dispatch_mips
|
||||
#define address_space_init_shareable address_space_init_shareable_mips
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_mips
|
||||
#define address_space_ldl address_space_ldl_mips
|
||||
#define address_space_ldl_be address_space_ldl_be_mips
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_mips64
|
||||
#define address_space_init address_space_init_mips64
|
||||
#define address_space_init_dispatch address_space_init_dispatch_mips64
|
||||
#define address_space_init_shareable address_space_init_shareable_mips64
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_mips64
|
||||
#define address_space_ldl address_space_ldl_mips64
|
||||
#define address_space_ldl_be address_space_ldl_be_mips64
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_mips64el
|
||||
#define address_space_init address_space_init_mips64el
|
||||
#define address_space_init_dispatch address_space_init_dispatch_mips64el
|
||||
#define address_space_init_shareable address_space_init_shareable_mips64el
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_mips64el
|
||||
#define address_space_ldl address_space_ldl_mips64el
|
||||
#define address_space_ldl_be address_space_ldl_be_mips64el
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_mipsel
|
||||
#define address_space_init address_space_init_mipsel
|
||||
#define address_space_init_dispatch address_space_init_dispatch_mipsel
|
||||
#define address_space_init_shareable address_space_init_shareable_mipsel
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_mipsel
|
||||
#define address_space_ldl address_space_ldl_mipsel
|
||||
#define address_space_ldl_be address_space_ldl_be_mipsel
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_powerpc
|
||||
#define address_space_init address_space_init_powerpc
|
||||
#define address_space_init_dispatch address_space_init_dispatch_powerpc
|
||||
#define address_space_init_shareable address_space_init_shareable_powerpc
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_powerpc
|
||||
#define address_space_ldl address_space_ldl_powerpc
|
||||
#define address_space_ldl_be address_space_ldl_be_powerpc
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_sparc
|
||||
#define address_space_init address_space_init_sparc
|
||||
#define address_space_init_dispatch address_space_init_dispatch_sparc
|
||||
#define address_space_init_shareable address_space_init_shareable_sparc
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_sparc
|
||||
#define address_space_ldl address_space_ldl_sparc
|
||||
#define address_space_ldl_be address_space_ldl_be_sparc
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_sparc64
|
||||
#define address_space_init address_space_init_sparc64
|
||||
#define address_space_init_dispatch address_space_init_dispatch_sparc64
|
||||
#define address_space_init_shareable address_space_init_shareable_sparc64
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_sparc64
|
||||
#define address_space_ldl address_space_ldl_sparc64
|
||||
#define address_space_ldl_be address_space_ldl_be_sparc64
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#define address_space_get_flatview address_space_get_flatview_x86_64
|
||||
#define address_space_init address_space_init_x86_64
|
||||
#define address_space_init_dispatch address_space_init_dispatch_x86_64
|
||||
#define address_space_init_shareable address_space_init_shareable_x86_64
|
||||
#define address_space_get_iotlb_entry address_space_get_iotlb_entry_x86_64
|
||||
#define address_space_ldl address_space_ldl_x86_64
|
||||
#define address_space_ldl_be address_space_ldl_be_x86_64
|
||||
|
|
Loading…
Reference in a new issue