From 5539f61f5bcfb9c20da2371750320439af330f1c Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 16 Apr 2008 10:21:08 +0100 Subject: 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 --- extras/mini-os/kernel.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'extras/mini-os/kernel.c') 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; -- cgit v1.2.3