diff options
author | Jack Steiner <steiner@sgi.com> | 2009-12-16 00:48:07 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 15:20:15 (GMT) |
commit | 648eb8e50200a09db2488623958d9cbd4b8aaf55 (patch) | |
tree | b8f2dc6444eccbd7a34cdea784528a46eeebb84b /drivers/misc/sgi-gru/gruhandles.h | |
parent | f2965d68b6775290218ff2a040e64c8b40556280 (diff) | |
download | linux-648eb8e50200a09db2488623958d9cbd4b8aaf55.tar.xz |
gru: improve messages for malfunctioning GRUs
Improve error messages for malfunctioning GRUs. Identify the type of
instruction that is failing.
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/gruhandles.h')
-rw-r--r-- | drivers/misc/sgi-gru/gruhandles.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/sgi-gru/gruhandles.h b/drivers/misc/sgi-gru/gruhandles.h index f441122..47b762f 100644 --- a/drivers/misc/sgi-gru/gruhandles.h +++ b/drivers/misc/sgi-gru/gruhandles.h @@ -91,6 +91,12 @@ /* Convert an arbitrary handle address to the beginning of the GRU segment */ #define GRUBASE(h) ((void *)((unsigned long)(h) & ~(GRU_SIZE - 1))) +/* Test a valid handle address to determine the type */ +#define TYPE_IS(hn, h) ((h) >= GRU_##hn##_BASE && (h) < \ + GRU_##hn##_BASE + GRU_NUM_##hn * GRU_HANDLE_STRIDE && \ + (((h) & (GRU_HANDLE_STRIDE - 1)) == 0)) + + /* General addressing macros. */ static inline void *get_gseg_base_address(void *base, int ctxnum) { |