[ac7d5ef0] | 1 | /* internal.h |
---|
| 2 | * |
---|
| 3 | * This include file contains internal information |
---|
| 4 | * for the RTEMS stack checker. |
---|
| 5 | * |
---|
[7ac4ae9] | 6 | * COPYRIGHT (c) 1989-2006. |
---|
[ac7d5ef0] | 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * |
---|
[98e4ebf5] | 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[3160ff6] | 11 | * http://www.rtems.com/license/LICENSE. |
---|
[ac7d5ef0] | 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #ifndef __INTERNAL_STACK_CHECK_h |
---|
| 17 | #define __INTERNAL_STACK_CHECK_h |
---|
| 18 | |
---|
| 19 | #ifdef __cplusplus |
---|
| 20 | extern "C" { |
---|
| 21 | #endif |
---|
| 22 | |
---|
| 23 | /* |
---|
| 24 | * This structure is used to fill in and compare the "end of stack" |
---|
| 25 | * marker pattern. |
---|
| 26 | * pattern area must be a multiple of 4 words. |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | #ifdef CPU_STACK_CHECK_SIZE |
---|
| 30 | #define PATTERN_SIZE_WORDS (((CPU_STACK_CHECK_SIZE / 4) + 3) & ~0x3) |
---|
| 31 | #else |
---|
[df49c60] | 32 | #define PATTERN_SIZE_WORDS (4) |
---|
[ac7d5ef0] | 33 | #endif |
---|
| 34 | |
---|
[3e08d4e] | 35 | #define PATTERN_SIZE_BYTES (PATTERN_SIZE_WORDS * sizeof(uint32_t )) |
---|
[ac7d5ef0] | 36 | |
---|
| 37 | typedef struct { |
---|
[3e08d4e] | 38 | uint32_t pattern[ PATTERN_SIZE_WORDS ]; |
---|
[ac7d5ef0] | 39 | } Stack_check_Control; |
---|
| 40 | |
---|
| 41 | /* |
---|
| 42 | * The pattern used to fill the entire stack. |
---|
| 43 | */ |
---|
| 44 | |
---|
| 45 | #define BYTE_PATTERN 0xA5 |
---|
| 46 | #define U32_PATTERN 0xA5A5A5A5 |
---|
| 47 | |
---|
| 48 | /* |
---|
[7ac4ae9] | 49 | * rtems_stack_checker_create_extension |
---|
[ac7d5ef0] | 50 | */ |
---|
| 51 | |
---|
[7ac4ae9] | 52 | boolean rtems_stack_checker_create_extension( |
---|
[ac7d5ef0] | 53 | Thread_Control *running, |
---|
| 54 | Thread_Control *the_thread |
---|
| 55 | ); |
---|
| 56 | |
---|
| 57 | /* |
---|
[7ac4ae9] | 58 | * rtems_stack_checker_begin_extension |
---|
[ac7d5ef0] | 59 | */ |
---|
| 60 | |
---|
[7ac4ae9] | 61 | void rtems_stack_checker_begin_extension( |
---|
[ac7d5ef0] | 62 | Thread_Control *the_thread |
---|
| 63 | ); |
---|
| 64 | |
---|
| 65 | /* |
---|
[7ac4ae9] | 66 | * rtems_stack_checker_switch_extension |
---|
[ac7d5ef0] | 67 | */ |
---|
| 68 | |
---|
[7ac4ae9] | 69 | void rtems_stack_checker_switch_extension( |
---|
[ac7d5ef0] | 70 | Thread_Control *running, |
---|
| 71 | Thread_Control *heir |
---|
| 72 | ); |
---|
| 73 | |
---|
| 74 | /* |
---|
[7ac4ae9] | 75 | * rtems_stack_checker_fatal_extension |
---|
[ac7d5ef0] | 76 | */ |
---|
| 77 | |
---|
[7ac4ae9] | 78 | void rtems_stack_checker_fatal_extension( |
---|
[11290355] | 79 | Internal_errors_Source source, |
---|
| 80 | boolean is_internal, |
---|
[3e08d4e] | 81 | uint32_t status |
---|
[ac7d5ef0] | 82 | ); |
---|
| 83 | |
---|
| 84 | /* |
---|
[7ac4ae9] | 85 | * rtems_stack_checker_dump_usage |
---|
[ac7d5ef0] | 86 | */ |
---|
| 87 | |
---|
[7ac4ae9] | 88 | void rtems_stack_checker_dump_usage( void ); |
---|
[ac7d5ef0] | 89 | |
---|
| 90 | #ifdef __cplusplus |
---|
| 91 | } |
---|
| 92 | #endif |
---|
| 93 | |
---|
| 94 | #endif |
---|
| 95 | /* end of include file */ |
---|