grumain.c (7f2251b1bcdd3d2971b2fde3008b270ea11b8780) | grumain.c (67bf04a5c2574e9495f660f418f6df776821d578) |
---|---|
1/* 2 * SN Platform GRU Driver 3 * 4 * DRIVER TABLE MANAGER + GRU CONTEXT LOAD/UNLOAD 5 * 6 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 485 unchanged lines hidden (view full) --- 494 save += gru_copy_handle(cb, save); 495 save += gru_copy_handle(cbe + i * GRU_HANDLE_STRIDE, 496 save); 497 } else { 498 memset(cb, 0, GRU_CACHE_LINE_BYTES); 499 memset(cbe + i * GRU_HANDLE_STRIDE, 0, 500 GRU_CACHE_LINE_BYTES); 501 } | 1/* 2 * SN Platform GRU Driver 3 * 4 * DRIVER TABLE MANAGER + GRU CONTEXT LOAD/UNLOAD 5 * 6 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 485 unchanged lines hidden (view full) --- 494 save += gru_copy_handle(cb, save); 495 save += gru_copy_handle(cbe + i * GRU_HANDLE_STRIDE, 496 save); 497 } else { 498 memset(cb, 0, GRU_CACHE_LINE_BYTES); 499 memset(cbe + i * GRU_HANDLE_STRIDE, 0, 500 GRU_CACHE_LINE_BYTES); 501 } |
502 /* Flush CBE to hide race in context restart */ 503 mb(); 504 gru_flush_cache(cbe + i * GRU_HANDLE_STRIDE); |
|
502 cb += GRU_HANDLE_STRIDE; 503 } 504 505 if (data_valid) 506 memcpy(gseg + GRU_DS_BASE, save, length); 507 else 508 memset(gseg + GRU_DS_BASE, 0, length); 509} --- 4 unchanged lines hidden (view full) --- 514 void *gseg, *cb, *cbe; 515 unsigned long length; 516 int i, scr; 517 518 gseg = grubase + ctxnum * GRU_GSEG_STRIDE; 519 cb = gseg + GRU_CB_BASE; 520 cbe = grubase + GRU_CBE_BASE; 521 length = hweight64(dsrmap) * GRU_DSR_AU_BYTES; | 505 cb += GRU_HANDLE_STRIDE; 506 } 507 508 if (data_valid) 509 memcpy(gseg + GRU_DS_BASE, save, length); 510 else 511 memset(gseg + GRU_DS_BASE, 0, length); 512} --- 4 unchanged lines hidden (view full) --- 517 void *gseg, *cb, *cbe; 518 unsigned long length; 519 int i, scr; 520 521 gseg = grubase + ctxnum * GRU_GSEG_STRIDE; 522 cb = gseg + GRU_CB_BASE; 523 cbe = grubase + GRU_CBE_BASE; 524 length = hweight64(dsrmap) * GRU_DSR_AU_BYTES; |
525 526 /* CBEs may not be coherent. Flush them from cache */ 527 for_each_cbr_in_allocation_map(i, &cbrmap, scr) 528 gru_flush_cache(cbe + i * GRU_HANDLE_STRIDE); 529 mb(); /* Let the CL flush complete */ 530 |
|
522 gru_prefetch_context(gseg, cb, cbe, cbrmap, length); 523 524 for_each_cbr_in_allocation_map(i, &cbrmap, scr) { 525 save += gru_copy_handle(save, cb); 526 save += gru_copy_handle(save, cbe + i * GRU_HANDLE_STRIDE); 527 cb += GRU_HANDLE_STRIDE; 528 } 529 memcpy(save, gseg + GRU_DS_BASE, length); --- 405 unchanged lines hidden --- | 531 gru_prefetch_context(gseg, cb, cbe, cbrmap, length); 532 533 for_each_cbr_in_allocation_map(i, &cbrmap, scr) { 534 save += gru_copy_handle(save, cb); 535 save += gru_copy_handle(save, cbe + i * GRU_HANDLE_STRIDE); 536 cb += GRU_HANDLE_STRIDE; 537 } 538 memcpy(save, gseg + GRU_DS_BASE, length); --- 405 unchanged lines hidden --- |