ANDROID: module: Add vendor hook

Add vendor hook for module init, so we can get memory type and
use it to do memory type check for architecture
dependent page table setting.

Bug: 181639260

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: I95b70d7a57994f2548fddfb2290d4c9136f58785
This commit is contained in:
Kuan-Ying Lee
2021-02-22 16:40:22 +08:00
committed by Todd Kjos
parent 2ff446fc4d
commit 4d63efb9ae
3 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM module
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_MODULE_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
struct module;
DECLARE_HOOK(android_vh_set_module_permit_before_init,
TP_PROTO(const struct module *mod),
TP_ARGS(mod));
DECLARE_HOOK(android_vh_set_module_permit_after_init,
TP_PROTO(const struct module *mod),
TP_ARGS(mod));
#endif /* _TRACE_HOOK_MODULE_H */
/* This part must be outside protection */
#include <trace/define_trace.h>