diff --git a/core/smc_hook.c b/core/smc_hook.c index 60d19449856134bf60f1e9a7cd22a98847f8006b..9af0d8e491998430da4cbaba534f5e418a85152e 100644 --- a/core/smc_hook.c +++ b/core/smc_hook.c @@ -28,7 +28,7 @@ void register_smc_hook(void (*pre_hook)(void *), void (*post_hook)(void *)) g_smc_hooks.smc_pre_hook = pre_hook; g_smc_hooks.smc_post_hook = post_hook; } -EXPORT_SYMBOL(register_smc_hook); +EXPORT_SYMBOL_TZ(register_smc_hook); void call_smc_pre_hook(unsigned int cmd_id) { diff --git a/core/tc_client_driver.c b/core/tc_client_driver.c index a9455ae505e7e21b42d158f83ea72fec142585ce..1401bd9932758c1597ce89dc1f745eddfd7f1032 100644 --- a/core/tc_client_driver.c +++ b/core/tc_client_driver.c @@ -1208,7 +1208,11 @@ static int enable_dev_nodes(void) return 0; } +#if (KERNEL_VERSION(6, 6, 0) <= LINUX_VERSION_CODE) +static char *tee_devnode(const struct device *dev, umode_t *mode) +#else static char *tee_devnode(struct device *dev, umode_t *mode) +#endif { if (!dev || !mode) return NULL; diff --git a/core/teek_client_api.c b/core/teek_client_api.c index 5364b1ed81d8d6f81769d1817e4db62ef98e21ab..1e3113a1c0e0308e243fd50b8488ec4f15b8ae69 100644 --- a/core/teek_client_api.c +++ b/core/teek_client_api.c @@ -348,7 +348,7 @@ uint32_t teek_initialize_context(const char *name, tlogd("open device success\n"); return TEEC_SUCCESS; } -EXPORT_SYMBOL(teek_initialize_context); +EXPORT_SYMBOL_TZ(teek_initialize_context); /* * This function finalizes an initialized TEE Context. @@ -366,7 +366,7 @@ void teek_finalize_context(struct teec_context *context) tc_ns_client_close(context->dev); context->dev = NULL; } -EXPORT_SYMBOL(teek_finalize_context); +EXPORT_SYMBOL_TZ(teek_finalize_context); static bool is_oper_param_valid(const struct teec_operation *operation) { @@ -570,7 +570,7 @@ uint32_t teek_open_session(struct teec_context *context, } return ret; } -EXPORT_SYMBOL(teek_open_session); +EXPORT_SYMBOL_TZ(teek_open_session); /* * This function closes an opened Session. @@ -618,7 +618,7 @@ void teek_close_session(struct teec_session *session) tloge("close session failed\n"); } } -EXPORT_SYMBOL(teek_close_session); +EXPORT_SYMBOL_TZ(teek_close_session); static uint32_t proc_invoke_cmd(struct teec_session *session, struct tc_ns_client_context *cli_context, uint32_t *origin) @@ -700,7 +700,7 @@ set_ori: *return_origin = origin; return teec_ret; } -EXPORT_SYMBOL(teek_invoke_command); +EXPORT_SYMBOL_TZ(teek_invoke_command); uint32_t teek_send_secfile(struct teec_session *session, const char *file_buffer, unsigned int file_size) @@ -719,7 +719,7 @@ uint32_t teek_send_secfile(struct teec_session *session, livepatch_up_read_sem(); return ret; } -EXPORT_SYMBOL(teek_send_secfile); +EXPORT_SYMBOL_TZ(teek_send_secfile); TEEC_Result TEEK_SendSecfile(TEEC_Session *session, const char *file_buffer, unsigned int file_size) @@ -727,7 +727,7 @@ TEEC_Result TEEK_SendSecfile(TEEC_Session *session, return (TEEC_Result)teek_send_secfile((struct teec_session *)session, file_buffer, file_size); } -EXPORT_SYMBOL(TEEK_SendSecfile); +EXPORT_SYMBOL_TZ(TEEK_SendSecfile); /* * This function registers a block of existing Client Application memory @@ -747,20 +747,20 @@ int TEEK_IsAgentAlive(unsigned int agent_id) { return teek_is_agent_alive(agent_id); } -EXPORT_SYMBOL(TEEK_IsAgentAlive); +EXPORT_SYMBOL_TZ(TEEK_IsAgentAlive); TEEC_Result TEEK_InitializeContext(const char *name, TEEC_Context *context) { return (TEEC_Result)teek_initialize_context(name, (struct teec_context *)context); } -EXPORT_SYMBOL(TEEK_InitializeContext); +EXPORT_SYMBOL_TZ(TEEK_InitializeContext); void TEEK_FinalizeContext(TEEC_Context *context) { teek_finalize_context((struct teec_context *)context); } -EXPORT_SYMBOL(TEEK_FinalizeContext); +EXPORT_SYMBOL_TZ(TEEK_FinalizeContext); /* * Function: TEEK_OpenSession @@ -785,13 +785,13 @@ TEEC_Result TEEK_OpenSession(TEEC_Context *context, TEEC_Session *session, (const struct teec_uuid *)destination, connectionMethod, connectionData, (struct teec_operation *)operation, returnOrigin); } -EXPORT_SYMBOL(TEEK_OpenSession); +EXPORT_SYMBOL_TZ(TEEK_OpenSession); void TEEK_CloseSession(TEEC_Session *session) { teek_close_session((struct teec_session *)session); } -EXPORT_SYMBOL(TEEK_CloseSession); +EXPORT_SYMBOL_TZ(TEEK_CloseSession); TEEC_Result TEEK_InvokeCommand(TEEC_Session *session, uint32_t commandID, TEEC_Operation *operation, uint32_t *returnOrigin) @@ -800,6 +800,6 @@ TEEC_Result TEEK_InvokeCommand(TEEC_Session *session, uint32_t commandID, (struct teec_session *)session, commandID, (struct teec_operation *)operation, returnOrigin); } -EXPORT_SYMBOL(TEEK_InvokeCommand); +EXPORT_SYMBOL_TZ(TEEK_InvokeCommand); /* end: for KERNEL-HAL out interface */ diff --git a/core/tz_spi_notify.c b/core/tz_spi_notify.c index 1d4a264817fc16dda56342ce49e8e39763b6d63a..7b82064d367ccde7fc1adbbe3da31ec2b7a8892b 100644 --- a/core/tz_spi_notify.c +++ b/core/tz_spi_notify.c @@ -585,7 +585,7 @@ int TC_NS_RegisterServiceCallbackFunc(const char *uuid, void *func, return tc_ns_register_service_call_back_func(uuid_in, func, private_data); } -EXPORT_SYMBOL(TC_NS_RegisterServiceCallbackFunc); +EXPORT_SYMBOL_TZ(TC_NS_RegisterServiceCallbackFunc); int send_notify_cmd(unsigned int cmd_id) { diff --git a/core/tzdebug.c b/core/tzdebug.c index e013315169f6be17bcb832ecd4c51ab7257626b1..29ee596554391d9fe4efe9dde1d579fcfa724b32 100644 --- a/core/tzdebug.c +++ b/core/tzdebug.c @@ -185,7 +185,7 @@ int get_tee_meminfo(struct tee_mem *meminfo) return 0; } -EXPORT_SYMBOL(get_tee_meminfo); +EXPORT_SYMBOL_TZ(get_tee_meminfo); static void send_dump_task_state(void) { diff --git a/teek_ns_client.h b/teek_ns_client.h index b866b64b20f8af097df2cd6d75ae66598aa68490..d5ff88bc88920003b9acd897f2da18d6fc0e3fbd 100644 --- a/teek_ns_client.h +++ b/teek_ns_client.h @@ -265,4 +265,10 @@ struct tc_op_params { bool op_inited; }; +#if (defined CONFIG_EXPORT_BY_GPL) || (KERNEL_VERSION(6, 6, 0) <= LINUX_VERSION_CODE) +#define EXPORT_SYMBOL_TZ EXPORT_SYMBOL_GPL +#else +#define EXPORT_SYMBOL_TZ EXPORT_SYMBOL +#endif + #endif diff --git a/tzdriver_internal/tee_reboot/reboot.c b/tzdriver_internal/tee_reboot/reboot.c index e539825dd7a8474b12cea2b418de704d63c2a5c9..fc96b08dfa01531660d91a25a05088140e509f12 100644 --- a/tzdriver_internal/tee_reboot/reboot.c +++ b/tzdriver_internal/tee_reboot/reboot.c @@ -236,7 +236,7 @@ int teek_register_alarm_func(tee_alarm_func alarm_func) g_tee_alarm_func = alarm_func; return 0; } -EXPORT_SYMBOL(teek_register_alarm_func); +EXPORT_SYMBOL_TZ(teek_register_alarm_func); void get_teecd_pid(void) { @@ -348,7 +348,7 @@ err: return ret; } #ifdef CONFIG_TEE_UPGRADE -EXPORT_SYMBOL(tee_reboot); +EXPORT_SYMBOL_TZ(tee_reboot); #endif static struct task_struct *g_reboot_thread;