Date: Sun, 30 Sep 2018 16:57:31 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339025 - head/sys/x86/include Message-ID: <201809301657.w8UGvVMt060743@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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 ",@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809301657.w8UGvVMt060743>