Linux Kernal inconsistency?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 
I developed a Loadable Kernel Module and compiled and tested it for 2.4.1 through 2.4.9 kernel releases
 
Red Hat 7.2 is based on the 2.4.7 kernel. So I compiled my LKM for a 2.4.7 kernel from kernel.org and thought that it would
work on the same 2.4.7 kernel found in Red Hat 7.2. I was wrong.
 
When my LKM loads on the Red Hat 7.2 box using insmod -f mylkm.o I get an unresolved symbol up_and_exit.
 
I was aware that the up_and_exit() was replaced by complete_and_exit() in 2.4.9(pre) and had added the following macros
in my header files to deal with such:
 
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9)
#define THREAD_SEM_EXIT(c,l) up_and_exit(c,l)
#define THREAD_SEM_DECLARE(c) DECLARE_MUTEX_LOCKED(c)
#define THREAD_SEM_WAIT_COMPLETE(c) {down(c);up(c);}
 
#else
#include <linux/completion.h>
#define THREAD_SEM_EXIT(c,l) complete_and_exit(c,l)
#define THREAD_SEM_DECLARE(c) DECLARE_COMPLETION(c)
#define THREAD_SEM_WAIT_COMPLETE(c) wait_for_completion(c)
#endif
 
I further researched the issue and found that there was no 2.4.7-10 published at kernel.org.
 
Further, the 2.4.8 kernel from kernel.org still has up_and_exit() defined in kernel.h.
 
Is this a common practice of companies like Red Hat...?  I would think that if they built a 2.4.7-10 kernel that it would at least
be function-level compatable with the approved 2.4.7 kernel found at kernel.org and certainly not take out kernel functions.
 
Am I just misunderstanding something really simple?
 
Further, given the above, how would I/others deal with cases where 2.4.7 has a function that is not found in
RedHat's own 2.4.7-10 but is found in 2.4.8 and then goes away in 2.4.9 and above?
 
 
Stuart
 

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux