diff options
Diffstat (limited to 'schedsim/rtems/wkspace.c')
-rw-r--r-- | schedsim/rtems/wkspace.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/schedsim/rtems/wkspace.c b/schedsim/rtems/wkspace.c index de9f76c..61fbb47 100644 --- a/schedsim/rtems/wkspace.c +++ b/schedsim/rtems/wkspace.c @@ -20,7 +20,9 @@ #include <rtems/score/interr.h> #include <stdlib.h> +#include <malloc.h> +#define DEBUG_WORKSPACE #if defined(DEBUG_WORKSPACE) #include <stdio.h> #endif @@ -59,6 +61,27 @@ void *_Workspace_Allocate( return memory; } +void *_Workspace_Allocate_aligned( size_t size, size_t alignment ) +{ + void *memory; + int sc; + + memory = memalign( alignment, size ); + #if defined(DEBUG_WORKSPACE) + fprintf( + stderr, + "Workspace_Allocate_aligned(%d, %d) from %p/%p -> %p\n", + size, + alignment, + __builtin_return_address( 0 ), + __builtin_return_address( 1 ), + memory + ); + #endif + return memory; +} + + /* * _Workspace_Free */ |