Changeset fe100e16 in rtems


Ignore:
Timestamp:
Dec 22, 2015, 8:13:08 AM (22 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
44e9871
Parents:
b308f23
git-author:
Sebastian Huber <sebastian.huber@…> (12/22/15 08:13:08)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/08/16 08:00:53)
Message:

score: Add fatal errors for NULL entry init tasks

This simplifies the global construction.

Update #2514.

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthreadinitthreads.c

    rb308f23 rfe100e16  
    7575
    7676    thread_entry = user_threads[ index ].thread_entry;
     77    if ( thread_entry == NULL ) {
     78      _Terminate(
     79        INTERNAL_ERROR_CORE,
     80        false,
     81        INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL
     82      );
     83    }
    7784
    78     if ( register_global_construction && thread_entry != NULL ) {
     85    if ( register_global_construction ) {
    7986      register_global_construction = false;
    8087      thread_entry = (void *(*)(void *)) _Thread_Global_construction;
  • cpukit/rtems/src/taskinitusers.c

    rb308f23 rfe100e16  
    2525#include <rtems/rtems/modes.h>
    2626#include <rtems/rtems/rtemsapi.h>
     27#include <rtems/score/assert.h>
    2728#include <rtems/score/stack.h>
    2829#include <rtems/rtems/tasksimpl.h>
     
    8283
    8384    entry_point = user_tasks[ index ].entry_point;
     85    if ( entry_point == NULL ) {
     86      _Terminate(
     87        INTERNAL_ERROR_CORE,
     88        false,
     89        INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL
     90      );
     91    }
    8492
    85     if ( register_global_construction && entry_point != NULL ) {
     93    if ( register_global_construction ) {
    8694      register_global_construction = false;
    8795      entry_point = (rtems_task_entry) _Thread_Global_construction;
     
    93101      user_tasks[ index ].argument
    94102    );
    95     if ( !rtems_is_status_successful( return_value ) )
    96       _Terminate( INTERNAL_ERROR_RTEMS_API, true, return_value );
     103    _Assert( rtems_is_status_successful( return_value ) );
     104    (void) return_value;
    97105  }
    98106}
  • cpukit/sapi/src/interrtext.c

    rb308f23 rfe100e16  
    88
    99/*
    10  * Copyright (c) 2012-2014 embedded brains GmbH.  All rights reserved.
     10 * Copyright (c) 2012-2015 embedded brains GmbH.  All rights reserved.
    1111 *
    1212 *  embedded brains GmbH
     
    5353  "INTERNAL_ERROR_NO_MEMORY_FOR_HEAP",
    5454  "INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR",
    55   "INTERNAL_ERROR_RESOURCE_IN_USE"
     55  "INTERNAL_ERROR_RESOURCE_IN_USE",
     56  "INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL",
     57  "INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL"
    5658};
    5759
  • cpukit/score/include/rtems/score/interr.h

    rb308f23 rfe100e16  
    162162  INTERNAL_ERROR_NO_MEMORY_FOR_HEAP,
    163163  INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR,
    164   INTERNAL_ERROR_RESOURCE_IN_USE
     164  INTERNAL_ERROR_RESOURCE_IN_USE,
     165  INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL,
     166  INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL
    165167} Internal_errors_Core_list;
    166168
  • testsuites/psxtests/psxfatal01/testcase.h

    rb308f23 rfe100e16  
    2828#define FATAL_ERROR_DESCRIPTION \
    2929        "POSIX API Init thread create failure - NULL entry"
    30 #define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_POSIX_API
     30#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
    3131#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
    32 #define FATAL_ERROR_EXPECTED_ERROR       ((POSIX_FD_PTHREAD << 8) | EFAULT)
     32#define FATAL_ERROR_EXPECTED_ERROR \
     33  INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL
    3334
    3435void force_error(void)
  • testsuites/sptests/spfatal02/testcase.h

    rb308f23 rfe100e16  
    2525#define FATAL_ERROR_TEST_NAME            "2"
    2626#define FATAL_ERROR_DESCRIPTION          "Classic API Init task start failure"
    27 #define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_RTEMS_API
    28 #define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
    29 #define FATAL_ERROR_EXPECTED_ERROR       RTEMS_INVALID_ADDRESS
     27#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
     28#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
     29#define FATAL_ERROR_EXPECTED_ERROR \
     30  INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL
    3031
    3132void force_error()
  • testsuites/sptests/spinternalerror02/init.c

    rb308f23 rfe100e16  
    11/*
    2  * Copyright (c) 2012-2014 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2012-2015 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    3636  } while ( text != text_last );
    3737
    38   rtems_test_assert( error - 3 == INTERNAL_ERROR_RESOURCE_IN_USE );
     38  rtems_test_assert(
     39    error - 3 == INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL
     40  );
    3941}
    4042
  • testsuites/sptests/spinternalerror02/spinternalerror02.scn

    rb308f23 rfe100e16  
    1 *** TEST SPINTERNALERROR 2 ***
     1*** BEGIN OF TEST SPINTERNALERROR 2 ***
    22INTERNAL_ERROR_NO_CONFIGURATION_TABLE
    33INTERNAL_ERROR_NO_CPU_TABLE
     
    2525INTERNAL_ERROR_NO_MEMORY_FOR_HEAP
    2626INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR
     27INTERNAL_ERROR_RESOURCE_IN_USE
     28INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL
     29INTERNAL_ERROR_POSIX_INIT_THREAD_ENTRY_IS_NULL
    2730?
    2831?
Note: See TracChangeset for help on using the changeset viewer.