memory, exec: Expose all memory block related flags.

We need to use these flags in other files rather than just in exec.c,
For example, RAM_SHARED should be used when create a ram block from file.
We expose them the exec/memory.h

Backports commit b0e5de93811077254a536c23b713b49e12efb742 from qemu
This commit is contained in:
Junyan He 2018-08-22 12:59:52 -04:00 committed by Lioncash
parent 214dadf7e7
commit 6ead2c3d1f
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 20 additions and 15 deletions

View file

@ -53,21 +53,6 @@
//#define DEBUG_SUBPAGE
#if !defined(CONFIG_USER_ONLY)
/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
#define RAM_PREALLOC (1 << 0)
/* RAM is mmap-ed with MAP_SHARED */
#define RAM_SHARED (1 << 1)
/* Only a portion of RAM (used_length) is actually used, and migrated.
* This used_length size can change across reboots.
*/
#define RAM_RESIZEABLE (1 << 2)
#endif
bool set_preferred_target_page_bits(struct uc_struct *uc, int bits)
{
/* The target page size is the lowest common denominator for all

View file

@ -62,6 +62,26 @@ struct IOMMUTLBEntry {
IOMMUAccessFlags perm;
};
/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
#define RAM_PREALLOC (1 << 0)
/* RAM is mmap-ed with MAP_SHARED */
#define RAM_SHARED (1 << 1)
/* Only a portion of RAM (used_length) is actually used, and migrated.
* This used_length size can change across reboots.
*/
#define RAM_RESIZEABLE (1 << 2)
/* UFFDIO_ZEROPAGE is available on this RAMBlock to atomically
* zero the page and wake waiting processes.
* (Set during postcopy)
*/
#define RAM_UF_ZEROPAGE (1 << 3)
/* RAM can be migrated */
#define RAM_MIGRATABLE (1 << 4)
/*
* Memory region callbacks
*/