Changeset 499c09f in rtems-docs


Ignore:
Timestamp:
Jan 17, 2016, 5:44:59 AM (4 years ago)
Author:
Amar Takhar <amar@…>
Branches:
4.11, master
Children:
b350509
Parents:
a6b837e
git-author:
Amar Takhar <amar@…> (01/17/16 05:44:59)
git-committer:
Amar Takhar <verm@…> (05/03/16 00:51:23)
Message:

Fix warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsp_howto/bsp_howto.rst

    ra6b837e r499c09f  
    291291or device drivers for peripheral controllers found on the CPU itself.
    292292This class of code may be found in the following directory:
     293
    293294.. code:: c
    294295
     
    296297
    297298CPU model dependent support code is found in the following directory:
     299
    298300.. code:: c
    299301
     
    301303
    302304*CPU_MODEL* may be a specific CPU model name or a name indicating a CPU
    303 core or a set of related CPU models.  The file ``configure.ac`` in each``c/src/lib/libcpu/*CPU*`` directory contains the logic which enables
     305core or a set of related CPU models.  The file ``configure.ac`` in each ``c/src/lib/libcpu/*CPU*`` directory contains the logic which enables
    304306the appropriate subdirectories for the specific CPU model your BSP has.
    305307
     
    361363
    362364The build order of the BSP is determined by the Makefile structure.
    363 This structure is discussed in more detail in the :ref:`Makefiles <Makefiles>`
     365This structure is discussed in more detail in the `Makefiles`_
    364366chapter.
    365367
     
    381383.. COMMENT: All rights reserved.
    382384
    383 .. _Makefiles:
    384385
    385386Makefiles
     
    393394
    394395- .. code:: c
     396
    395397      bootstrap
    396398
    397399- .. code:: c
     400
    398401      configure
    399402
    400403- .. code:: c
     404
    401405      build
    402406
    403407- .. code:: c
     408
    404409      install
    405410
     
    663668.. code:: c
    664669
    665     +-----------------+
    666     |     .text       |  RAM or ROM
    667     +-----------------+
    668     |     .data       |  RAM
    669     +-----------------+
    670     |     .bss        |  RAM
    671     +-----------------+
     670    +-----------------+-------------+
     671    |     .text       |  RAM or ROM |
     672    +-----------------+-------------+
     673    |     .data       |  RAM        |
     674    +-----------------+-------------+
     675    |     .bss        |  RAM        |
     676    +-----------------+-------------+
    672677
    673678Example Linker Command Script
     
    872877    }
    873878
    874 .. _Linker-Script-Initialized-Data:
    875 
    876879Initialized Data
    877880================
     
    889892The solution is to place a copy of the initialized data in a separate
    890893area of memory and copy it into the proper location each time the
    891 program is started.  It is common practice to place a copy of the initialized``.data`` section at the end of the code (``.text``) section
     894program is started.  It is common practice to place a copy of the initialized ``.data`` section at the end of the code (``.text``) section
    892895in ROM when building a PROM image. The GNU tool ``objcopy``
    893896can be used for this purpose.
     
    895898The following figure illustrates the steps a linked program goes through
    896899to become a downloadable image.
    897 .. code:: c
    898 
    899     +--------------+     +--------------------+
    900     | .data    RAM |     | .data          RAM |
    901     +--------------+     +--------------------+
    902     | .bss     RAM |     | .bss           RAM |
    903     +--------------+     +--------------------+         +----------------+
    904     | .text    ROM |     | .text          ROM |         |     .text      |
    905     +--------------+     +--------------------+         +----------------+
    906     | copy of .data  ROM |         | copy of .data  |
    907     +--------------------+         +----------------+
    908     Step 1                Step 2                       Step 3
     900
     901
     902+--------------+-----+--------------------+--------------------------+
     903| .data    RAM |     | .data          RAM |                          |
     904+--------------+     +--------------------+                          |
     905| .bss     RAM |     | .bss           RAM |                          |
     906+--------------+     +--------------------+-----+--------------------+
     907| .text    ROM |     | .text          ROM |     |     .text          |
     908+--------------+-----+---------+----------+-----+--------------------+
     909| copy of .data  ROM |         | copy of .data  |                    |
     910+--------------------+---------+----------------+--------------------+
     911|  Step 1            |Step 2                       Step 3            |
     912+--------------------+--------------------------+--------------------+
    909913
    910914In Step 1, the program is linked together using the BSP linker script.
     
    11361140
    11371141- .. index:: CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
     1142
    11381143  ``CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK`` must be defined if the
    11391144  BSP has proper support for ``sbrk``.  This is discussed in more detail
     
    11411146
    11421147- .. index:: BSP_IDLE_TASK_BODY
     1148
    11431149  ``BSP_IDLE_TASK_BODY`` may be defined to the entry point of a
    11441150  BSP specific IDLE thread implementation.  This may be overridden if the
     
    11461152
    11471153- .. index:: BSP_IDLE_TASK_STACK_SIZE
     1154
    11481155  ``BSP_IDLE_TASK_STACK_SIZE`` may be defined to the desired
    11491156  default stack size for the IDLE task as recommended when using this BSP.
    11501157
    11511158- .. index:: BSP_INTERRUPT_STACK_SIZE
     1159
    11521160  ``BSP_INTERRUPT_STACK_SIZE`` may be defined to the desired default interrupt stack size as recommended when using this BSP.  This is sometimes required when the BSP developer has knowledge of stack intensive interrupt handlers.
    11531161
    11541162- .. index:: BSP_ZERO_WORKSPACE_AUTOMATICALLY
     1163
    11551164  ``BSP_ZERO_WORKSPACE_AUTOMATICALLY`` is defined when the BSP
    11561165  requires that RTEMS zero out the RTEMS C Program Heap at initialization.
     
    11591168
    11601169- .. index:: BSP_DEFAULT_UNIFIED_WORK_AREAS
     1170
    11611171  ``BSP_DEFAULT_UNIFIED_WORK_AREAS`` is defined when the BSP
    11621172  recommends that the unified work areas configuration should always
     
    11791189controller manipulation and encapsulate that information.  It is usually
    11801190implemented as follows:
     1191
    11811192.. code:: c
    11821193
     
    12311242
    12321243- .. index:: bsp_interrupt_facility_initialize()
     1244
    12331245  ``bsp_interrupt_facility_initialize()`` contains bsp specific interrupt
    12341246  initialization code(Clear Pending interrupts by modifying registers, etc.).
     
    12371249
    12381250- .. index:: bsp_interrupt_handler_default()
     1251
    12391252  ``bsp_interrupt_handler_default()`` acts as a fallback handler when
    12401253  no ISR address has been provided corresponding to a vector in the table.
    12411254
    12421255- .. index:: bsp_interrupt_dispatch()
     1256
    12431257  ``bsp_interrupt_dispatch()`` service the ISR by handling
    12441258  any bsp specific code & calling the generic method bsp_interrupt_handler_dispatch()
     
    12481262
    12491263- .. index:: bsp_interrupt_vector_enable()
     1264
    12501265  ``bsp_interrupt_vector_enable()`` enables interrupts and is called in
    12511266  irq-generic.c while setting up the table.
    12521267
    12531268- .. index:: bsp_interrupt_vector_disable()
     1269
    12541270  ``bsp_interrupt_vector_disable()`` disables interrupts and is called in
    12551271  irq-generic.c while setting up the table & during other important parts.
    12561272
    12571273An interrupt handler is installed or removed with the help of the following functions :
     1274
    12581275.. code:: c
    12591276
     
    16581675handled by an address decoder, so that the microprocessor knows which
    16591676memory chip(s) to access.   The following figure illustrates this:
     1677
    16601678.. code:: c
    16611679
     
    16951713
    16961714- copies the .data section from ROM to its location reserved in RAM
    1697   (see :ref:`Linker Script Initialized Data <Linker-Script-Initialized-Data>` for more details about this copy),
     1715  (see `Initialized Data`_ for more details about this copy),
    16981716
    16991717- clear ``.bss`` section (all the non-initialized
     
    18761894# The basic console driver functions using the Termios support.  Add this
    18771895  the BSPs Makefile.am:
     1896
    18781897  .. code:: c
     1898
    18791899      [...]
    18801900      libbsp_a_SOURCES += ../../shared/console-termios.c
     
    18971917If you want to use polled IO it should look like the following.  Termios must
    18981918be told the addresses of the handler that are to be used for simple character
    1899 IO, i.e. pointers to the ``my_driver_poll_read()`` and``my_driver_poll_write()`` functions described later in :ref:`Console Driver
    1900 Termios and Polled IO <Console-Driver-Termios-and-Polled-IO>`.
     1919IO, i.e. pointers to the ``my_driver_poll_read()`` and``my_driver_poll_write()`` functions described later in `Termios and Polled IO`_.
     1920
    19011921.. code:: c
    19021922
     
    19161936handler to be passed to Termios.  Indeed a ``console_read()`` call returns the
    19171937contents of Termios input buffer.  This buffer is filled in the driver
    1918 interrupt subroutine, see also :ref:`Console Driver Termios and Interrupt Driven
    1919 IO <Console-Driver-Termios-and-Interrupt-Driven-IO>`.  The driver is responsible for providing a pointer to the``my_driver_interrupt_write()`` function.
     1938interrupt subroutine, see also `Termios and Interrupt Driven IO`_.  The driver
     1939is responsible for providing a pointer to the``my_driver_interrupt_write()`` function.
     1940
    19201941.. code:: c
    19211942
     
    19561977    #endif /* MY_DRIVER_H \*/
    19571978
    1958 .. _Console-Driver-Termios-and-Polled-IO:
    19591979
    19601980Termios and Polled IO
     
    19992019    }
    20002020    }
    2001 
    2002 .. _Console-Driver-Termios-and-Interrupt-Driven-IO:
    20032021
    20042022Termios and Interrupt Driven IO
     
    32343252    the fields commonly contained in this memory type specific attribute
    32353253    structure area:
     3254
    32363255    *use_protection_algorithm*
     3256
    32373257        is set to TRUE to indicate that the protection (i.e. locking) algorithm
    32383258        should be used for this area of non-volatile memory.  A particular
    32393259        type of non-volatile memory may not have a protection algorithm.
     3260
    32403261    *access*
     3262
    32413263        is an enumerated type to indicate the organization of the memory
    32423264        devices in this memory area.  The following is a list of the
     
    32523274        - single unsigned8 at offset 2 in an unsigned32
    32533275        - single unsigned8 at offset 3 in an unsigned32
     3276
    32543277    *depth*
     3278
    32553279        is the depth of the progamming FIFO on this particular chip.  Some
    32563280        chips, particularly EEPROMs, have the same programming algorithm but
     
    32653289    partition in this area.  Fields within each element of this
    32663290    table are defined as follows:
     3291
    32673292    *offset*
     3293
    32683294        is the offset of this partition from the base address of this area.
     3295
    32693296    *length*
     3297
    32703298        is the length of this partition.
    32713299
     
    34833511RTEMS application Makefiles, then adding the following line accomplishes
    34843512this:
     3513
    34853514.. code:: c
    34863515
     
    34893518This is equivalent to the following list of definitions.  Early versions
    34903519of the RTEMS BSD network stack required that all of these be defined.
     3520
    34913521.. code:: c
    34923522
     
    36633693
    36643694``SIOCSIFADDR``
     3695
    36653696    If the device is an Ethernet interface these
    36663697    commands should be passed on to ``ether_ioctl``.
    36673698
    36683699``SIOCSIFFLAGS``
     3700
    36693701    This command should be used to start or stop the device,
    36703702    depending on the state of the interface ``IFF_UP`` and``IFF_RUNNING`` bits in ``if_flags``:
     3703
    36713704    ``IFF_RUNNING``
     3705
    36723706        Stop the device.
     3707
    36733708    ``IFF_UP``
     3709
    36743710        Start the device.
     3711
    36753712    ``IFF_UP|IFF_RUNNING``
     3713
    36763714        Stop then start the device.
     3715
    36773716    ``0``
     3717
    36783718        Do nothing.
    36793719
     
    37573797
    37583798*Intr*
     3799
    37593800    is the information required to cause an interrupt on a node.  This
    37603801    structure contains the following fields:
     3802
    37613803    *address*
     3804
    37623805        is the address to write at to cause an interrupt on that node.
    37633806        For a polled node, this should be NULL.
     3807
    37643808    *value*
     3809
    37653810        is the value to write to cause an interrupt.
     3811
    37663812    *length*
     3813
    37673814        is the length of the entity to write on the node to cause an interrupt.
    37683815        This can be 0 to indicate polled operation, 1 to write a byte, 2 to
     
    39664013buffer device.  If the graphics hardware supports console text output,
    39674014as is the case with the pc386 VGA hardware, initialization into graphics
    3968 mode may be deferred until the device is ``open()``ed.
     4015mode may be deferred until the device is ``open()`` ed.
    39694016
    39704017The ``frame_buffer_initialize()`` function may look like this:
     4018
    39714019.. code:: c
    39724020
Note: See TracChangeset for help on using the changeset viewer.