Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176741
b: refs/heads/master
c: 1848a71
h: refs/heads/master
i:
  176739: 231e152
v: v3
  • Loading branch information
Jack Steiner authored and Linus Torvalds committed Dec 16, 2009
1 parent f103fe8 commit 731711c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c550222f64265c9384c45d7f691445386025a82b
refs/heads/master: 1848a710287b33a92c3c5b2f4c3ae201a879eb7e
30 changes: 22 additions & 8 deletions trunk/drivers/misc/sgi-gru/grukservices.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@
#define ASYNC_HAN_TO_BID(h) ((h) - 1)
#define ASYNC_BID_TO_HAN(b) ((b) + 1)
#define ASYNC_HAN_TO_BS(h) gru_base[ASYNC_HAN_TO_BID(h)]
#define KCB_TO_GID(cb) ((cb - gru_start_vaddr) / \
(GRU_SIZE * GRU_CHIPLETS_PER_BLADE))
#define KCB_TO_BS(cb) gru_base[KCB_TO_GID(cb)]

#define GRU_NUM_KERNEL_CBR 1
#define GRU_NUM_KERNEL_DSR_BYTES 256
Expand Down Expand Up @@ -388,11 +385,28 @@ int gru_get_cb_exception_detail(void *cb,
struct control_block_extended_exc_detail *excdet)
{
struct gru_control_block_extended *cbe;
struct gru_blade_state *bs;
int cbrnum;

bs = KCB_TO_BS(cb);
cbrnum = thread_cbr_number(bs->bs_kgts, get_cb_number(cb));
struct gru_thread_state *kgts = NULL;
unsigned long off;
int cbrnum, bid;

/*
* Locate kgts for cb. This algorithm is SLOW but
* this function is rarely called (ie., almost never).
* Performance does not matter.
*/
for_each_possible_blade(bid) {
if (!gru_base[bid])
break;
kgts = gru_base[bid]->bs_kgts;
if (!kgts || !kgts->ts_gru)
continue;
off = cb - kgts->ts_gru->gs_gru_base_vaddr;
if (off < GRU_SIZE)
break;
kgts = NULL;
}
BUG_ON(!kgts);
cbrnum = thread_cbr_number(kgts, get_cb_number(cb));
cbe = get_cbe(GRUBASE(cb), cbrnum);
gru_flush_cache(cbe); /* CBE not coherent */
sync_core();
Expand Down

0 comments on commit 731711c

Please sign in to comment.