Changeset 69b68d1f in mainline
- Timestamp:
- 2009-11-08T20:05:48Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 70a1c59
- Parents:
- 74cbac7d
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r74cbac7d r69b68d1f 428 428 429 429 % Serial line input module 430 ! [CONFIG_DSRLNIN=y|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&MACHINE=serengeti&CONFIG_SGCN_KBD=y) ] CONFIG_SRLN (y)430 ! [CONFIG_DSRLNIN=y|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&MACHINE=serengeti&CONFIG_SGCN_KBD=y)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y) 431 431 432 432 % EGA support -
kernel/arch/sparc64/include/drivers/niagara.h
r74cbac7d r69b68d1f 36 36 #define KERN_sparc64_NIAGARA_H 37 37 38 #include <proc/thread.h> 39 #include <console/chardev.h> 40 41 typedef struct { 42 thread_t *thread; 43 indev_t *srlnin; 44 } niagara_instance_t; 45 38 46 char niagara_getc(void); 39 47 void niagara_grab(void); 40 48 void niagara_release(void); 41 void niagara_init(void); 42 void niagara_poll(void); 49 niagara_instance_t *niagarain_init(void); 43 50 44 51 #endif -
kernel/arch/sparc64/src/drivers/niagara.c
r74cbac7d r69b68d1f 41 41 #include <ddi/device.h> 42 42 #include <arch/asm.h> 43 #include <arch.h> 43 44 #include <mm/slab.h> 44 45 #include <arch/drivers/kbd.h> … … 46 47 #include <sysinfo/sysinfo.h> 47 48 #include <ipc/irq.h> 49 #include <print.h> 50 #include <proc/thread.h> 51 #include <console/console.h> 52 #include <genarch/srln/srln.h> 53 54 #define POLL_INTERVAL 10000 48 55 49 56 /** … … 55 62 */ 56 63 #define FICTIONAL_INR 1 64 65 66 static niagara_instance_t *instance = NULL; 57 67 58 68 /* functions referenced from definitions of I/O operations structures */ … … 78 88 * the mapped buffer. The shared buffer definition follows. 79 89 */ 90 /* 80 91 #define OUTPUT_BUFFER_SIZE ((PAGE_SIZE) - 2 * 8) 81 92 static volatile struct { … … 87 98 __attribute__ ((aligned(PAGE_SIZE))) 88 99 output_buffer; 100 */ 89 101 90 102 #if 0 … … 197 209 } 198 210 211 #endif 212 199 213 /** 200 214 * Function regularly called by the keyboard polling thread. Asks the … … 202 216 * and sends it to the upper layers of HelenOS. 203 217 */ 204 void niagara_poll(void) 205 { 218 static void niagara_poll(niagara_instance_t *instance) 219 { 220 /* 206 221 while (output_buffer.read_ptr != output_buffer.write_ptr) { 207 222 do_putchar(output_buffer.data[output_buffer.read_ptr]); … … 209 224 ((output_buffer.read_ptr) + 1) % OUTPUT_BUFFER_SIZE; 210 225 } 226 */ 211 227 212 228 uint64_t c; 213 229 214 230 if (__hypercall_fast_ret1(0, 0, 0, 0, 0, CONS_GETCHAR, &c) == EOK) { 231 indev_push_character(instance->srlnin, c); 232 #if 0 215 233 ipl_t ipl = interrupts_disable(); 216 234 spinlock_lock(&niagara_irq.lock); … … 235 253 chardev_push_character(&niagara_io, '\n'); 236 254 } 237 } 238 239 } 240 241 #endif 255 #endif 256 } 257 258 } 259 260 /** 261 * Polling thread function. 262 */ 263 static void kniagarapoll(void *instance) { 264 while (true) { 265 //MH 266 //if (!silent) 267 niagara_poll(instance); 268 269 thread_usleep(POLL_INTERVAL); 270 } 271 } 242 272 243 273 /** … … 245 275 * input/output is used. 246 276 */ 247 void niagara_init(void) 248 { 277 static void niagara_init(void) 278 { 279 if (instance) 280 return; 281 282 instance = malloc(sizeof(niagara_instance_t), FRAME_ATOMIC); 283 284 if (instance) { 285 instance->thread = thread_create(kniagarapoll, instance, TASK, 0, 286 "kniagarapoll", true); 287 288 if (!instance->thread) { 289 free(instance); 290 instance = NULL; 291 return; 292 } 293 } 294 295 instance->srlnin = NULL; 296 249 297 #if 0 250 298 kbd_type = KBD_SUN4V; … … 269 317 * niagara fb driver can communicate with kernel using a shared buffer. 270 318 */ 271 output_buffer.read_ptr = 0;272 output_buffer.write_ptr = 0;319 //output_buffer.read_ptr = 0; 320 //output_buffer.write_ptr = 0; 273 321 274 322 #if 0 … … 296 344 } 297 345 346 /** 347 * A public function which initializes input from the Niagara console. 348 */ 349 niagara_instance_t *niagarain_init(void) 350 { 351 niagara_init(); 352 353 // TODO - move to console init 354 if (instance) { 355 srln_instance_t *srln_instance = srln_init(); 356 if (srln_instance) { 357 indev_t *sink = stdin_wire(); 358 indev_t *srln = srln_wire(srln_instance, sink); 359 360 // wire std. input to niagara 361 instance->srlnin = srln; 362 thread_ready(instance->thread); 363 } 364 } 365 return instance; 366 } 367 298 368 /** @} 299 369 */ -
kernel/arch/sparc64/src/sun4v/sparc64.c
r74cbac7d r69b68d1f 90 90 irq_init(1 << 11, 128); 91 91 } 92 niagara_init();93 92 } 94 93 … … 105 104 //MH 106 105 //standalone_sparc64_console_init(); 106 niagarain_init(); 107 107 } 108 108
Note:
See TracChangeset
for help on using the changeset viewer.