mmzone.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2010 Loongson Inc. & Lemote Inc. &
  3. * Institute of Computing Technology
  4. * Author: Xiang Gao, gaoxiang@ict.ac.cn
  5. * Huacai Chen, chenhc@lemote.com
  6. * Xiaofu Meng, Shuangshuang Zhang
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #ifndef _ASM_MACH_MMZONE_H
  14. #define _ASM_MACH_MMZONE_H
  15. #include <boot_param.h>
  16. #define NODE_ADDRSPACE_SHIFT 44
  17. #define NODE0_ADDRSPACE_OFFSET 0x000000000000UL
  18. #define NODE1_ADDRSPACE_OFFSET 0x100000000000UL
  19. #define NODE2_ADDRSPACE_OFFSET 0x200000000000UL
  20. #define NODE3_ADDRSPACE_OFFSET 0x300000000000UL
  21. #define pa_to_nid(addr) (((addr) & 0xf00000000000) >> NODE_ADDRSPACE_SHIFT)
  22. #define LEVELS_PER_SLICE 128
  23. struct slice_data {
  24. unsigned long irq_enable_mask[2];
  25. int level_to_irq[LEVELS_PER_SLICE];
  26. };
  27. struct hub_data {
  28. cpumask_t h_cpus;
  29. unsigned long slice_map;
  30. unsigned long irq_alloc_mask[2];
  31. struct slice_data slice[2];
  32. };
  33. struct node_data {
  34. struct pglist_data pglist;
  35. struct hub_data hub;
  36. cpumask_t cpumask;
  37. };
  38. extern struct node_data *__node_data[];
  39. #define NODE_DATA(n) (&__node_data[(n)]->pglist)
  40. #define hub_data(n) (&__node_data[(n)]->hub)
  41. extern void setup_zero_pages(void);
  42. extern void __init prom_init_numa_memory(void);
  43. #endif /* _ASM_MACH_MMZONE_H */