virtio_balloon.c (234270) | virtio_balloon.c (238360) |
---|---|
1/*- 2 * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27/* Driver for VirtIO memory balloon devices. */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27/* Driver for VirtIO memory balloon devices. */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/virtio/balloon/virtio_balloon.c 234270 2012-04-14 05:48:04Z grehan $"); | 30__FBSDID("$FreeBSD: head/sys/dev/virtio/balloon/virtio_balloon.c 238360 2012-07-11 02:57:19Z grehan $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/endian.h> 36#include <sys/kthread.h> 37#include <sys/malloc.h> 38#include <sys/module.h> --- 368 unchanged lines hidden (view full) --- 407 KASSERT(error == 0, ("error enqueuing page frames to virtqueue")); 408 virtqueue_notify(vq); 409 410 /* 411 * Inflate and deflate operations are done synchronously. The 412 * interrupt handler will wake us up. 413 */ 414 VTBALLOON_LOCK(sc); | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/endian.h> 36#include <sys/kthread.h> 37#include <sys/malloc.h> 38#include <sys/module.h> --- 368 unchanged lines hidden (view full) --- 407 KASSERT(error == 0, ("error enqueuing page frames to virtqueue")); 408 virtqueue_notify(vq); 409 410 /* 411 * Inflate and deflate operations are done synchronously. The 412 * interrupt handler will wake us up. 413 */ 414 VTBALLOON_LOCK(sc); |
415 | |
416 while ((c = virtqueue_dequeue(vq, NULL)) == NULL) 417 msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); 418 VTBALLOON_UNLOCK(sc); 419 420 KASSERT(c == vq, ("unexpected balloon operation response")); 421} 422 423static void --- 148 unchanged lines hidden --- | 415 while ((c = virtqueue_dequeue(vq, NULL)) == NULL) 416 msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); 417 VTBALLOON_UNLOCK(sc); 418 419 KASSERT(c == vq, ("unexpected balloon operation response")); 420} 421 422static void --- 148 unchanged lines hidden --- |