2020-08-18 13:57:41 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _STATIC_CALL_TYPES_H
|
|
|
|
#define _STATIC_CALL_TYPES_H
|
|
|
|
|
2020-08-18 13:57:42 +00:00
|
|
|
#include <linux/types.h>
|
2020-08-18 13:57:41 +00:00
|
|
|
#include <linux/stringify.h>
|
|
|
|
|
|
|
|
#define STATIC_CALL_KEY_PREFIX __SCK__
|
2020-08-18 13:57:42 +00:00
|
|
|
#define STATIC_CALL_KEY_PREFIX_STR __stringify(STATIC_CALL_KEY_PREFIX)
|
|
|
|
#define STATIC_CALL_KEY_PREFIX_LEN (sizeof(STATIC_CALL_KEY_PREFIX_STR) - 1)
|
2020-08-18 13:57:41 +00:00
|
|
|
#define STATIC_CALL_KEY(name) __PASTE(STATIC_CALL_KEY_PREFIX, name)
|
|
|
|
|
|
|
|
#define STATIC_CALL_TRAMP_PREFIX __SCT__
|
|
|
|
#define STATIC_CALL_TRAMP_PREFIX_STR __stringify(STATIC_CALL_TRAMP_PREFIX)
|
2020-08-18 13:57:42 +00:00
|
|
|
#define STATIC_CALL_TRAMP_PREFIX_LEN (sizeof(STATIC_CALL_TRAMP_PREFIX_STR) - 1)
|
2020-08-18 13:57:41 +00:00
|
|
|
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
|
|
|
|
#define STATIC_CALL_TRAMP_STR(name) __stringify(STATIC_CALL_TRAMP(name))
|
|
|
|
|
2020-08-18 13:57:49 +00:00
|
|
|
/*
|
|
|
|
* Flags in the low bits of static_call_site::key.
|
|
|
|
*/
|
|
|
|
#define STATIC_CALL_SITE_TAIL 1UL /* tail call */
|
|
|
|
#define STATIC_CALL_SITE_INIT 2UL /* init section */
|
|
|
|
#define STATIC_CALL_SITE_FLAGS 3UL
|
|
|
|
|
2020-08-18 13:57:42 +00:00
|
|
|
/*
|
|
|
|
* The static call site table needs to be created by external tooling (objtool
|
|
|
|
* or a compiler plugin).
|
|
|
|
*/
|
|
|
|
struct static_call_site {
|
|
|
|
s32 addr;
|
|
|
|
s32 key;
|
|
|
|
};
|
|
|
|
|
2020-08-18 13:57:41 +00:00
|
|
|
#endif /* _STATIC_CALL_TYPES_H */
|