The open_softirq function cannot be recognized in the module.

Source: Internet
Author: User
The open_softirq function cannot be recognized in the module-general Linux technology-Linux programming and kernel information. The following is a detailed description. My problem is that in the following code, the softirq function is called in softirq. c is defined in interrupt. the expression in the h function is extern, but during fc6 compilation, open_softirq is always prompted to be unrecognizable.
However, when the make command is successful, the module is loaded again and the error is still caused by open_softirq being an unrecognizable symbol.

At the beginning, I thought it was the fc6 source code package. Only the. h file does not have the. c file. So I downloaded the 2.6.18.1 source code package and compiled it under fc6, and then the make loaded module still encountered the same problem.
However, in the 2.6.15.5 kernel environment, you can compile it, load it normally, and print the output hello, world !!
I 'd like to ask you what is going on.

# Include
# Include
# Include

# Include

MODULE_DESCRIPTION ("My kernel module ");
MODULE_AUTHOR ("root (root@localhost.localdomain )");
MODULE_LICENSE ("$ LICENSE $ ");

Static void timer_func (struct softirq_action * h)
{
Printk (KERN_ALERT "hello, world !! \ N ");
}

Void fastcall raise_softirq (unsigned int nr)
{
Unsigned long flags;

Local_irq_save (flags );
Raise_softirq_irqoff (nr );
Local_irq_restore (flags );
}

Static int test1_init_module (void)
{
Printk (KERN_DEBUG "Module test1 init \ n ");
Open_softirq (TIMER_SOFTIRQ, timer_func, NULL );
Raise_softirq (TIMER_SOFTIRQ );
Return 0;
}

Static void test1_exit_module (void)
{
Printk (KERN_DEBUG "Module test1 exit \ n ");
}

Module_init (test1_init_module );
Module_exit (test1_exit_module );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.