Move the entrypoint and startup code in boot.s.

Write ksarm.h and kxarm.h headers, defining the ARM Assembly ABI.
Rewrite the ARM assembler files we currently have to match the ABI.

svn path=/trunk/; revision=32313
This commit is contained in:
ReactOS Portable Systems Group 2008-02-12 05:55:12 +00:00
parent 76a0229615
commit 358d95b0c1
6 changed files with 63 additions and 28 deletions

View file

@ -6,29 +6,14 @@
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
.title "ARM FreeLDR Entry Point"
.include "ntoskrnl/include/internal/arm/kxarm.h"
.include "ntoskrnl/include/internal/arm/ksarm.h"
//#include <kxarm.h>
#define CPSR_IRQ_DISABLE 0x80
#define CPSR_FIQ_DISABLE 0x40
#define CPSR_THUMB_ENABLE 0x20
#define C1_MMU_CONTROL 0x01
#define C1_ALIGNMENT_CONTROL 0x02
#define C1_DCACHE_CONTROL 0x04
#define C1_ICACHE_CONTROL 0x1000
#define C1_VECTOR_CONTROL 0x2000
/* GLOBALS ********************************************************************/
.global _start
.global ArmTranslationTable
.section startup
/* BOOT CODE ******************************************************************/
_start:
.section startup
NESTED_ENTRY _start
PROLOG_END _start
//
// C entrypoint
//
@ -67,8 +52,7 @@ _start:
// r0 contains the ARM_BOARD_CONFIGURATION_DATA structure
//
bx lr
/* BOOT STACK *****************************************************************/
ENTRY_END _start
L_BootStackEnd:
.long BootStackEnd
@ -81,9 +65,8 @@ BootStack:
.space 0x4000
BootStackEnd:
.long 0
/* INITIAL PAGE TABLE *********************************************************/
.section pagedata
.global ArmTranslationTable
ArmTranslationTable:
.space 0x4000

View file

@ -0,0 +1,9 @@
.equ CPSR_IRQ_DISABLE, 0x80
.equ CPSR_FIQ_DISABLE, 0x40
.equ CPSR_THUMB_ENABLE, 0x20
.equ C1_MMU_CONTROL, 0x01
.equ C1_ALIGNMENT_CONTROL, 0x02
.equ C1_DCACHE_CONTROL, 0x04
.equ C1_ICACHE_CONTROL, 0x1000
.equ C1_VECTOR_CONTROL, 0x2000

View file

@ -0,0 +1,21 @@
.macro TEXTAREA
.section text, "rx"
.align 2
.endm
.macro NESTED_ENTRY Name
.global &Name
.align 2
.func &Name
&Name:
.endm
.macro PROLOG_END Name
prolog_&Name:
.endm
.macro ENTRY_END Name
end_&Name:
.endfunc
.endm

View file

@ -0,0 +1,22 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/ke/arm/boot.s
* PURPOSE: Implements the kernel entry point for ARM machines
* PROGRAMMERS: ReactOS Portable Systems Group
*/
.title "ARM Kernel Entry Point"
.include "ntoskrnl/include/internal/arm/kxarm.h"
.include "ntoskrnl/include/internal/arm/ksarm.h"
TEXTAREA
NESTED_ENTRY KiSystemStartup
PROLOG_END KiSystemStartup
//
// Do stuff!
//
b .
ENTRY_END KiSystemStartup

View file

@ -111,7 +111,6 @@ GENERATE_ARM_STUB KiInitializeUserApc
GENERATE_ARM_STUB KeDisableInterrupts
GENERATE_ARM_STUB KeContextToTrapFrame
GENERATE_ARM_STUB KiDispatchException
GENERATE_ARM_STUB KiSystemStartup
GENERATE_ARM_STUB NtSetLdtEntries
GENERATE_ARM_STUB NtRaiseException
GENERATE_ARM_STUB NtCallbackReturn

View file

@ -59,7 +59,8 @@
</if>
<if property="ARCH" value="arm">
<directory name="arm">
<file>stubs_asm.s</file>
<file first="true">boot.s</file>
<file>stubs_asm.s</file>
<file>stubs.c</file>
</directory>
</if>