Find the answer to your Linux question:
Results 1 to 2 of 2
This could be a basic question. I am using an atomic64_t variable for a counter in a kernel module. This compiled fine on x86_64 machines but not on i386, so ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2013
    Posts
    1

    atomic64 on i386 arch


    This could be a basic question.
    I am using an atomic64_t variable for a counter in a kernel module. This compiled fine on x86_64 machines but not on i386, so included the atomic64_32.h header :

    if defined(__i386__)
    #include <asm/atomic64_32.h>
    #endif

    This is helping to get the module compiled but fails to load the module saying the atomic64_* symbols are not found?
    Unknown symbol atomic64_inc
    Unknown symbol atomic64_set

    What is the correct way to use atomic64_t types in a kernel module?

    I tried looking up the exported kernel symbols and it does not list the atomic64* smbols both on i386 and x86_64 archs
    cat /proc/kallsyms | grep atomic64_inc

    I guess my basic understanding of kernel symbols and loading is poor. Please refer me to any good documentation if any.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,397
    Not having used these variable types, I can't say for sure, but if the module load fails, then the kernel is missing something. Check your kernel configuration. You may need to either change it to handle them, or to add them to your own module (type definitions, not declarations) to assure they are available for the dynamic kernel linker.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •