214 }
215 }
216
217 /*
218 * This entry point handles output requests from restricted contexts like
219 * kmdb, where services like mutexes are not available. This function
220 * is entered when OBP or when a kernel debugger (such as kmdb)
221 * are generating console output. In those cases, power management
222 * concerns are handled by the abort sequence initiation (ie. when
223 * the user hits L1+A or the equivalent to enter OBP or the debugger.).
224 * It is also entered when the kernel is panicing.
225 */
226 void
227 tem_safe_polled_write(
228 tem_vt_state_t tem_arg,
229 uchar_t *buf,
230 int len)
231 {
232 struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg;
233
234 #ifdef __lock_lint
235 _NOTE(NO_COMPETING_THREADS_NOW)
236 _NOTE(NO_COMPETING_THREADS_AS_SIDE_EFFECT)
237 #endif
238
239 if (!tem->tvs_initialized) {
240 return;
241 }
242
243 tem_safe_check_first_time(tem, kcred, CALLED_FROM_STANDALONE);
244 tem_safe_terminal_emulate(tem, buf, len, NULL, CALLED_FROM_STANDALONE);
245 }
246
247 /* Process partial UTF-8 sequence. */
248 static void
249 tem_safe_input_partial(struct tem_vt_state *tem, cred_t *credp,
250 enum called_from called_from)
251 {
252 int i;
253 uint8_t c;
254
255 if (tem->tvs_utf8_left == 0)
256 return;
257
258 for (i = 0; i < sizeof (tem->tvs_utf8_partial); i++) {
|
214 }
215 }
216
217 /*
218 * This entry point handles output requests from restricted contexts like
219 * kmdb, where services like mutexes are not available. This function
220 * is entered when OBP or when a kernel debugger (such as kmdb)
221 * are generating console output. In those cases, power management
222 * concerns are handled by the abort sequence initiation (ie. when
223 * the user hits L1+A or the equivalent to enter OBP or the debugger.).
224 * It is also entered when the kernel is panicing.
225 */
226 void
227 tem_safe_polled_write(
228 tem_vt_state_t tem_arg,
229 uchar_t *buf,
230 int len)
231 {
232 struct tem_vt_state *tem = (struct tem_vt_state *)tem_arg;
233
234 if (!tem->tvs_initialized) {
235 return;
236 }
237
238 tem_safe_check_first_time(tem, kcred, CALLED_FROM_STANDALONE);
239 tem_safe_terminal_emulate(tem, buf, len, NULL, CALLED_FROM_STANDALONE);
240 }
241
242 /* Process partial UTF-8 sequence. */
243 static void
244 tem_safe_input_partial(struct tem_vt_state *tem, cred_t *credp,
245 enum called_from called_from)
246 {
247 int i;
248 uint8_t c;
249
250 if (tem->tvs_utf8_left == 0)
251 return;
252
253 for (i = 0; i < sizeof (tem->tvs_utf8_partial); i++) {
|