svn commit: r339025 - head/sys/x86/include

Konstantin Belousov kib at FreeBSD.org
Sun Sep 30 16:57:32 UTC 2018


Author: kib
Date: Sun Sep 30 16:57:30 2018
New Revision: 339025
URL: https://svnweb.freebsd.org/changeset/base/339025

Log:
  Update x86/ifunc.h.
  
  Remove ifunc emulation.
  Add helper for usermode ifunc resolver definition.
  Update copyright years.
  
  Sponsored by:	The FreeBSD Foundation
  Approved by:	re (rgrimes)
  MFC after:	1 week

Modified:
  head/sys/x86/include/ifunc.h

Modified: head/sys/x86/include/ifunc.h
==============================================================================
--- head/sys/x86/include/ifunc.h	Sun Sep 30 16:21:31 2018	(r339024)
+++ head/sys/x86/include/ifunc.h	Sun Sep 30 16:57:30 2018	(r339025)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015, 2017 The FreeBSD Foundation
+ * Copyright (c) 2015-2018 The FreeBSD Foundation
  * All rights reserved.
  *
  * This software was developed by Konstantin Belousov <kib at FreeBSD.org>
@@ -32,27 +32,19 @@
 #ifndef __X86_IFUNC_H
 #define	__X86_IFUNC_H
 
-#define	DECLARE_LIFUNC(ret_type, name, args)				\
-ret_type name args
-
-#define	DEFINE_LIFUNC(scope, selector_qual, ret_type, name, args)	\
-__asm__ (scope "\t" #name "\n"						\
-	 "\t.type\t" #name ", at function\n"				\
-	 #name ":\n"							\
-	 "\tjmp	*" #name "_selector\n"					\
-	 "\t.size\t" #name ",\t. - "#name);				\
-selector_qual ret_type (*name##_selector)args  __used;			\
-DECLARE_LIFUNC(ret_type, name, args)
-
-#define	DEFINE_STATIC_LIFUNC(ret_type, name, args)			\
-	DEFINE_LIFUNC(".local", static, ret_type, name, args)
-
-#define	DEFINE_GLOBAL_LIFUNC(ret_type, name, args)			\
-	DEFINE_LIFUNC(".globl", , ret_type, name, args)
-
-#define	DEFINE_IFUNC(qual, ret_type, name, args, resolver_qual)	\
+#define	DEFINE_IFUNC(qual, ret_type, name, args, resolver_qual)		\
     resolver_qual ret_type (*name##_resolver(void))args __used;		\
     qual ret_type name args __attribute__((ifunc(#name "_resolver")));	\
     resolver_qual ret_type (*name##_resolver(void))args
+
+#define	DEFINE_UIFUNC(qual, ret_type, name, args, resolver_qual)	\
+    resolver_qual ret_type (*name##_resolver(uint32_t, uint32_t,	\
+	uint32_t, uint32_t))args __used;				\
+    qual ret_type name args __attribute__((ifunc(#name "_resolver")));	\
+    resolver_qual ret_type (*name##_resolver(				\
+	uint32_t cpu_feature __unused,					\
+	uint32_t cpu_feature2 __unused,					\
+	uint32_t cpu_stdext_feature __unused,				\
+	uint32_t cpu_stdext_feature2 __unused))args
 
 #endif


More information about the svn-src-head mailing list