Changeset 37030e3 in rtems for doc


Ignore:
Timestamp:
Dec 9, 2015, 7:05:57 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
20d7093a
Parents:
938ef78c
git-author:
Sebastian Huber <sebastian.huber@…> (12/09/15 07:05:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/10/15 07:32:36)
Message:

bsps: Call bsp_work_area_initialize() early

Call bsp_work_area_initialize() before bsp_start(). This allows
bsp_start() to use malloc() etc. which is beneficial for systems with a
plug-and-play hardware enumeration.

Update #2408.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/bsp_howto/init.t

    r938ef78c r37030e3  
    149149for later use by the application.
    150150
    151 @item It invokes the BSP specific routine @code{bsp_start()} which is
    152 written in C and thus able to perform more advanced initialization.
    153 Often MMU and bus initialization occurs here.
    154 
    155151@item It invokes the BSP specific routine @code{bsp_work_area_initialize()}
    156152which is supposed to initialize the RTEMS Workspace and the C Program Heap.
     
    161157@code{#include <bsp/bootcard.h>}.
    162158
     159@item It invokes the BSP specific routine @code{bsp_start()} which is
     160written in C and thus able to perform more advanced initialization.
     161Often MMU, bus and interrupt controller initialization occurs here.  Since the
     162RTEMS Workspace and the C Program Heap was already initialized by
     163@code{bsp_work_area_initialize()}, this routine may use @code{malloc()}, etc.
     164
    163165@item It invokes the RTEMS directive
    164166@code{rtems_initialize_data_structures()} to initialize the RTEMS
     
    215217That's it.  We just went through the entire sequence.
    216218
     219@subsection bsp_work_area_initialize() - BSP Specific Work Area Initialization
     220
     221This is the first BSP specific C routine to execute during system
     222initialization.  It must initialize the support for allocating memory from the
     223C Program Heap and RTEMS Workspace commonly referred to as the work areas.
     224Many BSPs place the work areas at the end of RAM although this is certainly not
     225a requirement.  Usually the default implementation in
     226@file{c/src/lib/libbsp/shared/bspgetworkarea.c} should be sufficient.  Custom
     227implementations can use @code{bsp_work_area_initialize_default()} or
     228@code{bsp_work_area_initialize_with_table()} available as inline functions from
     229@code{#include <bsp/bootcard.h>}.
     230
    217231@subsection bsp_start() - BSP Specific Initialization
    218232
    219 This is the first BSP specific C routine to execute during system
    220 initialization.  This routine often performs required fundamental
    221 hardware initialization such as setting bus controller registers
    222 that do not have a direct impact on whether or not C code can execute.
    223 The source code for this routine is usually found in the following
    224 file:
    225 
    226 @example
    227 c/src/lib/libbsp/CPU/BSP/startup/bspstart.c
    228 @end example
    229 
    230 On older BSPs not using @code{boot_card()}'s support for allocating memory
    231 to the C Program Heap and RTEMS Workspace, one of the most important
    232 functions performed by this routine is determining where the RTEMS
    233 Workspace is to be located in memory.  All RTEMS objects and task stacks
    234 will be allocated from this Workspace.  The RTEMS Workspace is distinct
    235 from the application heap used for @code{malloc()}.  Many BSPs place
    236 the RTEMS Workspace area at the end of RAM although this is certainly
    237 not a requirement.
     233This is the second BSP specific C routine to execute during system
     234initialization.  It is called right after @code{bsp_work_area_initialize()}.
     235The @code{bsp_start()} routine often performs required fundamental hardware
     236initialization such as setting bus controller registers that do not have a
     237direct impact on whether or not C code can execute.  The interrupt controllers
     238are usually initialized here.  The source code for this routine is usually
     239found in the file @file{c/src/lib/libbsp/$@{CPU@}/$@{BSP@}/startup/bspstart.c}.
     240It is not allowed to create any operating system objects, e.g. RTEMS
     241semaphores.
    238242
    239243After completing execution, this routine returns to the @code{boot_card()}
    240 routine.
     244routine.  In case of errors, the initialization should be terminated via
     245@code{bsp_fatal()}.
    241246
    242247@subsection RTEMS Pretasking Callback
Note: See TracChangeset for help on using the changeset viewer.