Describes predefine macros for mbed online compiler (armcc)

Committer:
MACRUM
Date:
Thu Mar 16 21:58:09 2017 +0900
Revision:
6:40e873bbc5f7
Add licence header info

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 6:40e873bbc5f7 1
MACRUM 6:40e873bbc5f7 2 /** \addtogroup platform */
MACRUM 6:40e873bbc5f7 3 /** @{*/
MACRUM 6:40e873bbc5f7 4 /* mbed Microcontroller Library
MACRUM 6:40e873bbc5f7 5 * Copyright (c) 2016-2016 ARM Limited
MACRUM 6:40e873bbc5f7 6 *
MACRUM 6:40e873bbc5f7 7 * Licensed under the Apache License, Version 2.0 (the "License");
MACRUM 6:40e873bbc5f7 8 * you may not use this file except in compliance with the License.
MACRUM 6:40e873bbc5f7 9 * You may obtain a copy of the License at
MACRUM 6:40e873bbc5f7 10 *
MACRUM 6:40e873bbc5f7 11 * http://www.apache.org/licenses/LICENSE-2.0
MACRUM 6:40e873bbc5f7 12 *
MACRUM 6:40e873bbc5f7 13 * Unless required by applicable law or agreed to in writing, software
MACRUM 6:40e873bbc5f7 14 * distributed under the License is distributed on an "AS IS" BASIS,
MACRUM 6:40e873bbc5f7 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MACRUM 6:40e873bbc5f7 16 * See the License for the specific language governing permissions and
MACRUM 6:40e873bbc5f7 17 * limitations under the License.
MACRUM 6:40e873bbc5f7 18 */
MACRUM 6:40e873bbc5f7 19 #ifndef MBED_STATS_H
MACRUM 6:40e873bbc5f7 20 #define MBED_STATS_H
MACRUM 6:40e873bbc5f7 21 #include <stdint.h>
MACRUM 6:40e873bbc5f7 22 #include <stddef.h>
MACRUM 6:40e873bbc5f7 23
MACRUM 6:40e873bbc5f7 24 #ifdef __cplusplus
MACRUM 6:40e873bbc5f7 25 extern "C" {
MACRUM 6:40e873bbc5f7 26 #endif
MACRUM 6:40e873bbc5f7 27
MACRUM 6:40e873bbc5f7 28 typedef struct {
MACRUM 6:40e873bbc5f7 29 uint32_t current_size; /**< Bytes allocated currently. */
MACRUM 6:40e873bbc5f7 30 uint32_t max_size; /**< Max bytes allocated at a given time. */
MACRUM 6:40e873bbc5f7 31 uint32_t total_size; /**< Cumulative sum of bytes ever allocated. */
MACRUM 6:40e873bbc5f7 32 uint32_t reserved_size; /**< Current number of bytes allocated for the heap. */
MACRUM 6:40e873bbc5f7 33 uint32_t alloc_cnt; /**< Current number of allocations. */
MACRUM 6:40e873bbc5f7 34 uint32_t alloc_fail_cnt; /**< Number of failed allocations. */
MACRUM 6:40e873bbc5f7 35 } mbed_stats_heap_t;
MACRUM 6:40e873bbc5f7 36
MACRUM 6:40e873bbc5f7 37 /**
MACRUM 6:40e873bbc5f7 38 * Fill the passed in heap stat structure with heap stats.
MACRUM 6:40e873bbc5f7 39 *
MACRUM 6:40e873bbc5f7 40 * @param stats A pointer to the mbed_stats_heap_t structure to fill
MACRUM 6:40e873bbc5f7 41 */
MACRUM 6:40e873bbc5f7 42 void mbed_stats_heap_get(mbed_stats_heap_t *stats);
MACRUM 6:40e873bbc5f7 43
MACRUM 6:40e873bbc5f7 44 typedef struct {
MACRUM 6:40e873bbc5f7 45 uint32_t thread_id; /**< Identifier for thread that owns the stack. */
MACRUM 6:40e873bbc5f7 46 uint32_t max_size; /**< Sum of the maximum number of bytes used in each stack. */
MACRUM 6:40e873bbc5f7 47 uint32_t reserved_size; /**< Current number of bytes allocated for all stacks. */
MACRUM 6:40e873bbc5f7 48 uint32_t stack_cnt; /**< Number of stacks currently allocated. */
MACRUM 6:40e873bbc5f7 49 } mbed_stats_stack_t;
MACRUM 6:40e873bbc5f7 50
MACRUM 6:40e873bbc5f7 51 /**
MACRUM 6:40e873bbc5f7 52 * Fill the passed in structure with stack stats.
MACRUM 6:40e873bbc5f7 53 *
MACRUM 6:40e873bbc5f7 54 * @param stats A pointer to the mbed_stats_stack_t structure to fill
MACRUM 6:40e873bbc5f7 55 */
MACRUM 6:40e873bbc5f7 56 void mbed_stats_stack_get(mbed_stats_stack_t *stats);
MACRUM 6:40e873bbc5f7 57
MACRUM 6:40e873bbc5f7 58 /**
MACRUM 6:40e873bbc5f7 59 * Fill the passed array of stat structures with the stack stats
MACRUM 6:40e873bbc5f7 60 * for each available stack.
MACRUM 6:40e873bbc5f7 61 *
MACRUM 6:40e873bbc5f7 62 * @param stats A pointer to an array of mbed_stats_stack_t structures to fill
MACRUM 6:40e873bbc5f7 63 * @param count The number of mbed_stats_stack_t structures in the provided array
MACRUM 6:40e873bbc5f7 64 * @return The number of mbed_stats_stack_t structures that have been filled,
MACRUM 6:40e873bbc5f7 65 * this is equal to the number of stacks on the system.
MACRUM 6:40e873bbc5f7 66 */
MACRUM 6:40e873bbc5f7 67 size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count);
MACRUM 6:40e873bbc5f7 68
MACRUM 6:40e873bbc5f7 69 #ifdef __cplusplus
MACRUM 6:40e873bbc5f7 70 }
MACRUM 6:40e873bbc5f7 71 #endif
MACRUM 6:40e873bbc5f7 72
MACRUM 6:40e873bbc5f7 73 #endif
MACRUM 6:40e873bbc5f7 74
MACRUM 6:40e873bbc5f7 75 /** @}*/