diff options
author | Cao jin | 2016-11-02 14:44:47 +0100 |
---|---|---|
committer | Michael Tokarev | 2017-01-24 21:26:53 +0100 |
commit | 6e4c890e15b23f078650499fbde11760b8eccf10 (patch) | |
tree | 0c606e5587a6c6a59b10d297e19ef9f5ca48f6a8 /util/oslib-win32.c | |
parent | util/mmap-alloc: check parameter before using (diff) | |
download | qemu-6e4c890e15b23f078650499fbde11760b8eccf10.tar.gz qemu-6e4c890e15b23f078650499fbde11760b8eccf10.tar.xz qemu-6e4c890e15b23f078650499fbde11760b8eccf10.zip |
util/mmap-alloc: refactor a little bit for readability
1st mmap returns *ptr* which aligns to host page size,
| size + align |
------------------------------------------
ptr
input param *align* could be 1M, or 2M, or host page size. After
QEMU_ALIGN_UP, offset will >= 0
2nd mmap use flag MAP_FIXED, then it return ptr+offset, or else fail.
If it success, then we will have something like:
| offset | size |
--------------------------------------
ptr ptr1
*ptr1* is what we really want to return, it equals ptr+offset.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'util/oslib-win32.c')
0 files changed, 0 insertions, 0 deletions