2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2011, Jack Lange <jacklange@cs.pitt.edu>
11 * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jacklangel@cs.pitt.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #include <util/vmm_barrier.h>
25 int v3_init_barrier(struct v3_barrier * barrier) {
26 memset(barrier, 0, sizeof(struct v3_barrier));
27 v3_lock_init(&(barrier->lock));
33 int v3_activate_barrier(struct guest_info * core, struct v3_barrier * barrier) {
37 flag = v3_lock_irqsave(barrier->lock);
39 if (barrier->active == 0) {
44 v3_unlock_irqrestore(barrier->lock, flag);
51 // wait for barrier catch
60 int v3_deactivate_barrier(struct v3_barrier * barrier) {
65 int v3_check_barrier(struct guest_info * core, struct v3_barrier * barrier) {
67 if (barrier->activated == 0) {
73 // wait for cpu bit to clear