aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru/grumain.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/grumain.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/grumain.c')
-rw-r--r--drivers/misc/sgi-gru/grumain.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c
index 6358244f392d..0c7bd384f0cf 100644
--- a/drivers/misc/sgi-gru/grumain.c
+++ b/drivers/misc/sgi-gru/grumain.c
@@ -537,13 +537,12 @@ void gru_load_context(struct gru_thread_state *gts)
537{ 537{
538 struct gru_state *gru = gts->ts_gru; 538 struct gru_state *gru = gts->ts_gru;
539 struct gru_context_configuration_handle *cch; 539 struct gru_context_configuration_handle *cch;
540 int err, asid, ctxnum = gts->ts_ctxnum; 540 int i, err, asid, ctxnum = gts->ts_ctxnum;
541 541
542 gru_dbg(grudev, "gts %p\n", gts); 542 gru_dbg(grudev, "gts %p\n", gts);
543 cch = get_cch(gru->gs_gru_base_vaddr, ctxnum); 543 cch = get_cch(gru->gs_gru_base_vaddr, ctxnum);
544 544
545 lock_cch_handle(cch); 545 lock_cch_handle(cch);
546 asid = gru_load_mm_tracker(gru, gts);
547 cch->tfm_fault_bit_enable = 546 cch->tfm_fault_bit_enable =
548 (gts->ts_user_options == GRU_OPT_MISS_FMM_POLL 547 (gts->ts_user_options == GRU_OPT_MISS_FMM_POLL
549 || gts->ts_user_options == GRU_OPT_MISS_FMM_INTR); 548 || gts->ts_user_options == GRU_OPT_MISS_FMM_INTR);
@@ -553,8 +552,16 @@ void gru_load_context(struct gru_thread_state *gts)
553 cch->tlb_int_select = gts->ts_tlb_int_select; 552 cch->tlb_int_select = gts->ts_tlb_int_select;
554 } 553 }
555 cch->tfm_done_bit_enable = 0; 554 cch->tfm_done_bit_enable = 0;
556 err = cch_allocate(cch, asid, gts->ts_sizeavail, gts->ts_cbr_map, 555 cch->dsr_allocation_map = gts->ts_dsr_map;
557 gts->ts_dsr_map); 556 cch->cbr_allocation_map = gts->ts_cbr_map;
557 asid = gru_load_mm_tracker(gru, gts);
558 cch->unmap_enable = 0;
559 for (i = 0; i < 8; i++) {
560 cch->asid[i] = asid + i;
561 cch->sizeavail[i] = gts->ts_sizeavail;
562 }
563
564 err = cch_allocate(cch);
558 if (err) { 565 if (err) {
559 gru_dbg(grudev, 566 gru_dbg(grudev,
560 "err %d: cch %p, gts %p, cbr 0x%lx, dsr 0x%lx\n", 567 "err %d: cch %p, gts %p, cbr 0x%lx, dsr 0x%lx\n",