Deleted Added
full compact
grant_table.c (183375) grant_table.c (185605)
1/******************************************************************************
2 * gnttab.c
3 *
4 * Two sets of functionality:
5 * 1. Granting foreign access to our memory reservation.
6 * 2. Accessing others' memory reservations via grant references.
7 * (i.e., mechanisms for both sender and recipient of grant references)
8 *
9 * Copyright (c) 2005, Christopher Clark
10 * Copyright (c) 2004, K A Fraser
11 */
12
13#include <sys/cdefs.h>
1/******************************************************************************
2 * gnttab.c
3 *
4 * Two sets of functionality:
5 * 1. Granting foreign access to our memory reservation.
6 * 2. Accessing others' memory reservations via grant references.
7 * (i.e., mechanisms for both sender and recipient of grant references)
8 *
9 * Copyright (c) 2005, Christopher Clark
10 * Copyright (c) 2004, K A Fraser
11 */
12
13#include <sys/cdefs.h>
14__FBSDID("$FreeBSD: head/sys/xen/gnttab.c 183375 2008-09-26 05:29:39Z kmacy $");
14__FBSDID("$FreeBSD: head/sys/xen/gnttab.c 185605 2008-12-04 07:59:05Z kmacy $");
15
16#include "opt_global.h"
17#include "opt_pmap.h"
18
19#include <sys/param.h>
20#include <sys/systm.h>
21#include <sys/bus.h>
22#include <sys/conf.h>

--- 509 unchanged lines hidden (view full) ---

532 return -ENOSPC;
533
534 if ((rc = gnttab_map(cur, cur + extra - 1)) == 0)
535 rc = grow_gnttab_list(extra);
536
537 return rc;
538}
539
15
16#include "opt_global.h"
17#include "opt_pmap.h"
18
19#include <sys/param.h>
20#include <sys/systm.h>
21#include <sys/bus.h>
22#include <sys/conf.h>

--- 509 unchanged lines hidden (view full) ---

532 return -ENOSPC;
533
534 if ((rc = gnttab_map(cur, cur + extra - 1)) == 0)
535 rc = grow_gnttab_list(extra);
536
537 return rc;
538}
539
540static int
541gnttab_init(void *unused)
540int
541gnttab_init()
542{
543 int i;
544 unsigned int max_nr_glist_frames;
545 unsigned int nr_init_grefs;
546
547 if (!is_running_on_xen())
548 return -ENODEV;
549

--- 38 unchanged lines hidden (view full) ---

588 for (i--; i >= 0; i--)
589 free(gnttab_list[i], M_DEVBUF);
590 free(gnttab_list, M_DEVBUF);
591 return -ENOMEM;
592
593}
594
595MTX_SYSINIT(gnttab, &gnttab_list_lock, "GNTTAB LOCK", MTX_DEF);
542{
543 int i;
544 unsigned int max_nr_glist_frames;
545 unsigned int nr_init_grefs;
546
547 if (!is_running_on_xen())
548 return -ENODEV;
549

--- 38 unchanged lines hidden (view full) ---

588 for (i--; i >= 0; i--)
589 free(gnttab_list[i], M_DEVBUF);
590 free(gnttab_list, M_DEVBUF);
591 return -ENOMEM;
592
593}
594
595MTX_SYSINIT(gnttab, &gnttab_list_lock, "GNTTAB LOCK", MTX_DEF);
596SYSINIT(gnttab, SI_SUB_PSEUDO, SI_ORDER_FIRST, gnttab_init, NULL);
596//SYSINIT(gnttab, SI_SUB_PSEUDO, SI_ORDER_FIRST, gnttab_init, NULL);