diff options
-rw-r--r-- | pci-arbiter/main.c | 9 | ||||
-rw-r--r-- | rumpdisk/main.c | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pci-arbiter/main.c b/pci-arbiter/main.c index 510e7dbc..602a545c 100644 --- a/pci-arbiter/main.c +++ b/pci-arbiter/main.c @@ -203,8 +203,17 @@ main (int argc, char **argv) if (next_task != MACH_PORT_NULL) { + /* We are a bootstrap process */ + machdev_register (&pci_arbiter_emulation_ops); machdev_trivfs_init (argc, argv, next_task, "pci", NULL /* _SERVERS_BUS "pci" */, &bootstrap); + + /* Make sure we will not swap out, in case we are needed for swapping + back in. */ + err = mlockall(MCL_CURRENT | MCL_FUTURE); + if (err) + error (1, errno, "cannot lock all memory"); + machdev_device_init (); err = pthread_create (&t, NULL, machdev_server, NULL); if (err) diff --git a/rumpdisk/main.c b/rumpdisk/main.c index bafe0250..a1873c31 100644 --- a/rumpdisk/main.c +++ b/rumpdisk/main.c @@ -25,6 +25,7 @@ #include <error.h> #include <argp.h> #include <version.h> +#include <sys/mman.h> #include "libmachdev/machdev.h" #include "block-rump.h" @@ -113,6 +114,13 @@ main (int argc, char **argv) rump_register_block (); machdev_trivfs_init (argc, argv, bootstrap_resume_task, "rumpdisk", "/dev/rumpdisk", &bootstrap); + + /* Make sure we will not swap out, in case we drive the disk used for + swapping. */ + err = mlockall(MCL_CURRENT | MCL_FUTURE); + if (err) + error (1, errno, "cannot lock all memory"); + machdev_device_init (); err = pthread_create (&t, NULL, machdev_server, NULL); if (err) |