Changeset 516ff92 in mainline for kernel/arch
- Timestamp:
- 2009-01-31T21:27:18Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4863e50b
- Parents:
- 96a2e45
- Location:
- kernel/arch
- Files:
-
- 9 edited
-
arm32/include/machine.h (modified) (1 diff)
-
arm32/src/drivers/gxemul.c (modified) (1 diff)
-
ia32xen/src/drivers/xconsole.c (modified) (1 diff)
-
ia64/src/ia64.c (modified) (1 diff)
-
ia64/src/ski/ski.c (modified) (3 diffs)
-
mips32/src/drivers/msim.c (modified) (4 diffs)
-
mips32/src/drivers/serial.c (modified) (4 diffs)
-
ppc32/src/ppc32.c (modified) (1 diff)
-
sparc64/src/drivers/sgcn.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/machine.h
r96a2e45 r516ff92 103 103 104 104 105 #ifdef MACHINE_GXEMUL_TESTARM 106 #define machine_console_init(devno) gxemul_console_init(devno) 107 #define machine_grab_console gxemul_grab_console 108 #define machine_release_console gxemul_release_console 109 #define machine_hw_map_init gxemul_hw_map_init 110 #define machine_timer_irq_start gxemul_timer_irq_start 111 #define machine_cpu_halt gxemul_cpu_halt 112 #define machine_get_memory_size gxemul_get_memory_size 113 #define machine_debug_putc(ch) gxemul_debug_putc(ch) 114 #define machine_irq_exception(exc_no, istate) \ 115 gxemul_irq_exception(exc_no, istate) 116 #define machine_get_fb_address gxemul_get_fb_address 105 #ifdef MACHINE_GXEMUL_TESTARM 106 #define machine_console_init(devno) gxemul_console_init(devno) 107 #define machine_grab_console gxemul_grab_console 108 #define machine_release_console gxemul_release_console 109 #define machine_hw_map_init gxemul_hw_map_init 110 #define machine_timer_irq_start gxemul_timer_irq_start 111 #define machine_cpu_halt gxemul_cpu_halt 112 #define machine_get_memory_size gxemul_get_memory_size 113 #define machine_debug_putc(ch) gxemul_debug_putc(ch) 114 #define machine_irq_exception(exc_no, istate) gxemul_irq_exception(exc_no, istate) 115 #define machine_get_fb_address gxemul_get_fb_address 117 116 #endif 118 117 -
kernel/arch/arm32/src/drivers/gxemul.c
r96a2e45 r516ff92 134 134 * @param ch Characted to be printed. 135 135 */ 136 static void gxemul_write(chardev_t *dev, const char ch) 137 { 138 *((char *) gxemul_hw_map.videoram) = ch; 136 static void gxemul_write(chardev_t *dev, const char ch, bool silent) 137 { 138 if (!silent) 139 *((char *) gxemul_hw_map.videoram) = ch; 139 140 } 140 141 -
kernel/arch/ia32xen/src/drivers/xconsole.c
r96a2e45 r516ff92 56 56 } 57 57 58 void xen_putchar(chardev_t *d, const char ch )58 void xen_putchar(chardev_t *d, const char ch, bool silent) 59 59 { 60 if (start_info.console.domU.evtchn != 0) { 61 uint32_t cons = console_page.out_cons; 62 uint32_t prod = console_page.out_prod; 63 64 memory_barrier(); 65 66 if ((prod - cons) > sizeof(console_page.out)) 67 return; 68 69 if (ch == '\n') 70 console_page.out[MASK_INDEX(prod++, console_page.out)] = '\r'; 71 console_page.out[MASK_INDEX(prod++, console_page.out)] = ch; 72 73 write_barrier(); 74 75 console_page.out_prod = prod; 76 77 xen_notify_remote(start_info.console.domU.evtchn); 78 } else 79 xen_console_io(CONSOLE_IO_WRITE, 1, &ch); 60 if (!silent) { 61 if (start_info.console.domU.evtchn != 0) { 62 uint32_t cons = console_page.out_cons; 63 uint32_t prod = console_page.out_prod; 64 65 memory_barrier(); 66 67 if ((prod - cons) > sizeof(console_page.out)) 68 return; 69 70 if (ch == '\n') 71 console_page.out[MASK_INDEX(prod++, console_page.out)] = '\r'; 72 console_page.out[MASK_INDEX(prod++, console_page.out)] = ch; 73 74 write_barrier(); 75 76 console_page.out_prod = prod; 77 78 xen_notify_remote(start_info.console.domU.evtchn); 79 } else 80 xen_console_io(CONSOLE_IO_WRITE, 1, &ch); 81 } 80 82 } 81 83 -
kernel/arch/ia64/src/ia64.c
r96a2e45 r516ff92 255 255 #else 256 256 i8042_grab(); 257 #endif 258 #endif 257 #endif 258 #endif 259 259 } 260 260 -
kernel/arch/ia64/src/ski/ski.c
r96a2e45 r516ff92 57 57 static bool kbd_disabled; 58 58 59 static void ski_putchar(chardev_t *d, const char ch);60 static int32_t ski_getchar(void);61 62 59 /** Display character on debug console 63 60 * … … 68 65 * @param ch Character to be printed. 69 66 */ 70 void ski_putchar(chardev_t *d, const char ch) 71 { 72 asm volatile ( 73 "mov r15 = %0\n" 74 "mov r32 = %1\n" /* r32 is in0 */ 75 "break 0x80000\n" /* modifies r8 */ 76 : 77 : "i" (SKI_PUTCHAR), "r" (ch) 78 : "r15", "in0", "r8" 79 ); 80 81 if (ch == '\n') 82 ski_putchar(d, '\r'); 67 static void ski_putchar(chardev_t *d, const char ch, bool silent) 68 { 69 if (!silent) { 70 asm volatile ( 71 "mov r15 = %0\n" 72 "mov r32 = %1\n" /* r32 is in0 */ 73 "break 0x80000\n" /* modifies r8 */ 74 : 75 : "i" (SKI_PUTCHAR), "r" (ch) 76 : "r15", "in0", "r8" 77 ); 78 79 if (ch == '\n') 80 ski_putchar(d, '\r'); 81 } 83 82 } 84 83 … … 92 91 * @return ASCII code of pressed key or 0 if no key pressed. 93 92 */ 94 int32_t ski_getchar(void)93 static int32_t ski_getchar(void) 95 94 { 96 95 uint64_t ch; -
kernel/arch/mips32/src/drivers/msim.c
r96a2e45 r516ff92 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ … … 59 59 60 60 /** Putchar that works with MSIM & gxemul */ 61 void msim_write(chardev_t *dev, const char ch )61 void msim_write(chardev_t *dev, const char ch, bool silent) 62 62 { 63 *((char *) MSIM_VIDEORAM) = ch; 63 if (!silent) 64 *((char *) MSIM_VIDEORAM) = ch; 64 65 } 65 66 … … 81 82 { 82 83 char ch; 83 84 84 85 while (1) { 85 86 ch = *((volatile char *) MSIM_KBD_ADDRESS); … … 102 103 char ch = 0; 103 104 104 ch = *((char *) MSIM_KBD_ADDRESS);105 if (ch =='\r')106 ch = '\n';107 if (ch == 0x7f)108 ch = '\b';109 chardev_push_character(&console, ch);105 ch = *((char *) MSIM_KBD_ADDRESS); 106 if (ch =='\r') 107 ch = '\n'; 108 if (ch == 0x7f) 109 ch = '\b'; 110 chardev_push_character(&console, ch); 110 111 } 111 112 } -
kernel/arch/mips32/src/drivers/serial.c
r96a2e45 r516ff92 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ … … 47 47 static bool kb_enabled; 48 48 49 static void serial_write(chardev_t *d, const char ch )49 static void serial_write(chardev_t *d, const char ch, bool silent) 50 50 { 51 serial_t *sd = (serial_t *)d->data; 52 53 if (ch == '\n') 54 serial_write(d, '\r'); 55 /* Wait until transmit buffer empty */ 56 while (! (SERIAL_READ_LSR(sd->port) & (1<<TRANSMIT_EMPTY_BIT))) 57 ; 58 SERIAL_WRITE(sd->port, ch); 51 if (!silent) { 52 serial_t *sd = (serial_t *)d->data; 53 54 if (ch == '\n') 55 serial_write(d, '\r'); 56 57 /* Wait until transmit buffer empty */ 58 while (!(SERIAL_READ_LSR(sd->port) & (1 << TRANSMIT_EMPTY_BIT))); 59 SERIAL_WRITE(sd->port, ch); 60 } 59 61 } 60 62 … … 134 136 { 135 137 serial_t *sd = &sconf[0]; 136 137 138 138 139 chardev_initialize("serial_console", &console, &serial_ops); 139 140 console.data = sd; … … 146 147 serial_irq.handler = serial_irq_handler; 147 148 irq_register(&serial_irq); 148 149 149 150 /* I don't know why, but the serial interrupts simply 150 * don't work on simics 151 */ 151 don't work on simics */ 152 152 virtual_timer_fnc = &serial_handler; 153 153 -
kernel/arch/ppc32/src/ppc32.c
r96a2e45 r516ff92 148 148 149 149 /* Unreachable */ 150 for (;;) 151 ; 150 while (true); 152 151 } 153 152 -
kernel/arch/sparc64/src/drivers/sgcn.c
r96a2e45 r516ff92 296 296 * written straight away. 297 297 */ 298 static void sgcn_putchar(struct chardev * cd, const char c) 299 { 300 spinlock_lock(&sgcn_output_lock); 301 302 sgcn_do_putchar(c); 303 if (c == '\n') { 304 sgcn_do_putchar('\r'); 298 static void sgcn_putchar(struct chardev * cd, const char c, bool silent) 299 { 300 if (!silent) { 301 spinlock_lock(&sgcn_output_lock); 302 303 sgcn_do_putchar(c); 304 if (c == '\n') 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
Note:
See TracChangeset
for help on using the changeset viewer.
