Linux driver phys_mem_access_prot undefined

I have a loadable module that throws a warning about phys_mem_access_prot when building on Ubuntu 9.10 (Linux 2.6.31-22-server).

[664] make -C /lib/modules/`uname -r`/build M=`pwd` 
make: Entering directory `/usr/src/linux-headers-2.6.31-22-server'
  LD      /home/chuck/dev/svd/built-in.o
  CC [M]  /home/chuck/dev/svd/svd.o
  LD [M]  /home/chuck/dev/svd/svd_drv.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "phys_mem_access_prot" [/home/chuck/dev/svd/svd_drv.ko] undefined!
  CC      /home/chuck/dev/svd/svd_drv.mod.o
  LD [M]  /home/chuck/dev/svd/svd_drv.ko
make: Leaving directory `/usr/src/linux-headers-2.6.31-22-server'

The function is displayed in the file System.map-2.6.31-22-server

[667] grep phys_mem_access_prot /boot/System.map-2.6.31-22-server 
ffffffff8103fb40 T phys_mem_access_prot
ffffffff8103fb50 T phys_mem_access_prot_allowed

and the driver loads, so I am confused why I am not modposthappy. Is this a problem because the kernel does not export the function using EXPORT_SYMBOL()?

+3
source share
1 answer

You answered your question! Any kernel function used by a module must be exported by one of the various EXPORT_SYMBOL () macros.

You will also see problems if non-GPL modules must use functions exported by EXPORT_SYMBOL_GPL.

+1

Source: https://habr.com/ru/post/1750332/


All Articles