mp_bus_to_node.c 430 B

1234567891011121314151617181920212223
  1. #include <linux/pci.h>
  2. #include <linux/init.h>
  3. #include <linux/topology.h>
  4. #define BUS_NR 256
  5. static unsigned char mp_bus_to_node[BUS_NR];
  6. void set_mp_bus_to_node(int busnum, int node)
  7. {
  8. if (busnum >= 0 && busnum < BUS_NR)
  9. mp_bus_to_node[busnum] = (unsigned char) node;
  10. }
  11. int get_mp_bus_to_node(int busnum)
  12. {
  13. int node;
  14. if (busnum < 0 || busnum > (BUS_NR - 1))
  15. return 0;
  16. node = mp_bus_to_node[busnum];
  17. return node;
  18. }