1    /* --COPYRIGHT--,EPL
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     * 
    11     * --/COPYRIGHT--*/
    12    /*
    13     *  ======== SysBuf.xdc ========
    14     */
    15    import xdc.runtime.Types;
    16    
    17    /*!
    18     *  ======== SysBuf ========
    19     *  Minimal implementation of functions required by System
    20     *
    21     *  `SysBuf` writes all output to a circular memory buffer configured by
    22     *  the user.
    23     *
    24     *  This module provides a simple but 100% portable implementation of the
    25     *  `{@link ISystemSupport}` interface.
    26     */
    27    module SysBuf inherits xdc.runtime.ISystemSupport {
    28     
    29        /*!
    30         *  ======== bufSize ========
    31         *  Size (in MAUs) of the output.
    32         *
    33         *  An internal buffer of this size is allocated. All output is stored 
    34         *  in this internal buffer. 
    35         *
    36         *  If 0 is specified for the size, no buffer is created and all output
    37         *  is simply dropped.
    38         */
    39        config SizeT bufSize = 1024;
    40    
    41        /*!
    42         *  ======== bufName ========
    43         *  Global variable name containing pointer to output buffer
    44         *
    45         *  This variable will be created so that it is easy to view the
    46         *  contents of the output buffer within a debugger.  If `bufName` is
    47         *  set to `null` or `undefined`, the variable will not be created.
    48         */
    49        metaonly config String bufName = "SYSBUF";
    50        
    51        /*!
    52         *  ======== sectionName ========
    53         *  Section where the internal buffer managed by `SysBuf` is placed.
    54         *
    55         *  The default is to have no explicit placement.
    56         */
    57        metaonly config String sectionName = null;
    58       
    59    internal:
    60        
    61        struct Module_State {
    62            Char outbuf[];  /* output buffer */
    63            UInt outidx;    /* index of next available output character */
    64        }
    65    }