capture: Fix buffer allocation and free

Do not use function static variables.  Remove superfluous volatile
qualifiers.  Use proper integer types.

Close #2706.
This commit is contained in:
Sebastian Huber
2016-05-12 11:12:27 +02:00
parent 1379d840a4
commit 2f11d4a014
2 changed files with 11 additions and 11 deletions

View File

@@ -28,8 +28,8 @@
void * rtems_capture_buffer_allocate( rtems_capture_buffer_t* buffer, size_t size )
{
static uint32_t end;
static void *ptr;
size_t end;
void *ptr;
if ( rtems_capture_buffer_is_full( buffer ) )
return NULL;
@@ -89,8 +89,8 @@ void * rtems_capture_buffer_allocate( rtems_capture_buffer_t* buffer, size_t siz
void *rtems_capture_buffer_free( rtems_capture_buffer_t* buffer, size_t size )
{
static void *ptr;
static uint32_t next;
void *ptr;
size_t next;
size_t buff_size;
if (size == 0)

View File

@@ -34,10 +34,10 @@ extern "C" {
typedef struct {
uint8_t *buffer;
size_t size;
volatile uint32_t count;
volatile uint32_t head;
volatile uint32_t tail;
volatile uint32_t end;
size_t count;
size_t head;
size_t tail;
size_t end;
} rtems_capture_buffer_t;
static inline void rtems_capture_buffer_flush( rtems_capture_buffer_t* buffer )