GCC versions prior to 11.3 do not support the "mwait" target attribute.
This change adds compiler version checks to the pragmas using this
attribute, enabling builds with GCC 11.1 & 11.2.
Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #4
#ifndef _MWAITINTRIN_H_INCLUDED
#define _MWAITINTRIN_H_INCLUDED
+#if ((__GNUC__ >= 12) || (__GNUC__ == 11 && __GNUC_MINOR__ >= 3))
#ifndef __MWAIT__
#pragma GCC push_options
#pragma GCC target("mwait")
#define __DISABLE_MWAIT__
#endif /* __MWAIT__ */
+#endif /* GCC >= 11.3 */
extern __inline void
__attribute__((__gnu_inline__, __always_inline__, __artificial__))