mirror of
https://github.com/openharmony/kernel_linux_common_modules.git
synced 2026-08-26 17:16:37 -04:00
feat: common modules compatible with linux-6.6
Signed-off-by: minjie.yu <minjie.yu@unionman.com.cn>
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
ifeq ($(CONFIG_TZDRIVER),y)
|
||||
KERNEL_DIR := $(srctree)
|
||||
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../third_party/bounds_checking_function/include/
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/bounds_checking_function/include/
|
||||
|
||||
obj-$(CONFIG_TZDRIVER) += agent_rpmb/
|
||||
obj-$(CONFIG_TZDRIVER) += auth/
|
||||
|
||||
Executable → Regular
+1
-1
@@ -6,7 +6,7 @@ endif
|
||||
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/platform_drivers/tzdriver
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/platform_drivers/tzdriver/core
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../third_party/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/bounds_checking_function/include
|
||||
|
||||
ifeq ($(CONFIG_MEDIATEK_SOLUTION),y)
|
||||
MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM))
|
||||
|
||||
@@ -3,7 +3,7 @@ KERNEL_DIR :=$(srctree)
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/core
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/tlogger
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../third_party/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../base/security/selinux/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../base/security/selinux
|
||||
|
||||
@@ -4,7 +4,7 @@ ifneq ($(TARGET_BUILD_VARIANT), user)
|
||||
ccflags-y += -DDEF_ENG
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../third_party/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/agent_rpmb/core
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/auth
|
||||
|
||||
@@ -1263,7 +1263,11 @@ static int tc_ns_client_init(void)
|
||||
ret = load_tz_shared_mem(g_dev_node);
|
||||
if (ret != 0)
|
||||
goto unmap_res_mem;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
|
||||
g_driver_class = class_create(THIS_MODULE, TC_NS_CLIENT_DEV);
|
||||
#else
|
||||
g_driver_class = class_create(TC_NS_CLIENT_DEV);
|
||||
#endif
|
||||
if (IS_ERR_OR_NULL(g_driver_class)) {
|
||||
tloge("class create failed");
|
||||
ret = -ENOMEM;
|
||||
|
||||
@@ -447,7 +447,11 @@ static void spi_broadcast_notifications(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
|
||||
missed = (uint32_t)__arch_xchg(0, &g_notify_data->meta.context.meta.missed, MISSED_COUNT);
|
||||
#else
|
||||
missed = (uint32_t)__xchg(0, &g_notify_data->meta.context.meta.missed, MISSED_COUNT);
|
||||
#endif
|
||||
if (missed == 0)
|
||||
return;
|
||||
if ((missed & (1U << NOTIFY_DATA_ENTRY_WAKEUP)) != 0) {
|
||||
|
||||
@@ -24,7 +24,12 @@
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <linux/stdarg.h>
|
||||
#endif
|
||||
#include <linux/mm.h>
|
||||
#include <asm/tlbflush.h>
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
@@ -13,7 +13,12 @@
|
||||
*/
|
||||
|
||||
#include "dynamic_ion_mem.h"
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <linux/stdarg.h>
|
||||
#endif
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
@@ -4,7 +4,7 @@ ifneq ($(TARGET_BUILD_VARIANT), user)
|
||||
ccflags-y += -DDEF_ENG
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../third_party/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/core
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/include
|
||||
|
||||
@@ -1030,16 +1030,19 @@ static int tlogger_chown(const char *file_path, uint32_t file_path_len)
|
||||
uid_t user = ROOT_UID;
|
||||
gid_t group = ROOT_GID;
|
||||
int ret;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
|
||||
mm_segment_t old_fs;
|
||||
|
||||
#endif
|
||||
get_log_chown(&user, &group);
|
||||
|
||||
/* not need modify chown attr */
|
||||
if (group == ROOT_GID && user == ROOT_UID)
|
||||
return 0;
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
#endif
|
||||
#if (KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE)
|
||||
ret = (int)ksys_chown((const char __user *)file_path, user, group);
|
||||
#else
|
||||
@@ -1047,11 +1050,15 @@ static int tlogger_chown(const char *file_path, uint32_t file_path_len)
|
||||
#endif
|
||||
if (ret != 0) {
|
||||
tloge("sys chown for last teemsg file error\n");
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
|
||||
set_fs(old_fs);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
|
||||
set_fs(old_fs);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -12,7 +12,7 @@ ifeq ($(CONFIG_TEE_TUI_MTK), y)
|
||||
EXTRA_CFLAGS += -Idrivers/tzdriver
|
||||
EXTRA_CFLAGS += -Idrivers/tzdriver/core
|
||||
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../third_party/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -Idrivers/gpu/drm/mediatek
|
||||
EXTRA_CFLAGS += -Idrivers/misc/mediatek/memory-ssmr
|
||||
EXTRA_CFLAGS += -Idrivers/devkit/lcdkit/lcdkit3.0/kernel/mtk/include
|
||||
|
||||
@@ -4,7 +4,7 @@ ifneq ($(TARGET_BUILD_VARIANT), user)
|
||||
ccflags-y += -DDEF_ENG
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/../../../../third_party/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/bounds_checking_function/include
|
||||
EXTRA_CFLAGS += -I$(KERNEL_DIR)/drivers/tzdriver/include
|
||||
EXTRA_CFLAGS += -include internal_functions.h
|
||||
|
||||
|
||||
Reference in New Issue
Block a user