diff options
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/kdebug.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/system.h | 14 | ||||
-rw-r--r-- | include/asm-sparc64/termios.h | 78 |
3 files changed, 46 insertions, 48 deletions
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h index f70d3dad01f9..6321f5a0198d 100644 --- a/include/asm-sparc64/kdebug.h +++ b/include/asm-sparc64/kdebug.h | |||
@@ -16,7 +16,7 @@ struct die_args { | |||
16 | }; | 16 | }; |
17 | 17 | ||
18 | /* Note - you should never unregister because that can race with NMIs. | 18 | /* Note - you should never unregister because that can race with NMIs. |
19 | * If you really want to do it first unregister - then synchronize_kernel | 19 | * If you really want to do it first unregister - then synchronize_sched |
20 | * - then free. | 20 | * - then free. |
21 | */ | 21 | */ |
22 | int register_die_notifier(struct notifier_block *nb); | 22 | int register_die_notifier(struct notifier_block *nb); |
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index fd12ca386f48..f9be2c5b4dc9 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -139,19 +139,13 @@ extern void __flushw_user(void); | |||
139 | #define flush_user_windows flushw_user | 139 | #define flush_user_windows flushw_user |
140 | #define flush_register_windows flushw_all | 140 | #define flush_register_windows flushw_all |
141 | 141 | ||
142 | #define prepare_arch_switch(rq, next) \ | 142 | /* Don't hold the runqueue lock over context switch */ |
143 | do { spin_lock(&(next)->switch_lock); \ | 143 | #define __ARCH_WANT_UNLOCKED_CTXSW |
144 | spin_unlock(&(rq)->lock); \ | 144 | #define prepare_arch_switch(next) \ |
145 | do { \ | ||
145 | flushw_all(); \ | 146 | flushw_all(); \ |
146 | } while (0) | 147 | } while (0) |
147 | 148 | ||
148 | #define finish_arch_switch(rq, prev) \ | ||
149 | do { spin_unlock_irq(&(prev)->switch_lock); \ | ||
150 | } while (0) | ||
151 | |||
152 | #define task_running(rq, p) \ | ||
153 | ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock)) | ||
154 | |||
155 | /* See what happens when you design the chip correctly? | 149 | /* See what happens when you design the chip correctly? |
156 | * | 150 | * |
157 | * We tell gcc we clobber all non-fixed-usage registers except | 151 | * We tell gcc we clobber all non-fixed-usage registers except |
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h index 8effce0da087..9777a9cca88a 100644 --- a/include/asm-sparc64/termios.h +++ b/include/asm-sparc64/termios.h | |||
@@ -100,16 +100,17 @@ struct winsize { | |||
100 | #define user_termio_to_kernel_termios(termios, termio) \ | 100 | #define user_termio_to_kernel_termios(termios, termio) \ |
101 | ({ \ | 101 | ({ \ |
102 | unsigned short tmp; \ | 102 | unsigned short tmp; \ |
103 | get_user(tmp, &(termio)->c_iflag); \ | 103 | int err; \ |
104 | err = get_user(tmp, &(termio)->c_iflag); \ | ||
104 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ | 105 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ |
105 | get_user(tmp, &(termio)->c_oflag); \ | 106 | err |= get_user(tmp, &(termio)->c_oflag); \ |
106 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ | 107 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ |
107 | get_user(tmp, &(termio)->c_cflag); \ | 108 | err |= get_user(tmp, &(termio)->c_cflag); \ |
108 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ | 109 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ |
109 | get_user(tmp, &(termio)->c_lflag); \ | 110 | err |= get_user(tmp, &(termio)->c_lflag); \ |
110 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ | 111 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ |
111 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | 112 | err |= copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ |
112 | 0; \ | 113 | err; \ |
113 | }) | 114 | }) |
114 | 115 | ||
115 | /* | 116 | /* |
@@ -119,53 +120,56 @@ struct winsize { | |||
119 | */ | 120 | */ |
120 | #define kernel_termios_to_user_termio(termio, termios) \ | 121 | #define kernel_termios_to_user_termio(termio, termios) \ |
121 | ({ \ | 122 | ({ \ |
122 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | 123 | int err; \ |
123 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | 124 | err = put_user((termios)->c_iflag, &(termio)->c_iflag); \ |
124 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | 125 | err |= put_user((termios)->c_oflag, &(termio)->c_oflag); \ |
125 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | 126 | err |= put_user((termios)->c_cflag, &(termio)->c_cflag); \ |
126 | put_user((termios)->c_line, &(termio)->c_line); \ | 127 | err |= put_user((termios)->c_lflag, &(termio)->c_lflag); \ |
127 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 128 | err |= put_user((termios)->c_line, &(termio)->c_line); \ |
129 | err |= copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
128 | if (!((termios)->c_lflag & ICANON)) { \ | 130 | if (!((termios)->c_lflag & ICANON)) { \ |
129 | put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ | 131 | err |= put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ |
130 | put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ | 132 | err |= put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ |
131 | } \ | 133 | } \ |
132 | 0; \ | 134 | err; \ |
133 | }) | 135 | }) |
134 | 136 | ||
135 | #define user_termios_to_kernel_termios(k, u) \ | 137 | #define user_termios_to_kernel_termios(k, u) \ |
136 | ({ \ | 138 | ({ \ |
137 | get_user((k)->c_iflag, &(u)->c_iflag); \ | 139 | int err; \ |
138 | get_user((k)->c_oflag, &(u)->c_oflag); \ | 140 | err = get_user((k)->c_iflag, &(u)->c_iflag); \ |
139 | get_user((k)->c_cflag, &(u)->c_cflag); \ | 141 | err |= get_user((k)->c_oflag, &(u)->c_oflag); \ |
140 | get_user((k)->c_lflag, &(u)->c_lflag); \ | 142 | err |= get_user((k)->c_cflag, &(u)->c_cflag); \ |
141 | get_user((k)->c_line, &(u)->c_line); \ | 143 | err |= get_user((k)->c_lflag, &(u)->c_lflag); \ |
142 | copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ | 144 | err |= get_user((k)->c_line, &(u)->c_line); \ |
145 | err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ | ||
143 | if((k)->c_lflag & ICANON) { \ | 146 | if((k)->c_lflag & ICANON) { \ |
144 | get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 147 | err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
145 | get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 148 | err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
146 | } else { \ | 149 | } else { \ |
147 | get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 150 | err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
148 | get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 151 | err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
149 | } \ | 152 | } \ |
150 | 0; \ | 153 | err; \ |
151 | }) | 154 | }) |
152 | 155 | ||
153 | #define kernel_termios_to_user_termios(u, k) \ | 156 | #define kernel_termios_to_user_termios(u, k) \ |
154 | ({ \ | 157 | ({ \ |
155 | put_user((k)->c_iflag, &(u)->c_iflag); \ | 158 | int err; \ |
156 | put_user((k)->c_oflag, &(u)->c_oflag); \ | 159 | err = put_user((k)->c_iflag, &(u)->c_iflag); \ |
157 | put_user((k)->c_cflag, &(u)->c_cflag); \ | 160 | err |= put_user((k)->c_oflag, &(u)->c_oflag); \ |
158 | put_user((k)->c_lflag, &(u)->c_lflag); \ | 161 | err |= put_user((k)->c_cflag, &(u)->c_cflag); \ |
159 | put_user((k)->c_line, &(u)->c_line); \ | 162 | err |= put_user((k)->c_lflag, &(u)->c_lflag); \ |
160 | copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ | 163 | err |= put_user((k)->c_line, &(u)->c_line); \ |
164 | err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ | ||
161 | if(!((k)->c_lflag & ICANON)) { \ | 165 | if(!((k)->c_lflag & ICANON)) { \ |
162 | put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 166 | err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
163 | put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 167 | err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
164 | } else { \ | 168 | } else { \ |
165 | put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 169 | err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
166 | put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 170 | err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
167 | } \ | 171 | } \ |
168 | 0; \ | 172 | err; \ |
169 | }) | 173 | }) |
170 | 174 | ||
171 | #endif /* __KERNEL__ */ | 175 | #endif /* __KERNEL__ */ |