I definitely agree the easy part is the algorithm and the hard part is
creating the dependency list. For instance, attached is a small
algorithm that does the initcall sequencing at run time.
The API is is simple, you just register your initcall with a list of
critical initcalls you need to be run before yours (not all, just the
ones you definitely need to be run first). Then the ordering of the all
the initcalls are sequenced at run time. This way you don't have to
worry about link ordering or code ordering of your initcalls during
make/compile/link. All initcall ordering is done during boot.
This really frees you from module inter-dependencies because is doesn't
mater in what order you register you initcalls. You only need register
them with a list the critical modules that need to be initialized before
yours.
The API also provides that you can register more than one initcall for
your module with a different set of critical modules that must be run
first.
This should be relative easy to add to the kernel, as you don't have to
modify any of the existing initcalls. You do need to remove all
existing calls to them and register them instead with the new API.
Untar and "cd init; cc *.c; ./a.out"
Four example modules register their initcalls, "foo1, foo2, foo3, foo4",
and then the main routine sequences them at run time.
Regards, Keith
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/