diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-04-16 10:21:08 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-04-16 10:21:08 +0100 |
commit | 5539f61f5bcfb9c20da2371750320439af330f1c (patch) | |
tree | 7623555d6682d8c70c55bfa70f3a3bba2a5f8ad7 /extras/mini-os/kernel.c | |
parent | 426747a871e69c0f789bbb03de7156170c120686 (diff) | |
download | xen-5539f61f5bcfb9c20da2371750320439af330f1c.tar.gz xen-5539f61f5bcfb9c20da2371750320439af330f1c.tar.bz2 xen-5539f61f5bcfb9c20da2371750320439af330f1c.zip |
stubdom: make use of PVFB resize event
which with the offset support also permits to expose the VGA vram and
non-shared vram throught PVFB at the same time, switching between both
as appropriate.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/kernel.c')
-rw-r--r-- | extras/mini-os/kernel.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c index 6888eee508..c37644bf4f 100644 --- a/extras/mini-os/kernel.c +++ b/extras/mini-os/kernel.c @@ -297,9 +297,20 @@ static void fbfront_thread(void *p) { size_t line_length = WIDTH * (DEPTH / 8); size_t memsize = HEIGHT * line_length; + unsigned long *mfns; + int i, n = (memsize + PAGE_SIZE-1) / PAGE_SIZE; + memsize = n * PAGE_SIZE; fb = _xmalloc(memsize, PAGE_SIZE); - fb_dev = init_fbfront(NULL, fb, WIDTH, HEIGHT, DEPTH, line_length, memsize); + mfns = xmalloc_array(unsigned long, n); + for (i = 0; i < n; i++) { + /* trigger CoW */ + ((char *) fb) [i * PAGE_SIZE] = 0; + barrier(); + mfns[i] = virtual_to_mfn((char *) fb + i * PAGE_SIZE); + } + fb_dev = init_fbfront(NULL, mfns, WIDTH, HEIGHT, DEPTH, line_length, n); + xfree(mfns); if (!fb_dev) { xfree(fb); return; |