gru.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation; either version 2.1 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef __GRU_H__
  19. #define __GRU_H__
  20. /*
  21. * GRU architectural definitions
  22. */
  23. #define GRU_CACHE_LINE_BYTES 64
  24. #define GRU_HANDLE_STRIDE 256
  25. #define GRU_CB_BASE 0
  26. #define GRU_DS_BASE 0x20000
  27. /*
  28. * Size used to map GRU GSeg
  29. */
  30. #if defined(CONFIG_X86_64)
  31. #define GRU_GSEG_PAGESIZE (256 * 1024UL) /* ZZZ 2MB ??? */
  32. #else
  33. #error "Unsupported architecture"
  34. #endif
  35. /*
  36. * Structure for obtaining GRU resource information
  37. */
  38. struct gru_chiplet_info {
  39. int node;
  40. int chiplet;
  41. int blade;
  42. int total_dsr_bytes;
  43. int total_cbr;
  44. int total_user_dsr_bytes;
  45. int total_user_cbr;
  46. int free_user_dsr_bytes;
  47. int free_user_cbr;
  48. };
  49. /*
  50. * Statictics kept for each context.
  51. */
  52. struct gru_gseg_statistics {
  53. unsigned long fmm_tlbmiss;
  54. unsigned long upm_tlbmiss;
  55. unsigned long tlbdropin;
  56. unsigned long context_stolen;
  57. unsigned long reserved[10];
  58. };
  59. /* Flags for GRU options on the gru_create_context() call */
  60. /* Select one of the follow 4 options to specify how TLB misses are handled */
  61. #define GRU_OPT_MISS_DEFAULT 0x0000 /* Use default mode */
  62. #define GRU_OPT_MISS_USER_POLL 0x0001 /* User will poll CB for faults */
  63. #define GRU_OPT_MISS_FMM_INTR 0x0002 /* Send interrupt to cpu to
  64. handle fault */
  65. #define GRU_OPT_MISS_FMM_POLL 0x0003 /* Use system polling thread */
  66. #define GRU_OPT_MISS_MASK 0x0003 /* Mask for TLB MISS option */
  67. #endif /* __GRU_H__ */