kernel/time/clocksource.c needs struct task_struct on m68k
PATCH 1/1 kernel/time/clocksource.c needs struct task_struct on m68k
kernel/time/clocksource.c needs struct task_struct on m68k.
Because it uses spin_unlock_irq(), which, on m68k, uses hardirq_count(), which uses preempt_count(), which needs to dereference struct task_struct, we have to include sched.h. Because it would cause a loop inclusion, we cannot include sched.h in any other of asm-m68k/system.h, linux/thread_info.h, linux/hardirq.h, which leaves this ugly include in a C file as the only simple solution.
kernel/time/clocksource.c +1 -0
@@ -28,6 +28,7 @@#include <linux/sysdev.h> #include <linux/init.h> #include <linux/module.h> +#include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */ /* XXX - Would like a better way for initializing curr_clocksource */ extern struct clocksource clocksource_jiffies;
Signature · 2 lines
OpenPGP public key: http://krystal.dyndns.org:8080/key/compudj.gpg Key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
Quoted 8 lines · Mathieu Desnoyers
kernel/time/clocksource.cneeds structtask_structon m68k.Because it uses
spin_unlock_irq(), which, on m68k, useshardirq_count(), which usespreempt_count(), which needs to dereference structtask_struct, we have to includesched.h. Because it would cause a loop inclusion, we cannot includesched.hin any other ofasm-m68k/system.h,linux/thread_info.h,linux/hardirq.h, which leaves this ugly include in a C file as the only simple solution.
This indeed sounds quite ugly. If there really is no other simple way to resolve this, this case seems to provide the missing incentive to create a task_struct.h header file.
Unfortunately, I currently cannot foresee when I will have time to do so.
Tim