Date: Mon, 16 May 2016 08:50:32 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299927 - head/sys/dev/hyperv/vmbus Message-ID: <201605160850.u4G8oWkq004319@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Mon May 16 08:50:32 2016 New Revision: 299927 URL: https://svnweb.freebsd.org/changeset/base/299927 Log: hyperv/vmbus: Use atomic_testandclear Prepare to use unsigned long for event channel bit array. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6382 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 08:34:17 2016 (r299926) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon May 16 08:50:32 2016 (r299927) @@ -33,6 +33,7 @@ #include <sys/lock.h> #include <sys/mutex.h> #include <machine/bus.h> +#include <machine/atomic.h> #include <vm/vm.h> #include <vm/vm_param.h> #include <vm/pmap.h> @@ -313,7 +314,7 @@ hv_vmbus_on_events(int cpu) /* * receive size is 1/2 page and divide that by 4 bytes */ - if (synch_test_and_clear_bit(0, &event->flags32[0])) { + if (atomic_testandclear_int(&event->flags32[0], 0)) { recv_interrupt_page = hv_vmbus_g_connection.recv_interrupt_page; } else { @@ -337,8 +338,8 @@ hv_vmbus_on_events(int cpu) continue; for (bit = 0; bit < HV_CHANNEL_DWORD_LEN; bit++) { - if (synch_test_and_clear_bit(bit, - (uint32_t *)&recv_interrupt_page[dword])) { + if (atomic_testandclear_int( + &recv_interrupt_page[dword], bit)) { struct hv_vmbus_channel *channel; rel_id = (dword << 5) + bit;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605160850.u4G8oWkq004319>