示例#1
0
文件: ipc.c 项目: bhargavz/cloudproxy
static void ipc_increment_ack(volatile UINT32 *ack)
{
    if (NULL != ack)
    {
        hw_interlocked_increment((INT32 *) ack);
    }
}
示例#2
0
void interruptible_lock_acquire_readlock(VMM_READ_WRITE_LOCK* lock)
{
    (void)lock;
    interruptible_lock_acquire(&lock->lock);
    hw_interlocked_increment((INT32*)(&lock->readers));
    lock_release(&lock->lock);
}
示例#3
0
/* apply vmexit config to the gcpu that are allocated
 * for the current host cpu */
static
void apply_vmexit_config(cpu_id_t from UNUSED, void *arg)
{
	guest_gcpu_econtext_t ctx;
	guest_cpu_handle_t gcpu;
	cpu_id_t this_hcpu_id = hw_cpu_id();

	ipc_comm_guest_struct_t *ipc = (ipc_comm_guest_struct_t *)arg;
	guest_handle_t guest = ipc->guest;
	volatile uint32_t *p_executed_count = &(ipc->executed);

	MON_ASSERT(guest);

	for (gcpu = mon_guest_gcpu_first(guest, &ctx); gcpu;
	     gcpu = mon_guest_gcpu_next(&ctx)) {
		if (this_hcpu_id == scheduler_get_host_cpu_id(gcpu)) {
			gcpu_control_apply_only(gcpu);
		}
	}

	/* mark as done */
	hw_interlocked_increment((int32_t *)p_executed_count);
}