source: rtems/cpukit/libmisc/monitor/symbols.h

Last change on this file was e4cc56a7, checked in by Joel Sherrill <joel@…>, on 03/24/22 at 17:37:47

cpukit/libmisc/monitor/: Manually change to BSD-2 license

This code did not have any copyrights or licenses and a bit
of archeology was needed to determine authorship.

This code was in the initial import into the RTEMS CVS repository when
it was established in May 1995. There was very little, if any, code not
written by OAR Corporation in that initial import. After discussion
with Chris Johns, it was determined that this code was from OAR
Corporation and that he had added a few features later. Both
Chris Johns and OAR Corporation have given permission to relicense.

Updates #3053.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @brief RTEMS monitor symbol table functions
7 *
8 * Entry points for symbol table routines.
9 */
10
11/*
12 * COPYRIGHT (c) 1989-2022. On-Line Applications Research Corporation (OAR).
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 *    notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 *    notice, this list of conditions and the following disclaimer in the
21 *    documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef _INCLUDE_SYMBOLS_H
37#define _INCLUDE_SYMBOLS_H
38
39#include <rtems/monitor.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45struct _rtems_symbol_t {
46    uint32_t   value;
47    char            *name;
48} ;
49
50#define SYMBOL_STRING_BLOCK_SIZE 4080
51typedef struct rtems_symbol_string_block_s {
52    struct rtems_symbol_string_block_s *next;
53    char   buffer[SYMBOL_STRING_BLOCK_SIZE];
54} rtems_symbol_string_block_t;
55
56struct _rtems_symbol_table_t {
57
58    uint32_t   sorted;          /* are symbols sorted right now? */
59    uint32_t   growth_factor;   /* % to grow by when needed */
60    uint32_t   next;            /* next symbol slot to use when adding */
61    uint32_t   size;            /* max # of symbols */
62
63    /*
64     * Symbol list -- sorted by address (when we do a lookup)
65     */
66
67    rtems_symbol_t  *addresses;         /* symbol array by address */
68
69    /*
70     * String pool, unsorted, a list of blocks of string data
71     */
72
73    rtems_symbol_string_block_t *string_buffer_head;
74    rtems_symbol_string_block_t *string_buffer_current;
75    uint32_t   strings_next;      /* next byte to use in this block */
76
77} ;
78
79#define rtems_symbol_name(sp)   ((sp)->name)
80#define rtems_symbol_value(sp)  ((sp)->value)
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* ! _INCLUDE_SYMBOLS_H */
Note: See TracBrowser for help on using the repository browser.