- Now that KDCOM works for printing on the serial port, get rid of the arm_kprintf file, function and hack,and use KdpSerialPrint instead (still a hack, but at least uses our components)

svn path=/trunk/; revision=34473
This commit is contained in:
ReactOS Portable Systems Group 2008-07-13 22:17:28 +00:00
parent e069d3cba6
commit 43dd8f4408
3 changed files with 8 additions and 99 deletions

View file

@ -1,84 +0,0 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: ntoskrnl/ke/arm/arm_kprintf.c
* PURPOSE: Early serial printf-style kernel debugging (ARM bringup)
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
//
// UART Registers
//
#define UART_BASE (void*)0xe00f1000 /* HACK: freeldr mapped it here */
#define UART_PL01x_DR (UART_BASE + 0x00)
#define UART_PL01x_RSR (UART_BASE + 0x04)
#define UART_PL01x_ECR (UART_BASE + 0x04)
#define UART_PL01x_FR (UART_BASE + 0x18)
#define UART_PL011_IBRD (UART_BASE + 0x24)
#define UART_PL011_FBRD (UART_BASE + 0x28)
#define UART_PL011_LCRH (UART_BASE + 0x2C)
#define UART_PL011_CR (UART_BASE + 0x30)
#define UART_PL011_IMSC (UART_BASE + 0x38)
//
// LCR Values
//
#define UART_PL011_LCRH_WLEN_8 0x60
#define UART_PL011_LCRH_FEN 0x10
//
// FCR Values
//
#define UART_PL011_CR_UARTEN 0x01
#define UART_PL011_CR_TXE 0x100
#define UART_PL011_CR_RXE 0x200
//
// LSR Values
//
#define UART_PL01x_FR_RXFE 0x10
#define UART_PL01x_FR_TXFF 0x20
#define READ_REGISTER_ULONG(r) (*(volatile ULONG * const)(r))
#define WRITE_REGISTER_ULONG(r, v) (*(volatile ULONG *)(r) = (v))
/* FUNCTIONS ******************************************************************/
VOID
ArmVersaPutChar(IN INT Char)
{
//
// Properly support new-lines
//
if (Char == '\n') ArmVersaPutChar('\r');
//
// Wait for ready
//
while ((READ_REGISTER_ULONG(UART_PL01x_FR) & UART_PL01x_FR_TXFF) != 0);
//
// Send the character
//
WRITE_REGISTER_ULONG(UART_PL01x_DR, Char);
}
void arm_kprintf(const char *fmt, ...) {
char buf[1024], *s;
va_list args;
va_start(args, fmt);
_vsnprintf(buf,sizeof(buf),fmt,args);
va_end(args);
for (s = buf; *s; s++)
ArmVersaPutChar(*s);
}

View file

@ -31,6 +31,11 @@ KiIdleLoop(
VOID
);
VOID
STDCALL
KdpSerialDebugPrint(LPSTR Message,
ULONG Length);
VOID
DebugService(IN ULONG ServiceType,
IN PCHAR Buffer,
@ -41,8 +46,7 @@ DebugService(IN ULONG ServiceType,
//
// FIXME: ARM Bring-up Hack
//
void arm_kprintf(const char *fmt, ...);
arm_kprintf("%s", Buffer);
KdpSerialDebugPrint(Buffer, Length);
}
VOID
@ -51,10 +55,9 @@ DebugService2(IN ULONG Arg1,
IN ULONG Service)
{
//
// FIXME: ARM Bring-up Hack
// FIXME: TODO
//
void arm_kprintf(const char *fmt, ...);
arm_kprintf("Loading symbols for %Z...\n", (PCHAR)Arg1);
return;
}
VOID
@ -79,8 +82,6 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
LARGE_INTEGER PageDirectory;
PKPCR Pcr;
ULONG i;
DPRINT1("[INIT] Process: %p Thread: %p Stack: %p PRCB: %p Number: %d LoaderBlock: %p\n",
InitProcess, InitThread, IdleStack, Prcb, Number, LoaderBlock);
//
// Initialize the platform
@ -330,13 +331,6 @@ KiInitializeSystem(IN ULONG Magic,
ARM_PTE Pte;
PKPCR Pcr;
ARM_CONTROL_REGISTER ControlRegister;
DPRINT1("-----------------------------------------------------\n");
DPRINT1("ReactOS-ARM "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n");
DPRINT1("Command Line: %s\n", LoaderBlock->LoadOptions);
DPRINT1("ARC Paths: %s %s %s %s\n", LoaderBlock->ArcBootDeviceName,
LoaderBlock->NtHalPathName,
LoaderBlock->ArcHalDeviceName,
LoaderBlock->NtBootPathName);
//
// Detect ARM version (Architecture 6 is the ARMv5TE-J, go figure!)

View file

@ -61,7 +61,6 @@
<if property="ARCH" value="arm">
<directory name="arm">
<file first="true">boot.s</file>
<file>arm_kprintf.c</file>
<file>cpu.c</file>
<file>ctxswtch.s</file>
<file>exp.c</file>