X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_queue.c;h=20fa255ac22bb5f2aa0c78e954c3449a9279830f;hb=81361b1fc66eb2ca2e1eb80d3c3b98c6accde9d0;hp=03cfb6d5098b7fcb9d19b743a2d8e23ab9939dd8;hpb=43cf194456fcf1cc7bf4850aa0200a50e7a27920;p=palacios.git diff --git a/palacios/src/palacios/vmm_queue.c b/palacios/src/palacios/vmm_queue.c index 03cfb6d..20fa255 100644 --- a/palacios/src/palacios/vmm_queue.c +++ b/palacios/src/palacios/vmm_queue.c @@ -33,19 +33,21 @@ struct v3_queue * v3_create_queue() { void v3_enqueue(struct v3_queue * queue, addr_t entry) { struct v3_queue_entry * q_entry = V3_Malloc(sizeof(struct v3_queue_entry)); + unsigned int flags = 0; - v3_lock(queue->lock); + flags = v3_lock_irqsave(queue->lock); q_entry->entry = entry; list_add_tail(&(q_entry->entry_list), &(queue->entries)); queue->num_entries++; - v3_unlock(queue->lock); + v3_unlock_irqrestore(queue->lock, flags); } addr_t v3_dequeue(struct v3_queue * queue) { addr_t entry_val = 0; + unsigned int flags = 0; - v3_lock(queue->lock); + flags = v3_lock_irqsave(queue->lock); if (!list_empty(&(queue->entries))) { struct list_head * q_entry = queue->entries.next; struct v3_queue_entry * tmp_entry = list_entry(q_entry, struct v3_queue_entry, entry_list); @@ -54,7 +56,7 @@ addr_t v3_dequeue(struct v3_queue * queue) { list_del(q_entry); V3_Free(tmp_entry); } - v3_unlock(queue->lock); + v3_unlock_irqrestore(queue->lock, flags); return entry_val; }