From b300ac43642d85d08957d9e6fc33cc7018c27c2c Mon Sep 17 00:00:00 2001 From: ReactOS Portable Systems Group Date: Sun, 15 Jun 2008 06:14:02 +0000 Subject: [PATCH] - Start major ARM port cleanup: - Make use of the SARCH rbuild parameter to define the target board (default to ARM VersatilePB for now) - Make official ARM include directory (include/reactos/arm) and move the ARM DDK there - Start creating header files for different target board components. - Update halfuncs in NDK with one missing function, and temporarily, one ARM function. svn path=/trunk/; revision=33979 --- reactos/ReactOS-arm.rbuild | 6 +++ reactos/config-arm.template.rbuild | 7 +-- reactos/include/ndk/halfuncs.h | 13 +++++ reactos/include/reactos/{ => arm}/armddk.h | 0 reactos/include/reactos/arm/targets/pl011.h | 58 +++++++++++++++++++++ reactos/include/reactos/arm/targets/pl190.h | 20 +++++++ reactos/include/reactos/arm/targets/sp804.h | 46 ++++++++++++++++ reactos/ntoskrnl/ke/arm/trapc.c | 6 --- 8 files changed, 147 insertions(+), 9 deletions(-) rename reactos/include/reactos/{ => arm}/armddk.h (100%) create mode 100644 reactos/include/reactos/arm/targets/pl011.h create mode 100644 reactos/include/reactos/arm/targets/pl190.h create mode 100644 reactos/include/reactos/arm/targets/sp804.h diff --git a/reactos/ReactOS-arm.rbuild b/reactos/ReactOS-arm.rbuild index 9d88badb791..907b6f3526f 100644 --- a/reactos/ReactOS-arm.rbuild +++ b/reactos/ReactOS-arm.rbuild @@ -12,9 +12,15 @@ + include/reactos/arm + + + + + -Os -ftracer diff --git a/reactos/config-arm.template.rbuild b/reactos/config-arm.template.rbuild index ee446425109..6a0c495272d 100644 --- a/reactos/config-arm.template.rbuild +++ b/reactos/config-arm.template.rbuild @@ -14,15 +14,16 @@ - + diff --git a/reactos/include/ndk/halfuncs.h b/reactos/include/ndk/halfuncs.h index a20b1d1c2f9..d010fcc11cc 100644 --- a/reactos/include/ndk/halfuncs.h +++ b/reactos/include/ndk/halfuncs.h @@ -137,6 +137,12 @@ HalBeginSystemInterrupt( PKIRQL OldIrql ); +VOID +FASTCALL +HalClearSoftwareInterrupt( + IN KIRQL Request +); + NTHALAPI BOOLEAN NTAPI @@ -162,6 +168,13 @@ HalEndSystemInterrupt( ULONG Vector ); +#ifdef _ARM_ // FIXME: ndk/arm? armddk.h? +ULONG +HalGetInterruptSource( + VOID +); +#endif + NTHALAPI VOID NTAPI diff --git a/reactos/include/reactos/armddk.h b/reactos/include/reactos/arm/armddk.h similarity index 100% rename from reactos/include/reactos/armddk.h rename to reactos/include/reactos/arm/armddk.h diff --git a/reactos/include/reactos/arm/targets/pl011.h b/reactos/include/reactos/arm/targets/pl011.h new file mode 100644 index 00000000000..ec9208f10ef --- /dev/null +++ b/reactos/include/reactos/arm/targets/pl011.h @@ -0,0 +1,58 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/reactos/arm/targets/pl011.h + * PURPOSE: PL011 Registers and Constants + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* GLOBALS ********************************************************************/ + +// +// UART Registers +// +#define UART_BASE (PVOID)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 +// +typedef union _PL011_LCR_REGISTER +{ + ULONG Todo; +} PL011_LCR_REGISTER, *PPL011_LCR_REGISTER; + +#define UART_PL011_LCRH_WLEN_8 0x60 +#define UART_PL011_LCRH_FEN 0x10 + +// +// FCR Values +// +typedef union _PL011_FCR_REGISTER +{ + ULONG Todo; +} PL011_FCR_REGISTER, *PPL011_FCR_REGISTER; + +#define UART_PL011_CR_UARTEN 0x01 +#define UART_PL011_CR_TXE 0x100 +#define UART_PL011_CR_RXE 0x200 + +// +// LSR Values +// +typedef union _PL011_LSR_REGISTER +{ + ULONG Todo; +} PL011_LSR_REGISTER, *PPL011_LSR_REGISTER; + +#define UART_PL01x_FR_RXFE 0x10 +#define UART_PL01x_FR_TXFF 0x20 diff --git a/reactos/include/reactos/arm/targets/pl190.h b/reactos/include/reactos/arm/targets/pl190.h new file mode 100644 index 00000000000..1e901771e70 --- /dev/null +++ b/reactos/include/reactos/arm/targets/pl190.h @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/reactos/arm/targets/pl190.h + * PURPOSE: PL190 Registers and Constants + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* GLOBALS ********************************************************************/ + +// +// VIC Registers +// +#define VIC_BASE (PVOID)0xE0040000 /* HACK: freeldr mapped it here */ + +#define VIC_INT_STATUS (VIC_BASE + 0x00) +#define VIC_INT_ENABLE (VIC_BASE + 0x10) +#define VIC_INT_CLEAR (VIC_BASE + 0x14) +#define VIC_SOFT_INT (VIC_BASE + 0x18 +#define VIC_SOFT_INT_CLEAR (VIC_BASE + 0x1C) diff --git a/reactos/include/reactos/arm/targets/sp804.h b/reactos/include/reactos/arm/targets/sp804.h new file mode 100644 index 00000000000..79ba93ad094 --- /dev/null +++ b/reactos/include/reactos/arm/targets/sp804.h @@ -0,0 +1,46 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/reactos/arm/targets/pl011.h + * PURPOSE: SB804 Registers and Constants + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* GLOBALS ********************************************************************/ + +// +// Timer Registers +// +#define TIMER_BASE(x) (PVOID)(0xE00E2000 + (x * 0x1000)) /* HACK: freeldr mapped it here */ +#define TIMER0_LOAD TIMER_BASE(0, 0x00) +#define TIMER0_VALUE TIMER_BASE(0, 0x04) +#define TIMER0_CONTROL TIMER_BASE(0, 0x08) +#define TIMER0_INT_CLEAR TIMER_BASE(0, 0x0C) +#define TIMER0_INT_STATUS TIMER_BASE(0, 0x10) +#define TIMER0_INT_MASK TIMER_BASE(0, 0x14) +#define TIMER0_BACKGROUND_LOAD TIMER_BASE(0, 0x18) +#define TIMER1_LOAD TIMER_BASE(1, 0x00) +#define TIMER1_VALUE TIMER_BASE(1, 0x04) +#define TIMER1_CONTROL TIMER_BASE(1, 0x08) +#define TIMER1_INT_CLEAR TIMER_BASE(1, 0x0C) +#define TIMER1_INT_STATUS TIMER_BASE(1, 0x10) +#define TIMER1_INT_MASK TIMER_BASE(1, 0x14) +#define TIMER1_BACKGROUND_LOAD TIMER_BASE(1, 0x18) + +// +// Control Register +// +typedef union _SP804_CONTROL_REGISTER +{ + struct + { + ULONG Wrap:1; + ULONG Wide:1; + ULONG Prescale:2; + ULONG Reserved:1; + ULONG Interrupt:1; + ULONG Periodic:1; + ULONG Enabled:1; + }; + ULONG AsUlong; +} SP804_CONTROL_REGISTER, *PSP804_CONTROL_REGISTER; diff --git a/reactos/ntoskrnl/ke/arm/trapc.c b/reactos/ntoskrnl/ke/arm/trapc.c index 57243d5c1ee..d9d66562431 100644 --- a/reactos/ntoskrnl/ke/arm/trapc.c +++ b/reactos/ntoskrnl/ke/arm/trapc.c @@ -27,12 +27,6 @@ KiSystemCall( /* FUNCTIONS ******************************************************************/ -ULONG -HalGetInterruptSource(VOID); - -VOID FASTCALL -HalClearSoftwareInterrupt(IN KIRQL Request); - VOID KiIdleLoop(VOID) {