1 | /* |
---|
2 | * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. |
---|
3 | * |
---|
4 | * Redistribution and use in source and binary forms, with or without |
---|
5 | * modification, are permitted provided that the following conditions |
---|
6 | * are met: |
---|
7 | * 1. Redistributions of source code must retain the above copyright |
---|
8 | * notice, this list of conditions and the following disclaimer. |
---|
9 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
10 | * notice, this list of conditions and the following disclaimer in the |
---|
11 | * documentation and/or other materials provided with the distribution. |
---|
12 | * |
---|
13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
---|
14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
---|
17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
23 | * SUCH DAMAGE. |
---|
24 | */ |
---|
25 | |
---|
26 | /* |
---|
27 | * Debugger for RTEMS. |
---|
28 | */ |
---|
29 | |
---|
30 | #ifndef _RTEMS_DEBUGGER_BLOCK_h |
---|
31 | #define _RTEMS_DEBUGGER_BLOCK_h |
---|
32 | |
---|
33 | #include <rtems/rtems-debugger.h> |
---|
34 | |
---|
35 | #ifdef __cplusplus |
---|
36 | extern "C" { |
---|
37 | #endif /* __cplusplus */ |
---|
38 | |
---|
39 | /** |
---|
40 | * DB server block manages a block of re-sizable memory. The block only |
---|
41 | * grows. As more threads enter the system the block becomes the peak and then |
---|
42 | * sits at that level. |
---|
43 | */ |
---|
44 | typedef struct rtems_debugger_block |
---|
45 | { |
---|
46 | void* block; /**< The block of memory. */ |
---|
47 | size_t step; /**< The step size the block is increased by. */ |
---|
48 | size_t size; /**< The size of the elements in the block. */ |
---|
49 | size_t count; /**< The number of elements in the block. */ |
---|
50 | size_t level; /**< The usage level in the block. */ |
---|
51 | } rtems_debugger_block; |
---|
52 | |
---|
53 | /** |
---|
54 | * Create a block. |
---|
55 | */ |
---|
56 | extern int rtems_debugger_block_create(rtems_debugger_block* block, |
---|
57 | size_t step, |
---|
58 | size_t size); |
---|
59 | |
---|
60 | /** |
---|
61 | * Destroy a block. |
---|
62 | */ |
---|
63 | extern int rtems_debugger_block_destroy(rtems_debugger_block* block); |
---|
64 | |
---|
65 | /** |
---|
66 | * Resize a block. |
---|
67 | */ |
---|
68 | extern int rtems_debugger_block_resize(rtems_debugger_block* block); |
---|
69 | |
---|
70 | #ifdef __cplusplus |
---|
71 | } |
---|
72 | #endif /* __cplusplus */ |
---|
73 | |
---|
74 | |
---|
75 | #endif |
---|