X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Furcu%2Fuatomic%2Fgeneric.h;h=a03015897baa6fe980c36b03da95d181b4d93fc0;hb=d3d3857f678627e7bbfb5a8d6f3bc15cd2a694d9;hp=5bb0d4f983c3b96c920827b991b6798fadc5cbbd;hpb=6893800a4d1cc14dff0395ddcd660a5138db183d;p=userspace-rcu.git diff --git a/include/urcu/uatomic/generic.h b/include/urcu/uatomic/generic.h index 5bb0d4f..a030158 100644 --- a/include/urcu/uatomic/generic.h +++ b/include/urcu/uatomic/generic.h @@ -1,22 +1,15 @@ +// SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved. +// SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved. +// SPDX-FileCopyrightText: 1999-2004 Hewlett-Packard Development Company, L.P. +// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers +// SPDX-FileCopyrightText: 2010 Paolo Bonzini +// +// SPDX-License-Identifier: LicenseRef-Boehm-GC + #ifndef _URCU_UATOMIC_GENERIC_H #define _URCU_UATOMIC_GENERIC_H /* - * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. - * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. - * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. - * Copyright (c) 2009 Mathieu Desnoyers - * Copyright (c) 2010 Paolo Bonzini - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * * Code inspired from libuatomic_ops-1.2, inherited in part from the * Boehm-Demers-Weiser conservative garbage collector. */ @@ -38,19 +31,23 @@ extern "C" { #endif #if !defined __OPTIMIZE__ || defined UATOMIC_NO_LINK_ERROR +#ifdef ILLEGAL_INSTR static inline __attribute__((always_inline)) void _uatomic_link_error(void) { -#ifdef ILLEGAL_INSTR /* * generate an illegal instruction. Cannot catch this with * linker tricks when optimizations are disabled. */ __asm__ __volatile__(ILLEGAL_INSTR); +} #else +static inline __attribute__((always_inline, __noreturn__)) +void _uatomic_link_error(void) +{ __builtin_trap(); -#endif } +#endif #else /* #if !defined __OPTIMIZE__ || defined UATOMIC_NO_LINK_ERROR */ extern void _uatomic_link_error(void);