hw & arm: clean up core CRT0

ref #1006
This commit is contained in:
Martin Stein 2013-12-18 17:07:35 +01:00 committed by Norman Feske
parent 1e7c0c2066
commit e83849cf99
2 changed files with 33 additions and 43 deletions

View File

@ -1,11 +1,8 @@
/* /*
* \brief Startup code for core on ARM * \brief Startup code for core
* \author Martin Stein * \author Martin Stein
* \author Stefan Kalkowski * \author Stefan Kalkowski
* \date 2011-10-01 * \date 2011-10-01
*
* The code in this file is compliant to the general ARM instruction- and
* register-set but the semantics are tested only on ARMv6 and ARMv7 by now.
*/ */
/* /*
@ -15,25 +12,23 @@
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
*/ */
/**
* Do no operation for 'count' cycles
*/
.macro _nop count
.rept \count
mov r8, r8
.endr
.endm
.section ".text.crt0" .section ".text.crt0"
/* ELF entry symbol */ /* program entry-point */
.global _start .global _start
_start: _start:
/* idle a little initially because 'u-boot' likes it this way */ /* idle a little initially because U-Boot likes it this way */
_nop 8 mov r8, r8
mov r8, r8
mov r8, r8
mov r8, r8
mov r8, r8
mov r8, r8
mov r8, r8
mov r8, r8
/* zero-fill BSS segment, BSS boundaries must be aligned to 4 */ /* zero-fill BSS segment */
ldr r0, =_bss_start ldr r0, =_bss_start
ldr r1, =_bss_end ldr r1, =_bss_end
mov r2, #0 mov r2, #0
@ -53,19 +48,14 @@
ldr sp, =_kernel_stack_high ldr sp, =_kernel_stack_high
bl kernel bl kernel
/* catch erroneous return */ /* catch erroneous return of the kernel main-routine */
3: b 3b 3: b 3b
.section .bss .section .bss
/* kernel stack, must be aligned to an 8-byte boundary */ /* kernel stack, must be aligned to an 8-byte boundary */
.align 3 .align 3
.space 64*1024 .space 64 * 1024
.global _kernel_stack_high .global _kernel_stack_high
_kernel_stack_high: _kernel_stack_high:
/* main-thread UTCB-pointer for the Genode thread-API */
.align 2
.global _main_thread_utcb
_main_thread_utcb: .long 0

View File

@ -39,12 +39,12 @@
using namespace Kernel; using namespace Kernel;
/* get core configuration */
extern Genode::Native_utcb * _main_thread_utcb;
extern Genode::Native_thread_id _main_thread_id; extern Genode::Native_thread_id _main_thread_id;
extern int _kernel_stack_high; extern int _kernel_stack_high;
extern "C" void CORE_MAIN(); extern "C" void CORE_MAIN();
Genode::Native_utcb * _main_thread_utcb;
namespace Kernel namespace Kernel
{ {
/** /**