Changeset 5f4c41b2 in mainline
- Timestamp:
- 2017-11-26T02:41:55Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f4cfd271
- Parents:
- 9940ce0
- Location:
- uspace
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/ski-con/ski-con.c
r9940ce0 r5f4c41b2 193 193 static void ski_con_putchar(ski_con_t *con, char ch) 194 194 { 195 if (ch == '\n') 196 ski_con_putchar(con, '\r'); 197 195 198 #ifdef UARCH_ia64 196 199 asm volatile ( … … 205 208 (void) ch; 206 209 #endif 207 if (ch == '\n')208 ski_con_putchar(con, '\r');209 210 } 210 211 -
uspace/drv/char/sun4v-con/sun4v-con.c
r9940ce0 r5f4c41b2 38 38 #include <io/chardev_srv.h> 39 39 #include <stdbool.h> 40 #include < thread.h>40 #include <sysinfo.h> 41 41 42 42 #include "sun4v-con.h" … … 59 59 } __attribute__((packed)) __attribute__((aligned(PAGE_SIZE))) *input_buffer_t; 60 60 61 #define OUTPUT_FIFO_SIZE ((PAGE_SIZE) - 2 * sizeof(uint64_t)) 62 63 typedef volatile struct { 64 uint64_t read_ptr; 65 uint64_t write_ptr; 66 char data[OUTPUT_FIFO_SIZE]; 67 } __attribute__((packed)) output_fifo_t; 68 61 69 /* virtual address of the shared buffer */ 62 70 static input_buffer_t input_buffer; 71 static output_fifo_t *output_fifo; 63 72 64 73 static int sun4v_con_read(chardev_srv_t *, void *, size_t, size_t *); … … 72 81 static void sun4v_con_putchar(sun4v_con_t *con, uint8_t data) 73 82 { 74 (void) con; 75 (void) data; 83 if (data == '\n') 84 sun4v_con_putchar(con, '\r'); 85 86 while (output_fifo->write_ptr == 87 (output_fifo->read_ptr + OUTPUT_FIFO_SIZE - 1) 88 % OUTPUT_FIFO_SIZE); 89 90 output_fifo->data[output_fifo->write_ptr] = data; 91 output_fifo->write_ptr = 92 ((output_fifo->write_ptr) + 1) % OUTPUT_FIFO_SIZE; 76 93 } 77 94 … … 105 122 } 106 123 124 sysarg_t paddr; 125 rc = sysinfo_get_value("niagara.outbuf.address", &paddr); 126 if (rc != EOK) { 127 ddf_msg(LVL_ERROR, "Outbuf address information not found"); 128 return rc; 129 } 130 131 output_fifo = (output_fifo_t *) AS_AREA_ANY; 132 133 rc = physmem_map(paddr, 1, AS_AREA_READ | AS_AREA_WRITE, 134 (void *) &output_fifo); 135 if (rc != EOK) { 136 ddf_msg(LVL_ERROR, "Error mapping memory: %d", rc); 137 return rc; 138 } 139 107 140 rc = ddf_fun_bind(fun); 108 141 if (rc != EOK) { … … 111 144 } 112 145 146 ddf_fun_add_to_category(fun, "console"); 147 113 148 return EOK; 114 149 error: 115 /* XXX Clean up thread */116 117 150 if (input_buffer != (input_buffer_t) AS_AREA_ANY) 118 151 physmem_unmap((void *) input_buffer); -
uspace/srv/hid/output/Makefile
r9940ce0 r5f4c41b2 36 36 port/ega.c \ 37 37 port/kchar.c \ 38 port/niagara.c \39 38 port/chardev.c \ 40 39 proto/vt100.c \ -
uspace/srv/hid/output/output.c
r9940ce0 r5f4c41b2 37 37 #include "port/ega.h" 38 38 #include "port/kchar.h" 39 #include "port/niagara.h"40 39 #include "port/chardev.h" 41 40 #include "output.h" … … 479 478 ega_init(); 480 479 kchar_init(); 481 niagara_init();482 480 } 483 481 -
uspace/srv/hid/output/port/chardev.c
r9940ce0 r5f4c41b2 151 151 } 152 152 153 printf("%s: Connecting service %zu\n", NAME, sid); 154 char *name; 155 rc = loc_service_get_name(sid, &name); 156 if (rc != EOK) { 157 fibril_mutex_unlock(&discovery_lock); 158 return; 159 } 160 printf("%s: Service name is %s\n", NAME, name); 161 free(name); 162 153 163 sess = loc_service_connect(sid, INTERFACE_DDF, IPC_FLAG_BLOCKING); 154 164 if (!sess) { … … 176 186 if (!config_key_exists("console")) { 177 187 console = NULL; 178 #ifndef MACHINE_ski 188 #ifdef MACHINE_ski 189 /* OK */ 190 #elif defined(UARCH_sparc64) && defined(PROCESSOR_sun4v) 191 /* OK */ 192 #else 179 193 return EOK; 180 194 #endif
Note:
See TracChangeset
for help on using the changeset viewer.