aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru/gruhandles.c
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-06-17 19:28:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:03:59 -0400
commit6e9100741ca430eeef8022794f8b62a23a5916af (patch)
tree4c19d2cbbd2d3f1cd429946120c078b653ae67b3 /drivers/misc/sgi-gru/gruhandles.c
parentd57c82b10709bbb1deb7eb26cf42abcde8851e4d (diff)
gru: support cch_allocate for kernel threads
Change the interface to cch_allocate so that it can be used to allocate GRU contexts for kernel threads. Kernel threads use the GRU in unmapped mode and do not require ASIDs for the GRU TLB. 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.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/misc/sgi-gru/gruhandles.c b/drivers/misc/sgi-gru/gruhandles.c
index 9b7ccb32869..a3a870ad915 100644
--- a/drivers/misc/sgi-gru/gruhandles.c
+++ b/drivers/misc/sgi-gru/gruhandles.c
@@ -72,18 +72,8 @@ static int wait_instruction_complete(void *h, enum mcs_op opc)
72 return status; 72 return status;
73} 73}
74 74
75int cch_allocate(struct gru_context_configuration_handle *cch, 75int cch_allocate(struct gru_context_configuration_handle *cch)
76 int asidval, int sizeavail, unsigned long cbrmap,
77 unsigned long dsrmap)
78{ 76{
79 int i;
80
81 for (i = 0; i < 8; i++) {
82 cch->asid[i] = (asidval++);
83 cch->sizeavail[i] = sizeavail;
84 }
85 cch->dsr_allocation_map = dsrmap;
86 cch->cbr_allocation_map = cbrmap;
87 cch->opc = CCHOP_ALLOCATE; 77 cch->opc = CCHOP_ALLOCATE;
88 start_instruction(cch); 78 start_instruction(cch);
89 return wait_instruction_complete(cch, cchop_allocate); 79 return wait_instruction_complete(cch, cchop_allocate);