Changeset 38de8a5 in mainline for arch/mips/src/console.c
- Timestamp:
- 2005-09-09T13:50:54Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b02e5d1
- Parents:
- b0edf3b2
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
arch/mips/src/console.c
rb0edf3b2 r38de8a5 1 1 /* 2 * Copyright (C) 200 3-2004 Jakub Jermar2 * Copyright (C) 2005 Ondrej Palkovsky 3 3 * All rights reserved. 4 4 * … … 30 30 #include <arch/types.h> 31 31 #include <arch/cp0.h> 32 #include <arch/console.h> 32 33 33 #define VIDEORAM 0xB0000000 34 static void (*putchar_func)(const char ch) = NULL; 35 36 static void cons_putchar(const char ch) 37 { 38 *((char *) VIDEORAM) = ch; 39 } 40 41 42 static void serial_putchar(const char ch) 43 { 44 int i; 45 46 if (ch=='\n') 47 putchar('\r'); 48 49 /* Wait until transmit buffer empty */ 50 while (! ((*SERIAL_LSR) & (1<<TRANSMIT_EMPTY_BIT))) 51 ; 52 *(SERIAL_PORT_BASE) = ch; 53 } 54 55 void console_init(void) 56 { 57 /* The LSR on the start usually contains this value */ 58 if (*SERIAL_LSR == 0x60) 59 putchar_func = serial_putchar; 60 else 61 putchar_func = cons_putchar; 62 } 34 63 35 64 void putchar(const char ch) 36 65 { 37 // __u32 status = cp0_status_read(); 38 39 // cp0_status_write(cp0_status_read() | cp0_status_erl_error_bit); 40 *((char *) VIDEORAM) = ch; 41 // cp0_status_write(status); 66 putchar_func(ch); 42 67 }
Note:
See TracChangeset
for help on using the changeset viewer.