2010-08-09 Joel Sherrill <joel.sherrill@oarcorp.com>

PR 1661/testing
	* spfifo02/init.c, spmountmgr01/init.c, spprivenv01/init.c: Eliminate
	most references to RTEMS_Malloc_Heap.
This commit is contained in:
Joel Sherrill
2010-08-09 14:29:36 +00:00
parent 38cc1e1b21
commit 8d9c8247e5
4 changed files with 14 additions and 19 deletions

View File

@@ -1,3 +1,9 @@
2010-08-09 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1661/testing
* spfifo02/init.c, spmountmgr01/init.c, spprivenv01/init.c: Eliminate
most references to RTEMS_Malloc_Heap.
2010-08-09 Sebastian Huber <sebastian.huber@embedded-brains.de> 2010-08-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* sp09/screen12.c: Update for rtems_region_create() changes. * sp09/screen12.c: Update for rtems_region_create() changes.

View File

@@ -17,7 +17,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <rtems/score/heap.h> #include <rtems/libcsupport.h>
#define MAXIMUM 10 #define MAXIMUM 10
#define NUM_OPEN_REQ 26 #define NUM_OPEN_REQ 26
@@ -28,8 +28,6 @@ int BarrierCount;
rtems_id Semaphores[MAXIMUM]; rtems_id Semaphores[MAXIMUM];
int SemaphoreCount; int SemaphoreCount;
extern Heap_Control *RTEMS_Malloc_Heap;
void create_all_barriers(void) void create_all_barriers(void)
{ {
rtems_status_code status; rtems_status_code status;
@@ -132,7 +130,6 @@ rtems_task Init(
void *alloc_ptr = (void *)0; void *alloc_ptr = (void *)0;
int num_opens = 0; int num_opens = 0;
int index = 0; int index = 0;
Heap_Information_block Info;
puts( "\n\n*** TEST FIFO 08 ***" ); puts( "\n\n*** TEST FIFO 08 ***" );
@@ -154,8 +151,7 @@ rtems_task Init(
delete_semaphore(); delete_semaphore();
_Heap_Get_information(RTEMS_Malloc_Heap, &Info); alloc_ptr = malloc( malloc_free_space() - 4 );
alloc_ptr = malloc(Info.Free.largest-4);
puts("Opening FIFO.. expect ENOMEM since no memory is available"); puts("Opening FIFO.. expect ENOMEM since no memory is available");
open_fifo(ENOMEM, O_RDWR); open_fifo(ENOMEM, O_RDWR);

View File

@@ -11,11 +11,9 @@
#include <tmacros.h> #include <tmacros.h>
#include "test_support.h" #include "test_support.h"
#include <rtems/score/heap.h>
#include <errno.h> #include <errno.h>
#include <rtems/libio_.h> #include <rtems/libio_.h>
#include <rtems/libcsupport.h>
extern Heap_Control *RTEMS_Malloc_Heap;
int fs_mount( rtems_filesystem_mount_table_entry_t *mt_entry, int fs_mount( rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data ) const void *data )
@@ -29,13 +27,11 @@ rtems_task Init(
{ {
int status = 0; int status = 0;
void *alloc_ptr = (void *)0; void *alloc_ptr = (void *)0;
Heap_Information_block Info;
puts( "\n\n*** TEST MOUNT MANAGER ROUTINE - 01 ***" ); puts( "\n\n*** TEST MOUNT MANAGER ROUTINE - 01 ***" );
puts( "Init - allocating most of heap -- OK" ); puts( "Init - allocating most of heap -- OK" );
_Heap_Get_information(RTEMS_Malloc_Heap, &Info); alloc_ptr = malloc( malloc_free_space() - 4 );
alloc_ptr = malloc( Info.Free.largest - 4 );
rtems_test_assert( alloc_ptr != NULL ); rtems_test_assert( alloc_ptr != NULL );
puts( "Init - attempt to register filesystem fs - expect ENOMEM" ); puts( "Init - attempt to register filesystem fs - expect ENOMEM" );

View File

@@ -11,10 +11,8 @@
#include <tmacros.h> #include <tmacros.h>
#include "test_support.h" #include "test_support.h"
#include <rtems/score/heap.h>
#include <rtems/libio_.h> #include <rtems/libio_.h>
#include <rtems/libcsupport.h>
extern Heap_Control *RTEMS_Malloc_Heap;
rtems_task task_routine( rtems_task_argument not_used ) rtems_task task_routine( rtems_task_argument not_used )
{ {
@@ -35,16 +33,15 @@ rtems_task Init(
int sc = 0; int sc = 0;
bool status = 0; bool status = 0;
void *alloc_ptr = (void *)0; void *alloc_ptr = (void *)0;
Heap_Information_block Info;
rtems_id current_task_id; rtems_id current_task_id;
rtems_id task_id; rtems_id task_id;
rtems_name another_task_name; rtems_name another_task_name;
Heap_Information_block Info;
puts( "\n\n*** TEST USER ENVIRONMENT ROUTINE - 01 ***" ); puts( "\n\n*** TEST USER ENVIRONMENT ROUTINE - 01 ***" );
puts( "Init - allocating most of heap -- OK" ); puts( "Init - allocating most of heap -- OK" );
_Heap_Get_information(RTEMS_Malloc_Heap, &Info); alloc_ptr = malloc( malloc_free_space() - 4 );
alloc_ptr = malloc( Info.Free.largest - 4 );
rtems_test_assert( alloc_ptr != NULL ); rtems_test_assert( alloc_ptr != NULL );
puts( "Init - attempt to reset env - expect RTEMS_NO_MEMORY" ); puts( "Init - attempt to reset env - expect RTEMS_NO_MEMORY" );