Go to the documentation of this file.
13 #include <sys/times.h>
14 #include <sys/errno.h>
18 #include "stm32f4xx.h"
21 #define MAX_STACK_SIZE 0x200
27 register char * stack_ptr
asm(
"sp");
33 caddr_t
_sbrk(
int incr)
35 extern char end
asm(
"end");
36 static char *heap_end;
37 char *prev_heap_end,*min_stack_ptr;
42 prev_heap_end = heap_end;
46 min_stack_ptr = (
char*)(*(
unsigned int *)*(
unsigned int *)0xE000ED08);
50 if (heap_end + incr > min_stack_ptr)
52 if (heap_end + incr > stack_ptr)
63 return (caddr_t) prev_heap_end;
74 tzp->tz_minuteswest = 0;
105 for (DataIdx = 0; DataIdx < len; DataIdx++)
119 st->st_mode = S_IFCHR;
133 int _read(
int file,
char *ptr,
int len)
137 for (DataIdx = 0; DataIdx < len; DataIdx++)
145 int _open(
char *path,
int flags, ...)
168 int _stat(
char *file,
struct stat *st)
170 st->st_mode = S_IFCHR;
int _kill(int pid, int sig)
void initialise_monitor_handles()
int _lseek(int file, int ptr, int dir)
int _times(struct tms *buf)
int _gettimeofday(struct timeval *tp, struct timezone *tzp)
int __io_putchar(int ch) __attribute__((weak))
int _write(int file, char *ptr, int len)
int _read(int file, char *ptr, int len)
int _execve(char *name, char **argv, char **env)
void * _sbrk(ptrdiff_t incr)
_sbrk() allocates memory to the newlib heap and is used by malloc and others from the C library
int _stat(char *file, struct stat *st)
int _open(char *path, int flags,...)
int _link(char *old, char *new)
int _fstat(int file, struct stat *st)
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
Reverse byte order (16 bit)