17afa713aSIngo Weinhold /* 2d51ce540SAxel Dörfler * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. 37afa713aSIngo Weinhold * Distributed under the terms of the MIT License. 47afa713aSIngo Weinhold * 57afa713aSIngo Weinhold * Copyright 2001, Travis Geiselbrecht. All rights reserved. 67afa713aSIngo Weinhold * Distributed under the terms of the NewOS License. 77afa713aSIngo Weinhold */ 87afa713aSIngo Weinhold 97afa713aSIngo Weinhold 107afa713aSIngo Weinhold #include <arch_platform.h> 117afa713aSIngo Weinhold #include <arch/debug_console.h> 127afa713aSIngo Weinhold #include <boot/kernel_args.h> 137afa713aSIngo Weinhold #include <kernel.h> 14e50cf876SIngo Weinhold #include <vm/vm.h> 157afa713aSIngo Weinhold 167afa713aSIngo Weinhold #include <string.h> 177afa713aSIngo Weinhold 187afa713aSIngo Weinhold 19d51ce540SAxel Dörfler void arch_debug_remove_interrupt_handler(uint32 line)20d51ce540SAxel Dörflerarch_debug_remove_interrupt_handler(uint32 line) 21d51ce540SAxel Dörfler { 22d51ce540SAxel Dörfler } 23d51ce540SAxel Dörfler 24d51ce540SAxel Dörfler 25d51ce540SAxel Dörfler void arch_debug_install_interrupt_handlers(void)26d51ce540SAxel Dörflerarch_debug_install_interrupt_handlers(void) 27d51ce540SAxel Dörfler { 28d51ce540SAxel Dörfler } 29d51ce540SAxel Dörfler 30d51ce540SAxel Dörfler 31*8bcc50c3SIngo Weinhold int arch_debug_blue_screen_try_getchar(void)32*8bcc50c3SIngo Weinholdarch_debug_blue_screen_try_getchar(void) 33*8bcc50c3SIngo Weinhold { 34*8bcc50c3SIngo Weinhold // TODO: Implement correctly! 35*8bcc50c3SIngo Weinhold return arch_debug_blue_screen_getchar(); 36*8bcc50c3SIngo Weinhold } 37*8bcc50c3SIngo Weinhold 38*8bcc50c3SIngo Weinhold 397afa713aSIngo Weinhold char arch_debug_blue_screen_getchar(void)407afa713aSIngo Weinholdarch_debug_blue_screen_getchar(void) 417afa713aSIngo Weinhold { 427afa713aSIngo Weinhold return 0; 437afa713aSIngo Weinhold } 447afa713aSIngo Weinhold 457afa713aSIngo Weinhold 46*8bcc50c3SIngo Weinhold int arch_debug_serial_try_getchar(void)47*8bcc50c3SIngo Weinholdarch_debug_serial_try_getchar(void) 48*8bcc50c3SIngo Weinhold { 49*8bcc50c3SIngo Weinhold // TODO: Implement correctly! 50*8bcc50c3SIngo Weinhold return arch_debug_serial_getchar(); 51*8bcc50c3SIngo Weinhold } 52*8bcc50c3SIngo Weinhold 53*8bcc50c3SIngo Weinhold 547afa713aSIngo Weinhold char arch_debug_serial_getchar(void)557afa713aSIngo Weinholdarch_debug_serial_getchar(void) 567afa713aSIngo Weinhold { 577afa713aSIngo Weinhold return PPCPlatform::Default()->SerialDebugGetChar(); 587afa713aSIngo Weinhold } 597afa713aSIngo Weinhold 607afa713aSIngo Weinhold 617afa713aSIngo Weinhold void arch_debug_serial_putchar(const char c)627afa713aSIngo Weinholdarch_debug_serial_putchar(const char c) 637afa713aSIngo Weinhold { 647afa713aSIngo Weinhold return PPCPlatform::Default()->SerialDebugPutChar(c); 657afa713aSIngo Weinhold } 667afa713aSIngo Weinhold 677afa713aSIngo Weinhold 687afa713aSIngo Weinhold void arch_debug_serial_puts(const char * s)697afa713aSIngo Weinholdarch_debug_serial_puts(const char *s) 707afa713aSIngo Weinhold { 717afa713aSIngo Weinhold while (*s != '\0') { 727afa713aSIngo Weinhold arch_debug_serial_putchar(*s); 737afa713aSIngo Weinhold s++; 747afa713aSIngo Weinhold } 757afa713aSIngo Weinhold } 767afa713aSIngo Weinhold 777afa713aSIngo Weinhold 787afa713aSIngo Weinhold void arch_debug_serial_early_boot_message(const char * string)797afa713aSIngo Weinholdarch_debug_serial_early_boot_message(const char *string) 807afa713aSIngo Weinhold { 817afa713aSIngo Weinhold // this function will only be called in fatal situations 827afa713aSIngo Weinhold } 837afa713aSIngo Weinhold 847afa713aSIngo Weinhold 857afa713aSIngo Weinhold status_t arch_debug_console_init(kernel_args * args)867afa713aSIngo Weinholdarch_debug_console_init(kernel_args *args) 877afa713aSIngo Weinhold { 887afa713aSIngo Weinhold return PPCPlatform::Default()->InitSerialDebug(args); 897afa713aSIngo Weinhold } 907afa713aSIngo Weinhold 917afa713aSIngo Weinhold 927afa713aSIngo Weinhold status_t arch_debug_console_init_settings(kernel_args * args)937afa713aSIngo Weinholdarch_debug_console_init_settings(kernel_args *args) 947afa713aSIngo Weinhold { 957afa713aSIngo Weinhold return B_OK; 967afa713aSIngo Weinhold } 977afa713aSIngo Weinhold 98