Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: cc3000_ping_demo_try_2
Fork of mbed by
stackheap.h
- Committer:
- simon.ford@mbed.co.uk
- Date:
- 2008-11-27
- Revision:
- 4:5d1359a283bc
- Parent:
- 1:6b7f447ca868
File content as of revision 4:5d1359a283bc:
/* mbed Microcontroller Library - stackheap
* Copyright (c) 2007-2008, sford
*/
#ifndef MBED_STACKHEAP_H
#define MBED_STACKHEAP_H
namespace mbed {
/* Section: stackheap
* Useful functions for seeing what is going on with the stack and heap
*/
/* Function: code_base
* Return the address of the fixed base of the code region
*/
int code_base();
/* Function: code_limit
* Return the address of the top of the code region
*/
int code_limit();
/* Function: rw_base
* Return the address of the fixed base of the rw region
*/
int rw_base();
/* Function: rw_limit
* Return the address of the top of the rw region
*/
int rw_limit();
/* Function: heap_base
* Return the address of the fixed base of the heap
*/
int heap_base();
/* Function: heap_limit
* Return the address of the current top of the heap
*/
int heap_limit();
/* Function: stack_base
* Return the address of the fixed base of the stack
*/
int stack_base();
/* Function: stack_limit
* Return the address of the current top of the stack
*/
//int stack_limit();
/* Function: code_size
* Return the size of the code region
*/
int code_size();
/* Function: rw_size
* Return the size of the rw region
*/
int rw_size();
/* Function: heap_size
* Return the current size of the heap pool allocated
*/
int heap_size();
/* Function: stack_size
* Return the current size of the stack used
*/
//int stack_size();
inline int stack_limit() {
#ifdef __GNUC__
return (unsigned)__builtin_frame_address(0);
#else
return __current_sp();
#endif
}
inline int stack_size() {
return stack_base() - stack_limit();
}
} // namespace mbed
#endif
