Rev 1707 | Rev 1723 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1707 | Rev 1717 | ||
---|---|---|---|
Line 226... | Line 226... | ||
226 | if (active_console == KERNEL_CONSOLE) |
226 | if (active_console == KERNEL_CONSOLE) |
227 | return; |
227 | return; |
228 | active_console = KERNEL_CONSOLE; |
228 | active_console = KERNEL_CONSOLE; |
229 | curs_visibility(0); |
229 | curs_visibility(0); |
230 | 230 | ||
- | 231 | async_serialize_start(); |
|
231 | if (kernel_pixmap == -1) { |
232 | if (kernel_pixmap == -1) { |
232 | /* store/restore unsupported */ |
233 | /* store/restore unsupported */ |
233 | set_style_col(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND); |
234 | set_style_col(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND); |
234 | clrscr(); |
235 | clrscr(); |
235 | } else { |
236 | } else { |
236 | gcons_in_kernel(); |
237 | gcons_in_kernel(); |
237 | console_pixmap = switch_screens(kernel_pixmap); |
238 | console_pixmap = switch_screens(kernel_pixmap); |
238 | kernel_pixmap = -1; |
239 | kernel_pixmap = -1; |
239 | } |
240 | } |
- | 241 | async_serialize_end(); |
|
240 | 242 | ||
241 | __SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE); |
243 | __SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE); |
242 | return; |
244 | return; |
243 | } |
245 | } |
244 | 246 | ||
- | 247 | async_serialize_start(); |
|
- | 248 | ||
245 | if (console_pixmap != -1) { |
249 | if (console_pixmap != -1) { |
246 | kernel_pixmap = switch_screens(console_pixmap); |
250 | kernel_pixmap = switch_screens(console_pixmap); |
247 | console_pixmap = -1; |
251 | console_pixmap = -1; |
248 | } |
252 | } |
249 | active_console = newcons; |
253 | active_console = newcons; |
Line 278... | Line 282... | ||
278 | } |
282 | } |
279 | } |
283 | } |
280 | 284 | ||
281 | curs_goto(conn->screenbuffer.position_y, conn->screenbuffer.position_x); |
285 | curs_goto(conn->screenbuffer.position_y, conn->screenbuffer.position_x); |
282 | curs_visibility(conn->screenbuffer.is_cursor_visible); |
286 | curs_visibility(conn->screenbuffer.is_cursor_visible); |
- | 287 | ||
- | 288 | async_serialize_end(); |
|
283 | } |
289 | } |
284 | 290 | ||
285 | /** Handler for keyboard */ |
291 | /** Handler for keyboard */ |
286 | static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall) |
292 | static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall) |
287 | { |
293 | { |
288 | ipc_callid_t callid; |
294 | ipc_callid_t callid; |
289 | ipc_call_t call; |
295 | ipc_call_t call; |
290 | int retval; |
296 | int retval; |
291 | int c; |
297 | int c; |
292 | connection_t *conn; |
298 | connection_t *conn; |
- | 299 | int newcon; |
|
293 | 300 | ||
294 | /* Ignore parameters, the connection is alread opened */ |
301 | /* Ignore parameters, the connection is alread opened */ |
295 | while (1) { |
302 | while (1) { |
296 | callid = async_get_call(&call); |
303 | callid = async_get_call(&call); |
297 | switch (IPC_GET_METHOD(call)) { |
304 | switch (IPC_GET_METHOD(call)) { |
298 | case IPC_M_PHONE_HUNGUP: |
305 | case IPC_M_PHONE_HUNGUP: |
299 | /* TODO: Handle hangup */ |
306 | /* TODO: Handle hangup */ |
300 | return; |
307 | return; |
- | 308 | case KBD_MS_LEFT: |
|
- | 309 | newcon = gcons_mouse_btn(IPC_GET_ARG1(call)); |
|
- | 310 | if (newcon != -1) |
|
- | 311 | change_console(newcon); |
|
- | 312 | break; |
|
301 | case KBD_MS_MOVE: |
313 | case KBD_MS_MOVE: |
302 | gcons_mouse_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
314 | gcons_mouse_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
303 | break; |
315 | break; |
304 | case KBD_PUSHCHAR: |
316 | case KBD_PUSHCHAR: |
305 | /* got key from keyboard driver */ |
317 | /* got key from keyboard driver */ |
Line 309... | Line 321... | ||
309 | /* switch to another virtual console */ |
321 | /* switch to another virtual console */ |
310 | 322 | ||
311 | conn = &connections[active_console]; |
323 | conn = &connections[active_console]; |
312 | // if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) { |
324 | // if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) { |
313 | if ((c >= 0x101) && (c < 0x101 + CONSOLE_COUNT)) { |
325 | if ((c >= 0x101) && (c < 0x101 + CONSOLE_COUNT)) { |
314 | async_serialize_start(); |
- | |
315 | if (c == 0x112) |
326 | if (c == 0x112) |
316 | change_console(KERNEL_CONSOLE); |
327 | change_console(KERNEL_CONSOLE); |
317 | else |
328 | else |
318 | change_console(c - 0x101); |
329 | change_console(c - 0x101); |
319 | async_serialize_end(); |
- | |
320 | break; |
330 | break; |
321 | } |
331 | } |
322 | 332 | ||
323 | /* if client is awaiting key, send it */ |
333 | /* if client is awaiting key, send it */ |
324 | if (conn->keyrequest_counter > 0) { |
334 | if (conn->keyrequest_counter > 0) { |