amd_nb.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _ASM_X86_AMD_NB_H
  2. #define _ASM_X86_AMD_NB_H
  3. #include <linux/pci.h>
  4. extern struct pci_device_id amd_nb_misc_ids[];
  5. struct bootnode;
  6. extern int early_is_amd_nb(u32 value);
  7. extern int amd_cache_northbridges(void);
  8. extern void amd_flush_garts(void);
  9. extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn);
  10. extern int amd_scan_nodes(void);
  11. #ifdef CONFIG_NUMA_EMU
  12. extern void amd_fake_nodes(const struct bootnode *nodes, int nr_nodes);
  13. extern void amd_get_nodes(struct bootnode *nodes);
  14. #endif
  15. struct amd_northbridge {
  16. struct pci_dev *misc;
  17. };
  18. struct amd_northbridge_info {
  19. u16 num;
  20. u64 flags;
  21. struct amd_northbridge *nb;
  22. };
  23. extern struct amd_northbridge_info amd_northbridges;
  24. #define AMD_NB_GART 0x1
  25. #define AMD_NB_L3_INDEX_DISABLE 0x2
  26. #ifdef CONFIG_AMD_NB
  27. static inline int amd_nb_num(void)
  28. {
  29. return amd_northbridges.num;
  30. }
  31. static inline int amd_nb_has_feature(int feature)
  32. {
  33. return ((amd_northbridges.flags & feature) == feature);
  34. }
  35. static inline struct amd_northbridge *node_to_amd_nb(int node)
  36. {
  37. return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
  38. }
  39. #else
  40. #define amd_nb_num(x) 0
  41. #define amd_nb_has_feature(x) false
  42. #define node_to_amd_nb(x) NULL
  43. #endif
  44. #endif /* _ASM_X86_AMD_NB_H */