mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
hw/xen: Use XEN_PAGE_SIZE in PV backend drivers
XC_PAGE_SIZE comes from the actual Xen libraries, while XEN_PAGE_SIZE is provided by QEMU itself in xen_backend_ops.h. For backends which may be built for emulation mode, use the latter. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Paul Durrant <paul@xen.org>
This commit is contained in:
parent
7a8a749da7
commit
a9ae1418b3
4 changed files with 20 additions and 20 deletions
|
@ -489,13 +489,13 @@ static int xenfb_map_fb(struct XenFB *xenfb)
|
|||
}
|
||||
|
||||
if (xenfb->pixels) {
|
||||
munmap(xenfb->pixels, xenfb->fbpages * XC_PAGE_SIZE);
|
||||
munmap(xenfb->pixels, xenfb->fbpages * XEN_PAGE_SIZE);
|
||||
xenfb->pixels = NULL;
|
||||
}
|
||||
|
||||
xenfb->fbpages = DIV_ROUND_UP(xenfb->fb_len, XC_PAGE_SIZE);
|
||||
xenfb->fbpages = DIV_ROUND_UP(xenfb->fb_len, XEN_PAGE_SIZE);
|
||||
n_fbdirs = xenfb->fbpages * mode / 8;
|
||||
n_fbdirs = DIV_ROUND_UP(n_fbdirs, XC_PAGE_SIZE);
|
||||
n_fbdirs = DIV_ROUND_UP(n_fbdirs, XEN_PAGE_SIZE);
|
||||
|
||||
pgmfns = g_new0(xen_pfn_t, n_fbdirs);
|
||||
fbmfns = g_new0(xen_pfn_t, xenfb->fbpages);
|
||||
|
@ -528,8 +528,8 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
|
|||
{
|
||||
size_t mfn_sz = sizeof_field(struct xenfb_page, pd[0]);
|
||||
size_t pd_len = sizeof_field(struct xenfb_page, pd) / mfn_sz;
|
||||
size_t fb_pages = pd_len * XC_PAGE_SIZE / mfn_sz;
|
||||
size_t fb_len_max = fb_pages * XC_PAGE_SIZE;
|
||||
size_t fb_pages = pd_len * XEN_PAGE_SIZE / mfn_sz;
|
||||
size_t fb_len_max = fb_pages * XEN_PAGE_SIZE;
|
||||
int max_width, max_height;
|
||||
|
||||
if (fb_len_lim > fb_len_max) {
|
||||
|
@ -930,7 +930,7 @@ static void fb_disconnect(struct XenLegacyDevice *xendev)
|
|||
* instead. This releases the guest pages and keeps qemu happy.
|
||||
*/
|
||||
qemu_xen_foreignmem_unmap(fb->pixels, fb->fbpages);
|
||||
fb->pixels = mmap(fb->pixels, fb->fbpages * XC_PAGE_SIZE,
|
||||
fb->pixels = mmap(fb->pixels, fb->fbpages * XEN_PAGE_SIZE,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON,
|
||||
-1, 0);
|
||||
if (fb->pixels == MAP_FAILED) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue