mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-20 10:27:50 +08:00
2004-05-06 Joel Sherrill <joel@OARcorp.com>
PR 618/rtems * rtems/include/rtems/rtems/status.h, rtems/src/clockget.c, rtems/src/clockset.c, rtems/src/dpmemcreate.c, rtems/src/dpmemexternal2internal.c, rtems/src/dpmeminternal2external.c, rtems/src/eventmp.c, rtems/src/eventreceive.c, rtems/src/eventsend.c, rtems/src/msgqbroadcast.c, rtems/src/msgqcreate.c, rtems/src/msgqflush.c, rtems/src/msgqgetnumberpending.c, rtems/src/msgqreceive.c, rtems/src/msgqsubmit.c, rtems/src/partcreate.c, rtems/src/partdelete.c, rtems/src/partgetbuffer.c, rtems/src/ratemoncancel.c, rtems/src/ratemoncreate.c, rtems/src/ratemondelete.c, rtems/src/ratemongetstatus.c, rtems/src/ratemonident.c, rtems/src/ratemonperiod.c, rtems/src/regioncreate.c, rtems/src/regiondelete.c, rtems/src/regionextend.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionreturnsegment.c, rtems/src/semcreate.c, rtems/src/semdelete.c, rtems/src/semflush.c, rtems/src/semident.c, rtems/src/taskcreate.c, rtems/src/taskgetnote.c, rtems/src/taskmode.c, rtems/src/taskrestart.c, rtems/src/taskresume.c, rtems/src/tasksetnote.c, rtems/src/tasksuspend.c, rtems/src/taskvariableadd.c, rtems/src/taskvariabledelete.c, rtems/src/taskvariableget.c, rtems/src/taskwakewhen.c, rtems/src/timercreate.c, rtems/src/timerdelete.c, rtems/src/timerfireafter.c, rtems/src/timerfirewhen.c, rtems/src/timerserverfireafter.c, rtems/src/timerserverfirewhen.c, score/include/rtems/score/object.h, score/src/coretodvalidate.c, score/src/objectnametoid.c: Add NULL checks.
This commit is contained in:
@@ -1,3 +1,35 @@
|
||||
2004-05-06 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
PR 618/rtems
|
||||
* rtems/include/rtems/rtems/status.h, rtems/src/clockget.c,
|
||||
rtems/src/clockset.c, rtems/src/dpmemcreate.c,
|
||||
rtems/src/dpmemexternal2internal.c,
|
||||
rtems/src/dpmeminternal2external.c, rtems/src/eventmp.c,
|
||||
rtems/src/eventreceive.c, rtems/src/eventsend.c,
|
||||
rtems/src/msgqbroadcast.c, rtems/src/msgqcreate.c,
|
||||
rtems/src/msgqflush.c, rtems/src/msgqgetnumberpending.c,
|
||||
rtems/src/msgqreceive.c, rtems/src/msgqsubmit.c,
|
||||
rtems/src/partcreate.c, rtems/src/partdelete.c,
|
||||
rtems/src/partgetbuffer.c, rtems/src/ratemoncancel.c,
|
||||
rtems/src/ratemoncreate.c, rtems/src/ratemondelete.c,
|
||||
rtems/src/ratemongetstatus.c, rtems/src/ratemonident.c,
|
||||
rtems/src/ratemonperiod.c, rtems/src/regioncreate.c,
|
||||
rtems/src/regiondelete.c, rtems/src/regionextend.c,
|
||||
rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c,
|
||||
rtems/src/regionreturnsegment.c, rtems/src/semcreate.c,
|
||||
rtems/src/semdelete.c, rtems/src/semflush.c, rtems/src/semident.c,
|
||||
rtems/src/taskcreate.c, rtems/src/taskgetnote.c,
|
||||
rtems/src/taskmode.c, rtems/src/taskrestart.c,
|
||||
rtems/src/taskresume.c, rtems/src/tasksetnote.c,
|
||||
rtems/src/tasksuspend.c, rtems/src/taskvariableadd.c,
|
||||
rtems/src/taskvariabledelete.c, rtems/src/taskvariableget.c,
|
||||
rtems/src/taskwakewhen.c, rtems/src/timercreate.c,
|
||||
rtems/src/timerdelete.c, rtems/src/timerfireafter.c,
|
||||
rtems/src/timerfirewhen.c, rtems/src/timerserverfireafter.c,
|
||||
rtems/src/timerserverfirewhen.c, score/include/rtems/score/object.h,
|
||||
score/src/coretodvalidate.c, score/src/objectnametoid.c: Add NULL
|
||||
checks.
|
||||
|
||||
2004-04-30 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* libnetworking/kern/kern_sysctl.c: sysctl_register_all cannot be
|
||||
|
||||
@@ -63,8 +63,9 @@ extern rtems_status_code _Status_Object_name_errors_to_status[];
|
||||
|
||||
#ifdef RTEMS_API_INIT
|
||||
rtems_status_code _Status_Object_name_errors_to_status[] = {
|
||||
RTEMS_SUCCESSFUL, /* OBJECTS_ID_NAME_OR_ID_LOOKUP_SUCCESSFUL */
|
||||
RTEMS_SUCCESSFUL, /* OBJECTS_SUCCESSFUL */
|
||||
RTEMS_INVALID_NAME, /* OBJECTS_INVALID_NAME */
|
||||
RTEMS_INVALID_ADDRESS, /* OBJECTS_INVALID_ADDRESS */
|
||||
RTEMS_INVALID_ID, /* OBJECTS_INVALID_ID */
|
||||
RTEMS_INVALID_NODE /* OBJECTS_INVALID_NODE */
|
||||
};
|
||||
|
||||
@@ -45,6 +45,9 @@ rtems_status_code rtems_clock_get(
|
||||
ISR_Level level;
|
||||
rtems_interval tmp;
|
||||
|
||||
if ( !time_buffer )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
switch ( option ) {
|
||||
case RTEMS_CLOCK_GET_TOD:
|
||||
if ( !_TOD_Is_set )
|
||||
|
||||
@@ -39,6 +39,9 @@ rtems_status_code rtems_clock_set(
|
||||
{
|
||||
rtems_interval seconds;
|
||||
|
||||
if ( !time_buffer )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( _TOD_Validate( time_buffer ) ) {
|
||||
seconds = _TOD_To_seconds( time_buffer );
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
@@ -40,7 +40,8 @@ boolean _TOD_Validate(
|
||||
{
|
||||
uint32_t days_in_month;
|
||||
|
||||
if ((the_tod->ticks >= _TOD_Ticks_per_second) ||
|
||||
if ((!the_tod) ||
|
||||
(the_tod->ticks >= _TOD_Ticks_per_second) ||
|
||||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
|
||||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
|
||||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
|
||||
|
||||
@@ -52,6 +52,9 @@ rtems_status_code rtems_port_create(
|
||||
if ( !rtems_is_name_valid( name) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !_Addresses_Is_aligned( internal_start ) ||
|
||||
!_Addresses_Is_aligned( external_start ) )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
@@ -49,6 +49,9 @@ rtems_status_code rtems_port_external_to_internal(
|
||||
Objects_Locations location;
|
||||
uint32_t ending;
|
||||
|
||||
if ( !internal )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_port = _Dual_ported_memory_Get( id, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE: /* this error cannot be returned */
|
||||
|
||||
@@ -49,6 +49,9 @@ rtems_status_code rtems_port_internal_to_external(
|
||||
Objects_Locations location;
|
||||
uint32_t ending;
|
||||
|
||||
if ( !external )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_port = _Dual_ported_memory_Get( id, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE: /* this error cannot be returned */
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
rtems_status_code _Event_MP_Send_request_packet (
|
||||
Event_MP_Remote_operations operation,
|
||||
Objects_Id event_id,
|
||||
rtems_event_set event_in
|
||||
rtems_event_set event_in
|
||||
)
|
||||
{
|
||||
Event_MP_Packet *the_packet;
|
||||
|
||||
@@ -48,6 +48,9 @@ rtems_status_code rtems_event_receive(
|
||||
{
|
||||
RTEMS_API_Control *api;
|
||||
|
||||
if ( !event_out )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
|
||||
|
||||
if ( _Event_sets_Is_empty( event_in ) ) {
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_event_send(
|
||||
Objects_Id id,
|
||||
rtems_event_set event_in
|
||||
Objects_Id id,
|
||||
rtems_event_set event_in
|
||||
)
|
||||
{
|
||||
register Thread_Control *the_thread;
|
||||
|
||||
@@ -60,6 +60,12 @@ rtems_status_code rtems_message_queue_broadcast(
|
||||
Objects_Locations location;
|
||||
CORE_message_queue_Status core_status;
|
||||
|
||||
if ( !buffer )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !count )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_message_queue = _Message_queue_Get( id, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE:
|
||||
|
||||
@@ -67,6 +67,9 @@ rtems_status_code rtems_message_queue_create(
|
||||
if ( !rtems_is_name_valid( name ) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( (is_global = _Attributes_Is_global( attribute_set ) ) &&
|
||||
!_System_state_Is_multiprocessing )
|
||||
|
||||
@@ -56,6 +56,9 @@ rtems_status_code rtems_message_queue_flush(
|
||||
register Message_queue_Control *the_message_queue;
|
||||
Objects_Locations location;
|
||||
|
||||
if ( !count )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_message_queue = _Message_queue_Get( id, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE:
|
||||
|
||||
@@ -54,6 +54,9 @@ rtems_status_code rtems_message_queue_get_number_pending(
|
||||
register Message_queue_Control *the_message_queue;
|
||||
Objects_Locations location;
|
||||
|
||||
if ( !count )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_message_queue = _Message_queue_Get( id, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE:
|
||||
|
||||
@@ -61,6 +61,12 @@ rtems_status_code rtems_message_queue_receive(
|
||||
Objects_Locations location;
|
||||
boolean wait;
|
||||
|
||||
if ( !buffer )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !size )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_message_queue = _Message_queue_Get( id, &location );
|
||||
switch ( location ) {
|
||||
|
||||
|
||||
@@ -69,6 +69,9 @@ rtems_status_code _Message_queue_Submit(
|
||||
Objects_Locations location;
|
||||
CORE_message_queue_Status msg_status;
|
||||
|
||||
if ( !buffer )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_message_queue = _Message_queue_Get( id, &location );
|
||||
switch ( location )
|
||||
{
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
* id - pointer to partition id
|
||||
*
|
||||
* Output parameters:
|
||||
* id - partition id
|
||||
* id - partition id
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_partition_create(
|
||||
@@ -47,7 +47,7 @@ rtems_status_code rtems_partition_create(
|
||||
void *starting_address,
|
||||
uint32_t length,
|
||||
uint32_t buffer_size,
|
||||
rtems_attribute attribute_set,
|
||||
rtems_attribute attribute_set,
|
||||
Objects_Id *id
|
||||
)
|
||||
{
|
||||
@@ -56,6 +56,12 @@ rtems_status_code rtems_partition_create(
|
||||
if ( !rtems_is_name_valid( name ) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
if ( !starting_address )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
|
||||
!_Partition_Is_buffer_size_aligned( buffer_size ) )
|
||||
return RTEMS_INVALID_SIZE;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_partition_delete(
|
||||
@@ -42,7 +42,7 @@ rtems_status_code rtems_partition_delete(
|
||||
)
|
||||
{
|
||||
register Partition_Control *the_partition;
|
||||
Objects_Locations location;
|
||||
Objects_Locations location;
|
||||
|
||||
the_partition = _Partition_Get( id, &location );
|
||||
switch ( location ) {
|
||||
|
||||
@@ -46,6 +46,9 @@ rtems_status_code rtems_partition_get_buffer(
|
||||
Objects_Locations location;
|
||||
void *the_buffer;
|
||||
|
||||
if ( !buffer )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_partition = _Partition_Get( id, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE:
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful and caller is not the owning thread
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_rate_monotonic_cancel(
|
||||
@@ -39,7 +39,7 @@ rtems_status_code rtems_rate_monotonic_cancel(
|
||||
)
|
||||
{
|
||||
Rate_monotonic_Control *the_period;
|
||||
Objects_Locations location;
|
||||
Objects_Locations location;
|
||||
|
||||
the_period = _Rate_monotonic_Get( id, &location );
|
||||
switch ( location ) {
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
* id - pointer to rate monotonic id
|
||||
*
|
||||
* Output parameters:
|
||||
* id - rate monotonic id
|
||||
* id - rate monotonic id
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_rate_monotonic_create(
|
||||
@@ -47,6 +47,9 @@ rtems_status_code rtems_rate_monotonic_create(
|
||||
if ( !rtems_is_name_valid( name ) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
_Thread_Disable_dispatch(); /* to prevent deletion */
|
||||
|
||||
the_period = _Rate_monotonic_Allocate();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_rate_monotonic_delete(
|
||||
@@ -39,7 +39,7 @@ rtems_status_code rtems_rate_monotonic_delete(
|
||||
)
|
||||
{
|
||||
Rate_monotonic_Control *the_period;
|
||||
Objects_Locations location;
|
||||
Objects_Locations location;
|
||||
|
||||
the_period = _Rate_monotonic_Get( id, &location );
|
||||
switch ( location ) {
|
||||
|
||||
@@ -45,7 +45,7 @@ rtems_status_code rtems_rate_monotonic_get_status(
|
||||
Objects_Locations location;
|
||||
Rate_monotonic_Control *the_period;
|
||||
|
||||
if ( status == NULL )
|
||||
if ( !status )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_period = _Rate_monotonic_Get( id, &location );
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
* id - pointer to period id
|
||||
*
|
||||
* Output parameters:
|
||||
* *id - region id
|
||||
* *id - region id
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_rate_monotonic_ident(
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_rate_monotonic_period(
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
* id - address of region id to set
|
||||
*
|
||||
* Output parameters:
|
||||
* id - region id
|
||||
* id - region id
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_region_create(
|
||||
@@ -48,7 +48,7 @@ rtems_status_code rtems_region_create(
|
||||
void *starting_address,
|
||||
uint32_t length,
|
||||
uint32_t page_size,
|
||||
rtems_attribute attribute_set,
|
||||
rtems_attribute attribute_set,
|
||||
Objects_Id *id
|
||||
)
|
||||
{
|
||||
@@ -57,6 +57,12 @@ rtems_status_code rtems_region_create(
|
||||
if ( !rtems_is_name_valid( name ) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
if ( !starting_address )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !_Addresses_Is_aligned( starting_address ) )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_region_delete(
|
||||
@@ -43,7 +43,7 @@ rtems_status_code rtems_region_delete(
|
||||
)
|
||||
{
|
||||
register Region_Control *the_region;
|
||||
Objects_Locations location;
|
||||
Objects_Locations location;
|
||||
|
||||
_RTEMS_Lock_allocator();
|
||||
the_region = _Region_Get( id, &location );
|
||||
|
||||
@@ -51,6 +51,9 @@ rtems_status_code rtems_region_extend(
|
||||
Heap_Extend_status heap_status;
|
||||
rtems_status_code status;
|
||||
|
||||
if ( !starting_address )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
status = RTEMS_SUCCESSFUL;
|
||||
|
||||
_RTEMS_Lock_allocator(); /* to prevent deletion */
|
||||
|
||||
@@ -54,6 +54,9 @@ rtems_status_code rtems_region_get_segment(
|
||||
Thread_Control *executing;
|
||||
void *the_segment;
|
||||
|
||||
if ( !segment )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
*segment = NULL;
|
||||
|
||||
if ( size == 0 )
|
||||
|
||||
@@ -49,6 +49,12 @@ rtems_status_code rtems_region_get_segment_size(
|
||||
Objects_Locations location;
|
||||
Thread_Control *executing;
|
||||
|
||||
if ( !segment )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !size )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
_RTEMS_Lock_allocator();
|
||||
executing = _Thread_Executing;
|
||||
the_region = _Region_Get( id, &location );
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_region_return_segment(
|
||||
|
||||
@@ -81,6 +81,9 @@ rtems_status_code rtems_semaphore_create(
|
||||
if ( !rtems_is_name_valid( name ) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( _Attributes_Is_global( attribute_set ) ) {
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
|
||||
@@ -58,9 +58,9 @@
|
||||
* id - pointer to semaphore id
|
||||
*
|
||||
* Output parameters:
|
||||
* *id - semaphore id
|
||||
* *id - semaphore id
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_semaphore_ident(
|
||||
|
||||
@@ -72,6 +72,9 @@ rtems_status_code rtems_task_create(
|
||||
ASR_Information *asr;
|
||||
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !rtems_is_name_valid( name ) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
* note - pointer to note
|
||||
*
|
||||
* Output parameters:
|
||||
* note - filled in if successful
|
||||
* note - filled in if successful
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_task_get_note(
|
||||
@@ -56,6 +56,9 @@ rtems_status_code rtems_task_get_note(
|
||||
Objects_Locations location;
|
||||
RTEMS_API_Control *api;
|
||||
|
||||
if ( !note )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
/*
|
||||
* NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would
|
||||
* be checking an unsigned number for being negative.
|
||||
|
||||
@@ -58,6 +58,9 @@ rtems_status_code rtems_task_mode(
|
||||
boolean needs_asr_dispatching = FALSE;
|
||||
rtems_mode old_mode;
|
||||
|
||||
if ( !previous_mode_set )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
executing = _Thread_Executing;
|
||||
api = executing->API_Extensions[ THREAD_API_RTEMS ];
|
||||
asr = &api->Signal;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_task_restart(
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_task_resume(
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_task_set_note(
|
||||
|
||||
@@ -49,7 +49,7 @@ rtems_status_code rtems_task_suspend(
|
||||
)
|
||||
{
|
||||
register Thread_Control *the_thread;
|
||||
Objects_Locations location;
|
||||
Objects_Locations location;
|
||||
|
||||
the_thread = _Thread_Get( id, &location );
|
||||
switch ( location ) {
|
||||
|
||||
@@ -32,6 +32,9 @@ rtems_status_code rtems_task_variable_add(
|
||||
Objects_Locations location;
|
||||
rtems_task_variable_t *tvp, *new;
|
||||
|
||||
if ( !ptr )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_thread = _Thread_Get (tid, &location);
|
||||
switch (location) {
|
||||
case OBJECTS_REMOTE:
|
||||
|
||||
@@ -31,6 +31,9 @@ rtems_status_code rtems_task_variable_delete(
|
||||
Objects_Locations location;
|
||||
rtems_task_variable_t *tvp, *prev;
|
||||
|
||||
if ( !ptr )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
prev = NULL;
|
||||
|
||||
the_thread = _Thread_Get (tid, &location);
|
||||
|
||||
@@ -32,6 +32,12 @@ rtems_status_code rtems_task_variable_get(
|
||||
Objects_Locations location;
|
||||
rtems_task_variable_t *tvp;
|
||||
|
||||
if ( !ptr )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
if ( !result )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_thread = _Thread_Get (tid, &location);
|
||||
switch (location) {
|
||||
case OBJECTS_REMOTE:
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
*
|
||||
* Output parameters:
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_task_wake_when(
|
||||
rtems_time_of_day *time_buffer
|
||||
rtems_time_of_day *time_buffer
|
||||
)
|
||||
{
|
||||
Watchdog_Interval seconds;
|
||||
@@ -52,6 +52,9 @@ rtems_time_of_day *time_buffer
|
||||
if ( !_TOD_Is_set )
|
||||
return RTEMS_NOT_DEFINED;
|
||||
|
||||
if ( !time_buffer )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
time_buffer->ticks = 0;
|
||||
|
||||
if ( !_TOD_Validate( time_buffer ) )
|
||||
|
||||
@@ -47,6 +47,9 @@ rtems_status_code rtems_timer_create(
|
||||
if ( !rtems_is_name_valid( name ) )
|
||||
return RTEMS_INVALID_NAME;
|
||||
|
||||
if ( !id )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
_Thread_Disable_dispatch(); /* to prevent deletion */
|
||||
|
||||
the_timer = _Timer_Allocate();
|
||||
|
||||
@@ -39,8 +39,8 @@ rtems_status_code rtems_timer_delete(
|
||||
Objects_Id id
|
||||
)
|
||||
{
|
||||
Timer_Control *the_timer;
|
||||
Objects_Locations location;
|
||||
Timer_Control *the_timer;
|
||||
Objects_Locations location;
|
||||
|
||||
the_timer = _Timer_Get( id, &location );
|
||||
switch ( location ) {
|
||||
|
||||
@@ -51,6 +51,9 @@ rtems_status_code rtems_timer_fire_after(
|
||||
if ( ticks == 0 )
|
||||
return RTEMS_INVALID_NUMBER;
|
||||
|
||||
if ( !routine )
|
||||
return RTEMS_INVALID_ADDRESS;
|
||||
|
||||
the_timer = _Timer_Get( id, &location );
|
||||
switch ( location ) {
|
||||
case OBJECTS_REMOTE: /* should never return this */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user