Lines Matching refs:cb

262 static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)  in gru_get_cpu_resources()  argument
271 *cb = bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE; in gru_get_cpu_resources()
279 static void gru_free_cpu_resources(void *cb, void *dsr) in gru_free_cpu_resources() argument
366 void gru_lock_async_resource(unsigned long han, void **cb, void **dsr) in gru_lock_async_resource() argument
374 if (cb) in gru_lock_async_resource()
375 *cb = bs->kernel_cb + ncpus * GRU_HANDLE_STRIDE; in gru_lock_async_resource()
394 int gru_get_cb_exception_detail(void *cb, in gru_get_cb_exception_detail() argument
413 off = cb - kgts->ts_gru->gs_gru_base_vaddr; in gru_get_cb_exception_detail()
419 cbrnum = thread_cbr_number(kgts, get_cb_number(cb)); in gru_get_cb_exception_detail()
420 cbe = get_cbe(GRUBASE(cb), cbrnum); in gru_get_cb_exception_detail()
432 char *gru_get_cb_exception_detail_str(int ret, void *cb, in gru_get_cb_exception_detail_str() argument
435 struct gru_control_block_status *gen = (void *)cb; in gru_get_cb_exception_detail_str()
439 gru_get_cb_exception_detail(cb, &excdet); in gru_get_cb_exception_detail_str()
460 static int gru_retry_exception(void *cb) in gru_retry_exception() argument
462 struct gru_control_block_status *gen = (void *)cb; in gru_retry_exception()
469 if (gru_get_cb_message_queue_substatus(cb)) in gru_retry_exception()
471 gru_get_cb_exception_detail(cb, &excdet); in gru_retry_exception()
483 int gru_check_status_proc(void *cb) in gru_check_status_proc() argument
485 struct gru_control_block_status *gen = (void *)cb; in gru_check_status_proc()
490 ret = gru_retry_exception(cb); in gru_check_status_proc()
496 int gru_wait_proc(void *cb) in gru_wait_proc() argument
498 struct gru_control_block_status *gen = (void *)cb; in gru_wait_proc()
503 ret = gru_retry_exception(cb); in gru_wait_proc()
508 void gru_abort(int ret, void *cb, char *str) in gru_abort() argument
513 gru_get_cb_exception_detail_str(ret, cb, buf, sizeof(buf))); in gru_abort()
516 void gru_wait_abort_proc(void *cb) in gru_wait_abort_proc() argument
520 ret = gru_wait_proc(cb); in gru_wait_abort_proc()
522 gru_abort(ret, cb, "gru_wait_abort"); in gru_wait_abort_proc()
586 static int send_noop_message(void *cb, struct gru_message_queue_desc *mqd, in send_noop_message() argument
598 gru_mesq(cb, mqd->mq_gpa, gru_get_tri(mhdr), 1, IMA); in send_noop_message()
599 ret = gru_wait(cb); in send_noop_message()
602 substatus = gru_get_cb_message_queue_substatus(cb); in send_noop_message()
622 m = mqd->mq_gpa + (gru_get_amo_value_head(cb) << 6); in send_noop_message()
623 gru_vstore(cb, m, gru_get_tri(mesg), XTYPE_CL, 1, 1, in send_noop_message()
625 if (gru_wait(cb) == CBS_IDLE) in send_noop_message()
644 static int send_message_queue_full(void *cb, struct gru_message_queue_desc *mqd, in send_message_queue_full() argument
653 avalue = gru_get_amo_value(cb); in send_message_queue_full()
654 head = gru_get_amo_value_head(cb); in send_message_queue_full()
655 limit = gru_get_amo_value_limit(cb); in send_message_queue_full()
666 gru_gamir(cb, EOP_IR_CLR, HSTATUS(mqd->mq_gpa, half), XTYPE_DW, IMA); in send_message_queue_full()
667 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
669 if (!gru_get_amo_value(cb)) { in send_message_queue_full()
676 if (send_noop_message(cb, mqd, mesg)) { in send_message_queue_full()
677 gru_gamir(cb, EOP_IR_INC, HSTATUS(mqd->mq_gpa, half), in send_message_queue_full()
679 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
688 gru_gamer(cb, EOP_ERR_CSWAP, mqd->mq_gpa, XTYPE_DW, mqh.val, avalue, in send_message_queue_full()
690 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
694 if (gru_get_amo_value(cb) != avalue) { in send_message_queue_full()
696 gru_gamir(cb, EOP_IR_INC, HSTATUS(mqd->mq_gpa, half), XTYPE_DW, in send_message_queue_full()
698 if (gru_wait(cb) != CBS_IDLE) in send_message_queue_full()
713 static int send_message_put_nacked(void *cb, struct gru_message_queue_desc *mqd, in send_message_put_nacked() argument
719 m = mqd->mq_gpa + (gru_get_amo_value_head(cb) << 6); in send_message_put_nacked()
721 gru_vset(cb, m, 0, XTYPE_CL, lines, 1, IMA); in send_message_put_nacked()
722 if (gru_wait(cb) != CBS_IDLE) in send_message_put_nacked()
725 gru_vstore(cb, m, gru_get_tri(mesg), XTYPE_CL, lines, 1, IMA); in send_message_put_nacked()
726 if (gru_wait(cb) != CBS_IDLE) in send_message_put_nacked()
743 gru_vstore_phys(cb, gpa, gru_get_tri(mesg), IAA_REGISTER, IMA); in send_message_put_nacked()
744 ret = gru_wait(cb); in send_message_put_nacked()
755 static int send_message_failure(void *cb, struct gru_message_queue_desc *mqd, in send_message_failure() argument
760 substatus = gru_get_cb_message_queue_substatus(cb); in send_message_failure()
772 ret = send_message_queue_full(cb, mqd, mesg, lines); in send_message_failure()
780 ret = send_message_put_nacked(cb, mqd, mesg, lines); in send_message_failure()
801 void *cb; in gru_send_message_gpa() local
809 if (gru_get_cpu_resources(bytes, &cb, &dsr)) in gru_send_message_gpa()
822 gru_mesq(cb, mqd->mq_gpa, gru_get_tri(mhdr), clines, IMA); in gru_send_message_gpa()
823 istatus = gru_wait(cb); in gru_send_message_gpa()
825 ret = send_message_failure(cb, mqd, dsr, clines); in gru_send_message_gpa()
827 gru_free_cpu_resources(cb, dsr); in gru_send_message_gpa()
908 void *cb; in gru_read_gpa() local
913 if (gru_get_cpu_resources(GRU_NUM_KERNEL_DSR_BYTES, &cb, &dsr)) in gru_read_gpa()
916 gru_vload_phys(cb, gpa, gru_get_tri(dsr), iaa, IMA); in gru_read_gpa()
917 ret = gru_wait(cb); in gru_read_gpa()
920 gru_free_cpu_resources(cb, dsr); in gru_read_gpa()
932 void *cb; in gru_copy_gpa() local
937 if (gru_get_cpu_resources(GRU_NUM_KERNEL_DSR_BYTES, &cb, &dsr)) in gru_copy_gpa()
939 gru_bcopy(cb, src_gpa, dest_gpa, gru_get_tri(dsr), in gru_copy_gpa()
941 ret = gru_wait(cb); in gru_copy_gpa()
942 gru_free_cpu_resources(cb, dsr); in gru_copy_gpa()
954 void *cb; in quicktest0() local
959 if (gru_get_cpu_resources(GRU_CACHE_LINE_BYTES, &cb, &dsr)) in quicktest0()
965 gru_vload(cb, uv_gpa(&word0), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA); in quicktest0()
966 if (gru_wait(cb) != CBS_IDLE) { in quicktest0()
975 gru_vstore(cb, uv_gpa(&word1), gru_get_tri(dsr), XTYPE_DW, 1, 1, IMA); in quicktest0()
976 if (gru_wait(cb) != CBS_IDLE) { in quicktest0()
990 gru_free_cpu_resources(cb, dsr); in quicktest0()
1053 void *cb0, *cb; in quicktest2() local
1078 cb = cb0 + i * GRU_HANDLE_STRIDE; in quicktest2()
1079 istatus = gru_check_status(cb); in quicktest2()
1095 gen = cb; in quicktest2()