2009-05-14 Joel Sherrill <joel.sherrill@oarcorp.com>

* sp09/screen11.c, sp09/sp09.scn: Add case where buffer size is not
	large enough for buffer node overhead.
This commit is contained in:
Joel Sherrill
2009-05-14 16:01:01 +00:00
parent 02ba7cac29
commit d4b75d2043
3 changed files with 35 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2009-05-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp09/screen11.c, sp09/sp09.scn: Add case where buffer size is not
large enough for buffer node overhead.
2009-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac, spwatchdog/system.h,

View File

@@ -6,7 +6,7 @@
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -24,6 +24,7 @@ void Screen11()
void *buffer_address_2;
void *buffer_address_3;
rtems_status_code status;
uint32_t size;
status = rtems_partition_create(
0,
@@ -87,6 +88,33 @@ void Screen11()
"TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE"
);
/*
* Attempt to create a partition with a buffer size that is not large
* enough to account for the overhead.
*/
puts(
"TA1 - rtems_partition_create - buffer size < overhead - RTEMS_INVALID_SIZE"
);
#define SIZEOF_CHAIN_NODE 2 * sizeof(void *)
for ( size=0 ; size < SIZEOF_CHAIN_NODE ; size++) {
status = rtems_partition_create(
Partition_name[ 1 ],
Partition_good_area,
size,
256,
RTEMS_DEFAULT_ATTRIBUTES,
&Junk_id
);
if ( status != RTEMS_INVALID_SIZE )
printf( "ERROR when size == %d\n", size );
fatal_directive_status(
status,
RTEMS_INVALID_SIZE,
"rtems_partition_create with buffer_size > length"
);
}
/*
* The check for an object being global is only made if
* multiprocessing is enabled.

View File

@@ -189,6 +189,7 @@ TA1 - rtems_partition_create - RTEMS_INVALID_NAME
TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE
TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE
TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE
TA1 - rtems_partition_create - buffer size < overhead - RTEMS_INVALID_SIZE
TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED
TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS
TA1 - rtems_partition_create - RTEMS_INVALID_SIZE