Changeset 3a4ae6c in rtems for cpukit/sapi


Ignore:
Timestamp:
Sep 11, 1995, 7:35:39 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
ced11f99
Parents:
5072b07
Message:

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

Location:
cpukit/sapi
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/rtems/config.h

    r5072b07 r3a4ae6c  
    2222#endif
    2323
    24 #include <rtems/types.h>
    25 #include <rtems/object.h>
    26 #include <rtems/thread.h>
    27 
    28 /*
    29  *  The following records define the Initialization Tasks Table.
    30  *  Each entry contains the information required by RTEMS to
    31  *  create and start a user task automatically at executive
    32  *  initialization time.
    33  */
    34 
    35 typedef struct {
    36   rtems_name            name;              /* task name */
    37   unsigned32            stack_size;        /* task stack size */
    38   rtems_task_priority   initial_priority;  /* task priority */
    39   rtems_attribute       attribute_set;     /* task attributes */
    40   rtems_task_entry      entry_point;       /* task entry point */
    41   rtems_mode            mode_set;          /* task initial mode */
    42   unsigned32            argument;          /* task argument */
    43 } rtems_initialization_tasks_table;
    44 
    45 /*
    46  *
    47  *  The following defines the types for:
    48  *
    49  *    + major and minor numbers
    50  *    + the return type of a device driver entry
    51  *    + a pointer to a device driver entry
    52  *    + an entry in the the Device Driver Address Table.  Each entry in this
    53  *      table corresponds to an application provided device driver and
    54  *      defines the entry points for that device driver.
    55  */
    56 
    57 typedef unsigned32 rtems_device_major_number;
    58 typedef unsigned32 rtems_device_minor_number;
    59 
    60 typedef rtems_status_code rtems_device_driver;
    61 
    62 typedef rtems_device_driver ( *rtems_device_driver_entry )(
    63                  rtems_device_major_number,
    64                  rtems_device_minor_number,
    65                  void *
    66              );
    67 
    68 typedef struct {
    69   rtems_device_driver_entry initialization; /* initialization procedure */
    70   rtems_device_driver_entry open;           /* open request procedure */
    71   rtems_device_driver_entry close;          /* close request procedure */
    72   rtems_device_driver_entry read;           /* read request procedure */
    73   rtems_device_driver_entry write;          /* write request procedure */
    74   rtems_device_driver_entry control;        /* special functions procedure */
    75 }   rtems_driver_address_table;
    76 
    77 /*
    78  *  The following records defines the User Extension Table.
    79  *  This table defines the application dependent routines which
    80  *  are invoked at critical points in the life of each task and
    81  *  the system as a whole.
    82  */
    83 
    84 typedef void rtems_extension;
    85 
    86 typedef rtems_extension ( *rtems_task_create_extension )(
    87                  rtems_tcb *,
    88                  rtems_tcb *
    89              );
    90 
    91 typedef rtems_extension ( *rtems_task_delete_extension )(
    92                  rtems_tcb *,
    93                  rtems_tcb *
    94              );
    95 
    96 typedef rtems_extension ( *rtems_task_start_extension )(
    97                  rtems_tcb *,
    98                  rtems_tcb *
    99              );
    100 
    101 typedef rtems_extension ( *rtems_task_restart_extension )(
    102                  rtems_tcb *,
    103                  rtems_tcb *
    104              );
    105 
    106 typedef rtems_extension ( *rtems_task_switch_extension )(
    107                  rtems_tcb *,
    108                  rtems_tcb *
    109              );
    110 
    111 typedef rtems_extension ( *rtems_task_begin_extension )(
    112                  rtems_tcb *
    113              );
    114 
    115 typedef rtems_extension ( *rtems_task_exitted_extension )(
    116                  rtems_tcb *
    117              );
    118 
    119 typedef rtems_extension ( *rtems_fatal_extension )(
    120                  unsigned32
    121              );
    122 
    123 typedef struct {
    124   rtems_task_create_extension  rtems_task_create;
    125   rtems_task_start_extension   rtems_task_start;
    126   rtems_task_restart_extension rtems_task_restart;
    127   rtems_task_delete_extension  rtems_task_delete;
    128   rtems_task_switch_extension  task_switch;
    129   rtems_task_begin_extension   task_begin;
    130   rtems_task_exitted_extension task_exitted;
    131   rtems_fatal_extension        fatal;
    132 }   rtems_extensions_table;
    133 
    134 /*
    135  *  The following records define the Multiprocessor Communications
    136  *  Interface (MPCI) Table.  This table defines the user-provided
    137  *  MPCI which is a required part of a multiprocessor RTEMS system.
    138  *
    139  *  For non-blocking local operations that become remote operations,
    140  *  we need a timeout.  This is a per-driver timeout: default_timeout
    141  */
    142 
    143 /* XXX FORWARD REFERENCES */
    144 
    145 typedef struct Configuration_Table    rtems_configuration_table;
    146 typedef struct Configuration_Table_MP rtems_multiprocessing_table;
    147 
    148 typedef void rtems_mpci_entry;
    149 
    150 typedef rtems_mpci_entry ( *rtems_mpci_initialization_entry )(
    151                  rtems_configuration_table *,
    152                  rtems_cpu_table *,
    153                  rtems_multiprocessing_table *
    154              );
    155 
    156 typedef rtems_mpci_entry ( *rtems_mpci_get_packet_entry )(
    157                  rtems_packet_prefix **
    158              );
    159 
    160 typedef rtems_mpci_entry ( *rtems_mpci_return_packet_entry )(
    161                  rtems_packet_prefix *
    162              );
    163 
    164 typedef rtems_mpci_entry ( *rtems_mpci_send_entry )(
    165                  unsigned32,
    166                  rtems_packet_prefix *
    167              );
    168 
    169 typedef rtems_mpci_entry ( *rtems_mpci_receive_entry )(
    170                  rtems_packet_prefix **
    171              );
    172 
    173 typedef struct {
    174   unsigned32                      default_timeout;        /* in ticks */
    175   unsigned32                      maximum_packet_size;
    176   rtems_mpci_initialization_entry initialization;
    177   rtems_mpci_get_packet_entry     get_packet;
    178   rtems_mpci_return_packet_entry  return_packet;
    179   rtems_mpci_send_entry           send_packet;
    180   rtems_mpci_receive_entry        receive_packet;
    181 } rtems_mpci_table;
     24#include <rtems/rtems/status.h>
     25#include <rtems/extension.h>
     26#include <rtems/io.h>
     27#include <rtems/core/mpci.h>
     28#include <rtems/rtems/types.h>
     29#include <rtems/rtems/tasks.h>
    18230
    18331/*
     
    18836 */
    18937
    190 struct Configuration_Table_MP {
    191   unsigned32  node;                   /* local node number */
    192   unsigned32  maximum_nodes;          /* maximum # nodes in system */
    193   unsigned32  maximum_global_objects; /* maximum # global objects */
    194   unsigned32  maximum_proxies;        /* maximum # proxies */
    195   rtems_mpci_table *User_mpci_table;  /* pointer to MPCI table */
    196 };
     38typedef struct {
     39  unsigned32    node;                   /* local node number */
     40  unsigned32    maximum_nodes;          /* maximum # nodes in system */
     41  unsigned32    maximum_global_objects; /* maximum # global objects */
     42  unsigned32    maximum_proxies;        /* maximum # proxies */
     43  MPCI_Control *User_mpci_table;        /* pointer to MPCI table */
     44} rtems_multiprocessing_table;
    19745
    19846/*
     
    20856 */
    20957
    210 struct Configuration_Table {
     58typedef struct {
    21159  void                             *work_space_start;
    21260  unsigned32                        work_space_size;
     
    22573  rtems_initialization_tasks_table *User_initialization_tasks_table;
    22674  unsigned32                        number_of_device_drivers;
     75  unsigned32                        maximum_devices;
    22776  rtems_driver_address_table       *Device_driver_table;
    22877  rtems_extensions_table           *User_extension_table;
    22978  rtems_multiprocessing_table      *User_multiprocessing_table;
    230 };
     79} rtems_configuration_table;
    23180
    23281/*
    233  *  The following defines the default Multiprocessing Configuration
    234  *  Table.  This table is used in a single processor system.
     82 *  The following are provided strictly for the convenience of
     83 *  the user.  They are not used in RTEMS itself.
    23584 */
    23685
    237 extern const rtems_multiprocessing_table
    238   _Configuration_Default_multiprocessing_table;
    239 
    240 /*
    241  *  The following define the internal pointers to the user's
    242  *  configuration information.
    243  */
    244 
    245 EXTERN rtems_configuration_table   *_Configuration_Table;
    246 EXTERN rtems_multiprocessing_table *_Configuration_MP_table;
    247 EXTERN rtems_mpci_table            *_Configuration_MPCI_table;
    248 
    249 /*
    250  *
    251  *  _Configuration_Handler_initialization
    252  *
    253  *  DESCRIPTION:
    254  *
    255  *  This routine performs the initialization necessary for this handler.
    256  */
    257 
    258 STATIC INLINE void _Configuration_Handler_initialization(
    259   rtems_configuration_table   *configuration_table,
    260   rtems_multiprocessing_table *multiprocessing_table,
    261   rtems_mpci_table            *users_mpci_table
    262 );
    263 
    264 /*
    265  *  _Configuration_Is_multiprocessing
    266  *
    267  *  DESCRIPTION:
    268  *
    269  *  This function determines if a multiprocessing application has been
    270  *  configured, if so, TRUE is returned, otherwise FALSE is returned.
    271  */
    272 
    273 STATIC INLINE boolean _Configuration_Is_multiprocessing( void );
    274 
    275 /*
    276  *  _Configuration_Is_null_driver_address_table_pointer
    277  *
    278  *  DESCRIPTION:
    279  *
    280  *  This function returns TRUE if the_table is NULL and FALSE otherwise.
    281  */
    282 
    283 STATIC INLINE boolean _Configuration_Is_null_driver_address_table_pointer(
    284   rtems_driver_address_table *the_table
    285 );
    286 
    287 /*
    288  *  _Configuration_Is_null_extension_table_pointer
    289  *
    290  *  DESCRIPTION:
    291  *
    292  *  This function returns TRUE if the_table is NULL and FALSE otherwise.
    293  */
    294 
    295 STATIC INLINE boolean _Configuration_Is_null_extension_table_pointer(
    296   rtems_extensions_table *the_table
    297 );
    298 
    299 /*
    300  *  _Configuration_Is_null_initialization_tasks_table_pointer
    301  *
    302  *  DESCRIPTION:
    303  *
    304  *  This function returns TRUE if the_table is NULL and FALSE otherwise.
    305  */
    306 
    307 STATIC INLINE boolean
    308     _Configuration_Is_null_initialization_tasks_table_pointer(
    309   rtems_initialization_tasks_table *the_table
    310 );
    311 
    312 #include <rtems/config.inl>
     86EXTERN rtems_configuration_table    *_Configuration_Table;
     87EXTERN rtems_multiprocessing_table  *_Configuration_MP_table;
    31388
    31489#ifdef __cplusplus
  • cpukit/sapi/include/rtems/extension.h

    r5072b07 r3a4ae6c  
    2929#endif
    3030
    31 #include <rtems.h>
    32 #include <rtems/object.h>
    33 #include <rtems/userext.h>
     31#include <rtems/core/object.h>
     32#include <rtems/core/userext.h>
     33#include <rtems/rtems/status.h>  /* XXX */
     34#include <rtems/rtems/types.h>  /* XXX */
     35
     36/*
     37 *  Extension related types
     38 */
     39
     40typedef User_extensions_routine                   rtems_extension;
     41typedef User_extensions_thread_create_extension   rtems_task_create_extension;
     42typedef User_extensions_thread_delete_extension   rtems_task_delete_extension;
     43typedef User_extensions_thread_start_extension    rtems_task_start_extension;
     44typedef User_extensions_thread_restart_extension  rtems_task_restart_extension;
     45typedef User_extensions_thread_switch_extension   rtems_task_switch_extension;
     46typedef User_extensions_thread_post_switch_extension 
     47  rtems_task_post_switch_extension;
     48typedef User_extensions_thread_begin_extension    rtems_task_begin_extension;
     49typedef User_extensions_thread_exitted_extension  rtems_task_exitted_extension;
     50typedef User_extensions_fatal_extension           rtems_fatal_extension;
     51
     52typedef User_extensions_Table                     rtems_extensions_table;
    3453
    3554/*
     
    7493
    7594rtems_status_code rtems_extension_create(
    76   rtems_name                     name,
     95  rtems_name              name,
    7796  rtems_extensions_table *extension_table,
    78   Objects_Id                    *id
     97  Objects_Id              *id
    7998);
    8099
  • cpukit/sapi/include/rtems/init.h

    r5072b07 r3a4ae6c  
    3131#endif
    3232
    33 #include <rtems/types.h>
     33#include <rtems/rtems/types.h>
    3434#include <rtems/config.h>
    35 #include <rtems/intr.h>
     35#include <rtems/rtems/intr.h>
     36
     37/*
     38 *  The following defines the default Multiprocessing Configuration
     39 *  Table.  This table is used in a single processor system.
     40 */
     41
     42extern const rtems_multiprocessing_table
     43  _Initialization_Default_multiprocessing_table;
    3644
    3745/*
  • cpukit/sapi/include/rtems/io.h

    r5072b07 r3a4ae6c  
    3333#endif
    3434
    35 #include <rtems/config.h>
    36 
    37 /*
    38  *  The following declare the data required to manage the Device Driver
    39  *  Address Table.
    40  */
    41 
    42 EXTERN unsigned32                  _IO_Number_of_drivers;
    43 EXTERN rtems_driver_address_table *_IO_Driver_address_table;
    44 
     35#include <rtems/rtems/status.h>
     36
     37/*
     38 *
     39 *  The following defines the types for:
     40 *
     41 *    + major and minor numbers
     42 *    + the return type of a device driver entry
     43 *    + a pointer to a device driver entry
     44 *    + an entry in the the Device Driver Address Table.  Each entry in this
     45 *      table corresponds to an application provided device driver and
     46 *      defines the entry points for that device driver.
     47 */
     48 
     49typedef unsigned32 rtems_device_major_number;
     50typedef unsigned32 rtems_device_minor_number;
     51 
     52typedef rtems_status_code rtems_device_driver;
     53 
     54typedef rtems_device_driver ( *rtems_device_driver_entry )(
     55                 rtems_device_major_number,
     56                 rtems_device_minor_number,
     57                 void *
     58             );
     59
     60typedef struct {
     61  rtems_device_driver_entry initialization; /* initialization procedure */
     62  rtems_device_driver_entry open;           /* open request procedure */
     63  rtems_device_driver_entry close;          /* close request procedure */
     64  rtems_device_driver_entry read;           /* read request procedure */
     65  rtems_device_driver_entry write;          /* write request procedure */
     66  rtems_device_driver_entry control;        /* special functions procedure */
     67}   rtems_driver_address_table;
     68 
    4569/*
    4670 * Table for the io device names
     
    5478} rtems_driver_name_t;
    5579
    56 /*XXX this really should be allocated some better way... */
    57 /*XXX it should probably be a chain and use a 'maximum' drivers field
    58  * in config table */
    59 #define RTEMS_MAX_DRIVER_NAMES 20
    60 EXTERN rtems_driver_name_t rtems_driver_name_table[RTEMS_MAX_DRIVER_NAMES];
    61 
     80/*
     81 *  This is the table of device names.
     82 */
     83
     84/*
     85 *  The following declare the data required to manage the Driver
     86 *  Address Table and Device Name Table.
     87 */
     88
     89EXTERN unsigned32                  _IO_Number_of_drivers;
     90EXTERN rtems_driver_address_table *_IO_Driver_address_table;
     91EXTERN unsigned32                  _IO_Number_of_devices;
     92EXTERN rtems_driver_name_t        *_IO_Driver_name_table;
    6293
    6394/*
     
    71102STATIC INLINE void _IO_Manager_initialization(
    72103  rtems_driver_address_table *driver_table,
    73   unsigned32                          number_of_drivers
     104  unsigned32                  number_of_drivers,
     105  unsigned32                  number_of_devices
    74106);
    75107
  • cpukit/sapi/src/exinit.c

    r5072b07 r3a4ae6c  
    2222#include <rtems/system.h>
    2323#include <rtems/config.h>
    24 #include <rtems/copyrt.h>
    25 #include <rtems/clock.h>
    26 #include <rtems/tasks.h>
    2724#include <rtems/debug.h>
    28 #include <rtems/dpmem.h>
    29 #include <rtems/event.h>
    3025#include <rtems/extension.h>
    3126#include <rtems/fatal.h>
    32 #include <rtems/heap.h>
    3327#include <rtems/init.h>
    34 #include <rtems/intthrd.h>
    35 #include <rtems/isr.h>
    36 #include <rtems/intr.h>
    3728#include <rtems/io.h>
    38 #include <rtems/message.h>
    39 #include <rtems/mp.h>
    40 #include <rtems/mpci.h>
    41 #include <rtems/part.h>
    42 #include <rtems/priority.h>
    43 #include <rtems/ratemon.h>
    44 #include <rtems/region.h>
    45 #include <rtems/sem.h>
    46 #include <rtems/signal.h>
    4729#include <rtems/sysstate.h>
    48 #include <rtems/thread.h>
    49 #include <rtems/timer.h>
    50 #include <rtems/tod.h>
    51 #include <rtems/userext.h>
    52 #include <rtems/watchdog.h>
    53 #include <rtems/wkspace.h>
    54 
     30
     31#include <rtems/core/copyrt.h>
     32#include <rtems/core/heap.h>
     33#include <rtems/core/interr.h>
     34#include <rtems/core/intthrd.h>
     35#include <rtems/core/isr.h>
     36#include <rtems/core/mpci.h>
     37#include <rtems/core/priority.h>
     38#include <rtems/core/thread.h>
     39#include <rtems/core/tod.h>
     40#include <rtems/core/userext.h>
     41#include <rtems/core/watchdog.h>
     42#include <rtems/core/wkspace.h>
     43
     44#include <rtems/directives.h>
    5545#include <rtems/sptables.h>
     46
     47#include <rtems/rtems/rtemsapi.h>
    5648
    5749/*PAGE
     
    10496  _ISR_Disable( bsp_level );
    10597
    106   _System_state_Set( SYSTEM_STATE_BEFORE_INITIALIZATION );
     98  if ( cpu_table == NULL )
     99    _Internal_error_Occurred(
     100      INTERNAL_ERROR_CORE,
     101      TRUE,
     102      INTERNAL_ERROR_NO_CONFIGURATION_TABLE
     103    );
     104
     105  /*
     106   *  Initialize the system state based on whether this is an MP system.
     107   */
     108
     109  multiprocessing_table = configuration_table->User_multiprocessing_table;
     110
     111  _System_state_Handler_initialization(
     112    (multiprocessing_table) ? TRUE : FALSE
     113  );
     114
     115  /*
     116   *  Provided just for user convenience.
     117   */
     118
     119  _Configuration_Table    = configuration_table;
     120  _Configuration_MP_table = multiprocessing_table;
     121
     122  /*
     123   *  Internally we view single processor systems as a very restricted
     124   *  multiprocessor system.
     125   */
     126
     127  if ( multiprocessing_table == NULL )
     128    multiprocessing_table =
     129      (void *)&_Initialization_Default_multiprocessing_table;
     130
     131  if ( cpu_table == NULL )
     132    _Internal_error_Occurred(
     133      INTERNAL_ERROR_CORE,
     134      TRUE,
     135      INTERNAL_ERROR_NO_CPU_TABLE
     136    );
    107137
    108138  _CPU_Initialize( cpu_table, _Thread_Dispatch );
     
    114144
    115145  _Debug_Manager_initialization();
    116 
    117   multiprocessing_table = configuration_table->User_multiprocessing_table;
    118   if ( multiprocessing_table == NULL )
    119     multiprocessing_table =
    120       (void *) &_Configuration_Default_multiprocessing_table;
    121 
    122   _Configuration_Handler_initialization(
    123     configuration_table,
    124     multiprocessing_table,
    125     multiprocessing_table->User_mpci_table
    126   );
    127 
    128   _Attributes_Handler_initialization();
    129146
    130147  _Thread_Dispatch_initialization();
     
    143160  _Objects_Handler_initialization(
    144161    multiprocessing_table->node,
     162    multiprocessing_table->maximum_nodes,
    145163    multiprocessing_table->maximum_global_objects
    146164  );
     
    154172  _Thread_Handler_initialization(
    155173    configuration_table->ticks_per_timeslice,
     174    configuration_table->maximum_extensions,
    156175    multiprocessing_table->maximum_proxies
    157176  );
    158177
    159   _MPCI_Handler_initialization();
     178  _MPCI_Handler_initialization(
     179    multiprocessing_table->User_mpci_table
     180  );
     181
     182  _Internal_threads_Initialization();
    160183
    161184/* MANAGERS */
    162 
    163   _Interrupt_Manager_initialization();
    164 
    165   _Multiprocessing_Manager_initialization();
    166 
    167   _RTEMS_tasks_Manager_initialization( configuration_table->maximum_tasks );
    168 
    169   _Timer_Manager_initialization( configuration_table->maximum_timers );
    170185
    171186  _Extension_Manager_initialization( configuration_table->maximum_extensions );
     
    173188  _IO_Manager_initialization(
    174189    configuration_table->Device_driver_table,
    175     configuration_table->number_of_device_drivers
    176   );
    177 
    178   _Event_Manager_initialization();
    179 
    180   _Message_queue_Manager_initialization(
    181     configuration_table->maximum_message_queues
    182   );
    183 
    184   _Semaphore_Manager_initialization(
    185     configuration_table->maximum_semaphores
    186   );
    187 
    188   _Partition_Manager_initialization(
    189     configuration_table->maximum_partitions
    190   );
    191 
    192   _Region_Manager_initialization( configuration_table->maximum_regions );
    193 
    194   _Dual_ported_memory_Manager_initialization(
    195     configuration_table->maximum_ports
    196   );
    197 
    198   _Rate_monotonic_Manager_initialization(
    199     configuration_table->maximum_periods
    200   );
    201 
    202   _Internal_threads_Initialization();
     190    configuration_table->number_of_device_drivers,
     191    configuration_table->maximum_devices
     192  );
     193
     194  _RTEMS_API_Initialize( configuration_table );
    203195
    204196  if ( cpu_table->pretasking_hook )
    205197    (*cpu_table->pretasking_hook)();
     198
     199  _Internal_threads_Start();
    206200
    207201  _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
  • cpukit/sapi/src/extension.c

    r5072b07 r3a4ae6c  
    1515
    1616#include <rtems/system.h>
    17 #include <rtems/support.h>
    18 #include <rtems/object.h>
    19 #include <rtems/thread.h>
     17#include <rtems/rtems/support.h>
     18#include <rtems/core/object.h>
     19#include <rtems/core/thread.h>
    2020#include <rtems/extension.h>
    2121
     
    6666
    6767rtems_status_code rtems_extension_create(
    68   rtems_name                     name,
     68  rtems_name              name,
    6969  rtems_extensions_table *extension_table,
    70   Objects_Id                    *id
     70  Objects_Id             *id
    7171)
    7272{
     
    7474
    7575  if ( !rtems_is_name_valid( name ) )
    76     return ( RTEMS_INVALID_NAME );
     76    return RTEMS_INVALID_NAME;
    7777
    7878  _Thread_Disable_dispatch();         /* to prevent deletion */
     
    8282  if ( !the_extension ) {
    8383    _Thread_Enable_dispatch();
    84     return( RTEMS_TOO_MANY );
     84    return RTEMS_TOO_MANY;
    8585  }
    8686
     
    9191  *id = the_extension->Object.id;
    9292  _Thread_Enable_dispatch();
    93   return( RTEMS_SUCCESSFUL );
     93  return RTEMS_SUCCESSFUL;
    9494}
    9595
     
    116116)
    117117{
    118   return _Objects_Name_to_id(
     118  Objects_Name_to_id_errors  status;
     119
     120  status = _Objects_Name_to_id(
    119121    &_Extension_Information,
    120122    &name,
    121     RTEMS_SEARCH_LOCAL_NODE,
     123    OBJECTS_SEARCH_LOCAL_NODE,
    122124    id
    123125  );
     126
     127  return _Status_Object_name_errors_to_status[ status ];
    124128}
    125129
     
    149153    case OBJECTS_ERROR:
    150154    case OBJECTS_REMOTE:            /* should never return this */
    151       return( RTEMS_INVALID_ID );
     155      return RTEMS_INVALID_ID;
    152156    case OBJECTS_LOCAL:
    153157      _User_extensions_Remove_set( &the_extension->Extension );
     
    155159      _Extension_Free( the_extension );
    156160      _Thread_Enable_dispatch();
    157       return( RTEMS_SUCCESSFUL );
     161      return RTEMS_SUCCESSFUL;
    158162  }
    159163
    160   return( RTEMS_INTERNAL_ERROR );   /* unreached - only to remove warnings */
     164  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
    161165}
  • cpukit/sapi/src/fatal.c

    r5072b07 r3a4ae6c  
    1414
    1515#include <rtems/system.h>
    16 #include <rtems/config.h>
    1716#include <rtems/fatal.h>
    18 #include <rtems/sysstate.h>
    19 #include <rtems/userext.h>
     17#include <rtems/core/interr.h>
    2018
    2119/*PAGE
     
    2321 *  rtems_fatal_error_occurred
    2422 *
    25  *  This directive will invoke the fatal error handler supplied by the user
    26  *  followed by the the default one provided by the executive.  The default
    27  *  error handler assumes no hardware is present to help inform the user
    28  *  of the problem.  Halt stores the error code in a known register,
    29  *  disables interrupts, and halts the CPU.  If the CPU does not have a
    30  *  halt instruction, it will loop to itself.
     23 *  This directive will invoke the internal fatal error handler.
    3124 *
    3225 *  Input parameters:
    3326 *    the_error - fatal error status code
    3427 *
    35  *  Output parameters:
    36  *    the_error       - on stack
    37  *    status register - on stack
    38  *
    39  *  NOTE: The the_error is not necessarily a directive status code.
     28 *  Output parameters: NONE
    4029 */
    4130
     
    4433)
    4534{
    46 
    47   _User_extensions_Fatal( the_error );
    48 
    49   _System_state_Set( SYSTEM_STATE_FAILED );
    50 
    51   _CPU_Fatal_halt( the_error );
     35  _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, FALSE, the_error );
    5236
    5337/* will not return from this routine */
  • cpukit/sapi/src/io.c

    r5072b07 r3a4ae6c  
    1515
    1616#include <rtems/system.h>
    17 #include <rtems/config.h>
    1817#include <rtems/io.h>
    19 #include <rtems/isr.h>
    20 #include <rtems/thread.h>
    21 #include <rtems/intr.h>
     18#include <rtems/core/isr.h>
     19#include <rtems/core/thread.h>
    2220
    2321#include <string.h>
     
    3937
    4038   for ( major=0 ; major < _IO_Number_of_drivers ; major ++ )
    41      (void) rtems_io_initialize( major, 0, _Configuration_Table);
     39     (void) rtems_io_initialize( major, 0, NULL);
    4240}
    4341
     
    6159    rtems_driver_name_t *np;
    6260    unsigned32 level;
     61    unsigned32 index;
    6362
    6463    /* find an empty slot */
    65     for (np = rtems_driver_name_table; np < &rtems_driver_name_table[RTEMS_MAX_DRIVER_NAMES]; np++)
     64    for( index=0, np = _IO_Driver_name_table ;
     65         index < _IO_Number_of_devices ;
     66         index++, np++ )
    6667    {
    67         rtems_interrupt_disable(level);
     68
     69        _ISR_Disable(level);
    6870        if (np->device_name == 0)
    6971        {
     
    7274            np->major = major;
    7375            np->minor = minor;
    74             rtems_interrupt_enable(level);
     76            _ISR_Enable(level);
    7577
    7678            return RTEMS_SUCCESSFUL;
    7779        }
    78         rtems_interrupt_enable(level);
     80        _ISR_Enable(level);
    7981    }
    8082
     
    9496
    9597rtems_status_code rtems_io_lookup_name(
    96     const char *pathname,
     98    const char           *pathname,
    9799    rtems_driver_name_t **rnp
    98   )
     100)
    99101{
    100102    rtems_driver_name_t *np;
    101 
    102     for (np = rtems_driver_name_table; np < &rtems_driver_name_table[RTEMS_MAX_DRIVER_NAMES]; np++)
     103    unsigned32 index;
     104
     105    for( index=0, np = _IO_Driver_name_table ;
     106         index < _IO_Number_of_devices ;
     107         index++, np++ )
    103108        if (np->device_name)
    104109            if (strncmp(np->device_name, pathname, np->device_name_length) == 0)
Note: See TracChangeset for help on using the changeset viewer.