mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 12:56:46 +00:00
exec: make mmap_lock/mmap_unlock globally available
There is some iffy lock hierarchy going on in translate-all.c. To fix it, we need to take the mmap_lock in cpu-exec.c. Make the functions globally available. Backports commit 8fd19e6cfd5b6cdf028c6ac2ff4157ed831ea3a6 from qemu
This commit is contained in:
parent
62045513bb
commit
195a86283f
|
@ -371,11 +371,17 @@ void tlb_fill(CPUState *cpu, target_ulong addr, int is_write, int mmu_idx,
|
|||
#endif
|
||||
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
void mmap_lock(void);
|
||||
void mmap_unlock(void);
|
||||
|
||||
static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr)
|
||||
{
|
||||
return addr;
|
||||
}
|
||||
#else
|
||||
static inline void mmap_lock(void) {}
|
||||
static inline void mmap_unlock(void) {}
|
||||
|
||||
/* cputlb.c */
|
||||
tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr);
|
||||
#endif
|
||||
|
|
|
@ -162,6 +162,9 @@ int qemu_strnlen(const char *s, int max_len);
|
|||
* Returns: the pointer originally in @input.
|
||||
*/
|
||||
char *qemu_strsep(char **input, const char *delim);
|
||||
int qemu_strtol(const char *nptr, const char **endptr, int base,
|
||||
long *result);
|
||||
|
||||
|
||||
/*
|
||||
* strtosz() suffixes used to specify the default treatment of an
|
||||
|
|
|
@ -456,11 +456,6 @@ static inline PageDesc *page_find(struct uc_struct *uc, tb_page_addr_t index)
|
|||
return page_find_alloc(uc, index, 0);
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
#define mmap_lock() do { } while (0)
|
||||
#define mmap_unlock() do { } while (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
/* Currently it is not recommended to allocate big chunks of data in
|
||||
user mode. It will change when a dedicated libc will be used. */
|
||||
|
|
Loading…
Reference in a new issue