EasyManua.ls Logo

Intel i960 - Page 287

Intel i960
347 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Initializing the Execution Environment
10-3
10
Initializations differ for each processor and board. For example, some
board-specific startup routines initialize
mem_end in the linker
configuration file instead of in
__LL_init. Each board-specific low-level
library included with the assembler contains an appropriate
__LL_init.
See the startup file
crt960.s under the src/lib/libll/common
directory for an example.
If a program uses the C runtime library, startup code must call
__HL_init to ensure correct operation of all library functions,
including any I/O routines such as
printf.
The
__HL_init function calls the _exit_init, _stdio_init, and
_thread_init routines to allocate memory for library data structures
and to open standard devices. These routines require definition of
sbrk and open in the board-specific low-level library. The
__HL_init function is in the architecture-specific high-level libc.a
library. For more information about high-level libraries, refer to the
i960 Processor Library Supplement.
If performing profile-driven optimizations, the startup routine must
call a profile initialization routine before calling any instrumented
functions.
The startup routine also calls an executing program's
main function,
passing parameters to
main if necessary. The startup routine also
performs cleanup after
main returns, usually by calling exit. If the
target environment supports program command-line arguments such
as
argc and argv, call __arg_init to initialize such variables
immediately before calling the program
main function. The
__arg_init function is found in the MON960 low-level library. This
function is described in the Library Supplement.
The linker combines the startup routine with other object modules.
Normally, a configuration file provides the name of the startup file.
To override the startup file named in the configuration, use the linker
C (Startup) option. For more information on passing options to the
linker from the compiler invocation command line, see Chapter 2
(gcc960) or 3 (ic960).

Table of Contents

Related product manuals