diff options
author | Jack Steiner <steiner@sgi.com> | 2009-06-17 19:28:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 16:04:04 -0400 |
commit | 2b702b28addc0f9eb2f37148f0b99f546cadd30a (patch) | |
tree | 9313d3f09de281de0291baa77bc4f5d0057b4b8d /drivers/misc/sgi-gru/grukdump.c | |
parent | 1926ee85a903d189c5702eed6531be321e33eb47 (diff) |
gru: fixes to grudump utility
Minor fixes to the SGI GRU grudump facility:
- fix address where user data is written
- add gru number to data passed to user
- indicate if context is locked
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/grukdump.c')
-rw-r--r-- | drivers/misc/sgi-gru/grukdump.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c index 7b1bdf3906ba..0f9dd3e64b57 100644 --- a/drivers/misc/sgi-gru/grukdump.c +++ b/drivers/misc/sgi-gru/grukdump.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | static int gru_user_copy_handle(void __user **dp, void *s) | 27 | static int gru_user_copy_handle(void __user **dp, void *s) |
28 | { | 28 | { |
29 | if (copy_to_user(dp, s, GRU_HANDLE_BYTES)) | 29 | if (copy_to_user(*dp, s, GRU_HANDLE_BYTES)) |
30 | return -1; | 30 | return -1; |
31 | *dp += GRU_HANDLE_BYTES; | 31 | *dp += GRU_HANDLE_BYTES; |
32 | return 0; | 32 | return 0; |
@@ -109,7 +109,7 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum, | |||
109 | { | 109 | { |
110 | struct gru_dump_context_header hdr; | 110 | struct gru_dump_context_header hdr; |
111 | struct gru_dump_context_header __user *uhdr = ubuf; | 111 | struct gru_dump_context_header __user *uhdr = ubuf; |
112 | struct gru_context_configuration_handle *cch; | 112 | struct gru_context_configuration_handle *cch, *ubufcch; |
113 | struct gru_thread_state *gts; | 113 | struct gru_thread_state *gts; |
114 | int try, cch_locked, cbrcnt = 0, dsrcnt = 0, bytes = 0, ret = 0; | 114 | int try, cch_locked, cbrcnt = 0, dsrcnt = 0, bytes = 0, ret = 0; |
115 | void *grubase; | 115 | void *grubase; |
@@ -125,8 +125,11 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum, | |||
125 | } | 125 | } |
126 | 126 | ||
127 | ubuf += sizeof(hdr); | 127 | ubuf += sizeof(hdr); |
128 | ubufcch = ubuf; | ||
128 | if (gru_user_copy_handle(&ubuf, cch)) | 129 | if (gru_user_copy_handle(&ubuf, cch)) |
129 | goto fail; | 130 | goto fail; |
131 | if (cch_locked) | ||
132 | ubufcch->delresp = 0; | ||
130 | bytes = sizeof(hdr) + GRU_CACHE_LINE_BYTES; | 133 | bytes = sizeof(hdr) + GRU_CACHE_LINE_BYTES; |
131 | 134 | ||
132 | if (cch_locked || !lock_cch) { | 135 | if (cch_locked || !lock_cch) { |
@@ -155,6 +158,7 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum, | |||
155 | return ret; | 158 | return ret; |
156 | 159 | ||
157 | hdr.magic = GRU_DUMP_MAGIC; | 160 | hdr.magic = GRU_DUMP_MAGIC; |
161 | hdr.gid = gru->gs_gid; | ||
158 | hdr.ctxnum = ctxnum; | 162 | hdr.ctxnum = ctxnum; |
159 | hdr.cbrcnt = cbrcnt; | 163 | hdr.cbrcnt = cbrcnt; |
160 | hdr.dsrcnt = dsrcnt; | 164 | hdr.dsrcnt = dsrcnt; |