?? retarget.c
字號:
/*
** Copyright (C) ARM Limited, 2002. All rights reserved.
*/
#include <stdio.h>
#include <rt_misc.h>
extern unsigned int bottom_of_heap; //defined in heap.s
extern void core_init(void);
extern void clock_speed(int);
/*
The functions below are patched onto main - in later versions of ARM tools,
callouts from C Library Initialisation code will be available.
__rt_entry could be used instead of main
*/
extern void $Super$$main(void);
void $Sub$$main(void)
{
#ifdef SET_CLOCK
clock_speed(120);
#endif
core_init(); // does some extra setup work
$Super$$main(); // calls the original function
}
/*
This function re-implements the C Library semihosted function. The stack pointer
has aready been set and is passed back to the funtion, The base of the heap is
set from the scatter file
*/
__value_in_regs struct __initial_stackheap __user_initial_stackheap(
unsigned R0, unsigned SP, unsigned R2, unsigned SL)
{
struct __initial_stackheap config;
config.heap_base = (unsigned int)&bottom_of_heap; // defined in heap.s
// placed by scatterfile
config.stack_base = SP; // inherit SP from the execution environment
return config;
}
/*
Below is an equivalent example assembler version of __user_initial_stackheap.
It will be entered with the value of the stackpointer in r1 (as set in init.s),
this does not need to be changed and so can be passed unmodified out of the
function.
IMPORT bottom_of_heap
EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR r0,=bottom_of_heap
MOV pc,lr
*/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -