aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru/gruhandles.c
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-04-02 19:59:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-02 22:05:07 -0400
commit7b8274e93fbabc7534aa51f95551c30aecdd0066 (patch)
treef1cfc0e87b07a4094ee06d2dc73673635b4b1775 /drivers/misc/sgi-gru/gruhandles.c
parent27ca8a7b2bdfb3e22e67fbd5df58e6b6f0bbcd48 (diff)
sgi-gru: support multiple pagesizes in GRU
Add multiple pagesize support to the GRU driver. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru/gruhandles.c')
-rw-r--r--drivers/misc/sgi-gru/gruhandles.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/drivers/misc/sgi-gru/gruhandles.c b/drivers/misc/sgi-gru/gruhandles.c
index 9dcf5d896683..9b7ccb328697 100644
--- a/drivers/misc/sgi-gru/gruhandles.c
+++ b/drivers/misc/sgi-gru/gruhandles.c
@@ -72,42 +72,16 @@ static int wait_instruction_complete(void *h, enum mcs_op opc)
72 return status; 72 return status;
73} 73}
74 74
75#if defined CONFIG_IA64 75int cch_allocate(struct gru_context_configuration_handle *cch,
76static void cch_allocate_set_asids( 76 int asidval, int sizeavail, unsigned long cbrmap,
77 struct gru_context_configuration_handle *cch, int asidval) 77 unsigned long dsrmap)
78{ 78{
79 int i; 79 int i;
80 80
81 for (i = 0; i < 8; i++) { 81 for (i = 0; i < 8; i++) {
82 cch->asid[i] = (asidval++); 82 cch->asid[i] = (asidval++);
83#if 0 83 cch->sizeavail[i] = sizeavail;
84 /* ZZZ hugepages not supported yet */
85 if (i == RGN_HPAGE)
86 cch->sizeavail[i] = GRU_SIZEAVAIL(hpage_shift);
87 else
88#endif
89 cch->sizeavail[i] = GRU_SIZEAVAIL(PAGE_SHIFT);
90 } 84 }
91}
92#elif defined CONFIG_X86_64
93static void cch_allocate_set_asids(
94 struct gru_context_configuration_handle *cch, int asidval)
95{
96 int i;
97
98 for (i = 0; i < 8; i++) {
99 cch->asid[i] = asidval++;
100 cch->sizeavail[i] = GRU_SIZEAVAIL(PAGE_SHIFT) |
101 GRU_SIZEAVAIL(21);
102 }
103}
104#endif
105
106int cch_allocate(struct gru_context_configuration_handle *cch,
107 int asidval, unsigned long cbrmap,
108 unsigned long dsrmap)
109{
110 cch_allocate_set_asids(cch, asidval);
111 cch->dsr_allocation_map = dsrmap; 85 cch->dsr_allocation_map = dsrmap;
112 cch->cbr_allocation_map = cbrmap; 86 cch->cbr_allocation_map = cbrmap;
113 cch->opc = CCHOP_ALLOCATE; 87 cch->opc = CCHOP_ALLOCATE;