Changeset 26e7d6d in mainline for uspace/srv/hid/fb/port/ski.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/port/ski.c
r3842a955 r26e7d6d 1 1 /* 2 * Copyright (c) 200 5 Jakub Jermar3 * Copyright (c) 2008 Jiri Svoboda2 * Copyright (c) 2006 Ondrej Palkovsky 3 * Copyright (c) 2008 Martin Decky 4 4 * All rights reserved. 5 5 * … … 28 28 */ 29 29 30 /** @defgroup msimfb MSIM text console31 * @brief HelenOS MSIM text console.32 * @ingroup fbs33 * @{34 */35 30 /** @file 36 31 */ 37 32 38 #include < async.h>39 #include < libc.h>33 #include <sys/types.h> 34 #include <errno.h> 40 35 #include <sysinfo.h> 41 #include <as.h> 42 #include <ddi.h> 43 44 #include "serial_console.h" 36 #include "../ctl/serial.h" 45 37 #include "ski.h" 46 38 47 # define SKI_PUTCHAR 3139 #ifdef UARCH_ia64 48 40 49 #define WIDTH 80 50 #define HEIGHT 24 41 #define SKI_PUTCHAR 31 51 42 52 43 /** Display character on ski debug console … … 55 46 * display character on debug console. 56 47 * 57 * @param ch Character to be printed. 48 * @param c Character to be printed. 49 * 58 50 */ 59 static void ski_putc(const char c h)51 static void ski_putc(const char c) 60 52 { 61 53 asm volatile ( 62 54 "mov r15 = %0\n" 63 "mov r32 = %1\n" 64 "break 0x80000\n" 55 "mov r32 = %1\n" /* r32 is in0 */ 56 "break 0x80000\n" /* modifies r8 */ 65 57 : 66 : "i" (SKI_PUTCHAR), "r" (c h)58 : "i" (SKI_PUTCHAR), "r" (c) 67 59 : "r15", "in0", "r8" 68 60 ); 69 61 70 if (c h== '\n')62 if (c == '\n') 71 63 ski_putc('\r'); 64 } 65 66 static void ski_putchar(wchar_t ch) 67 { 68 if ((ch >= 0) && (ch < 128)) 69 ski_putc(ch); 70 else 71 ski_putc('?'); 72 } 73 74 static void ski_control_puts(const char *str) 75 { 76 while (*str) 77 ski_putc(*(str++)); 72 78 } 73 79 74 80 int ski_init(void) 75 81 { 76 serial_console_init(ski_putc, WIDTH, HEIGHT); 82 sysarg_t present; 83 int rc = sysinfo_get_value("fb", &present); 84 if (rc != EOK) 85 present = false; 77 86 78 async_set_client_connection(serial_client_connection); 79 return 0; 87 if (!present) 88 return ENOENT; 89 90 sysarg_t kind; 91 rc = sysinfo_get_value("fb.kind", &kind); 92 if (rc != EOK) 93 kind = (sysarg_t) -1; 94 95 if (kind != 6) 96 return EINVAL; 97 98 return serial_init(ski_putchar, ski_control_puts); 80 99 } 81 100 82 /** 83 * @} 101 #else /* UARCH_ia64 */ 102 103 int ski_init(void) 104 { 105 return ENOENT; 106 } 107 108 #endif 109 110 /** @} 84 111 */
Note:
See TracChangeset
for help on using the changeset viewer.