This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM335X: Build Driver Module Fail

Part Number: PROCESSOR-SDK-AM335X

Hi Team,

I have a question about how to build kernel module correctly.

Makefile is as below : 

CROSS_COMPILE := arm-none-linux-gnueabihf-
ARCH := arm
KERNEL_DIR := /lib/modules/$(shell uname -r)/build


MODULE_NAME = intc_gpio
obj-m += $(MODULE_NAME).o

all:
	make ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_DIR) M=$(PWD) modules
clean:
	make -C $(KERNEL_DIR) M=$(PWD) clean

Sample C Code

#include <linux/init.h>
#include <linux/module.h>

MODULE_DESCRIPTION("Hello_world");
MODULE_LICENSE("GPL");

static int hello_init(void)
{
 printk(KERN_INFO "Hello world !\n");
 return 0;
}

static void hello_exit(void)
{
 printk(KERN_INFO "Bye !\n");
}

module_init(hello_init);
module_exit(hello_exit);

The build error is as below

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- -C /lib/modules/5.4.0-150-generic/build M=/home/plcnet/workspace_ax5/example_driver modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-150-generic'
  CC [M]  /home/plcnet/workspace_ax5/example_driver/intc_gpio.o
In file included from ./include/linux/errno.h:5,
                 from ./include/linux/gpio.h:15,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/uapi/linux/errno.h:1:10: fatal error: asm/errno.h: No such file or directory
    1 | #include <asm/errno.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:270: recipe for target '/home/plcnet/workspace_ax5/example_driver/intc_gpio.o' failed
make[2]: *** [/home/plcnet/workspace_ax5/example_driver/intc_gpio.o] Error 1
Makefile:1767: recipe for target '/home/plcnet/workspace_ax5/example_driver' failed
make[1]: *** [/home/plcnet/workspace_ax5/example_driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-150-generic'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2

According to the error message, I check the missing file and try to supplement it.

However, what followed was more error messages.

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- -C /lib/modules/5.4.0-150-generic/build M=/home/plcnet/workspace_ax5/example_driver modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-150-generic'
  CC [M]  /home/plcnet/workspace_ax5/example_driver/intc_gpio.o
In file included from ./include/linux/compiler.h:325,
                 from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/barrier.h:9:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
    9 | #if __LINUX_ARM_ARCH__ >= 7 ||  \
      |     ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/barrier.h:10:3: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   10 |  (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K))
      |   ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/barrier.h:18:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   18 | #if __LINUX_ARM_ARCH__ >= 7
      |     ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/barrier.h:28:35: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   28 | #elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
      |                                   ^~~~~~~~~~~~~~~~~~
In file included from ./include/linux/irqflags.h:16,
                 from ./arch/arm/include/asm/bitops.h:28,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/irqflags.h:22:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   22 | #if __LINUX_ARM_ARCH__ >= 6
      |     ^~~~~~~~~~~~~~~~~~
In file included from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/bitops.h:216:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
  216 | #if __LINUX_ARM_ARCH__ < 5
      |     ^~~~~~~~~~~~~~~~~~
In file included from ./arch/arm/include/asm/bitops.h:218,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm-generic/bitops/__fls.h: In function ‘__fls’:
./include/asm-generic/bitops/__fls.h:18:21: warning: left shift count >= width of type [-Wshift-count-overflow]
   18 |  if (!(word & (~0ul << 32))) {
      |                     ^~
./include/asm-generic/bitops/__fls.h:20:8: warning: left shift count >= width of type [-Wshift-count-overflow]
   20 |   word <<= 32;
      |        ^~~
./include/asm-generic/bitops/__fls.h:23:21: warning: left shift count >= width of type [-Wshift-count-overflow]
   23 |  if (!(word & (~0ul << (BITS_PER_LONG-16)))) {
      |                     ^~
./include/asm-generic/bitops/__fls.h:27:21: warning: left shift count >= width of type [-Wshift-count-overflow]
   27 |  if (!(word & (~0ul << (BITS_PER_LONG-8)))) {
      |                     ^~
./include/asm-generic/bitops/__fls.h:31:21: warning: left shift count >= width of type [-Wshift-count-overflow]
   31 |  if (!(word & (~0ul << (BITS_PER_LONG-4)))) {
      |                     ^~
./include/asm-generic/bitops/__fls.h:35:21: warning: left shift count >= width of type [-Wshift-count-overflow]
   35 |  if (!(word & (~0ul << (BITS_PER_LONG-2)))) {
      |                     ^~
./include/asm-generic/bitops/__fls.h:39:21: warning: left shift count >= width of type [-Wshift-count-overflow]
   39 |  if (!(word & (~0ul << (BITS_PER_LONG-1))))
      |                     ^~
In file included from ./arch/arm/include/asm/bitops.h:219,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm-generic/bitops/__ffs.h: In function ‘__ffs’:
./include/asm-generic/bitops/__ffs.h:20:8: warning: right shift count >= width of type [-Wshift-count-overflow]
   20 |   word >>= 32;
      |        ^~~
In file included from ./include/linux/prefetch.h:15,
                 from ./arch/arm/include/asm/atomic.h:12,
                 from ./include/linux/atomic.h:7,
                 from ./include/asm-generic/bitops/lock.h:5,
                 from ./arch/arm/include/asm/bitops.h:243,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/processor.h: At top level:
./arch/arm/include/asm/processor.h:88:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   88 | #if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327)
      |     ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/processor.h:118:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
  118 | #if __LINUX_ARM_ARCH__ >= 5
      |     ^~~~~~~~~~~~~~~~~~
In file included from ./arch/arm/include/asm/atomic.h:16,
                 from ./include/linux/atomic.h:7,
                 from ./include/asm-generic/bitops/lock.h:5,
                 from ./arch/arm/include/asm/bitops.h:243,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/cmpxchg.h: In function ‘__xchg’:
./arch/arm/include/asm/cmpxchg.h:35:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   35 | #if __LINUX_ARM_ARCH__ >= 6
      |     ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/cmpxchg.h:42:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   42 | #if __LINUX_ARM_ARCH__ >= 6
      |     ^~~~~~~~~~~~~~~~~~
In file included from ./arch/arm/include/asm/atomic.h:16,
                 from ./include/linux/atomic.h:7,
                 from ./include/asm-generic/bitops/lock.h:5,
                 from ./arch/arm/include/asm/bitops.h:243,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/cmpxchg.h: At top level:
./arch/arm/include/asm/cmpxchg.h:124:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
  124 | #if __LINUX_ARM_ARCH__ < 6
      |     ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/cmpxchg.h:128:2: error: #error "SMP is not supported on this platform"
  128 | #error "SMP is not supported on this platform"
      |  ^~~~~
In file included from ./arch/arm/include/asm/cmpxchg.h:146,
                 from ./arch/arm/include/asm/atomic.h:16,
                 from ./include/linux/atomic.h:7,
                 from ./include/asm-generic/bitops/lock.h:5,
                 from ./arch/arm/include/asm/bitops.h:243,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm-generic/cmpxchg.h:11:2: error: #error "Cannot use generic cmpxchg on SMP"
   11 | #error "Cannot use generic cmpxchg on SMP"
      |  ^~~~~
In file included from ./include/linux/atomic.h:7,
                 from ./include/asm-generic/bitops/lock.h:5,
                 from ./arch/arm/include/asm/bitops.h:243,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/atomic.h:30:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   30 | #if __LINUX_ARM_ARCH__ >= 6
      |     ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/atomic.h:161:2: error: #error SMP not supported on pre-ARMv6 CPUs
  161 | #error SMP not supported on pre-ARMv6 CPUs
      |  ^~~~~
./arch/arm/include/asm/atomic.h:250:3: error: conflicting types for ‘atomic64_t’
  250 | } atomic64_t;
      |   ^~~~~~~~~~
In file included from ./include/linux/limits.h:6,
                 from ./include/linux/kernel.h:7,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/linux/types.h:178:3: note: previous declaration of ‘atomic64_t’ was here
  178 | } atomic64_t;
      |   ^~~~~~~~~~
In file included from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/bitops.h:202:31: error: conflicting types for ‘_find_first_bit_le’
  202 | #define find_first_bit(p,sz)  _find_first_bit_le(p,sz)
      |                               ^~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/find.h:59:22: note: in expansion of macro ‘find_first_bit’
   59 | extern unsigned long find_first_bit(const unsigned long *addr,
      |                      ^~~~~~~~~~~~~~
./arch/arm/include/asm/bitops.h:165:12: note: previous declaration of ‘_find_first_bit_le’ was here
  165 | extern int _find_first_bit_le(const unsigned long *p, unsigned size);
      |            ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/bitops.h:200:35: error: conflicting types for ‘_find_first_zero_bit_le’
  200 | #define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz)
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bitops/find.h:70:22: note: in expansion of macro ‘find_first_zero_bit’
   70 | extern unsigned long find_first_zero_bit(const unsigned long *addr,
      |                      ^~~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/bitops.h:163:12: note: previous declaration of ‘_find_first_zero_bit_le’ was here
  163 | extern int _find_first_zero_bit_le(const unsigned long *p, unsigned size);
      |            ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ./arch/arm/include/asm/swab.h:19,
                 from ./include/uapi/linux/swab.h:8,
                 from ./include/linux/swab.h:5,
                 from ./include/uapi/linux/byteorder/little_endian.h:13,
                 from ./include/linux/byteorder/little_endian.h:5,
                 from ./arch/arm/include/uapi/asm/byteorder.h:22,
                 from ./include/asm-generic/bitops/le.h:6,
                 from ./arch/arm/include/asm/bitops.h:268,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/uapi/asm/swab.h:27:29: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   27 | #if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
      |                             ^~~~~~~~~~~~~~~~~~
In file included from ./include/uapi/linux/swab.h:8,
                 from ./include/linux/swab.h:5,
                 from ./include/uapi/linux/byteorder/little_endian.h:13,
                 from ./include/linux/byteorder/little_endian.h:5,
                 from ./arch/arm/include/uapi/asm/byteorder.h:22,
                 from ./include/asm-generic/bitops/le.h:6,
                 from ./arch/arm/include/asm/bitops.h:268,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/swab.h:21:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   21 | #if __LINUX_ARM_ARCH__ >= 6
      |     ^~~~~~~~~~~~~~~~~~
In file included from ./include/linux/dynamic_debug.h:6,
                 from ./include/linux/printk.h:348,
                 from ./include/linux/kernel.h:15,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/linux/jump_label.h:122:8: error: redefinition of ‘struct jump_entry’
  122 | struct jump_entry {
      |        ^~~~~~~~~~
In file included from ./include/linux/jump_label.h:117,
                 from ./include/linux/dynamic_debug.h:6,
                 from ./include/linux/printk.h:348,
                 from ./include/linux/kernel.h:15,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/jump_label.h:42:8: note: originally defined here
   42 | struct jump_entry {
      |        ^~~~~~~~~~
In file included from ./arch/arm/include/asm/thread_info.h:13,
                 from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/fpstate.h:29:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
   29 | #if __LINUX_ARM_ARCH__ < 6
      |     ^~~~~~~~~~~~~~~~~~
In file included from ./arch/arm/include/asm/thread_info.h:14,
                 from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/page.h:104:2: error: #error Unknown user operations model
  104 | #error Unknown user operations model
      |  ^~~~~
In file included from ./include/linux/const.h:4,
                 from ./include/linux/bits.h:5,
                 from ./include/linux/bitops.h:5,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/memory.h:31:24: warning: "CONFIG_PAGE_OFFSETUL" is not defined, evaluates to 0 [-Wundef]
   31 | #define TASK_SIZE  (UL(CONFIG_PAGE_OFFSET) - UL(SZ_16M))
      |                        ^~~~~~~~~~~~~~~~~~
./include/uapi/linux/const.h:20:20: note: in definition of macro ‘__AC’
   20 | #define __AC(X,Y) (X##Y)
      |                    ^
./include/uapi/linux/const.h:25:18: note: in expansion of macro ‘_AC’
   25 | #define _UL(x)  (_AC(x, UL))
      |                  ^~~
./include/linux/const.h:6:17: note: in expansion of macro ‘_UL’
    6 | #define UL(x)  (_UL(x))
      |                 ^~~
./arch/arm/include/asm/memory.h:31:21: note: in expansion of macro ‘UL’
   31 | #define TASK_SIZE  (UL(CONFIG_PAGE_OFFSET) - UL(SZ_16M))
      |                     ^~
./arch/arm/include/asm/memory.h:50:5: note: in expansion of macro ‘TASK_SIZE’
   50 | #if TASK_SIZE > MODULES_VADDR
      |     ^~~~~~~~~
./arch/arm/include/asm/memory.h:23:25: warning: "CONFIG_PAGE_OFFSETUL" is not defined, evaluates to 0 [-Wundef]
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                         ^~~~~~~~~~~~~~~~~~
./include/uapi/linux/const.h:20:20: note: in definition of macro ‘__AC’
   20 | #define __AC(X,Y) (X##Y)
      |                    ^
./include/uapi/linux/const.h:25:18: note: in expansion of macro ‘_AC’
   25 | #define _UL(x)  (_AC(x, UL))
      |                  ^~~
./include/linux/const.h:6:17: note: in expansion of macro ‘_UL’
    6 | #define UL(x)  (_UL(x))
      |                 ^~~
./arch/arm/include/asm/memory.h:23:22: note: in expansion of macro ‘UL’
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                      ^~
./arch/arm/include/asm/memory.h:44:25: note: in expansion of macro ‘PAGE_OFFSET’
   44 | #define MODULES_VADDR  (PAGE_OFFSET - SZ_16M)
      |                         ^~~~~~~~~~~
./arch/arm/include/asm/memory.h:50:17: note: in expansion of macro ‘MODULES_VADDR’
   50 | #if TASK_SIZE > MODULES_VADDR
      |                 ^~~~~~~~~~~~~
In file included from ./arch/arm/include/asm/page.h:160,
                 from ./arch/arm/include/asm/thread_info.h:14,
                 from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/memory.h:44:37: warning: the right operand of ">" changes sign when promoted
   44 | #define MODULES_VADDR  (PAGE_OFFSET - SZ_16M)
      |                                     ^
./arch/arm/include/asm/memory.h:50:17: note: in expansion of macro ‘MODULES_VADDR’
   50 | #if TASK_SIZE > MODULES_VADDR
      |                 ^~~~~~~~~~~~~
In file included from ./include/linux/const.h:4,
                 from ./include/linux/bits.h:5,
                 from ./include/linux/bitops.h:5,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/memory.h: In function ‘__virt_to_phys_nodebug’:
./arch/arm/include/asm/memory.h:23:25: error: ‘CONFIG_PAGE_OFFSETUL’ undeclared (first use in this function); did you mean ‘CONFIG_PAGE_POOL’?
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                         ^~~~~~~~~~~~~~~~~~
./include/uapi/linux/const.h:20:20: note: in definition of macro ‘__AC’
   20 | #define __AC(X,Y) (X##Y)
      |                    ^
./include/uapi/linux/const.h:25:18: note: in expansion of macro ‘_AC’
   25 | #define _UL(x)  (_AC(x, UL))
      |                  ^~~
./include/linux/const.h:6:17: note: in expansion of macro ‘_UL’
    6 | #define UL(x)  (_UL(x))
      |                 ^~~
./arch/arm/include/asm/memory.h:23:22: note: in expansion of macro ‘UL’
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                      ^~
./arch/arm/include/asm/memory.h:254:26: note: in expansion of macro ‘PAGE_OFFSET’
  254 |  return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET;
      |                          ^~~~~~~~~~~
./arch/arm/include/asm/memory.h:23:25: note: each undeclared identifier is reported only once for each function it appears in
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                         ^~~~~~~~~~~~~~~~~~
./include/uapi/linux/const.h:20:20: note: in definition of macro ‘__AC’
   20 | #define __AC(X,Y) (X##Y)
      |                    ^
./include/uapi/linux/const.h:25:18: note: in expansion of macro ‘_AC’
   25 | #define _UL(x)  (_AC(x, UL))
      |                  ^~~
./include/linux/const.h:6:17: note: in expansion of macro ‘_UL’
    6 | #define UL(x)  (_UL(x))
      |                 ^~~
./arch/arm/include/asm/memory.h:23:22: note: in expansion of macro ‘UL’
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                      ^~
./arch/arm/include/asm/memory.h:254:26: note: in expansion of macro ‘PAGE_OFFSET’
  254 |  return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET;
      |                          ^~~~~~~~~~~
./arch/arm/include/asm/memory.h:146:29: error: ‘CONFIG_PHYS_OFFSETUL’ undeclared (first use in this function); did you mean ‘CONFIG_SND_OSSEMUL’?
  146 | #define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
      |                             ^~~~~~~~~~~~~~~~~~
./include/uapi/linux/const.h:20:20: note: in definition of macro ‘__AC’
   20 | #define __AC(X,Y) (X##Y)
      |                    ^
./include/uapi/linux/const.h:25:18: note: in expansion of macro ‘_AC’
   25 | #define _UL(x)  (_AC(x, UL))
      |                  ^~~
./include/linux/const.h:6:17: note: in expansion of macro ‘_UL’
    6 | #define UL(x)  (_UL(x))
      |                 ^~~
./arch/arm/include/asm/memory.h:146:26: note: in expansion of macro ‘UL’
  146 | #define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
      |                          ^~
./arch/arm/include/asm/memory.h:249:21: note: in expansion of macro ‘PLAT_PHYS_OFFSET’
  249 | #define PHYS_OFFSET PLAT_PHYS_OFFSET
      |                     ^~~~~~~~~~~~~~~~
./arch/arm/include/asm/memory.h:254:40: note: in expansion of macro ‘PHYS_OFFSET’
  254 |  return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET;
      |                                        ^~~~~~~~~~~
./arch/arm/include/asm/memory.h: In function ‘__phys_to_virt’:
./arch/arm/include/asm/memory.h:146:29: error: ‘CONFIG_PHYS_OFFSETUL’ undeclared (first use in this function); did you mean ‘CONFIG_SND_OSSEMUL’?
  146 | #define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
      |                             ^~~~~~~~~~~~~~~~~~
./include/uapi/linux/const.h:20:20: note: in definition of macro ‘__AC’
   20 | #define __AC(X,Y) (X##Y)
      |                    ^
./include/uapi/linux/const.h:25:18: note: in expansion of macro ‘_AC’
   25 | #define _UL(x)  (_AC(x, UL))
      |                  ^~~
./include/linux/const.h:6:17: note: in expansion of macro ‘_UL’
    6 | #define UL(x)  (_UL(x))
      |                 ^~~
./arch/arm/include/asm/memory.h:146:26: note: in expansion of macro ‘UL’
  146 | #define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
      |                          ^~
./arch/arm/include/asm/memory.h:249:21: note: in expansion of macro ‘PLAT_PHYS_OFFSET’
  249 | #define PHYS_OFFSET PLAT_PHYS_OFFSET
      |                     ^~~~~~~~~~~~~~~~
./arch/arm/include/asm/memory.h:259:13: note: in expansion of macro ‘PHYS_OFFSET’
  259 |  return x - PHYS_OFFSET + PAGE_OFFSET;
      |             ^~~~~~~~~~~
./arch/arm/include/asm/memory.h:23:25: error: ‘CONFIG_PAGE_OFFSETUL’ undeclared (first use in this function); did you mean ‘CONFIG_PAGE_POOL’?
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                         ^~~~~~~~~~~~~~~~~~
./include/uapi/linux/const.h:20:20: note: in definition of macro ‘__AC’
   20 | #define __AC(X,Y) (X##Y)
      |                    ^
./include/uapi/linux/const.h:25:18: note: in expansion of macro ‘_AC’
   25 | #define _UL(x)  (_AC(x, UL))
      |                  ^~~
./include/linux/const.h:6:17: note: in expansion of macro ‘_UL’
    6 | #define UL(x)  (_UL(x))
      |                 ^~~
./arch/arm/include/asm/memory.h:23:22: note: in expansion of macro ‘UL’
   23 | #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
      |                      ^~
./arch/arm/include/asm/memory.h:259:27: note: in expansion of macro ‘PAGE_OFFSET’
  259 |  return x - PHYS_OFFSET + PAGE_OFFSET;
      |                           ^~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h: At top level:
./arch/arm/include/asm/thread_info.h:86:59: error: macro "current_thread_info" passed 1 arguments, but takes just 0
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                                           ^
In file included from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/linux/thread_info.h:23: note: macro "current_thread_info" defined here
   23 | #define current_thread_info() ((struct thread_info *)current)
      | 
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: warning: variable ‘current_thread_info’ declared ‘inline’
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/thread_info.h:86:22: warning: ‘const’ attribute ignored [-Wattributes]
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                      ^~~~~~~~~~~
./arch/arm/include/asm/thread_info.h:86:22: warning: ‘gnu_inline’ attribute ignored [-Wattributes]
./arch/arm/include/asm/thread_info.h:86:35: error: ‘no_instrument_function’ attribute applies only to functions
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/thread_info.h:88:59: error: macro "current_thread_info" passed 1 arguments, but takes just 0
   88 | static inline struct thread_info *current_thread_info(void)
      |                                                           ^
In file included from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/linux/thread_info.h:23: note: macro "current_thread_info" defined here
   23 | #define current_thread_info() ((struct thread_info *)current)
      | 
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:89:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
   89 | {
      | ^
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/preempt.h: In function ‘preempt_count’:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:330:17: note: in definition of macro ‘__READ_ONCE’
  330 |  union { typeof(x) __val; char __c[1]; } __u;   \
      |                 ^
./include/asm/preempt.h:11:9: note: in expansion of macro ‘READ_ONCE’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |         ^~~~~~~~~
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/asm/preempt.h:11:19: note: in expansion of macro ‘current_thread_info’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:332:22: note: in definition of macro ‘__READ_ONCE’
  332 |   __read_once_size(&(x), __u.__c, sizeof(x));  \
      |                      ^
./include/asm/preempt.h:11:9: note: in expansion of macro ‘READ_ONCE’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |         ^~~~~~~~~
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/asm/preempt.h:11:19: note: in expansion of macro ‘current_thread_info’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:332:42: note: in definition of macro ‘__READ_ONCE’
  332 |   __read_once_size(&(x), __u.__c, sizeof(x));  \
      |                                          ^
./include/asm/preempt.h:11:9: note: in expansion of macro ‘READ_ONCE’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |         ^~~~~~~~~
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/asm/preempt.h:11:19: note: in expansion of macro ‘current_thread_info’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:334:30: note: in definition of macro ‘__READ_ONCE’
  334 |   __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
      |                              ^
./include/asm/preempt.h:11:9: note: in expansion of macro ‘READ_ONCE’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |         ^~~~~~~~~
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/asm/preempt.h:11:19: note: in expansion of macro ‘current_thread_info’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:334:50: note: in definition of macro ‘__READ_ONCE’
  334 |   __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
      |                                                  ^
./include/asm/preempt.h:11:9: note: in expansion of macro ‘READ_ONCE’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |         ^~~~~~~~~
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/asm/preempt.h:11:19: note: in expansion of macro ‘current_thread_info’
   11 |  return READ_ONCE(current_thread_info()->preempt_count);
      |                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/preempt.h: In function ‘preempt_count_ptr’:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/asm/preempt.h:16:10: note: in expansion of macro ‘current_thread_info’
   16 |  return &current_thread_info()->preempt_count;
      |          ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/preempt.h: In function ‘__preempt_count_dec_and_test’:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/linux/thread_info.h:111:22: note: in expansion of macro ‘current_thread_info’
  111 |  test_ti_thread_flag(current_thread_info(), flag)
      |                      ^~~~~~~~~~~~~~~~~~~
./include/linux/thread_info.h:113:28: note: in expansion of macro ‘test_thread_flag’
  113 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
      |                            ^~~~~~~~~~~~~~~~
./include/asm/preempt.h:69:36: note: in expansion of macro ‘tif_need_resched’
   69 |  return !--*preempt_count_ptr() && tif_need_resched();
      |                                    ^~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/asm-generic/gpio.h:5,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/asm/preempt.h: In function ‘should_resched’:
./include/asm/current.h:7:24: error: called object ‘current_thread_info’ is not a function or function pointer
    7 | #define get_current() (current_thread_info()->task)
      |                        ^~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
./include/asm/current.h:8:17: note: in expansion of macro ‘get_current’
    8 | #define current get_current()
      |                 ^~~~~~~~~~~
./include/linux/thread_info.h:23:54: note: in expansion of macro ‘current’
   23 | #define current_thread_info() ((struct thread_info *)current)
      |                                                      ^~~~~~~
./include/linux/thread_info.h:111:22: note: in expansion of macro ‘current_thread_info’
  111 |  test_ti_thread_flag(current_thread_info(), flag)
      |                      ^~~~~~~~~~~~~~~~~~~
./include/linux/thread_info.h:113:28: note: in expansion of macro ‘test_thread_flag’
  113 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
      |                            ^~~~~~~~~~~~~~~~
./include/asm/preempt.h:78:4: note: in expansion of macro ‘tif_need_resched’
   78 |    tif_need_resched());
      |    ^~~~~~~~~~~~~~~~
In file included from ./include/linux/thread_info.h:39,
                 from ./include/asm/current.h:5,
                 from ./include/linux/mutex.h:14,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/thread_info.h:86:35: note: declared here
   86 | static inline struct thread_info *current_thread_info(void) __attribute_const__;
      |                                   ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/spinlock.h:89,
                 from ./include/linux/radix-tree.h:16,
                 from ./include/linux/idr.h:15,
                 from ./include/linux/kernfs.h:13,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./arch/arm/include/asm/spinlock.h: At top level:
./arch/arm/include/asm/spinlock.h:5:5: warning: "__LINUX_ARM_ARCH__" is not defined, evaluates to 0 [-Wundef]
    5 | #if __LINUX_ARM_ARCH__ < 6
      |     ^~~~~~~~~~~~~~~~~~
./arch/arm/include/asm/spinlock.h:6:2: error: #error SMP not supported on pre-ARMv6 CPUs
    6 | #error SMP not supported on pre-ARMv6 CPUs
      |  ^~~~~
In file included from ./include/linux/mm_types.h:5,
                 from ./include/linux/mmzone.h:21,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/xarray.h:14,
                 from ./include/linux/radix-tree.h:18,
                 from ./include/linux/idr.h:15,
                 from ./include/linux/kernfs.h:13,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/asm-generic/gpio.h:8,
                 from ./include/linux/gpio.h:62,
                 from /home/plcnet/workspace_ax5/example_driver/intc_gpio.c:1:
./include/linux/mm_types_task.h:19:10: fatal error: asm/tlbbatch.h: No such file or directory
   19 | #include <asm/tlbbatch.h>
      |          ^~~~~~~~~~~~~~~~

Do you know how to fix it ? Do I need to install or upgrade packages to Make it ?

Thanks.

  • Hey Woody,

    Could you please list the contents of the "/lib/modules/5.4.0-150-generic/build"? if you are attempting to use -C you need to make sure that the given directory contains linux headers. The Yocto project has some nice documentation on building out-of-tree modules if you need some help with that: https://docs.yoctoproject.org/kernel-dev/common.html#working-with-out-of-tree-modules

    Regards,

    Randolph

  • Hi Sapp,

    Below is the content of the path, I have created a soft-link for "include/asm" using "$ ln -s asm-generic asm" to solve the first problem.

    But what followed was more error messages.

    user-ubuntu:/lib/modules/5.4.0-150-generic/build$ ls -l include/asm/
    Display all 125 possibilities? (y or n)
    4level-fixup.h         bitops-instrumented.h  dma-mapping.h          hugetlb.h              linkage.h              parport.h              seccomp.h              tlbflush.h
    5level-fixup.h         bitsperlong.h          early_ioremap.h        hw_irq.h               local64.h              pci.h                  sections.h             tlb.h
    asm-offsets.h          bug.h                  emergency-restart.h    ide_iops.h             local.h                pci_iomap.h            serial.h               topology.h
    asm-prototypes.h       bugs.h                 errno.h                int-ll64.h             mcs_spinlock.h         percpu.h               set_memory.h           trace_clock.h
    atomic64.h             cacheflush.h           error-injection.h      ioctl.h                memory_model.h         pgalloc.h              shmparam.h             uaccess.h
    atomic.h               cache.h                exec.h                 io.h                   mm-arch-hooks.h        pgtable.h              signal.h               unaligned.h
    atomic-instrumented.h  checksum.h             export.h               iomap.h                mm_hooks.h             pgtable-nop4d.h        simd.h                 user.h
    atomic-long.h          cmpxchg.h              extable.h              irqflags.h             mmiowb.h               pgtable-nop4d-hack.h   spinlock.h             vdso/
    audit_change_attr.h    cmpxchg-local.h        fb.h                   irq.h                  mmiowb_types.h         pgtable-nopmd.h        statfs.h               vga.h
    audit_dir_write.h      compat.h               fixmap.h               irq_regs.h             mmu_context.h          pgtable-nopud.h        string.h               vmlinux.lds.h
    audit_read.h           current.h              flat.h                 irq_work.h             mmu.h                  preempt.h              switch_to.h            vtime.h
    audit_signal.h         delay.h                ftrace.h               Kbuild                 module.h               qrwlock.h              syscall.h              word-at-a-time.h
    audit_write.h          device.h               futex.h                kdebug.h               mshyperv.h             qrwlock_types.h        syscalls.h             xor.h
    barrier.h              div64.h                getorder.h             kmap_types.h           msi.h                  qspinlock.h            termios-base.h         
    bitops/                dma-contiguous.h       gpio.h                 kprobes.h              page.h                 qspinlock_types.h      termios.h              
    bitops.h               dma.h                  hardirq.h              kvm_para.h             param.h                resource.h             timex.h                
    
    
    user-ubuntu:/lib/modules/5.4.0-150-generic/build$ ls -l include/asm-generic/
    Display all 125 possibilities? (y or n)
    4level-fixup.h         bitops-instrumented.h  dma-mapping.h          hugetlb.h              linkage.h              parport.h              seccomp.h              tlbflush.h
    5level-fixup.h         bitsperlong.h          early_ioremap.h        hw_irq.h               local64.h              pci.h                  sections.h             tlb.h
    asm-offsets.h          bug.h                  emergency-restart.h    ide_iops.h             local.h                pci_iomap.h            serial.h               topology.h
    asm-prototypes.h       bugs.h                 errno.h                int-ll64.h             mcs_spinlock.h         percpu.h               set_memory.h           trace_clock.h
    atomic64.h             cacheflush.h           error-injection.h      ioctl.h                memory_model.h         pgalloc.h              shmparam.h             uaccess.h
    atomic.h               cache.h                exec.h                 io.h                   mm-arch-hooks.h        pgtable.h              signal.h               unaligned.h
    atomic-instrumented.h  checksum.h             export.h               iomap.h                mm_hooks.h             pgtable-nop4d.h        simd.h                 user.h
    atomic-long.h          cmpxchg.h              extable.h              irqflags.h             mmiowb.h               pgtable-nop4d-hack.h   spinlock.h             vdso/
    audit_change_attr.h    cmpxchg-local.h        fb.h                   irq.h                  mmiowb_types.h         pgtable-nopmd.h        statfs.h               vga.h
    audit_dir_write.h      compat.h               fixmap.h               irq_regs.h             mmu_context.h          pgtable-nopud.h        string.h               vmlinux.lds.h
    audit_read.h           current.h              flat.h                 irq_work.h             mmu.h                  preempt.h              switch_to.h            vtime.h
    audit_signal.h         delay.h                ftrace.h               Kbuild                 module.h               qrwlock.h              syscall.h              word-at-a-time.h
    audit_write.h          device.h               futex.h                kdebug.h               mshyperv.h             qrwlock_types.h        syscalls.h             xor.h
    barrier.h              div64.h                getorder.h             kmap_types.h           msi.h                  qspinlock.h            termios-base.h         
    bitops/                dma-contiguous.h       gpio.h                 kprobes.h              page.h                 qspinlock_types.h      termios.h              
    bitops.h               dma.h                  hardirq.h              kvm_para.h             param.h                resource.h             timex.h

  • Woody, you've listed the contents of the include directories you've linked but I'm still not certain about the structure of the top level directory you are specifying with "-C" (/lib/modules/5.4.0-150-generic/build). Could you please list the contents of that directory.

  • Hi Sapp,

    Please see contents as below. If you have any ideas please share it with me, thank you.

    user-ubuntu:/lib/modules/5.4.0-150-generic/build$ ll
    total 2100
    drwxr-xr-x  7 root root    4096 Jun  9 08:41 ./
    drwxr-xr-x 11 root root    4096 Jun 30 09:45 ../
    drwxr-xr-x  3 root root    4096 Jun  9 08:41 arch/
    lrwxrwxrwx  1 root root      40 May 19 23:23 block -> ../linux-hwe-5.4-headers-5.4.0-150/block/
    lrwxrwxrwx  1 root root      40 May 19 23:23 certs -> ../linux-hwe-5.4-headers-5.4.0-150/certs/
    -rw-r--r--  1 root root  237630 May 19 23:23 .config
    -rw-r--r--  1 root root  237778 May 19 23:23 .config.old
    lrwxrwxrwx  1 root root      41 May 19 23:23 crypto -> ../linux-hwe-5.4-headers-5.4.0-150/crypto/
    lrwxrwxrwx  1 root root      48 May 19 23:23 Documentation -> ../linux-hwe-5.4-headers-5.4.0-150/Documentation/
    lrwxrwxrwx  1 root root      42 May 19 23:23 drivers -> ../linux-hwe-5.4-headers-5.4.0-150/drivers/
    lrwxrwxrwx  1 root root      37 May 19 23:23 fs -> ../linux-hwe-5.4-headers-5.4.0-150/fs/
    -rw-r--r--  1 root root      39 May 19 23:23 .gitignore
    drwxr-xr-x  4 root root    4096 Aug 22 11:30 include/
    lrwxrwxrwx  1 root root      39 May 19 23:23 init -> ../linux-hwe-5.4-headers-5.4.0-150/init/
    lrwxrwxrwx  1 root root      38 May 19 23:23 ipc -> ../linux-hwe-5.4-headers-5.4.0-150/ipc/
    lrwxrwxrwx  1 root root      41 May 19 23:23 Kbuild -> ../linux-hwe-5.4-headers-5.4.0-150/Kbuild
    lrwxrwxrwx  1 root root      42 May 19 23:23 Kconfig -> ../linux-hwe-5.4-headers-5.4.0-150/Kconfig
    drwxr-xr-x  2 root root    4096 Jun  9 08:41 kernel/
    lrwxrwxrwx  1 root root      38 May 19 23:23 lib -> ../linux-hwe-5.4-headers-5.4.0-150/lib/
    lrwxrwxrwx  1 root root      43 May 19 23:23 Makefile -> ../linux-hwe-5.4-headers-5.4.0-150/Makefile
    -rw-r--r--  1 root root    1194 May 19 23:23 .missing-syscalls.d
    lrwxrwxrwx  1 root root      37 May 19 23:23 mm -> ../linux-hwe-5.4-headers-5.4.0-150/mm/
    -rw-r--r--  1 root root 1621143 May 19 23:23 Module.symvers
    lrwxrwxrwx  1 root root      38 May 19 23:23 net -> ../linux-hwe-5.4-headers-5.4.0-150/net/
    lrwxrwxrwx  1 root root      42 May 19 23:23 samples -> ../linux-hwe-5.4-headers-5.4.0-150/samples/
    drwxr-xr-x  8 root root   12288 Jun  9 08:41 scripts/
    lrwxrwxrwx  1 root root      43 May 19 23:23 security -> ../linux-hwe-5.4-headers-5.4.0-150/security/
    lrwxrwxrwx  1 root root      40 May 19 23:23 sound -> ../linux-hwe-5.4-headers-5.4.0-150/sound/
    drwxr-xr-x  3 root root    4096 Jun  9 08:41 tools/
    lrwxrwxrwx  1 root root      41 May 19 23:23 ubuntu -> ../linux-hwe-5.4-headers-5.4.0-150/ubuntu/
    lrwxrwxrwx  1 root root      38 May 19 23:23 usr -> ../linux-hwe-5.4-headers-5.4.0-150/usr/
    lrwxrwxrwx  1 root root      39 May 19 23:23 virt -> ../linux-hwe-5.4-headers-5.4.0-150/virt/
    

  • Woody,

    Thanks, though, what is this build directory? Did you generate it or did some tool do it? I'm a little concerned that it just contains links to what appears to be a proper headers directory one level above.

    Was the headers directory above built using the correct architecture? Some header files are generated as part of the build process and may end up containing architecture specific code.

    Regards,

    Randolph

  • Hi Sapp,

    I am not sure how the build directory comes. I did not use any tool to generate it.

    If I want to re-generate these build directory, how should I do?

    Thanks.

     

  • Woody,

    Are you compiling this on target or are you cross-compiling this? If you're cross-compiling this, are you using the "Processor SDK SITARA AM335X Linux Package" assets?

    Regards,

    Randolph