[haiku-gsoc] Re: some questions about device manager

  • From: Philippe Houdoin <philippe.houdoin@xxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Wed, 11 Jul 2012 11:51:47 +0200

>  Thanks very much. The user accessible driver isn't necessary, it's just
> used to report some statics such as the time spent in c1/c2/c3 idle states.
> The problem is if they are implemented as normal modules, how to make they
> be loaded automatically?  Since the cpudile modules are neither busses nor
> bus_managers

My guess is that cpuidle modules may looks very similar to the MTRR
per-cpu modules, which are loaded by kernel in
src/system/kernel/arch/x86_arch_cpu.cpp:arch_cpu_init_post_modules().
Loading the cpuidle modules the same way will make sense, and avoid to
rely on a loading driver hack.
If I understood well, in arch_cpu_init_post_modules() busses modules
are already loaded, so ACPI bus should be initialized and ready,
allowing the acpi_cpuidle module to init.


In fact maybe they all should be merged in, to export both MTRR and
idle native support, but it could not worth the effort.
Meanwhile, their module names more clear regarding MTRR than
cpu/generic_x86/intel_v1...
For instance:

cpu/x86/mtrr/intel/v1
cpu/x86/mtrr/amd/v1
cpu/x86/mtrr/via/v1

and the new one:

cpu/x86/idle/intel/v1

If you look at src/add-ons/kernel/cpu/x86 folder, you will also see
how the specific modules are in fact hosted in one single binary, and
rely on a shared generic code they eventually override or expand on.
Maybe the same design could be adopted for idle feature too.

Bye,
Philippe.

Other related posts: