Changeset ad123964 in mainline
- Timestamp:
- 2006-06-01T00:21:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cf28036
- Parents:
- c594489
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
console/console.c
rc594489 rad123964 45 45 } 46 46 //#define CONSOLE_COUNT VFB_CONNECTIONS 47 #define CONSOLE_COUNT 647 #define CONSOLE_COUNT 8 48 48 49 49 #define NAME "CONSOLE" 50 50 51 int active_c lient = 0;51 int active_console = 1; 52 52 53 53 … … 94 94 int retval; 95 95 int i; 96 char c; 96 97 97 98 /* Ignore parameters, the connection is alread opened */ … … 112 113 /*FIXME: else store key to its buffer */ 113 114 retval = 0; 114 i = IPC_GET_ARG1(call) & 0xff; 115 c = IPC_GET_ARG1(call); 116 // ipc_call_sync_2(connections[3].vfb_phone, FB_PUTCHAR, 0, c,NULL,NULL); 115 117 /* switch to another virtual console */ 116 if (( i >= KBD_KEY_F1) && (i< KBD_KEY_F1 + CONSOLE_COUNT)) {117 active_c lient = i- KBD_KEY_F1;118 if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) { 119 active_console = c - KBD_KEY_F1; 118 120 break; 119 121 } 120 keybuffer_push(&(connections[active_client].keybuffer), i); 122 keybuffer_push(&(connections[active_console].keybuffer), c); 123 121 124 /* Send it to first FB, DEBUG */ 122 125 // ipc_call_async_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL); 123 // ipc_call_sync_2(connections[ 0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);126 // ipc_call_sync_2(connections[4].vfb_phone, FB_PUTCHAR, 0, c,NULL,NULL); 124 127 125 128 break; … … 157 160 return; 158 161 case CONSOLE_PUTCHAR: 162 if (consnum != active_console) { 163 } 159 164 /* Send message to fb */ 160 ipc_call_async_2(connections[consnum].vfb_phone, FB_PUTCHAR, IPC_GET_ARG1(call), IPC_GET_ARG2(call), NULL, NULL); 161 break; 165 ipc_call_sync_2(connections[consnum].vfb_phone, FB_PUTCHAR, IPC_GET_ARG1(call), IPC_GET_ARG2(call), NULL, NULL); 166 // ipc_call_sync_2(connections[6].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG2(call),NULL,NULL); 167 break; 168 case CONSOLE_CLEAR: 169 break; 170 case CONSOLE_GOTO: 171 break; 172 162 173 case CONSOLE_GETCHAR: 163 174 /* FIXME: Only temporary solution until request storage will be created */ 164 while ( !keybuffer_pop(&(connections[active_client].keybuffer), (char *)&arg1)) {175 while (keybuffer_empty(&(connections[consnum].keybuffer))) { 165 176 /* FIXME: buffer empty -> store request */ 166 async_usleep(1000 00);177 async_usleep(1000); 167 178 }; 179 keybuffer_pop(&(connections[consnum].keybuffer), (char *)&arg1); 180 // ipc_call_sync_2(connections[6].vfb_phone, FB_PUTCHAR, 0, arg1,NULL,NULL); 168 181 169 182 break; -
console/console.h
rc594489 rad123964 30 30 #define __CONSOLE_H__ 31 31 32 #define CONSOLE_GETCHAR 102 532 #define CONSOLE_GETCHAR 1026 33 33 #define CONSOLE_PUTCHAR 1027 34 #define CONSOLE_CLEAR 1028 35 #define CONSOLE_GOTO 1029 34 36 35 37 #endif -
fb/fb.c
rc594489 rad123964 141 141 142 142 case FB_PUTCHAR: 143 fb_putchar(vfb,IPC_GET_ARG2(call)); 144 ipc_answer_fast(callid,0,0,0); 145 break; 146 /* 147 * case FB_CLEAR: 143 148 ipc_answer_fast(callid,0,0,0); 144 149 fb_putchar(vfb,IPC_GET_ARG2(call)); 145 150 break; 151 * case FB_GOTO: 152 ipc_answer_fast(callid,0,0,0); 153 fb_putchar(vfb,IPC_GET_ARG2(call)); 154 break; 155 */ 146 156 default: 147 157 ipc_answer_fast(callid,ENOENT,0,0); -
kbd/generic/key_buffer.c
rc594489 rad123964 28 28 29 29 #include <key_buffer.h> 30 #include <futex.h> 31 32 atomic_t keybuffer_futex = FUTEX_INITIALIZER; 30 33 31 34 /** Clear key buffer. … … 33 36 void keybuffer_free(keybuffer_t *keybuffer) 34 37 { 35 38 futex_down(&keybuffer_futex); 39 keybuffer->head = 0; 40 keybuffer->tail = 0; 36 41 keybuffer->items = 0; 37 keybuffer->head = keybuffer->tail = keybuffer->items = 0;42 futex_up(&keybuffer_futex); 38 43 } 39 44 … … 70 75 void keybuffer_push(keybuffer_t *keybuffer, char key) 71 76 { 77 futex_down(&keybuffer_futex); 72 78 if (keybuffer->items < KEYBUFFER_SIZE) { 73 keybuffer->fifo[keybuffer->tail = (keybuffer->tail + 1) < keybuffer->items ? (keybuffer->tail + 1) : 0] = (key); 79 keybuffer->fifo[keybuffer->tail] = key; 80 keybuffer->tail = (keybuffer->tail + 1) % KEYBUFFER_SIZE; 74 81 keybuffer->items++; 75 82 } 83 futex_up(&keybuffer_futex); 76 84 } 77 85 … … 82 90 int keybuffer_pop(keybuffer_t *keybuffer, char *c) 83 91 { 92 futex_down(&keybuffer_futex); 84 93 if (keybuffer->items > 0) { 85 94 keybuffer->items--; 86 *c = keybuffer->fifo[keybuffer->head = (keybuffer->head + 1) < keybuffer->items ? (keybuffer->head + 1) : 0]; 95 *c = keybuffer->fifo[keybuffer->head]; 96 keybuffer->head = (keybuffer->head + 1) % KEYBUFFER_SIZE; 97 futex_up(&keybuffer_futex); 87 98 return 1; 88 99 } 100 futex_up(&keybuffer_futex); 89 101 return 0; 90 102 } -
kbd/include/key_buffer.h
rc594489 rad123964 32 32 #include <types.h> 33 33 34 #define KEYBUFFER_SIZE 128 /**< Size of buffer for pressed keys */ 34 /** Size of buffer for pressed keys */ 35 #define KEYBUFFER_SIZE 128 35 36 36 37 typedef struct { -
libc/generic/io/stream.c
rc594489 rad123964 119 119 if (console_phone < 0) { 120 120 while ((console_phone = ipc_connect_me_to(PHONE_NS, SERVICE_CONSOLE, 0)) < 0) { 121 volatile int a; 122 for (a = 0; a < 1048576; a++); 121 usleep(10000); 123 122 } 124 123 }
Note:
See TracChangeset
for help on using the changeset viewer.