X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Funit%2Furcu-asm.c;fp=tests%2Funit%2Furcu-asm.c;h=b616d3486c90a8d1ad7888e50186e5045f64e460;hp=0000000000000000000000000000000000000000;hb=f5ab766ee2c8300cb00ca5878b1cb464f960a66d;hpb=a5bae03d59c22e57263b8610b9fed99738303cf0 diff --git a/tests/unit/urcu-asm.c b/tests/unit/urcu-asm.c new file mode 100644 index 0000000..b616d34 --- /dev/null +++ b/tests/unit/urcu-asm.c @@ -0,0 +1,37 @@ +/* + * urcu-asm.c + * + * Userspace RCU library - assembly dump of primitives + * + * Copyright February 2009 - Mathieu Desnoyers + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include + +void show_read_lock(void) +{ + asm volatile ("/* start */"); + rcu_read_lock(); + asm volatile ("/* end */"); +} + +void show_read_unlock(void) +{ + asm volatile ("/* start */"); + rcu_read_unlock(); + asm volatile ("/* end */"); +}