Rev 4339 | Rev 4343 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4339 | Rev 4341 | ||
|---|---|---|---|
| Line 144... | Line 144... | ||
| 144 | SPINLOCK_INITIALIZE(sgcn_input_lock); |
144 | SPINLOCK_INITIALIZE(sgcn_input_lock); |
| 145 | 145 | ||
| 146 | 146 | ||
| 147 | /* functions referenced from definitions of I/O operations structures */ |
147 | /* functions referenced from definitions of I/O operations structures */ |
| 148 | static void sgcn_noop(chardev_t *); |
148 | static void sgcn_noop(chardev_t *); |
| 149 | static void sgcn_putchar(chardev_t *, const char); |
149 | static void sgcn_putchar(chardev_t *, const char, bool); |
| 150 | static char sgcn_key_read(chardev_t *); |
150 | static char sgcn_key_read(chardev_t *); |
| 151 | 151 | ||
| 152 | /** character device operations */ |
152 | /** character device operations */ |
| 153 | static chardev_operations_t sgcn_ops = { |
153 | static chardev_operations_t sgcn_ops = { |
| 154 | .suspend = sgcn_noop, |
154 | .suspend = sgcn_noop, |
| Line 293... | Line 293... | ||
| 293 | /** |
293 | /** |
| 294 | * SGCN output operation. Prints a single character to the SGCN. If the line |
294 | * SGCN output operation. Prints a single character to the SGCN. If the line |
| 295 | * feed character is written ('\n'), the carriage return character ('\r') is |
295 | * feed character is written ('\n'), the carriage return character ('\r') is |
| 296 | * written straight away. |
296 | * written straight away. |
| 297 | */ |
297 | */ |
| 298 | static void sgcn_putchar(struct chardev * cd, const char c) |
298 | static void sgcn_putchar(struct chardev * cd, const char c, bool silent) |
| 299 | { |
299 | { |
| - | 300 | if (!silent) { |
|
| 300 | spinlock_lock(&sgcn_output_lock); |
301 | spinlock_lock(&sgcn_output_lock); |
| 301 | 302 | ||
| 302 | sgcn_do_putchar(c); |
303 | sgcn_do_putchar(c); |
| 303 | if (c == '\n') { |
304 | if (c == '\n') |
| 304 | sgcn_do_putchar('\r'); |
305 | sgcn_do_putchar('\r'); |
| - | 306 | ||
| - | 307 | spinlock_unlock(&sgcn_output_lock); |
|
| 305 | } |
308 | } |
| 306 | - | ||
| 307 | spinlock_unlock(&sgcn_output_lock); |
- | |
| 308 | } |
309 | } |
| 309 | 310 | ||
| 310 | /** |
311 | /** |
| 311 | * Called when actively reading the character. Not implemented yet. |
312 | * Called when actively reading the character. Not implemented yet. |
| 312 | */ |
313 | */ |