• Patrick Mochel's avatar
    driver model: add support for CPUs. · 2a833213
    Patrick Mochel authored
    - Create struct cpu to generically describe cpus (it simply contains
      a struct sys_device in it).
    
    - Define an array of size NR_CPUS in arch/i386/kernel/cpu/common.c 
      and register each on bootup. This gives us something like:
    
    # tree -d /sys/root/sys/
    /sys/root/sys/
    |-- cpu0
    |-- pic0
    `-- rtc0
    
    and:
    
    # tree -d /sys/bus/system/devices/
    /sys/bus/system/devices/
    |-- cpu0 -> ../../../root/sys/cpu0
    
    - Define arch-specific CPU driver that's also registered on boot.
      That gives us: 
    
    # tree -d /sys/bus/system/drivers/
    /sys/bus/system/drivers/
    |-- cpu
    
    - Create a CPU device class that's registered very early. That 
      gives us all the CPUs in the system in one place:
    
    # tree -d /sys/class/cpu/
    /sys/class/cpu/
    |-- devices
    |   `-- 0 -> ../../../root/sys/cpu0
    `-- drivers
    
    Other archs are encouraged to do the same.
    2a833213
common.c 13.1 KB