amd_nb.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_get_nodes(struct bootnode *nodes);
  10. extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn);
  11. extern int amd_scan_nodes(void);
  12. struct amd_northbridge {
  13. struct pci_dev *misc;
  14. };
  15. struct amd_northbridge_info {
  16. u16 num;
  17. u64 flags;
  18. struct amd_northbridge *nb;
  19. };
  20. extern struct amd_northbridge_info amd_northbridges;
  21. #define AMD_NB_GART 0x1
  22. #ifdef CONFIG_AMD_NB
  23. static inline int amd_nb_num(void)
  24. {
  25. return amd_northbridges.num;
  26. }
  27. static inline int amd_nb_has_feature(int feature)
  28. {
  29. return ((amd_northbridges.flags & feature) == feature);
  30. }
  31. static inline struct amd_northbridge *node_to_amd_nb(int node)
  32. {
  33. return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
  34. }
  35. #else
  36. #define amd_nb_num(x) 0
  37. #define amd_nb_has_feature(x) false
  38. #define node_to_amd_nb(x) NULL
  39. #endif
  40. #endif /* _ASM_X86_AMD_NB_H */