diff options
author | Jack Steiner <steiner@sgi.com> | 2009-06-17 19:28:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 16:03:59 -0400 |
commit | d57c82b10709bbb1deb7eb26cf42abcde8851e4d (patch) | |
tree | 6e7e2a9e9e9254cfe63e94b8ee14cd1250324160 | |
parent | 364b76df80f62cee1b66e871df2f69db6e3d3d9e (diff) |
gru: change context load and unload
Remove "static" from the functions for loading/unloading GRU contexts.
These functions will be called from other GRU files. Fix bug in unlocking
gru context.
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>
-rw-r--r-- | drivers/misc/sgi-gru/grufault.c | 4 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/grumain.c | 10 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/grutables.h | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index 4089f862aa29..f15152165a99 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c | |||
@@ -558,8 +558,8 @@ int gru_handle_user_call_os(unsigned long cb) | |||
558 | * CCH may contain stale data if ts_force_cch_reload is set. | 558 | * CCH may contain stale data if ts_force_cch_reload is set. |
559 | */ | 559 | */ |
560 | if (gts->ts_gru && gts->ts_force_cch_reload) { | 560 | if (gts->ts_gru && gts->ts_force_cch_reload) { |
561 | gru_update_cch(gts, 0); | ||
562 | gts->ts_force_cch_reload = 0; | 561 | gts->ts_force_cch_reload = 0; |
562 | gru_update_cch(gts, 0); | ||
563 | } | 563 | } |
564 | 564 | ||
565 | ret = -EAGAIN; | 565 | ret = -EAGAIN; |
@@ -644,7 +644,7 @@ static int gru_unload_all_contexts(void) | |||
644 | if (gts && mutex_trylock(>s->ts_ctxlock)) { | 644 | if (gts && mutex_trylock(>s->ts_ctxlock)) { |
645 | spin_unlock(&gru->gs_lock); | 645 | spin_unlock(&gru->gs_lock); |
646 | gru_unload_context(gts, 1); | 646 | gru_unload_context(gts, 1); |
647 | gru_unlock_gts(gts); | 647 | mutex_unlock(>s->ts_ctxlock); |
648 | spin_lock(&gru->gs_lock); | 648 | spin_lock(&gru->gs_lock); |
649 | } | 649 | } |
650 | } | 650 | } |
diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c index 14baabc79da4..6358244f392d 100644 --- a/drivers/misc/sgi-gru/grumain.c +++ b/drivers/misc/sgi-gru/grumain.c | |||
@@ -533,7 +533,7 @@ void gru_unload_context(struct gru_thread_state *gts, int savestate) | |||
533 | * Load a GRU context by copying it from the thread data structure in memory | 533 | * Load a GRU context by copying it from the thread data structure in memory |
534 | * to the GRU. | 534 | * to the GRU. |
535 | */ | 535 | */ |
536 | static void gru_load_context(struct gru_thread_state *gts) | 536 | 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; |
@@ -600,8 +600,8 @@ int gru_update_cch(struct gru_thread_state *gts, int force_unload) | |||
600 | gts->ts_tlb_int_select = gru_cpu_fault_map_id(); | 600 | gts->ts_tlb_int_select = gru_cpu_fault_map_id(); |
601 | cch->tlb_int_select = gru_cpu_fault_map_id(); | 601 | cch->tlb_int_select = gru_cpu_fault_map_id(); |
602 | cch->tfm_fault_bit_enable = | 602 | cch->tfm_fault_bit_enable = |
603 | (gts->ts_user_options == GRU_OPT_MISS_FMM_POLL | 603 | (gts->ts_user_options == GRU_OPT_MISS_FMM_POLL |
604 | || gts->ts_user_options == GRU_OPT_MISS_FMM_INTR); | 604 | || gts->ts_user_options == GRU_OPT_MISS_FMM_INTR); |
605 | } else { | 605 | } else { |
606 | for (i = 0; i < 8; i++) | 606 | for (i = 0; i < 8; i++) |
607 | cch->asid[i] = 0; | 607 | cch->asid[i] = 0; |
@@ -645,7 +645,7 @@ static int gru_retarget_intr(struct gru_thread_state *gts) | |||
645 | #define next_gru(b, g) (((g) < &(b)->bs_grus[GRU_CHIPLETS_PER_BLADE - 1]) ? \ | 645 | #define next_gru(b, g) (((g) < &(b)->bs_grus[GRU_CHIPLETS_PER_BLADE - 1]) ? \ |
646 | ((g)+1) : &(b)->bs_grus[0]) | 646 | ((g)+1) : &(b)->bs_grus[0]) |
647 | 647 | ||
648 | static void gru_steal_context(struct gru_thread_state *gts, int blade_id) | 648 | void gru_steal_context(struct gru_thread_state *gts, int blade_id) |
649 | { | 649 | { |
650 | struct gru_blade_state *blade; | 650 | struct gru_blade_state *blade; |
651 | struct gru_state *gru, *gru0; | 651 | struct gru_state *gru, *gru0; |
@@ -711,7 +711,7 @@ static void gru_steal_context(struct gru_thread_state *gts, int blade_id) | |||
711 | /* | 711 | /* |
712 | * Scan the GRUs on the local blade & assign a GRU context. | 712 | * Scan the GRUs on the local blade & assign a GRU context. |
713 | */ | 713 | */ |
714 | static struct gru_state *gru_assign_gru_context(struct gru_thread_state *gts, | 714 | struct gru_state *gru_assign_gru_context(struct gru_thread_state *gts, |
715 | int blade) | 715 | int blade) |
716 | { | 716 | { |
717 | struct gru_state *gru, *grux; | 717 | struct gru_state *gru, *grux; |
diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h index c69086c9b986..4ddb5b92acbb 100644 --- a/drivers/misc/sgi-gru/grutables.h +++ b/drivers/misc/sgi-gru/grutables.h | |||
@@ -611,6 +611,10 @@ extern struct gru_thread_state *gru_find_thread_state(struct vm_area_struct | |||
611 | *vma, int tsid); | 611 | *vma, int tsid); |
612 | extern struct gru_thread_state *gru_alloc_thread_state(struct vm_area_struct | 612 | extern struct gru_thread_state *gru_alloc_thread_state(struct vm_area_struct |
613 | *vma, int tsid); | 613 | *vma, int tsid); |
614 | extern struct gru_state *gru_assign_gru_context(struct gru_thread_state *gts, | ||
615 | int blade); | ||
616 | extern void gru_load_context(struct gru_thread_state *gts); | ||
617 | extern void gru_steal_context(struct gru_thread_state *gts, int blade_id); | ||
614 | extern void gru_unload_context(struct gru_thread_state *gts, int savestate); | 618 | extern void gru_unload_context(struct gru_thread_state *gts, int savestate); |
615 | extern int gru_update_cch(struct gru_thread_state *gts, int force_unload); | 619 | extern int gru_update_cch(struct gru_thread_state *gts, int force_unload); |
616 | extern void gts_drop(struct gru_thread_state *gts); | 620 | extern void gts_drop(struct gru_thread_state *gts); |