Closed kugelbit closed 5 years ago
Ok so i solved my problem. For everbody interested: they deleted the EXPORT_SYMPOL macros for reasons (see: https://patchwork.kernel.org/patch/10106287/). I had to access the functions through the omap_dm_timer_ops struct (see dmtimer-omap.h). Now i can compile without manipulate the kernel.
kernel = linux-rt-4.14.114
cross compiler = arm-linux-gnueabihf-gcc
Hi
I want to use the dmtimer library:
header file: /include/clocksource/timer-ti-dm.h C FIle: /drivers/clocksource/timer-ti-dm.c
in a kernel modul: https://github.com/ddrown/pps-gmtimer/blob/ti_4_9_x/pps-gmtimer.c
(this is an old version of the module to use it now, i changed the header:
include <plat/dmtimer.h> to: #include <clocksource/timer-ti-dm.h>)
the modul use a hw-timer for a pps device.
if im compiling the module i get the following compiler-warnings:
WARNING: "omap_dm_timer_get_fclk" [/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_enable" [/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_request_by_node" [/gps_cape/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_read_status" /gps_cape/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_free" [/gps_cape/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_stop" /gps_cape/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_set_int_disable" [/gps_cape/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_set_source" [/gps_cape/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined! WARNING: "omap_dm_timer_read_counter" [/gps_cape/pps-gmtimer/kernel/pps-gmtimer/pps-gmtimer.ko] undefined!
and if im trying to load the compiled module with:
sudo insmod pps-gmtimer.ko
i get the following errors:
[ 228.063538] pps_gmtimer: Unknown symbol omap_dm_timer_request_by_node (err 0) [ 3330.286407] pps_gmtimer: Unknown symbol omap_dm_timer_stop (err 0) [ 3330.286431] pps_gmtimer: Unknown symbol omap_dm_timer_set_source (err 0) [ 3330.286446] pps_gmtimer: Unknown symbol omap_dm_timer_get_fclk (err 0) [ 3330.286460] pps_gmtimer: Unknown symbol omap_dm_timer_free (err 0) [ 3330.286471] pps_gmtimer: Unknown symbol omap_dm_timer_request_by_node (err 0) [ 3330.286517] pps_gmtimer: Unknown symbol omap_dm_timer_set_int_disable (err 0) [ 3330.286540] pps_gmtimer: Unknown symbol omap_dm_timer_enable (err 0) [ 3330.289645] pps_gmtimer: Unknown symbol omap_dm_timer_read_counter (err 0) [ 3330.289676] pps_gmtimer: Unknown symbol omap_dm_timer_read_status (err 0)
In the thread: https://e2e.ti.com/support/processors/f/791/t/821652 the problem was solved by editing timer-ti-dm.c and adding the EXPORT_SYMBOL-macro to the missing functions.
But if i use this solution i have to manipulate and rebuild the kernel... and this not a user friendly way to use the dmtimer library.
So my question: Is there way to use the dmtimer library in an kernel modul without rebuilding the kernel? or Do i have to take another way to use the timers - which one?
[EDIT] the messing EXPORT_SYMPOL macros were deleted in commit fc6db34
But there no reason mentioned for that