mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-28 05:54:26 +08:00
2010-08-09 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1661/testing * psxchroot01/test.c, psximfs01/init.c, psximfs02/init.c, psxpipe01/init.c: Eliminate most references to RTEMS_Malloc_Heap.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2010-08-09 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
PR 1661/testing
|
||||
* psxchroot01/test.c, psximfs01/init.c, psximfs02/init.c,
|
||||
psxpipe01/init.c: Eliminate most references to RTEMS_Malloc_Heap.
|
||||
|
||||
2010-08-09 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* psxpasswd02/init.c: Remove unused variable.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/userenv.h>
|
||||
#include <pmacros.h>
|
||||
#include <rtems/score/heap.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
void touch( char *file )
|
||||
{
|
||||
@@ -64,8 +64,6 @@ int fileexists( char *file )
|
||||
}
|
||||
|
||||
#if defined(__rtems__)
|
||||
extern Heap_Control *RTEMS_Malloc_Heap;
|
||||
|
||||
int test_main(void)
|
||||
#else
|
||||
int main(
|
||||
@@ -76,7 +74,6 @@ int main(
|
||||
{
|
||||
int status;
|
||||
void *alloc_ptr = (void *)0;
|
||||
Heap_Information_block Info;
|
||||
/*
|
||||
* This test is the C equivalent of this sequence.
|
||||
#mkdir /one
|
||||
@@ -108,8 +105,7 @@ int main(
|
||||
touch( "/one/two/two.test" );
|
||||
|
||||
puts( "allocate most of memory - attempt to fail chroot - expect ENOTSUP" );
|
||||
_Heap_Get_information(RTEMS_Malloc_Heap, &Info);
|
||||
alloc_ptr = malloc( Info.Free.largest - 4 );
|
||||
alloc_ptr = malloc( malloc_free_space() - 4 );
|
||||
rtems_test_assert( alloc_ptr != NULL );
|
||||
|
||||
status = chroot( "/one" );
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
int TestFd;
|
||||
uint8_t Buffer[256];
|
||||
@@ -207,15 +208,12 @@ void unlink_it(void)
|
||||
rtems_test_assert( rc == 0 );
|
||||
}
|
||||
|
||||
extern Heap_Control *RTEMS_Malloc_Heap;
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
)
|
||||
{
|
||||
int i;
|
||||
void *alloc_ptr = (void *)0;
|
||||
Heap_Information_block Info;
|
||||
int position = 0;
|
||||
int status = 0;
|
||||
|
||||
@@ -240,8 +238,7 @@ rtems_task Init(
|
||||
/*
|
||||
* Allocate the heap, so that extend cannot be successful
|
||||
*/
|
||||
_Heap_Get_information( RTEMS_Malloc_Heap, &Info );
|
||||
alloc_ptr = malloc( Info.Free.largest-4 );
|
||||
alloc_ptr = malloc( malloc_free_space() - 4 );
|
||||
|
||||
extend_helper();
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
extern Heap_Control *RTEMS_Malloc_Heap;
|
||||
void IMFS_dump( void );
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
@@ -85,8 +85,7 @@ rtems_task Init(
|
||||
rtems_test_assert( errno == EACCES );
|
||||
|
||||
puts( "Allocate most of heap" );
|
||||
_Heap_Get_information( RTEMS_Malloc_Heap, &Info );
|
||||
alloc_ptr = malloc( Info.Free.largest - 150 );
|
||||
alloc_ptr = malloc( malloc_free_space() - 150 );
|
||||
|
||||
puts( "Attempt to mount a fs at /dir01 -- expect ENOMEM" );
|
||||
status = mount( NULL,
|
||||
@@ -101,8 +100,7 @@ rtems_task Init(
|
||||
free( alloc_ptr );
|
||||
|
||||
puts( "Allocate most of heap" );
|
||||
_Heap_Get_information( RTEMS_Malloc_Heap, &Info );
|
||||
alloc_ptr = malloc( Info.Free.largest - 4 );
|
||||
alloc_ptr = malloc( malloc_free_space() - 4 );
|
||||
|
||||
puts( "Changing directory to /" );
|
||||
status = chdir( "/" );
|
||||
|
||||
@@ -16,10 +16,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <rtems/score/heap.h>
|
||||
|
||||
extern Heap_Control *RTEMS_Malloc_Heap;
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument not_used
|
||||
@@ -29,7 +26,6 @@ rtems_task Init(
|
||||
int dummy_fd[2] = {0,0};
|
||||
int status = 0;
|
||||
void *alloc_ptr = (void *)0;
|
||||
Heap_Information_block Info;
|
||||
|
||||
puts( "*** TEST POSIX PIPE CREATION - 01 ***" );
|
||||
|
||||
@@ -54,8 +50,7 @@ rtems_task Init(
|
||||
status |= close( fd[1] );
|
||||
rtems_test_assert( status == 0 );
|
||||
|
||||
_Heap_Get_information(RTEMS_Malloc_Heap, &Info);
|
||||
alloc_ptr = malloc(Info.Free.largest-4);
|
||||
alloc_ptr = malloc( malloc_free_space() - 4 );
|
||||
|
||||
/* case where mkfifo fails */
|
||||
puts( "Init - attempt to create pipe -- expect ENOMEM" );
|
||||
|
||||
Reference in New Issue
Block a user