aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-06-17 19:28:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:04:03 -0400
commit9f2501142bd3c496afa7efdf18583aab56fe3134 (patch)
treec805d705289c0dbfcb6aee9f15313f0a46340f7f /drivers/misc/sgi-gru
parent6471cd4d6c2526f3df693895a6bfa70353fad3f7 (diff)
gru: cleanup gru inline functions
Cleanup of GRU inline functions to eliminate unnecessary inline code. Update function descriptions. 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>
Diffstat (limited to 'drivers/misc/sgi-gru')
-rw-r--r--drivers/misc/sgi-gru/gru_instructions.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/misc/sgi-gru/gru_instructions.h b/drivers/misc/sgi-gru/gru_instructions.h
index eb9140d32e62..3c9c06618e6a 100644
--- a/drivers/misc/sgi-gru/gru_instructions.h
+++ b/drivers/misc/sgi-gru/gru_instructions.h
@@ -623,9 +623,11 @@ static inline int gru_get_cb_substatus(void *cb)
623 return cbs->isubstatus; 623 return cbs->isubstatus;
624} 624}
625 625
626/* Check the status of a CB. If the CB is in UPM mode, call the 626/*
627 * OS to handle the UPM status. 627 * User interface to check an instruction status. UPM and exceptions
628 * Returns the CB status field value (0 for normal completion) 628 * are handled automatically. However, this function does NOT wait
629 * for an active instruction to complete.
630 *
629 */ 631 */
630static inline int gru_check_status(void *cb) 632static inline int gru_check_status(void *cb)
631{ 633{
@@ -633,34 +635,31 @@ static inline int gru_check_status(void *cb)
633 int ret; 635 int ret;
634 636
635 ret = cbs->istatus; 637 ret = cbs->istatus;
636 if (ret == CBS_CALL_OS) 638 if (ret != CBS_ACTIVE)
637 ret = gru_check_status_proc(cb); 639 ret = gru_check_status_proc(cb);
638 return ret; 640 return ret;
639} 641}
640 642
641/* Wait for CB to complete. 643/*
642 * Returns the CB status field value (0 for normal completion) 644 * User interface (via inline function) to wait for an instruction
645 * to complete. Completion status (IDLE or EXCEPTION is returned
646 * to the user. Exception due to hardware errors are automatically
647 * retried before returning an exception.
648 *
643 */ 649 */
644static inline int gru_wait(void *cb) 650static inline int gru_wait(void *cb)
645{ 651{
646 struct gru_control_block_status *cbs = (void *)cb; 652 return gru_wait_proc(cb);
647 int ret = cbs->istatus;
648
649 if (ret != CBS_IDLE)
650 ret = gru_wait_proc(cb);
651 return ret;
652} 653}
653 654
654/* Wait for CB to complete. Aborts program if error. (Note: error does NOT 655/*
656 * Wait for CB to complete. Aborts program if error. (Note: error does NOT
655 * mean TLB mis - only fatal errors such as memory parity error or user 657 * mean TLB mis - only fatal errors such as memory parity error or user
656 * bugs will cause termination. 658 * bugs will cause termination.
657 */ 659 */
658static inline void gru_wait_abort(void *cb) 660static inline void gru_wait_abort(void *cb)
659{ 661{
660 struct gru_control_block_status *cbs = (void *)cb; 662 gru_wait_abort_proc(cb);
661
662 if (cbs->istatus != CBS_IDLE)
663 gru_wait_abort_proc(cb);
664} 663}
665 664
666 665