summaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-30 20:58:55 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-30 20:58:55 +0100
commit81fb68fee81769d81c373e3af5a508d706b7e3d6 (patch)
treea35512d5b133430a4df44fad20bfb5d94d3b7243 /console
parent0e99041e8b1ce80e6a97944a195c6e6cddf451fd (diff)
wire console display pages
to work around improper handling of getting paged out. * console/display.c (user_create): Call vm_wire() on the created user data.
Diffstat (limited to 'console')
-rw-r--r--console/display.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/console/display.c b/console/display.c
index 98c70f50..ed5571e6 100644
--- a/console/display.c
+++ b/console/display.c
@@ -814,6 +814,21 @@ user_create (display_t display, uint32_t width, uint32_t height,
user->cursor.status = CONS_CURSOR_NORMAL;
conchar_memset (user->_matrix, chr, attr,
user->screen.width * user->screen.lines);
+
+ /* FIXME: it seems we don't properly handle getting paged out.
+ * For now, just wire the pages to work around the issue. */
+ {
+ mach_port_t host;
+
+ error_t err = get_privileged_ports (&host, NULL);
+ if (err)
+ host = mach_host_self ();
+
+ vm_wire (host, mach_task_self (), (vm_offset_t) user,
+ (vm_size_t) npages * vm_page_size, VM_PROT_READ);
+ if (host != mach_host_self ())
+ mach_port_deallocate (mach_task_self (), host);
+ }
return 0;
}