Lines Matching full:cb

61  * 		- 1 CB & a few DSRs that are reserved for each cpu on the blade.
255 static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr) in gru_get_cpu_resources() argument
264 *cb = bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE; in gru_get_cpu_resources()
272 static void gru_free_cpu_resources(void *cb, void *dsr) in gru_free_cpu_resources() argument
356 * cb - pointer to first CBR
359 void gru_lock_async_resource(unsigned long han, void **cb, void **dsr) in gru_lock_async_resource() argument
367 if (cb) in gru_lock_async_resource()
368 *cb = bs->kernel_cb + ncpus * GRU_HANDLE_STRIDE; in gru_lock_async_resource()
387 int gru_get_cb_exception_detail(void *cb, in gru_get_cb_exception_detail() argument
396 * Locate kgts for cb. This algorithm is SLOW but in gru_get_cb_exception_detail()
406 off = cb - kgts->ts_gru->gs_gru_base_vaddr; in gru_get_cb_exception_detail()
412 cbrnum = thread_cbr_number(kgts, get_cb_number(cb)); in gru_get_cb_exception_detail()
413 cbe = get_cbe(GRUBASE(cb), cbrnum); in gru_get_cb_exception_detail()
425 static char *gru_get_cb_exception_detail_str(int ret, void *cb, in gru_get_cb_exception_detail_str() argument
428 struct gru_control_block_status *gen = (void *)cb; in gru_get_cb_exception_detail_str()
432 gru_get_cb_exception_detail(cb, &excdet); in gru_get_cb_exception_detail_str()
434 "GRU:%d exception: cb %p, opc %d, exopc %d, ecause 0x%x," in gru_get_cb_exception_detail_str()
453 static int gru_retry_exception(void *cb) in gru_retry_exception() argument
455 struct gru_control_block_status *gen = (void *)cb; in gru_retry_exception()
462 if (gru_get_cb_message_queue_substatus(cb)) in gru_retry_exception()
464 gru_get_cb_exception_detail(cb, &excdet); in gru_retry_exception()
476 int gru_check_status_proc(void *cb) in gru_check_status_proc() argument
478 struct gru_control_block_status *gen = (void *)cb; in gru_check_status_proc()
483 ret = gru_retry_exception(cb); in gru_check_status_proc()
489 int gru_wait_proc(void *cb) in gru_wait_proc() argument
491 struct gru_control_block_status *gen = (void *)cb; in gru_wait_proc()
496 ret = gru_retry_exception(cb); in gru_wait_proc()
501 static void gru_abort(int ret, void *cb, char *str) in gru_abort() argument
506 gru_get_cb_exception_detail_str(ret, cb, buf, sizeof(buf))); in gru_abort()
509 void gru_wait_abort_proc(void *cb) in gru_wait_abort_proc() argument
513 ret = gru_wait_proc(cb); in gru_wait_abort_proc()
515 gru_abort(ret, cb, "gru_wait_abort"); in gru_wait_abort_proc()
579 static int send_noop_message(void *cb, struct gru_message_queue_desc *mqd, in send_noop_message() argument
591 gru_mesq(cb, mqd->mq_gpa, gru_get_tri(mhdr), 1, IMA); in send_noop_message()
592 ret = gru_wait(cb); in send_noop_message()
595 substatus = gru_get_cb_message_queue_substatus(cb); in send_noop_message()
615 m = mqd->mq_gpa + (gru_get_amo_value_head(cb) << 6); in send_noop_message()
616 gru_vstore(cb, m, gru_get_tri(mesg), XTYPE_CL, 1, 1, in send_noop_message()
618 if (gru_wait(cb) == CBS_IDLE) in send_noop_message()
637 static int send_message_queue_full(void *cb, struct gru_message_queue_desc *mqd, in send_message_queue_full() argument
646 avalue = gru_get_amo_value(cb); in send_message_queue_full()
647 head = gru_get_amo_value_head(cb); in send_message_queue_full()
648 limit = gru_get_amo_value_limit(cb); in send_message_queue_full()
659 gru_gamir(cb, EOP_IR_CLR, HSTATUS(mqd->mq_gpa, half), XTYPE_DW, IMA); in send_message_queue_full()
660 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
662 if (!gru_get_amo_value(cb)) { in send_message_queue_full()
669 if (send_noop_message(cb, mqd, mesg)) { in send_message_queue_full()
670 gru_gamir(cb, EOP_IR_INC, HSTATUS(mqd->mq_gpa, half), in send_message_queue_full()
672 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
681 gru_gamer(cb, EOP_ERR_CSWAP, mqd->mq_gpa, XTYPE_DW, mqh.val, avalue, in send_message_queue_full()
683 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
687 if (gru_get_amo_value(cb) != avalue) { in send_message_queue_full()
689 gru_gamir(cb, EOP_IR_INC, HSTATUS(mqd->mq_gpa, half), XTYPE_DW, in send_message_queue_full()
691 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
706 static int send_message_put_nacked(void *cb, struct gru_message_queue_desc *mqd, in send_message_put_nacked() argument
712 m = mqd->mq_gpa + (gru_get_amo_value_head(cb) << 6); in send_message_put_nacked()
714 gru_vset(cb, m, 0, XTYPE_CL, lines, 1, IMA); in send_message_put_nacked()
715 if (gru_wait(cb) != CBS_IDLE) in send_message_put_nacked()
718 gru_vstore(cb, m, gru_get_tri(mesg), XTYPE_CL, lines, 1, IMA); in send_message_put_nacked()
719 if (gru_wait(cb) != CBS_IDLE) in send_message_put_nacked()
734 ret = send_noop_message(cb, mqd, mesg); in send_message_put_nacked()
754 static int send_message_failure(void *cb, struct gru_message_queue_desc *mqd, in send_message_failure() argument
759 substatus = gru_get_cb_message_queue_substatus(cb); in send_message_failure()
771 ret = send_message_queue_full(cb, mqd, mesg, lines); in send_message_failure()
779 ret = send_message_put_nacked(cb, mqd, mesg, lines); in send_message_failure()
800 void *cb; in gru_send_message_gpa() local
808 if (gru_get_cpu_resources(bytes, &cb, &dsr)) in gru_send_message_gpa()
821 gru_mesq(cb, mqd->mq_gpa, gru_get_tri(mhdr), clines, IMA); in gru_send_message_gpa()
822 istatus = gru_wait(cb); in gru_send_message_gpa()
824 ret = send_message_failure(cb, mqd, dsr, clines); in gru_send_message_gpa()
826 gru_free_cpu_resources(cb, dsr); in gru_send_message_gpa()
907 void *cb; in gru_read_gpa() local
912 if (gru_get_cpu_resources(GRU_NUM_KERNEL_DSR_BYTES, &cb, &dsr)) in gru_read_gpa()
915 gru_vload_phys(cb, gpa, gru_get_tri(dsr), iaa, IMA); in gru_read_gpa()
916 ret = gru_wait(cb); in gru_read_gpa()
919 gru_free_cpu_resources(cb, dsr); in gru_read_gpa()
931 void *cb; in gru_copy_gpa() local
936 if (gru_get_cpu_resources(GRU_NUM_KERNEL_DSR_BYTES, &cb, &dsr)) in gru_copy_gpa()
938 gru_bcopy(cb, src_gpa, dest_gpa, gru_get_tri(dsr), in gru_copy_gpa()
940 ret = gru_wait(cb); in gru_copy_gpa()
941 gru_free_cpu_resources(cb, dsr); in gru_copy_gpa()
953 void *cb; in quicktest0() local
958 if (gru_get_cpu_resources(GRU_CACHE_LINE_BYTES, &cb, &dsr)) in quicktest0()
964 gru_vload(cb, uv_gpa(&word0), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA); in quicktest0()
965 if (gru_wait(cb) != CBS_IDLE) { in quicktest0()
974 gru_vstore(cb, uv_gpa(&word1), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA); in quicktest0()
975 if (gru_wait(cb) != CBS_IDLE) { in quicktest0()
989 gru_free_cpu_resources(cb, dsr); in quicktest0()
1050 void *cb0, *cb; in quicktest2() local
1075 cb = cb0 + i * GRU_HANDLE_STRIDE; in quicktest2()
1076 istatus = gru_check_status(cb); in quicktest2()
1083 printk(KERN_DEBUG "GRU:%d quicktest2: cb %d, exception\n", smp_processor_id(), i); in quicktest2()
1087 printk(KERN_DEBUG "GRU:%d quicktest2:cb %d, buf 0x%lx, 0x%lx, 0x%lx, 0x%lx\n", in quicktest2()
1092 gen = cb; in quicktest2()