2 * Copyright (c) 2006 The DragonFly Project. All rights reserved.
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * $DragonFly: src/sys/platform/vkernel/platform/init.c,v 1.27 2007/01/15 01:29:04 dillon Exp $
37 #include <sys/types.h>
38 #include <sys/systm.h>
39 #include <sys/kernel.h>
43 #include <sys/random.h>
44 #include <sys/vkernel.h>
46 #include <sys/reboot.h>
48 #include <sys/msgbuf.h>
49 #include <sys/vmspace.h>
50 #include <sys/socket.h>
51 #include <sys/sockio.h>
52 #include <vm/vm_page.h>
54 #include <machine/globaldata.h>
55 #include <machine/tls.h>
56 #include <machine/md_var.h>
57 #include <machine/vmparam.h>
60 #include <net/if_arp.h>
61 #include <net/ethernet.h>
62 #include <net/bridge/if_bridgevar.h>
63 #include <netinet/in.h>
64 #include <arpa/inet.h>
75 vm_paddr_t phys_avail[16];
77 vm_paddr_t Maxmem_bytes;
80 struct vknetif_info NetifInfo[VKNETIF_MAX];
85 vm_offset_t virtual_start;
86 vm_offset_t virtual_end;
87 vm_offset_t kernel_vm_end;
88 vm_offset_t crashdumpmap;
89 vm_offset_t clean_sva;
90 vm_offset_t clean_eva;
91 struct msgbuf *msgbufp;
94 vpte_t *KernelPTA; /* Warning: Offset for direct VA translation */
95 u_int cpu_feature; /* XXX */
96 u_int tsc_present; /* XXX */
98 struct privatespace *CPU_prvspace;
100 static struct trapframe proc0_tf;
101 static void *proc0paddr;
103 static void init_sys_memory(char *imageFile);
104 static void init_kern_memory(void);
105 static void init_globaldata(void);
106 static void init_vkernel(void);
107 static void init_rootdevice(char *imageFile);
108 static void init_netif(char *netifFile[], int netifFileNum);
109 static void usage(const char *ctl);
112 * Kernel startup for virtual kernels - standard main()
115 main(int ac, char **av)
117 char *memImageFile = NULL;
118 char *rootImageFile = NULL;
119 char *netifFile[VKNETIF_MAX];
121 int netifFileNum = 0;
129 while ((c = getopt(ac, av, "svm:r:e:I:")) != -1) {
133 * name=value:name=value:name=value...
136 kern_envp = malloc(n + 2);
137 for (i = 0; i < n; ++i) {
138 if (optarg[i] == ':')
141 kern_envp[i] = optarg[i];
147 boothowto |= RB_SINGLE;
153 memImageFile = optarg;
156 if (netifFileNum < VKNETIF_MAX)
157 netifFile[netifFileNum++] = optarg;
160 rootImageFile = optarg;
163 Maxmem_bytes = strtoull(optarg, &suffix, 0);
180 usage("Bad maxmem option");
190 init_sys_memory(memImageFile);
195 init_rootdevice(rootImageFile);
196 init_netif(netifFile, netifFileNum);
204 * Initialize system memory. This is the virtual kernel's 'RAM'.
208 init_sys_memory(char *imageFile)
215 * Figure out the system memory image size. If an image file was
216 * specified and -m was not specified, use the image file's size.
219 if (imageFile && stat(imageFile, &st) == 0 && Maxmem_bytes == 0)
220 Maxmem_bytes = (vm_paddr_t)st.st_size;
221 if ((imageFile == NULL || stat(imageFile, &st) < 0) &&
223 err(1, "Cannot create new memory file %s unless "
224 "system memory size is specified with -m",
230 * Maxmem must be known at this time
232 if (Maxmem_bytes < 32 * 1024 * 1024 || (Maxmem_bytes & SEG_MASK)) {
233 err(1, "Bad maxmem specification: 32MB minimum, "
234 "multiples of %dMB only",
235 SEG_SIZE / 1024 / 1024);
240 * Generate an image file name if necessary, then open/create the
241 * file exclusively locked. Do not allow multiple virtual kernels
242 * to use the same image file.
244 if (imageFile == NULL) {
245 for (i = 0; i < 1000000; ++i) {
246 asprintf(&imageFile, "/var/vkernel/memimg.%06d", i);
248 O_RDWR|O_CREAT|O_EXLOCK|O_NONBLOCK, 0644);
249 if (fd < 0 && errno == EWOULDBLOCK) {
256 fd = open(imageFile, O_RDWR|O_CREAT|O_EXLOCK|O_NONBLOCK, 0644);
258 printf("Using memory file: %s\n", imageFile);
259 if (fd < 0 || fstat(fd, &st) < 0) {
260 err(1, "Unable to open/create %s: %s",
261 imageFile, strerror(errno));
266 * Truncate or extend the file as necessary.
268 if (st.st_size > Maxmem_bytes) {
269 ftruncate(fd, Maxmem_bytes);
270 } else if (st.st_size < Maxmem_bytes) {
272 off_t off = st.st_size & ~SEG_MASK;
274 kprintf("%s: Reserving blocks for memory image\n", imageFile);
275 zmem = malloc(SEG_SIZE);
276 bzero(zmem, SEG_SIZE);
277 lseek(fd, off, SEEK_SET);
278 while (off < Maxmem_bytes) {
279 if (write(fd, zmem, SEG_SIZE) != SEG_SIZE) {
280 err(1, "Unable to reserve blocks for memory image");
286 err(1, "Unable to reserve blocks for memory image");
290 Maxmem = Maxmem_bytes >> PAGE_SHIFT;
294 * Initialize kernel memory. This reserves kernel virtual memory by using
299 init_kern_memory(void)
307 * Memory map our kernel virtual memory space. Note that the
308 * kernel image itself is not made part of this memory for the
311 * The memory map must be segment-aligned so we can properly
314 base = mmap((void *)0x40000000, KERNEL_KVA_SIZE, PROT_READ|PROT_WRITE,
315 MAP_FILE|MAP_SHARED|MAP_VPAGETABLE, MemImageFd, 0);
316 if (base == MAP_FAILED) {
317 err(1, "Unable to mmap() kernel virtual memory!");
320 madvise(base, KERNEL_KVA_SIZE, MADV_NOSYNC);
321 KvaStart = (vm_offset_t)base;
322 KvaSize = KERNEL_KVA_SIZE;
323 KvaEnd = KvaStart + KvaSize;
326 * Create a top-level page table self-mapping itself.
328 * Initialize the page directory at physical page index 0 to point
329 * to an array of page table pages starting at physical page index 1
331 lseek(MemImageFd, 0L, 0);
332 for (i = 0; i < KERNEL_KVA_SIZE / SEG_SIZE; ++i) {
333 pte = ((i + 1) * PAGE_SIZE) | VPTE_V | VPTE_R | VPTE_W;
334 write(MemImageFd, &pte, sizeof(pte));
338 * Initialize the PTEs in the page table pages required to map the
339 * page table itself. This includes mapping the page directory page
340 * at the base so we go one more loop then normal.
342 lseek(MemImageFd, PAGE_SIZE, 0);
343 for (i = 0; i <= KERNEL_KVA_SIZE / SEG_SIZE * sizeof(vpte_t); ++i) {
344 pte = (i * PAGE_SIZE) | VPTE_V | VPTE_R | VPTE_W;
345 write(MemImageFd, &pte, sizeof(pte));
349 * Initialize remaining PTEs to 0. We may be reusing a memory image
350 * file. This is approximately a megabyte.
352 i = (KERNEL_KVA_SIZE / PAGE_SIZE - i) * sizeof(pte);
353 zero = malloc(PAGE_SIZE);
354 bzero(zero, PAGE_SIZE);
356 write(MemImageFd, zero, (i > PAGE_SIZE) ? PAGE_SIZE : i);
357 i = i - ((i > PAGE_SIZE) ? PAGE_SIZE : i);
362 * Enable the page table and calculate pointers to our self-map
363 * for easy kernel page table manipulation.
365 * KernelPTA must be offset so we can do direct VA translations
367 mcontrol(base, KERNEL_KVA_SIZE, MADV_SETMAP,
368 0 | VPTE_R | VPTE_W | VPTE_V);
369 KernelPTD = (vpte_t *)base; /* pg directory */
370 KernelPTA = (vpte_t *)((char *)base + PAGE_SIZE); /* pg table pages */
371 KernelPTA -= KvaStart >> PAGE_SHIFT;
374 * phys_avail[] represents unallocated physical memory. MI code
375 * will use phys_avail[] to create the vm_page array.
377 phys_avail[0] = PAGE_SIZE +
378 KERNEL_KVA_SIZE / PAGE_SIZE * sizeof(vpte_t);
379 phys_avail[0] = (phys_avail[0] + PAGE_MASK) & ~(vm_paddr_t)PAGE_MASK;
380 phys_avail[1] = Maxmem_bytes;
383 * (virtual_start, virtual_end) represent unallocated kernel virtual
384 * memory. MI code will create kernel_map using these parameters.
386 virtual_start = KvaStart + PAGE_SIZE +
387 KERNEL_KVA_SIZE / PAGE_SIZE * sizeof(vpte_t);
388 virtual_start = (virtual_start + PAGE_MASK) & ~(vm_offset_t)PAGE_MASK;
389 virtual_end = KvaStart + KERNEL_KVA_SIZE;
392 * kernel_vm_end could be set to virtual_end but we want some
393 * indication of how much of the kernel_map we've used, so
394 * set it low and let pmap_growkernel increase it even though we
395 * don't need to create any new page table pages.
397 kernel_vm_end = virtual_start;
400 * Allocate space for process 0's UAREA.
402 proc0paddr = (void *)virtual_start;
403 for (i = 0; i < UPAGES; ++i) {
404 pmap_kenter_quick(virtual_start, phys_avail[0]);
405 virtual_start += PAGE_SIZE;
406 phys_avail[0] += PAGE_SIZE;
412 crashdumpmap = virtual_start;
413 virtual_start += MAXDUMPPGS * PAGE_SIZE;
416 * msgbufp maps the system message buffer
418 assert((MSGBUF_SIZE & PAGE_MASK) == 0);
419 msgbufp = (void *)virtual_start;
420 for (i = 0; i < (MSGBUF_SIZE >> PAGE_SHIFT); ++i) {
421 pmap_kenter_quick(virtual_start, phys_avail[0]);
422 virtual_start += PAGE_SIZE;
423 phys_avail[0] += PAGE_SIZE;
425 msgbufinit(msgbufp, MSGBUF_SIZE);
428 * used by kern_memio for /dev/mem access
430 ptvmmap = (caddr_t)virtual_start;
431 virtual_start += PAGE_SIZE;
434 * Bootstrap the kernel_pmap
440 * Map the per-cpu globaldata for cpu #0. Allocate the space using
441 * virtual_start and phys_avail[0]
445 init_globaldata(void)
452 * Reserve enough KVA to cover possible cpus. This is a considerable
453 * amount of KVA since the privatespace structure includes two
454 * whole page table mappings.
456 virtual_start = (virtual_start + SEG_MASK) & ~(vm_offset_t)SEG_MASK;
457 CPU_prvspace = (void *)virtual_start;
458 virtual_start += sizeof(struct privatespace) * SMP_MAXCPU;
461 * Allocate enough physical memory to cover the mdglobaldata
462 * portion of the space and the idle stack and map the pages
463 * into KVA. For cpu #0 only.
465 for (i = 0; i < sizeof(struct mdglobaldata); i += PAGE_SIZE) {
467 va = (vm_offset_t)&CPU_prvspace[0].mdglobaldata + i;
468 pmap_kenter_quick(va, pa);
469 phys_avail[0] += PAGE_SIZE;
471 for (i = 0; i < sizeof(CPU_prvspace[0].idlestack); i += PAGE_SIZE) {
473 va = (vm_offset_t)&CPU_prvspace[0].idlestack + i;
474 pmap_kenter_quick(va, pa);
475 phys_avail[0] += PAGE_SIZE;
479 * Setup the %gs for cpu #0. The mycpu macro works after this
482 tls_set_fs(&CPU_prvspace[0], sizeof(struct privatespace));
486 * Initialize very low level systems including thread0, proc0, etc.
492 struct mdglobaldata *gd;
494 gd = &CPU_prvspace[0].mdglobaldata;
495 bzero(gd, sizeof(*gd));
497 gd->mi.gd_curthread = &thread0;
498 thread0.td_gd = &gd->mi;
502 gd->mi.gd_prvspace = &CPU_prvspace[0];
503 mi_gdinit(&gd->mi, 0);
505 mi_proc0init(&gd->mi, proc0paddr);
506 proc0.p_lwp.lwp_md.md_regs = &proc0_tf;
511 #if 0 /* #ifdef DDB */
513 if (boothowto & RB_KDB)
514 Debugger("Boot flags requested debugger");
517 initializecpu(); /* Initialize CPU registers */
519 init_param2((phys_avail[1] - phys_avail[0]) / PAGE_SIZE);
523 * Map the message buffer
525 for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE)
526 pmap_kenter((vm_offset_t)msgbufp + off, avail_end + off);
527 msgbufinit(msgbufp, MSGBUF_SIZE);
530 thread0.td_pcb_cr3 ... MMU
531 proc0.p_lwp.lwp_md.md_regs = &proc0_tf;
536 * The root filesystem path for the virtual kernel is optional. If specified
537 * it points to a filesystem image.
539 * The virtual kernel caches data from our 'disk' just like a normal kernel,
540 * so we do not really want the real kernel to cache the data too. Use
541 * O_DIRECT to remove the duplication.
545 init_rootdevice(char *imageFile)
550 RootImageFd = open(imageFile, O_RDWR|O_DIRECT, 0644);
551 if (RootImageFd < 0 || fstat(RootImageFd, &st) < 0) {
552 err(1, "Unable to open/create %s: %s",
553 imageFile, strerror(errno));
556 rootdevnames[0] = "ufs:vkd0a";
562 netif_set_tapflags(int tap_unit, int f, int s)
567 bzero(&ifr, sizeof(ifr));
569 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "tap%d", tap_unit);
570 if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) {
571 warn("tap%d: ioctl(SIOCGIFFLAGS) failed: %s",
572 tap_unit, strerror(errno));
579 * If the flags are already set/cleared, then we return
580 * immediately to avoid extra syscalls
582 flags = (ifr.ifr_flags & 0xffff) | (ifr.ifr_flagshigh << 16);
586 if ((flags & f) == 0)
597 * Fix up ifreq.ifr_name, since it may be trashed
598 * in previous ioctl(SIOCGIFFLAGS)
600 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "tap%d", tap_unit);
602 ifr.ifr_flags = flags & 0xffff;
603 ifr.ifr_flagshigh = flags >> 16;
604 if (ioctl(s, SIOCSIFFLAGS, &ifr) < 0) {
605 warn("tap%d: ioctl(SIOCSIFFLAGS) failed: %s",
606 tap_unit, strerror(errno));
614 netif_set_tapaddr(int tap_unit, in_addr_t addr, in_addr_t mask, int s)
616 struct ifaliasreq ifra;
617 struct sockaddr_in *in;
619 bzero(&ifra, sizeof(ifra));
620 snprintf(ifra.ifra_name, sizeof(ifra.ifra_name), "tap%d", tap_unit);
623 in = (struct sockaddr_in *)&ifra.ifra_addr;
624 in->sin_family = AF_INET;
625 in->sin_len = sizeof(*in);
626 in->sin_addr.s_addr = addr;
630 in = (struct sockaddr_in *)&ifra.ifra_mask;
631 in->sin_len = sizeof(*in);
632 in->sin_addr.s_addr = mask;
635 if (ioctl(s, SIOCAIFADDR, &ifra) < 0) {
636 warn("tap%d: ioctl(SIOCAIFADDR) failed: %s",
637 tap_unit, strerror(errno));
645 netif_add_tap2brg(int tap_unit, const char *ifbridge, int s)
650 bzero(&ifbr, sizeof(ifbr));
651 snprintf(ifbr.ifbr_ifsname, sizeof(ifbr.ifbr_ifsname),
654 bzero(&ifd, sizeof(ifd));
655 strlcpy(ifd.ifd_name, ifbridge, sizeof(ifd.ifd_name));
656 ifd.ifd_cmd = BRDGADD;
657 ifd.ifd_len = sizeof(ifbr);
658 ifd.ifd_data = &ifbr;
660 if (ioctl(s, SIOCSDRVSPEC, &ifd) < 0) {
662 * 'errno == EEXIST' means that the tap(4) is already
663 * a member of the bridge(4)
665 if (errno != EEXIST) {
666 warn("ioctl(%s, SIOCSDRVSPEC) failed: %s",
667 ifbridge, strerror(errno));
674 #define TAPDEV_OFLAGS (O_RDWR | O_NONBLOCK)
676 /* XXX major()/minor() can't be used in vkernel */
677 #define TAPDEV_MAJOR(x) ((int)(((u_int)(x) >> 8) & 0xff))
678 #define TAPDEV_MINOR(x) ((int)((x) & 0xffff00ff))
680 #ifndef TAP_CDEV_MAJOR
681 #define TAP_CDEV_MAJOR 149
685 * Locate the first unused tap(4) device file if auto mode is requested,
686 * or open the user supplied device file, and bring up the corresponding
689 * NOTE: Only tap(4) device file is supported currently
693 netif_open_tap(const char *netif, int *tap_unit, int s)
695 char tap_dev[MAXPATHLEN];
701 if (strcmp(netif, "auto") == 0) {
705 * Find first unused tap(4) device file
708 snprintf(tap_dev, sizeof(tap_dev), "/dev/tap%d", i);
709 tap_fd = open(tap_dev, TAPDEV_OFLAGS);
710 if (tap_fd >= 0 || errno == ENOENT)
714 warnx("Unable to find a free tap(4)");
719 * User supplied tap(4) device file
721 if (netif[0] == '/') /* Absolute path */
722 strlcpy(tap_dev, netif, sizeof(tap_dev));
724 snprintf(tap_dev, sizeof(tap_dev), "/dev/%s", netif);
726 tap_fd = open(tap_dev, TAPDEV_OFLAGS);
728 warn("Unable to open %s: %s",
729 tap_dev, strerror(errno));
735 * Check whether the device file is a tap(4)
738 if (fstat(tap_fd, &st) == 0 && S_ISCHR(st.st_mode) &&
739 TAPDEV_MAJOR(st.st_rdev) == TAP_CDEV_MAJOR) {
740 *tap_unit = TAPDEV_MINOR(st.st_rdev);
743 * Bring up the corresponding tap(4) interface
745 if (netif_set_tapflags(*tap_unit, IFF_UP, s) == 0)
748 warnx("%s is not a tap(4) device", tap_dev);
764 * Following syntax is supported,
765 * 1) x.x.x.x tap(4)'s address is x.x.x.x
767 * 2) x.x.x.x/z tap(4)'s address is x.x.x.x
768 * tap(4)'s netmask len is z
770 * 3) x.x.x.x:y.y.y.y tap(4)'s address is x.x.x.x
771 * pseudo netif's address is y.y.y.y
773 * 4) x.x.x.x:y.y.y.y/z tap(4)'s address is x.x.x.x
774 * pseudo netif's address is y.y.y.y
775 * tap(4) and pseudo netif's netmask len are z
777 * 5) bridgeX tap(4) will be added to bridgeX
779 * 6) bridgeX:y.y.y.y tap(4) will be added to bridgeX
780 * pseudo netif's address is y.y.y.y
782 * 7) bridgeX:y.y.y.y/z tap(4) will be added to bridgeX
783 * pseudo netif's address is y.y.y.y
784 * pseudo netif's netmask len is z
788 netif_init_tap(int tap_unit, in_addr_t *addr, in_addr_t *mask, int s)
790 in_addr_t tap_addr, netmask, netif_addr;
792 char *tok, *masklen_str, *ifbridge;
797 tok = strtok(NULL, ":/");
800 * Nothing special, simply use tap(4) as backend
805 if (inet_pton(AF_INET, tok, &tap_addr) > 0) {
807 * tap(4)'s address is supplied
812 * If there is next token, then it may be pseudo
813 * netif's address or netmask len for tap(4)
818 * Not tap(4)'s address, assume it as a bridge(4)
825 * If there is next token, then it must be pseudo
831 netmask = netif_addr = 0;
833 tok = strtok(NULL, ":/");
837 if (inet_pton(AF_INET, tok, &netif_addr) <= 0) {
838 if (next_netif_addr) {
839 warnx("Invalid pseudo netif address: %s", tok);
845 * Current token is not address, then it must be netmask len
850 * Current token is pseudo netif address, if there is next token
851 * it must be netmask len
853 masklen_str = strtok(NULL, "/");
856 /* Calculate netmask */
857 if (masklen_str != NULL) {
860 masklen = strtoul(masklen_str, NULL, 10);
861 if (masklen < 32 && masklen > 0) {
862 netmask = htonl(~((1LL << (32 - masklen)) - 1)
865 warnx("Invalid netmask len: %lu", masklen);
870 /* Make sure there is no more token left */
871 if (strtok(NULL, ":/") != NULL) {
872 warnx("Invalid argument to '-I'");
877 if (ifbridge == NULL) {
878 /* Set tap(4) address/netmask */
879 if (netif_set_tapaddr(tap_unit, tap_addr, netmask, s) < 0)
882 /* Tie tap(4) to bridge(4) */
883 if (netif_add_tap2brg(tap_unit, ifbridge, s) < 0)
893 * NetifInfo[] will be filled for pseudo netif initialization.
894 * NetifNum will be bumped to reflect the number of valid entries
899 init_netif(char *netifExp[], int netifExpNum)
903 if (netifExpNum == 0)
906 s = socket(AF_INET, SOCK_DGRAM, 0); /* for ioctl(SIOC) */
910 for (i = 0; i < netifExpNum; ++i) {
911 struct vknetif_info *info;
912 in_addr_t netif_addr, netif_mask;
913 int tap_fd, tap_unit;
916 netif = strtok(netifExp[i], ":");
918 warnx("Invalide argument to '-I'");
923 * Open tap(4) device file and bring up the
924 * corresponding interface
926 tap_fd = netif_open_tap(netif, &tap_unit, s);
931 * Initialize tap(4) and get address/netmask
934 * NB: Rest part of netifExp[i] is passed
935 * to netif_init_tap() implicitly.
937 if (netif_init_tap(tap_unit, &netif_addr, &netif_mask, s) < 0) {
939 * NB: Closing tap(4) device file will bring
940 * down the corresponding interface
946 info = &NetifInfo[NetifNum];
947 info->tap_fd = tap_fd;
948 info->tap_unit = tap_unit;
949 info->netif_addr = netif_addr;
950 info->netif_mask = netif_mask;
953 if (NetifNum >= VKNETIF_MAX) /* XXX will this happen? */
961 usage(const char *ctl)
969 kprintf("cpu reset\n");
976 kprintf("cpu halt\n");
978 __asm__ __volatile("hlt");