Rev 534 | Rev 664 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 534 | Rev 586 | ||
|---|---|---|---|
| Line 24... | Line 24... | ||
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
27 | */ |
| 28 | 28 | ||
| 29 | #include <putchar.h> |
29 | #include <arch/console.h> |
| 30 | #include <genarch/ofw/ofw.h> |
30 | #include <genarch/ofw/ofw.h> |
| - | 31 | #include <console/chardev.h> |
|
| - | 32 | #include <console/console.h> |
|
| - | 33 | ||
| - | 34 | static void ofw_sparc64_putchar(chardev_t *d, const char ch); |
|
| - | 35 | ||
| - | 36 | static chardev_t ofw_sparc64_console; |
|
| - | 37 | static chardev_operations_t ofw_sparc64_console_ops = { |
|
| - | 38 | .write = ofw_sparc64_putchar |
|
| - | 39 | }; |
|
| - | 40 | ||
| - | 41 | void ofw_sparc64_console_init(void) |
|
| - | 42 | { |
|
| - | 43 | chardev_initialize("ofw_sparc64_console", &ofw_sparc64_console, &ofw_sparc64_console_ops); |
|
| - | 44 | stdout = &ofw_sparc64_console; |
|
| - | 45 | } |
|
| 31 | 46 | ||
| 32 | /** Print one character. |
47 | /** Print one character. |
| 33 | * |
48 | * |
| 34 | * @param ch Character to be printed. |
49 | * @param ch Character to be printed. |
| 35 | */ |
50 | */ |
| 36 | void putchar(const char ch) |
51 | void ofw_sparc64_putchar(chardev_t *d, const char ch) |
| 37 | { |
52 | { |
| 38 | if (ch == '\n') |
53 | if (ch == '\n') |
| 39 | ofw_putchar('\r'); |
54 | ofw_putchar('\r'); |
| 40 | ofw_putchar(ch); |
55 | ofw_putchar(ch); |
| 41 | } |
56 | } |