Support for variable length names added to Object Handler. This supports

both fixed length "raw" names and strings from the API's point of view.

Both inline and macro implementations were tested.
This commit is contained in:
Joel Sherrill
1995-08-23 19:30:23 +00:00
parent 80e2c29e64
commit 3235ad9a2c
414 changed files with 3776 additions and 1118 deletions

View File

@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
* $Id$
*/
#include <rtems.h>

View File

@@ -11,7 +11,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
* $Id$
*/
#include <rtems.h>

View File

@@ -35,7 +35,7 @@
*
* NOTE:
*
* newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
* $Id$
*
*/

View File

@@ -32,6 +32,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
/*
@@ -78,7 +79,7 @@ void _Dual_ported_memory_Manager_initialization(
*/
rtems_status_code rtems_port_create(
Objects_Name name,
rtems_name name,
void *internal_start,
void *external_start,
unsigned32 length,
@@ -96,7 +97,7 @@ rtems_status_code rtems_port_create(
*/
rtems_status_code rtems_port_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -43,9 +43,9 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
Event_MP_Remote_operations operation;
rtems_event_set event_in;
rtems_packet_prefix Prefix;
Event_MP_Remote_operations operation;
rtems_event_set event_in;
} Event_MP_Packet;
/*

View File

@@ -34,6 +34,7 @@
extern "C" {
#endif
#include <rtems/types.h>
#include <rtems/chain.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
@@ -129,7 +130,7 @@ void _Message_queue_Manager_initialization(
*/
rtems_status_code rtems_message_queue_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
unsigned32 max_message_size,
rtems_attribute attribute_set,
@@ -151,7 +152,7 @@ rtems_status_code rtems_message_queue_create(
*/
rtems_status_code rtems_message_queue_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -57,7 +57,7 @@ typedef enum {
typedef struct {
rtems_packet_prefix Prefix;
Message_queue_MP_Remote_operations operation;
Objects_Name name;
rtems_name name;
rtems_option option_set;
Objects_Id proxy_id;
unsigned32 count;
@@ -78,7 +78,7 @@ typedef struct {
void _Message_queue_MP_Send_process_packet (
Message_queue_MP_Remote_operations operation,
Objects_Id message_queue_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -31,6 +31,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/address.h>
#include <rtems/attr.h>
#include <rtems/object.h>
@@ -83,7 +84,7 @@ void _Partition_Manager_initialization(
*/
rtems_status_code rtems_partition_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 buffer_size,
@@ -106,7 +107,7 @@ rtems_status_code rtems_partition_create(
*/
rtems_status_code rtems_partition_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -48,9 +48,9 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
rtems_packet_prefix Prefix;
Partition_MP_Remote_operations operation;
Objects_Name name;
rtems_name name;
void *buffer;
Objects_Id proxy_id;
} Partition_MP_Packet;
@@ -67,7 +67,7 @@ typedef struct {
void _Partition_MP_Send_process_packet (
Partition_MP_Remote_operations operation,
Objects_Id partition_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -29,6 +29,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/watchdog.h>
@@ -88,7 +89,7 @@ void _Rate_monotonic_Manager_initialization(
*/
rtems_status_code rtems_rate_monotonic_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
);
@@ -104,7 +105,7 @@ rtems_status_code rtems_rate_monotonic_create(
*/
rtems_status_code rtems_rate_monotonic_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -30,6 +30,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
#include <rtems/heap.h>
@@ -86,7 +87,7 @@ void _Region_Manager_initialization(
*/
rtems_status_code rtems_region_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 page_size,
@@ -123,7 +124,7 @@ rtems_status_code rtems_region_extend(
*/
rtems_status_code rtems_region_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -48,10 +48,10 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
rtems_packet_prefix Prefix;
Region_MP_Remote_operations operation;
Objects_Name name;
rtems_option option_set;
rtems_name name;
rtems_option option_set;
unsigned32 size;
Objects_Id proxy_id;
void *segment;
@@ -69,7 +69,7 @@ typedef struct {
void _Region_MP_Send_process_packet (
Region_MP_Remote_operations operation,
Objects_Id region_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -24,6 +24,8 @@ extern "C" {
#endif
#include <rtems/system.h>
#include <rtems/types.h>
#include <rtems/init.h>
#include <rtems/tasks.h>
#include <rtems/intr.h>
@@ -43,31 +45,7 @@ extern "C" {
#include <rtems/ratemon.h>
#include <rtems/mp.h>
/*
* RTEMS basic type definitions
*/
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
typedef signed8 rtems_signed8; /* signed 8-bit value */
typedef signed16 rtems_signed16; /* signed 16-bit value */
typedef signed32 rtems_signed32; /* signed 32-bit value */
typedef signed64 rtems_signed64; /* signed 64-bit value */
typedef single_precision rtems_single; /* single precision float */
typedef double_precision rtems_double; /* double precision float */
typedef boolean rtems_boolean;
typedef Objects_Name rtems_name;
typedef Objects_Id rtems_id;
typedef Context_Control rtems_context;
typedef Context_Control_fp rtems_context_fp;
typedef CPU_Interrupt_frame rtems_interrupt_frame;
#include <rtems/support.h>
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP

View File

@@ -31,6 +31,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/attr.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
@@ -81,7 +82,7 @@ void _Semaphore_Manager_initialization(
*/
rtems_status_code rtems_semaphore_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
rtems_attribute attribute_set,
Objects_Id *id
@@ -102,7 +103,7 @@ rtems_status_code rtems_semaphore_create(
*/
rtems_status_code rtems_semaphore_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -49,11 +49,11 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
Semaphore_MP_Remote_operations operation;
Objects_Name name;
rtems_option option_set;
Objects_Id proxy_id;
rtems_packet_prefix Prefix;
Semaphore_MP_Remote_operations operation;
rtems_name name;
rtems_option option_set;
Objects_Id proxy_id;
} Semaphore_MP_Packet;
/*
@@ -68,7 +68,7 @@ typedef struct {
void _Semaphore_MP_Send_process_packet (
Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -43,9 +43,9 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
Signal_MP_Remote_operations operation;
rtems_signal_set signal_in;
rtems_packet_prefix Prefix;
Signal_MP_Remote_operations operation;
rtems_signal_set signal_in;
} Signal_MP_Packet;
/*

View File

@@ -0,0 +1,80 @@
/* support.h
*
* This include file contains information about support functions for
* the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_RTEMS_SUPPORT_h
#define __RTEMS_RTEMS_SUPPORT_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/types.h>
/*
* rtems_is_name_valid
*
* DESCRIPTION:
*
* This function returns TRUE if the name is valid, and FALSE otherwise.
*/
STATIC INLINE rtems_boolean rtems_is_name_valid (
rtems_name name
);
/*
* rtems_build_name
*
* DESCRIPTION:
*
* This function returns an object name composed of the four characters
* C1, C2, C3, and C4.
*
* NOTE:
*
* This must be implemented as a macro for use in Configuration Tables.
*
*/
#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
/*
* rtems_name_to_characters
*
* DESCRIPTION:
*
* This function breaks the object name into the four component
* characters C1, C2, C3, and C4.
*
*/
STATIC INLINE void rtems_name_to_characters(
rtems_name name,
char *c1,
char *c2,
char *c3,
char *c4
);
#include <rtems/support.inl>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -54,12 +54,12 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
RTEMS_tasks_MP_Remote_operations operation;
Objects_Name name;
rtems_task_priority the_priority;
unsigned32 notepad;
unsigned32 note;
rtems_packet_prefix Prefix;
RTEMS_tasks_MP_Remote_operations operation;
rtems_name name;
rtems_task_priority the_priority;
unsigned32 notepad;
unsigned32 note;
} RTEMS_tasks_MP_Packet;
/*
@@ -74,7 +74,7 @@ typedef struct {
void _RTEMS_tasks_MP_Send_process_packet (
RTEMS_tasks_MP_Remote_operations operation,
Objects_Id task_id,
Objects_Name name
rtems_name name
);
/*

View File

@@ -38,6 +38,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/message.h>
#include <rtems/object.h>
#include <rtems/part.h>
@@ -74,7 +75,7 @@ extern "C" {
*/
rtems_status_code rtems_task_create(
Objects_Name name,
rtems_name name,
rtems_task_priority initial_priority,
unsigned32 stack_size,
rtems_mode initial_modes,
@@ -97,7 +98,7 @@ rtems_status_code rtems_task_create(
*/
rtems_status_code rtems_task_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -33,6 +33,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/tod.h>
#include <rtems/watchdog.h>
@@ -95,7 +96,7 @@ void _Timer_Manager_initialization(
*/
rtems_status_code rtems_timer_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
);
@@ -111,7 +112,7 @@ rtems_status_code rtems_timer_create(
*/
rtems_status_code rtems_timer_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -0,0 +1,56 @@
/* types.h
*
* This include file defines the types used by the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_RTEMS_TYPES_h
#define __RTEMS_RTEMS_TYPES_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/object.h>
/*
* RTEMS basic type definitions
*/
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
typedef signed8 rtems_signed8; /* signed 8-bit value */
typedef signed16 rtems_signed16; /* signed 16-bit value */
typedef signed32 rtems_signed32; /* signed 32-bit value */
typedef signed64 rtems_signed64; /* signed 64-bit value */
typedef single_precision rtems_single; /* single precision float */
typedef double_precision rtems_double; /* double precision float */
typedef boolean rtems_boolean;
typedef unsigned32 rtems_name;
typedef Objects_Id rtems_id;
typedef Context_Control rtems_context;
typedef Context_Control_fp rtems_context_fp;
typedef CPU_Interrupt_frame rtems_interrupt_frame;
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -24,6 +24,8 @@ extern "C" {
#endif
#include <rtems/system.h>
#include <rtems/types.h>
#include <rtems/init.h>
#include <rtems/tasks.h>
#include <rtems/intr.h>
@@ -43,31 +45,7 @@ extern "C" {
#include <rtems/ratemon.h>
#include <rtems/mp.h>
/*
* RTEMS basic type definitions
*/
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
typedef signed8 rtems_signed8; /* signed 8-bit value */
typedef signed16 rtems_signed16; /* signed 16-bit value */
typedef signed32 rtems_signed32; /* signed 32-bit value */
typedef signed64 rtems_signed64; /* signed 64-bit value */
typedef single_precision rtems_single; /* single precision float */
typedef double_precision rtems_double; /* double precision float */
typedef boolean rtems_boolean;
typedef Objects_Name rtems_name;
typedef Objects_Id rtems_id;
typedef Context_Control rtems_context;
typedef Context_Control_fp rtems_context_fp;
typedef CPU_Interrupt_frame rtems_interrupt_frame;
#include <rtems/support.h>
#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP

View File

@@ -32,6 +32,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
/*
@@ -78,7 +79,7 @@ void _Dual_ported_memory_Manager_initialization(
*/
rtems_status_code rtems_port_create(
Objects_Name name,
rtems_name name,
void *internal_start,
void *external_start,
unsigned32 length,
@@ -96,7 +97,7 @@ rtems_status_code rtems_port_create(
*/
rtems_status_code rtems_port_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -43,9 +43,9 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
Event_MP_Remote_operations operation;
rtems_event_set event_in;
rtems_packet_prefix Prefix;
Event_MP_Remote_operations operation;
rtems_event_set event_in;
} Event_MP_Packet;
/*

View File

@@ -34,6 +34,7 @@
extern "C" {
#endif
#include <rtems/types.h>
#include <rtems/chain.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
@@ -129,7 +130,7 @@ void _Message_queue_Manager_initialization(
*/
rtems_status_code rtems_message_queue_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
unsigned32 max_message_size,
rtems_attribute attribute_set,
@@ -151,7 +152,7 @@ rtems_status_code rtems_message_queue_create(
*/
rtems_status_code rtems_message_queue_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -57,7 +57,7 @@ typedef enum {
typedef struct {
rtems_packet_prefix Prefix;
Message_queue_MP_Remote_operations operation;
Objects_Name name;
rtems_name name;
rtems_option option_set;
Objects_Id proxy_id;
unsigned32 count;
@@ -78,7 +78,7 @@ typedef struct {
void _Message_queue_MP_Send_process_packet (
Message_queue_MP_Remote_operations operation,
Objects_Id message_queue_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -31,6 +31,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/address.h>
#include <rtems/attr.h>
#include <rtems/object.h>
@@ -83,7 +84,7 @@ void _Partition_Manager_initialization(
*/
rtems_status_code rtems_partition_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 buffer_size,
@@ -106,7 +107,7 @@ rtems_status_code rtems_partition_create(
*/
rtems_status_code rtems_partition_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -48,9 +48,9 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
rtems_packet_prefix Prefix;
Partition_MP_Remote_operations operation;
Objects_Name name;
rtems_name name;
void *buffer;
Objects_Id proxy_id;
} Partition_MP_Packet;
@@ -67,7 +67,7 @@ typedef struct {
void _Partition_MP_Send_process_packet (
Partition_MP_Remote_operations operation,
Objects_Id partition_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -29,6 +29,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/watchdog.h>
@@ -88,7 +89,7 @@ void _Rate_monotonic_Manager_initialization(
*/
rtems_status_code rtems_rate_monotonic_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
);
@@ -104,7 +105,7 @@ rtems_status_code rtems_rate_monotonic_create(
*/
rtems_status_code rtems_rate_monotonic_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -30,6 +30,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
#include <rtems/heap.h>
@@ -86,7 +87,7 @@ void _Region_Manager_initialization(
*/
rtems_status_code rtems_region_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 page_size,
@@ -123,7 +124,7 @@ rtems_status_code rtems_region_extend(
*/
rtems_status_code rtems_region_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -48,10 +48,10 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
rtems_packet_prefix Prefix;
Region_MP_Remote_operations operation;
Objects_Name name;
rtems_option option_set;
rtems_name name;
rtems_option option_set;
unsigned32 size;
Objects_Id proxy_id;
void *segment;
@@ -69,7 +69,7 @@ typedef struct {
void _Region_MP_Send_process_packet (
Region_MP_Remote_operations operation,
Objects_Id region_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -31,6 +31,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/attr.h>
#include <rtems/object.h>
#include <rtems/threadq.h>
@@ -81,7 +82,7 @@ void _Semaphore_Manager_initialization(
*/
rtems_status_code rtems_semaphore_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
rtems_attribute attribute_set,
Objects_Id *id
@@ -102,7 +103,7 @@ rtems_status_code rtems_semaphore_create(
*/
rtems_status_code rtems_semaphore_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -49,11 +49,11 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
Semaphore_MP_Remote_operations operation;
Objects_Name name;
rtems_option option_set;
Objects_Id proxy_id;
rtems_packet_prefix Prefix;
Semaphore_MP_Remote_operations operation;
rtems_name name;
rtems_option option_set;
Objects_Id proxy_id;
} Semaphore_MP_Packet;
/*
@@ -68,7 +68,7 @@ typedef struct {
void _Semaphore_MP_Send_process_packet (
Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
);

View File

@@ -43,9 +43,9 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
Signal_MP_Remote_operations operation;
rtems_signal_set signal_in;
rtems_packet_prefix Prefix;
Signal_MP_Remote_operations operation;
rtems_signal_set signal_in;
} Signal_MP_Packet;
/*

View File

@@ -0,0 +1,80 @@
/* support.h
*
* This include file contains information about support functions for
* the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_RTEMS_SUPPORT_h
#define __RTEMS_RTEMS_SUPPORT_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/types.h>
/*
* rtems_is_name_valid
*
* DESCRIPTION:
*
* This function returns TRUE if the name is valid, and FALSE otherwise.
*/
STATIC INLINE rtems_boolean rtems_is_name_valid (
rtems_name name
);
/*
* rtems_build_name
*
* DESCRIPTION:
*
* This function returns an object name composed of the four characters
* C1, C2, C3, and C4.
*
* NOTE:
*
* This must be implemented as a macro for use in Configuration Tables.
*
*/
#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
/*
* rtems_name_to_characters
*
* DESCRIPTION:
*
* This function breaks the object name into the four component
* characters C1, C2, C3, and C4.
*
*/
STATIC INLINE void rtems_name_to_characters(
rtems_name name,
char *c1,
char *c2,
char *c3,
char *c4
);
#include <rtems/support.inl>
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -54,12 +54,12 @@ typedef enum {
*/
typedef struct {
rtems_packet_prefix Prefix;
RTEMS_tasks_MP_Remote_operations operation;
Objects_Name name;
rtems_task_priority the_priority;
unsigned32 notepad;
unsigned32 note;
rtems_packet_prefix Prefix;
RTEMS_tasks_MP_Remote_operations operation;
rtems_name name;
rtems_task_priority the_priority;
unsigned32 notepad;
unsigned32 note;
} RTEMS_tasks_MP_Packet;
/*
@@ -74,7 +74,7 @@ typedef struct {
void _RTEMS_tasks_MP_Send_process_packet (
RTEMS_tasks_MP_Remote_operations operation,
Objects_Id task_id,
Objects_Name name
rtems_name name
);
/*

View File

@@ -38,6 +38,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/message.h>
#include <rtems/object.h>
#include <rtems/part.h>
@@ -74,7 +75,7 @@ extern "C" {
*/
rtems_status_code rtems_task_create(
Objects_Name name,
rtems_name name,
rtems_task_priority initial_priority,
unsigned32 stack_size,
rtems_mode initial_modes,
@@ -97,7 +98,7 @@ rtems_status_code rtems_task_create(
*/
rtems_status_code rtems_task_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
);

View File

@@ -33,6 +33,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/tod.h>
#include <rtems/watchdog.h>
@@ -95,7 +96,7 @@ void _Timer_Manager_initialization(
*/
rtems_status_code rtems_timer_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
);
@@ -111,7 +112,7 @@ rtems_status_code rtems_timer_create(
*/
rtems_status_code rtems_timer_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -0,0 +1,56 @@
/* types.h
*
* This include file defines the types used by the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_RTEMS_TYPES_h
#define __RTEMS_RTEMS_TYPES_h
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/object.h>
/*
* RTEMS basic type definitions
*/
typedef unsigned8 rtems_unsigned8; /* unsigned 8-bit value */
typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */
typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */
typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */
typedef signed8 rtems_signed8; /* signed 8-bit value */
typedef signed16 rtems_signed16; /* signed 16-bit value */
typedef signed32 rtems_signed32; /* signed 32-bit value */
typedef signed64 rtems_signed64; /* signed 64-bit value */
typedef single_precision rtems_single; /* single precision float */
typedef double_precision rtems_double; /* double precision float */
typedef boolean rtems_boolean;
typedef unsigned32 rtems_name;
typedef Objects_Id rtems_id;
typedef Context_Control rtems_context;
typedef Context_Control_fp rtems_context_fp;
typedef CPU_Interrupt_frame rtems_interrupt_frame;
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,54 @@
/* support.inl
*
* This include file contains the static inline implementation of all
* of the inlined routines specific to the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_SUPPORT_inl
#define __RTEMS_SUPPORT_inl
/*PAGE
*
* rtems_is_name_valid
*
*/
STATIC INLINE rtems_boolean rtems_is_name_valid (
rtems_name name
)
{
return ( name != 0 );
}
/*PAGE
*
* rtems_name_to_characters
*
*/
STATIC INLINE void rtems_name_to_characters(
rtems_name name,
char *c1,
char *c2,
char *c3,
char *c4
)
{
*c1 = (name >> 24) & 0xff;
*c2 = (name >> 16) & 0xff;
*c3 = (name >> 8) & 0xff;
*c4 = name & 0xff;
}
#endif
/* end of include file */

View File

@@ -17,6 +17,11 @@
#ifndef __RTEMS_TASKS_inl
#define __RTEMS_TASKS_inl
#include <rtems/msgmp.h>
#include <rtems/partmp.h>
#include <rtems/regionmp.h>
#include <rtems/semmp.h>
/*PAGE
*
* _RTEMS_tasks_Allocate

View File

@@ -0,0 +1,54 @@
/* support.inl
*
* This include file contains the static inline implementation of all
* of the inlined routines specific to the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_SUPPORT_inl
#define __RTEMS_SUPPORT_inl
/*PAGE
*
* rtems_is_name_valid
*
*/
STATIC INLINE rtems_boolean rtems_is_name_valid (
rtems_name name
)
{
return ( name != 0 );
}
/*PAGE
*
* rtems_name_to_characters
*
*/
STATIC INLINE void rtems_name_to_characters(
rtems_name name,
char *c1,
char *c2,
char *c3,
char *c4
)
{
*c1 = (name >> 24) & 0xff;
*c2 = (name >> 16) & 0xff;
*c3 = (name >> 8) & 0xff;
*c4 = name & 0xff;
}
#endif
/* end of include file */

View File

@@ -17,6 +17,11 @@
#ifndef __RTEMS_TASKS_inl
#define __RTEMS_TASKS_inl
#include <rtems/msgmp.h>
#include <rtems/partmp.h>
#include <rtems/regionmp.h>
#include <rtems/semmp.h>
/*PAGE
*
* _RTEMS_tasks_Allocate

View File

@@ -0,0 +1,44 @@
/* support.inl
*
* This include file contains the macros implementation of all
* of the inlined routines specific to the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_SUPPORT_inl
#define __RTEMS_SUPPORT_inl
/*PAGE
*
* rtems_is_name_valid
*
*/
#define rtems_is_name_valid( _name ) \
( (_name) != 0 )
/*PAGE
*
* rtems_name_to_characters
*
*/
#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
{ \
(*(_c1) = ((_name) >> 24) & 0xff; \
(*(_c2) = ((_name) >> 16) & 0xff; \
(*(_c3) = ((_name) >> 8) & 0xff; \
(*(_c4) = ((_name)) & 0xff; \
}
#endif
/* end of include file */

View File

@@ -17,6 +17,11 @@
#ifndef __RTEMS_TASKS_inl
#define __RTEMS_TASKS_inl
#include <rtems/msgmp.h>
#include <rtems/partmp.h>
#include <rtems/regionmp.h>
#include <rtems/semmp.h>
/*PAGE
*
* _RTEMS_tasks_Allocate

View File

@@ -0,0 +1,44 @@
/* support.inl
*
* This include file contains the macros implementation of all
* of the inlined routines specific to the RTEMS API.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* $Id$
*/
#ifndef __RTEMS_SUPPORT_inl
#define __RTEMS_SUPPORT_inl
/*PAGE
*
* rtems_is_name_valid
*
*/
#define rtems_is_name_valid( _name ) \
( (_name) != 0 )
/*PAGE
*
* rtems_name_to_characters
*
*/
#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
{ \
(*(_c1) = ((_name) >> 24) & 0xff; \
(*(_c2) = ((_name) >> 16) & 0xff; \
(*(_c3) = ((_name) >> 8) & 0xff; \
(*(_c4) = ((_name)) & 0xff; \
}
#endif
/* end of include file */

View File

@@ -17,6 +17,11 @@
#ifndef __RTEMS_TASKS_inl
#define __RTEMS_TASKS_inl
#include <rtems/msgmp.h>
#include <rtems/partmp.h>
#include <rtems/regionmp.h>
#include <rtems/semmp.h>
/*PAGE
*
* _RTEMS_tasks_Allocate

View File

@@ -25,7 +25,7 @@ void _Dual_ported_memory_Manager_initialization(
}
rtems_status_code rtems_port_create(
Objects_Name name,
rtems_name name,
void *internal_start,
void *external_start,
unsigned32 length,
@@ -36,7 +36,7 @@ rtems_status_code rtems_port_create(
}
rtems_status_code rtems_port_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{

View File

@@ -32,7 +32,7 @@ void _Message_queue_Manager_initialization(
}
rtems_status_code rtems_message_queue_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
unsigned32 max_message_size,
rtems_attribute attribute_set,
@@ -43,7 +43,7 @@ rtems_status_code rtems_message_queue_create(
}
rtems_status_code rtems_message_queue_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
)

View File

@@ -27,7 +27,7 @@ void _Partition_Manager_initialization(
}
rtems_status_code rtems_partition_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 buffer_size,
@@ -39,7 +39,7 @@ rtems_status_code rtems_partition_create(
}
rtems_status_code rtems_partition_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
)

View File

@@ -28,7 +28,7 @@ void _Region_Manager_initialization(
}
rtems_status_code rtems_region_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 page_size,
@@ -40,7 +40,7 @@ rtems_status_code rtems_region_create(
}
rtems_status_code rtems_region_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{

View File

@@ -26,7 +26,7 @@ void _Rate_monotonic_Manager_initialization(
}
rtems_status_code rtems_rate_monotonic_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
@@ -34,7 +34,7 @@ rtems_status_code rtems_rate_monotonic_create(
}
rtems_status_code rtems_rate_monotonic_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{

View File

@@ -31,7 +31,7 @@ void _Semaphore_Manager_initialization(
}
rtems_status_code rtems_semaphore_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
rtems_attribute attribute_set,
Objects_Id *id
@@ -41,7 +41,7 @@ rtems_status_code rtems_semaphore_create(
}
rtems_status_code rtems_semaphore_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
)

View File

@@ -27,7 +27,7 @@ void _Timer_Manager_initialization(
}
rtems_status_code rtems_timer_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
@@ -35,7 +35,7 @@ rtems_status_code rtems_timer_create(
}
rtems_status_code rtems_timer_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{

View File

@@ -13,6 +13,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/address.h>
#include <rtems/dpmem.h>
#include <rtems/object.h>
@@ -36,11 +37,13 @@ void _Dual_ported_memory_Manager_initialization(
)
{
_Objects_Initialize_information(
&_Dual_ported_memory_Information,
OBJECTS_RTEMS_PORTS,
FALSE,
maximum_ports,
sizeof( Dual_ported_memory_Control )
&_Dual_ported_memory_Information,
OBJECTS_RTEMS_PORTS,
FALSE,
maximum_ports,
sizeof( Dual_ported_memory_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -64,7 +67,7 @@ void _Dual_ported_memory_Manager_initialization(
*/
rtems_status_code rtems_port_create(
Objects_Name name,
rtems_name name,
void *internal_start,
void *external_start,
unsigned32 length,
@@ -73,7 +76,7 @@ rtems_status_code rtems_port_create(
{
register Dual_ported_memory_Control *the_port;
if ( !_Objects_Is_name_valid( name) )
if ( !rtems_is_name_valid( name) )
return ( RTEMS_INVALID_NAME );
if ( !_Addresses_Is_aligned( internal_start ) ||
@@ -93,8 +96,12 @@ rtems_status_code rtems_port_create(
the_port->external_base = external_start;
the_port->length = length - 1;
_Objects_Open( &_Dual_ported_memory_Information,
&the_port->Object, name );
_Objects_Open(
&_Dual_ported_memory_Information,
&the_port->Object,
&name
);
*id = the_port->Object.id;
_Thread_Enable_dispatch();
return( RTEMS_SUCCESSFUL );
@@ -118,14 +125,14 @@ rtems_status_code rtems_port_create(
*/
rtems_status_code rtems_port_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
return(
_Objects_Name_to_id(
&_Dual_ported_memory_Information,
name,
&name,
RTEMS_SEARCH_ALL_NODES,
id
)

View File

@@ -22,6 +22,7 @@
#include <rtems/object.h>
#include <rtems/options.h>
#include <rtems/states.h>
#include <rtems/support.h>
#include <rtems/thread.h>
#include <rtems/wkspace.h>
#include <rtems/mpci.h>
@@ -48,7 +49,9 @@ void _Message_queue_Manager_initialization(
OBJECTS_RTEMS_MESSAGE_QUEUES,
TRUE,
maximum_message_queues,
sizeof( Message_queue_Control )
sizeof( Message_queue_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -130,7 +133,7 @@ failed:
*/
rtems_status_code rtems_message_queue_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
unsigned32 max_message_size,
rtems_attribute attribute_set,
@@ -139,7 +142,7 @@ rtems_status_code rtems_message_queue_create(
{
register Message_queue_Control *the_message_queue;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( _Attributes_Is_global( attribute_set ) &&
@@ -194,8 +197,11 @@ rtems_status_code rtems_message_queue_create(
_Thread_queue_Initialize( &the_message_queue->Wait_queue, attribute_set,
STATES_WAITING_FOR_MESSAGE );
_Objects_Open( &_Message_queue_Information,
&the_message_queue->Object, name );
_Objects_Open(
&_Message_queue_Information,
&the_message_queue->Object,
&name
);
*id = the_message_queue->Object.id;
@@ -230,13 +236,17 @@ rtems_status_code rtems_message_queue_create(
*/
rtems_status_code rtems_message_queue_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
return( _Objects_Name_to_id( &_Message_queue_Information, name,
node, id ) );
return _Objects_Name_to_id(
&_Message_queue_Information,
&name,
node,
id
);
}
/*PAGE

View File

@@ -32,7 +32,7 @@
void _Message_queue_MP_Send_process_packet (
Message_queue_MP_Remote_operations operation,
Objects_Id message_queue_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
)
{
@@ -434,7 +434,7 @@ void _Message_queue_MP_Send_extract_proxy (
_Message_queue_MP_Send_process_packet(
MESSAGE_QUEUE_MP_EXTRACT_PROXY,
the_thread->Wait.id,
(Objects_Name) 0,
(rtems_name) 0,
the_thread->Object.id
);
}

View File

@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/address.h>
#include <rtems/config.h>
#include <rtems/object.h>
@@ -42,7 +43,9 @@ void _Partition_Manager_initialization(
OBJECTS_RTEMS_PARTITIONS,
TRUE,
maximum_partitions,
sizeof( Partition_Control )
sizeof( Partition_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -69,7 +72,7 @@ void _Partition_Manager_initialization(
*/
rtems_status_code rtems_partition_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 buffer_size,
@@ -79,7 +82,7 @@ rtems_status_code rtems_partition_create(
{
register Partition_Control *the_partition;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
@@ -118,7 +121,7 @@ rtems_status_code rtems_partition_create(
_Chain_Initialize( &the_partition->Memory, starting_address,
length / buffer_size, buffer_size );
_Objects_Open( &_Partition_Information, &the_partition->Object, name );
_Objects_Open( &_Partition_Information, &the_partition->Object, &name );
*id = the_partition->Object.id;
if ( _Attributes_Is_global( attribute_set ) )
@@ -152,12 +155,12 @@ rtems_status_code rtems_partition_create(
*/
rtems_status_code rtems_partition_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
return( _Objects_Name_to_id( &_Partition_Information, name, node, id ) );
return _Objects_Name_to_id( &_Partition_Information, &name, node, id );
}
/*PAGE

View File

@@ -30,7 +30,7 @@
void _Partition_MP_Send_process_packet (
Partition_MP_Remote_operations operation,
Objects_Id partition_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
)
{
@@ -280,7 +280,7 @@ void _Partition_MP_Send_extract_proxy (
_Partition_MP_Send_process_packet(
PARTITION_MP_EXTRACT_PROXY,
the_thread->Wait.id,
(Objects_Name) 0,
(rtems_name) 0,
the_thread->Object.id
);

View File

@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/isr.h>
#include <rtems/object.h>
#include <rtems/ratemon.h>
@@ -40,11 +41,13 @@ void _Rate_monotonic_Manager_initialization(
)
{
_Objects_Initialize_information(
&_Rate_monotonic_Information,
OBJECTS_RTEMS_PERIODS,
FALSE,
maximum_periods,
sizeof( Rate_monotonic_Control )
&_Rate_monotonic_Information,
OBJECTS_RTEMS_PERIODS,
FALSE,
maximum_periods,
sizeof( Rate_monotonic_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -66,13 +69,13 @@ void _Rate_monotonic_Manager_initialization(
*/
rtems_status_code rtems_rate_monotonic_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
Rate_monotonic_Control *the_period;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return( RTEMS_INVALID_NAME );
_Thread_Disable_dispatch(); /* to prevent deletion */
@@ -87,7 +90,7 @@ rtems_status_code rtems_rate_monotonic_create(
the_period->owner = _Thread_Executing;
the_period->state = RATE_MONOTONIC_INACTIVE;
_Objects_Open( &_Rate_monotonic_Information, &the_period->Object, name );
_Objects_Open( &_Rate_monotonic_Information, &the_period->Object, &name );
*id = the_period->Object.id;
_Thread_Enable_dispatch();
@@ -112,13 +115,13 @@ rtems_status_code rtems_rate_monotonic_create(
*/
rtems_status_code rtems_rate_monotonic_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Rate_monotonic_Information,
name,
&name,
RTEMS_SEARCH_LOCAL_NODE,
id
);

View File

@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/config.h>
#include <rtems/object.h>
#include <rtems/options.h>
@@ -38,12 +39,14 @@ void _Region_Manager_initialization(
)
{
_Objects_Initialize_information(
&_Region_Information,
OBJECTS_RTEMS_REGIONS,
FALSE,
maximum_regions,
sizeof( Region_Control )
);
&_Region_Information,
OBJECTS_RTEMS_REGIONS,
FALSE,
maximum_regions,
sizeof( Region_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
/*PAGE
@@ -68,7 +71,7 @@ void _Region_Manager_initialization(
*/
rtems_status_code rtems_region_create(
Objects_Name name,
rtems_name name,
void *starting_address,
unsigned32 length,
unsigned32 page_size,
@@ -78,7 +81,7 @@ rtems_status_code rtems_region_create(
{
Region_Control *the_region;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( !_Addresses_Is_aligned( starting_address ) )
@@ -111,7 +114,7 @@ rtems_status_code rtems_region_create(
_Thread_queue_Initialize(
&the_region->Wait_queue, attribute_set, STATES_WAITING_FOR_SEGMENT );
_Objects_Open( &_Region_Information, &the_region->Object, name );
_Objects_Open( &_Region_Information, &the_region->Object, &name );
*id = the_region->Object.id;
_Thread_Enable_dispatch();
@@ -136,13 +139,13 @@ rtems_status_code rtems_region_create(
*/
rtems_status_code rtems_region_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Region_Information,
name,
&name,
RTEMS_SEARCH_LOCAL_NODE,
id
);

View File

@@ -30,7 +30,7 @@
void _Region_MP_Send_process_packet (
Region_MP_Remote_operations operation,
Objects_Id region_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
)
{
@@ -289,7 +289,7 @@ void _Region_MP_Send_extract_proxy (
_Region_MP_Send_process_packet(
REGION_MP_EXTRACT_PROXY,
the_thread->Wait.id,
(Objects_Name) 0,
(rtems_name) 0,
the_thread->Object.id
);
}

View File

@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/timer.h>
@@ -37,11 +38,13 @@ void _Timer_Manager_initialization(
)
{
_Objects_Initialize_information(
&_Timer_Information,
OBJECTS_RTEMS_TIMERS,
FALSE,
maximum_timers,
sizeof( Timer_Control )
&_Timer_Information,
OBJECTS_RTEMS_TIMERS,
FALSE,
maximum_timers,
sizeof( Timer_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -62,13 +65,13 @@ void _Timer_Manager_initialization(
*/
rtems_status_code rtems_timer_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
Timer_Control *the_timer;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
_Thread_Disable_dispatch(); /* to prevent deletion */
@@ -82,7 +85,7 @@ rtems_status_code rtems_timer_create(
the_timer->the_class = TIMER_DORMANT;
_Objects_Open( &_Timer_Information, &the_timer->Object, name );
_Objects_Open( &_Timer_Information, &the_timer->Object, &name );
*id = the_timer->Object.id;
_Thread_Enable_dispatch();
@@ -107,13 +110,13 @@ rtems_status_code rtems_timer_create(
*/
rtems_status_code rtems_timer_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Timer_Information,
name,
&name,
RTEMS_SEARCH_LOCAL_NODE,
id
);

View File

@@ -27,6 +27,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/attr.h>
#include <rtems/config.h>
#include <rtems/isr.h>
@@ -56,10 +57,12 @@ void _Semaphore_Manager_initialization(
{
_Objects_Initialize_information(
&_Semaphore_Information,
OBJECTS_RTEMS_SEMAPHORES,
OBJECTS_RTEMS_SEMAPHORES,
TRUE,
maximum_semaphores,
sizeof( Semaphore_Control )
sizeof( Semaphore_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -83,7 +86,7 @@ void _Semaphore_Manager_initialization(
*/
rtems_status_code rtems_semaphore_create(
Objects_Name name,
rtems_name name,
unsigned32 count,
rtems_attribute attribute_set,
Objects_Id *id
@@ -91,7 +94,7 @@ rtems_status_code rtems_semaphore_create(
{
register Semaphore_Control *the_semaphore;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
if ( _Attributes_Is_global( attribute_set ) ) {
@@ -147,7 +150,7 @@ rtems_status_code rtems_semaphore_create(
_Thread_queue_Initialize( &the_semaphore->Wait_queue,
attribute_set, STATES_WAITING_FOR_SEMAPHORE );
_Objects_Open( &_Semaphore_Information, &the_semaphore->Object, name );
_Objects_Open( &_Semaphore_Information, &the_semaphore->Object, &name );
*id = the_semaphore->Object.id;
@@ -181,12 +184,12 @@ rtems_status_code rtems_semaphore_create(
*/
rtems_status_code rtems_semaphore_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
return( _Objects_Name_to_id( &_Semaphore_Information, name, node, id ) );
return( _Objects_Name_to_id( &_Semaphore_Information, &name, node, id ) );
}
/*PAGE

View File

@@ -31,7 +31,7 @@
void _Semaphore_MP_Send_process_packet (
Semaphore_MP_Remote_operations operation,
Objects_Id semaphore_id,
Objects_Name name,
rtems_name name,
Objects_Id proxy_id
)
{
@@ -286,7 +286,7 @@ void _Semaphore_MP_Send_extract_proxy (
_Semaphore_MP_Send_process_packet(
SEMAPHORE_MP_EXTRACT_PROXY,
the_thread->Wait.id,
(Objects_Name) 0,
(rtems_name) 0,
the_thread->Object.id
);

View File

@@ -31,7 +31,7 @@
void _RTEMS_tasks_MP_Send_process_packet (
RTEMS_tasks_MP_Remote_operations operation,
Objects_Id task_id,
Objects_Name name
rtems_name name
)
{
RTEMS_tasks_MP_Packet *the_packet;

View File

@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/modes.h>
#include <rtems/object.h>
#include <rtems/stack.h>
@@ -48,7 +49,7 @@
*/
rtems_status_code rtems_task_create(
Objects_Name name,
rtems_name name,
rtems_task_priority initial_priority,
unsigned32 stack_size,
rtems_mode initial_modes,
@@ -62,7 +63,7 @@ rtems_status_code rtems_task_create(
void *memory;
rtems_attribute the_attribute_set;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
#if 0
@@ -156,7 +157,7 @@ rtems_status_code rtems_task_create(
_ASR_Initialize( &the_thread->Signal );
_Objects_Open( &_Thread_Information, &the_thread->Object, name );
_Objects_Open( &_Thread_Information, &the_thread->Object, &name );
*id = the_thread->Object.id;
@@ -192,13 +193,13 @@ rtems_status_code rtems_task_create(
*/
rtems_status_code rtems_task_ident(
Objects_Name name,
rtems_name name,
unsigned32 node,
Objects_Id *id
)
{
if ( name != OBJECTS_ID_OF_SELF )
return( _Objects_Name_to_id( &_Thread_Information, name, node, id ) );
return( _Objects_Name_to_id( &_Thread_Information, &name, node, id ) );
*id = _Thread_Executing->Object.id;
return( RTEMS_SUCCESSFUL );

View File

@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/timer.h>
@@ -37,11 +38,13 @@ void _Timer_Manager_initialization(
)
{
_Objects_Initialize_information(
&_Timer_Information,
OBJECTS_RTEMS_TIMERS,
FALSE,
maximum_timers,
sizeof( Timer_Control )
&_Timer_Information,
OBJECTS_RTEMS_TIMERS,
FALSE,
maximum_timers,
sizeof( Timer_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -62,13 +65,13 @@ void _Timer_Manager_initialization(
*/
rtems_status_code rtems_timer_create(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
Timer_Control *the_timer;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
_Thread_Disable_dispatch(); /* to prevent deletion */
@@ -82,7 +85,7 @@ rtems_status_code rtems_timer_create(
the_timer->the_class = TIMER_DORMANT;
_Objects_Open( &_Timer_Information, &the_timer->Object, name );
_Objects_Open( &_Timer_Information, &the_timer->Object, &name );
*id = the_timer->Object.id;
_Thread_Enable_dispatch();
@@ -107,13 +110,13 @@ rtems_status_code rtems_timer_create(
*/
rtems_status_code rtems_timer_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Timer_Information,
name,
&name,
RTEMS_SEARCH_LOCAL_NODE,
id
);

View File

@@ -21,6 +21,7 @@
extern "C" {
#endif
#include <rtems/types.h>
#include <rtems/object.h>
#include <rtems/thread.h>
@@ -32,7 +33,7 @@ extern "C" {
*/
typedef struct {
Objects_Name name; /* task name */
rtems_name name; /* task name */
unsigned32 stack_size; /* task stack size */
rtems_task_priority initial_priority; /* task priority */
rtems_attribute attribute_set; /* task attributes */

View File

@@ -28,6 +28,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/userext.h>
@@ -72,7 +73,7 @@ void _Extension_Manager_initialization(
*/
rtems_status_code rtems_extension_create(
Objects_Name name,
rtems_name name,
rtems_extensions_table *extension_table,
Objects_Id *id
);
@@ -89,7 +90,7 @@ rtems_status_code rtems_extension_create(
*/
rtems_status_code rtems_extension_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -30,6 +30,7 @@
extern "C" {
#endif
#include <rtems/types.h>
#include <rtems/config.h>
#include <rtems/intr.h>

View File

@@ -21,6 +21,7 @@
extern "C" {
#endif
#include <rtems/types.h>
#include <rtems/object.h>
#include <rtems/thread.h>
@@ -32,7 +33,7 @@ extern "C" {
*/
typedef struct {
Objects_Name name; /* task name */
rtems_name name; /* task name */
unsigned32 stack_size; /* task stack size */
rtems_task_priority initial_priority; /* task priority */
rtems_attribute attribute_set; /* task attributes */

View File

@@ -28,6 +28,7 @@
extern "C" {
#endif
#include <rtems.h>
#include <rtems/object.h>
#include <rtems/userext.h>
@@ -72,7 +73,7 @@ void _Extension_Manager_initialization(
*/
rtems_status_code rtems_extension_create(
Objects_Name name,
rtems_name name,
rtems_extensions_table *extension_table,
Objects_Id *id
);
@@ -89,7 +90,7 @@ rtems_status_code rtems_extension_create(
*/
rtems_status_code rtems_extension_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
);

View File

@@ -30,6 +30,7 @@
extern "C" {
#endif
#include <rtems/types.h>
#include <rtems/config.h>
#include <rtems/intr.h>

View File

@@ -25,7 +25,7 @@ void _Extension_Manager_initialization(
}
rtems_status_code rtems_extension_create(
Objects_Name name,
rtems_name name,
rtems_extensions_table *extension_table,
Objects_Id *id
)
@@ -34,7 +34,7 @@ rtems_status_code rtems_extension_create(
}
rtems_status_code rtems_extension_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{

View File

@@ -14,6 +14,7 @@
*/
#include <rtems/system.h>
#include <rtems/support.h>
#include <rtems/object.h>
#include <rtems/thread.h>
#include <rtems/extension.h>
@@ -35,11 +36,13 @@ void _Extension_Manager_initialization(
)
{
_Objects_Initialize_information(
&_Extension_Information,
OBJECTS_RTEMS_EXTENSIONS,
FALSE,
maximum_extensions,
sizeof( Extension_Control )
&_Extension_Information,
OBJECTS_RTEMS_EXTENSIONS,
FALSE,
maximum_extensions,
sizeof( Extension_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
}
@@ -61,14 +64,14 @@ void _Extension_Manager_initialization(
*/
rtems_status_code rtems_extension_create(
Objects_Name name,
rtems_name name,
rtems_extensions_table *extension_table,
Objects_Id *id
)
{
Extension_Control *the_extension;
if ( !_Objects_Is_name_valid( name ) )
if ( !rtems_is_name_valid( name ) )
return ( RTEMS_INVALID_NAME );
_Thread_Disable_dispatch(); /* to prevent deletion */
@@ -82,7 +85,7 @@ rtems_status_code rtems_extension_create(
_User_extensions_Add_set( &the_extension->Extension, extension_table );
_Objects_Open( &_Extension_Information, &the_extension->Object, name );
_Objects_Open( &_Extension_Information, &the_extension->Object, &name );
*id = the_extension->Object.id;
_Thread_Enable_dispatch();
@@ -107,13 +110,13 @@ rtems_status_code rtems_extension_create(
*/
rtems_status_code rtems_extension_ident(
Objects_Name name,
rtems_name name,
Objects_Id *id
)
{
return _Objects_Name_to_id(
&_Extension_Information,
name,
&name,
RTEMS_SEARCH_LOCAL_NODE,
id
);

View File

@@ -29,7 +29,25 @@ extern "C" {
* object names.
*/
typedef unsigned32 Objects_Name;
typedef void * Objects_Name;
/*
* Space for object names is allocated in multiples of this.
*
* NOTE: Must be a power of 2. Matches the name manipulation routines.
*/
#define OBJECTS_NAME_ALIGNMENT 4
/*
* Functions which compare names are prototyped like this.
*/
typedef boolean (*Objects_Name_comparators)(
void * /* name_1 */,
void * /* name_2 */,
unsigned32 /* length */
);
/*
* The following type defines the control block used to manage
@@ -91,7 +109,7 @@ typedef enum {
typedef struct {
Chain_Node Node;
Objects_Id id;
Objects_Name *name;
Objects_Name name;
} Objects_Control;
/*
@@ -108,6 +126,8 @@ typedef struct {
Objects_Name *name_table; /* table of local object names */
Chain_Control *global_table; /* pointer to global table */
Chain_Control Inactive; /* chain of inactive ctl blocks */
boolean is_string; /* TRUE if names are strings */
unsigned32 name_length; /* maximum length of names */
} Objects_Information;
/*
@@ -179,9 +199,78 @@ void _Objects_Initialize_information (
Objects_Classes the_class,
boolean supports_global,
unsigned32 maximum,
unsigned32 size
unsigned32 size,
boolean is_string,
unsigned32 maximum_name_length
);
/*
* _Objects_Clear_name
*
* DESCRIPTION:
*
* XXX
*/
void _Objects_Clear_name(
void *name,
unsigned32 length
);
/*
* _Objects_Copy_name_string
*
* DESCRIPTION:
*
* XXX
*/
void _Objects_Copy_name_string(
void *source,
void *destination
);
/*
* _Objects_Copy_name_raw
*
* DESCRIPTION:
*
* XXX
*/
void _Objects_Copy_name_raw(
void *source,
void *destination,
unsigned32 length
);
/*
* _Objects_Compare_name_string
*
* DESCRIPTION:
*
* XXX
*/
boolean _Objects_Compare_name_string(
void *name_1,
void *name_2,
unsigned32 length
);
/*
* _Objects_Compare_name_raw
*
* DESCRIPTION:
*
* XXX
*/
boolean _Objects_Compare_name_raw(
void *name_1,
void *name_2,
unsigned32 length
);
/*
* _Objects_Name_to_id
*
@@ -243,53 +332,6 @@ Objects_Control *_Objects_Get_next(
Objects_Id *next_id_p
);
/*
* _Objects_Is_name_valid
*
* DESCRIPTION:
*
* This function returns TRUE if the name is valid, and FALSE otherwise.
*/
STATIC INLINE boolean _Objects_Is_name_valid (
Objects_Name name
);
/*
* rtems_build_name
*
* DESCRIPTION:
*
* This function returns an object name composed of the four characters
* C1, C2, C3, and C4.
*
* NOTE:
*
* This must be implemented as a macro for use in Configuration Tables.
*
*/
#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
/*
* rtems_name_to_characters
*
* DESCRIPTION:
*
* This function breaks the object name into the four component
* characters C1, C2, C3, and C4.
*
*/
STATIC INLINE void rtems_name_to_characters(
Objects_Name name,
char *c1,
char *c2,
char *c3,
char *c4
);
/*
* _Objects_Build_id
*

View File

@@ -28,7 +28,8 @@ extern "C" {
typedef struct {
Objects_Control Object;
Objects_Name name;
unsigned32 name; /* XXX broken but works */
/* XXX If any API is MP with variable length names .. BOOM!!!! */
} Objects_MP_Control;
/*
@@ -93,7 +94,7 @@ STATIC INLINE boolean _Objects_MP_Is_null_global_object (
boolean _Objects_MP_Open (
Objects_Information *information,
Objects_Name the_name,
unsigned32 the_name, /* XXX -- wrong for variable length */
Objects_Id the_id,
boolean is_fatal_error
);

View File

@@ -127,6 +127,12 @@ extern const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ];
EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
/*
* XXX weird RTEMS stuff
*/
#define RTEMS_MAXIMUM_NAME_LENGTH 4
#ifdef __cplusplus
}
#endif

View File

@@ -29,7 +29,25 @@ extern "C" {
* object names.
*/
typedef unsigned32 Objects_Name;
typedef void * Objects_Name;
/*
* Space for object names is allocated in multiples of this.
*
* NOTE: Must be a power of 2. Matches the name manipulation routines.
*/
#define OBJECTS_NAME_ALIGNMENT 4
/*
* Functions which compare names are prototyped like this.
*/
typedef boolean (*Objects_Name_comparators)(
void * /* name_1 */,
void * /* name_2 */,
unsigned32 /* length */
);
/*
* The following type defines the control block used to manage
@@ -91,7 +109,7 @@ typedef enum {
typedef struct {
Chain_Node Node;
Objects_Id id;
Objects_Name *name;
Objects_Name name;
} Objects_Control;
/*
@@ -108,6 +126,8 @@ typedef struct {
Objects_Name *name_table; /* table of local object names */
Chain_Control *global_table; /* pointer to global table */
Chain_Control Inactive; /* chain of inactive ctl blocks */
boolean is_string; /* TRUE if names are strings */
unsigned32 name_length; /* maximum length of names */
} Objects_Information;
/*
@@ -179,9 +199,78 @@ void _Objects_Initialize_information (
Objects_Classes the_class,
boolean supports_global,
unsigned32 maximum,
unsigned32 size
unsigned32 size,
boolean is_string,
unsigned32 maximum_name_length
);
/*
* _Objects_Clear_name
*
* DESCRIPTION:
*
* XXX
*/
void _Objects_Clear_name(
void *name,
unsigned32 length
);
/*
* _Objects_Copy_name_string
*
* DESCRIPTION:
*
* XXX
*/
void _Objects_Copy_name_string(
void *source,
void *destination
);
/*
* _Objects_Copy_name_raw
*
* DESCRIPTION:
*
* XXX
*/
void _Objects_Copy_name_raw(
void *source,
void *destination,
unsigned32 length
);
/*
* _Objects_Compare_name_string
*
* DESCRIPTION:
*
* XXX
*/
boolean _Objects_Compare_name_string(
void *name_1,
void *name_2,
unsigned32 length
);
/*
* _Objects_Compare_name_raw
*
* DESCRIPTION:
*
* XXX
*/
boolean _Objects_Compare_name_raw(
void *name_1,
void *name_2,
unsigned32 length
);
/*
* _Objects_Name_to_id
*
@@ -243,53 +332,6 @@ Objects_Control *_Objects_Get_next(
Objects_Id *next_id_p
);
/*
* _Objects_Is_name_valid
*
* DESCRIPTION:
*
* This function returns TRUE if the name is valid, and FALSE otherwise.
*/
STATIC INLINE boolean _Objects_Is_name_valid (
Objects_Name name
);
/*
* rtems_build_name
*
* DESCRIPTION:
*
* This function returns an object name composed of the four characters
* C1, C2, C3, and C4.
*
* NOTE:
*
* This must be implemented as a macro for use in Configuration Tables.
*
*/
#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
/*
* rtems_name_to_characters
*
* DESCRIPTION:
*
* This function breaks the object name into the four component
* characters C1, C2, C3, and C4.
*
*/
STATIC INLINE void rtems_name_to_characters(
Objects_Name name,
char *c1,
char *c2,
char *c3,
char *c4
);
/*
* _Objects_Build_id
*

View File

@@ -28,7 +28,8 @@ extern "C" {
typedef struct {
Objects_Control Object;
Objects_Name name;
unsigned32 name; /* XXX broken but works */
/* XXX If any API is MP with variable length names .. BOOM!!!! */
} Objects_MP_Control;
/*
@@ -93,7 +94,7 @@ STATIC INLINE boolean _Objects_MP_Is_null_global_object (
boolean _Objects_MP_Open (
Objects_Information *information,
Objects_Name the_name,
unsigned32 the_name, /* XXX -- wrong for variable length */
Objects_Id the_id,
boolean is_fatal_error
);

View File

@@ -127,6 +127,12 @@ extern const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ];
EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
/*
* XXX weird RTEMS stuff
*/
#define RTEMS_MAXIMUM_NAME_LENGTH 4
#ifdef __cplusplus
}
#endif

View File

@@ -17,39 +17,6 @@
#ifndef __OBJECTS_inl
#define __OBJECTS_inl
/*PAGE
*
* _Objects_Is_name_valid
*
*/
STATIC INLINE boolean _Objects_Is_name_valid (
Objects_Name name
)
{
return ( name != 0 );
}
/*PAGE
*
* rtems_name_to_characters
*
*/
STATIC INLINE void rtems_name_to_characters(
Objects_Name name,
char *c1,
char *c2,
char *c3,
char *c4
)
{
*c1 = (name >> 24) & 0xff;
*c2 = (name >> 16) & 0xff;
*c3 = (name >> 8) & 0xff;
*c4 = name & 0xff;
}
/*PAGE
*
* _Objects_Build_id
@@ -186,12 +153,15 @@ STATIC INLINE void _Objects_Open(
Objects_Name name
)
{
unsigned32 index;
unsigned32 index;
index = rtems_get_index( the_object->id );
information->local_table[ index ] = the_object;
information->name_table[ index ] = name;
the_object->name = &information->name_table[ index ];
if ( information->is_string )
_Objects_Copy_name_string( name, the_object->name );
else
_Objects_Copy_name_raw( name, the_object->name, information->name_length );
}
/*PAGE
@@ -209,8 +179,7 @@ STATIC INLINE void _Objects_Close(
index = rtems_get_index( the_object->id );
information->local_table[ index ] = NULL;
information->name_table[ index ] = 0;
the_object->name = 0;
_Objects_Clear_name( the_object->name, information->name_length );
}
#endif

View File

@@ -17,39 +17,6 @@
#ifndef __OBJECTS_inl
#define __OBJECTS_inl
/*PAGE
*
* _Objects_Is_name_valid
*
*/
STATIC INLINE boolean _Objects_Is_name_valid (
Objects_Name name
)
{
return ( name != 0 );
}
/*PAGE
*
* rtems_name_to_characters
*
*/
STATIC INLINE void rtems_name_to_characters(
Objects_Name name,
char *c1,
char *c2,
char *c3,
char *c4
)
{
*c1 = (name >> 24) & 0xff;
*c2 = (name >> 16) & 0xff;
*c3 = (name >> 8) & 0xff;
*c4 = name & 0xff;
}
/*PAGE
*
* _Objects_Build_id
@@ -186,12 +153,15 @@ STATIC INLINE void _Objects_Open(
Objects_Name name
)
{
unsigned32 index;
unsigned32 index;
index = rtems_get_index( the_object->id );
information->local_table[ index ] = the_object;
information->name_table[ index ] = name;
the_object->name = &information->name_table[ index ];
if ( information->is_string )
_Objects_Copy_name_string( name, the_object->name );
else
_Objects_Copy_name_raw( name, the_object->name, information->name_length );
}
/*PAGE
@@ -209,8 +179,7 @@ STATIC INLINE void _Objects_Close(
index = rtems_get_index( the_object->id );
information->local_table[ index ] = NULL;
information->name_table[ index ] = 0;
the_object->name = 0;
_Objects_Clear_name( the_object->name, information->name_length );
}
#endif

View File

@@ -17,28 +17,6 @@
#ifndef __OBJECTS_inl
#define __OBJECTS_inl
/*PAGE
*
* _Objects_Is_name_valid
*
*/
#define _Objects_Is_name_valid( _name ) \
( (_name) != 0 )
/*
* rtems_name_to_characters
*
*/
#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
{ \
(*(_c1) = ((_name) >> 24) & 0xff; \
(*(_c2) = ((_name) >> 16) & 0xff; \
(*(_c3) = ((_name) >> 8) & 0xff; \
(*(_c4) = ((_name)) & 0xff; \
}
/*PAGE
*
* _Objects_Build_id
@@ -134,8 +112,12 @@
\
_index = rtems_get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = (_the_object); \
(_information)->name_table[ _index ] = (_name); \
(_the_object)->name = &(_information)->name_table[ _index ]; \
\
if ( (_information)->is_string ) \
_Objects_Copy_name_string( (_name), (_the_object)->name ); \
else \
_Objects_Copy_name_raw( \
(_name), (_the_object)->name, (_information)->name_length ); \
}
/*PAGE
@@ -150,8 +132,7 @@
\
_index = rtems_get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = NULL; \
(_information)->name_table[ _index ] = 0; \
(_the_object)->name = 0; \
_Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
}
#endif

View File

@@ -17,28 +17,6 @@
#ifndef __OBJECTS_inl
#define __OBJECTS_inl
/*PAGE
*
* _Objects_Is_name_valid
*
*/
#define _Objects_Is_name_valid( _name ) \
( (_name) != 0 )
/*
* rtems_name_to_characters
*
*/
#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
{ \
(*(_c1) = ((_name) >> 24) & 0xff; \
(*(_c2) = ((_name) >> 16) & 0xff; \
(*(_c3) = ((_name) >> 8) & 0xff; \
(*(_c4) = ((_name)) & 0xff; \
}
/*PAGE
*
* _Objects_Build_id
@@ -134,8 +112,12 @@
\
_index = rtems_get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = (_the_object); \
(_information)->name_table[ _index ] = (_name); \
(_the_object)->name = &(_information)->name_table[ _index ]; \
\
if ( (_information)->is_string ) \
_Objects_Copy_name_string( (_name), (_the_object)->name ); \
else \
_Objects_Copy_name_raw( \
(_name), (_the_object)->name, (_information)->name_length ); \
}
/*PAGE
@@ -150,8 +132,7 @@
\
_index = rtems_get_index( (_the_object)->id ); \
(_information)->local_table[ _index ] = NULL; \
(_information)->name_table[ _index ] = 0; \
(_the_object)->name = 0; \
_Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
}
#endif

View File

@@ -55,6 +55,7 @@ void _Objects_Handler_initialization(
* the_class - object class
* supports_global - TRUE if this is a global object class
* maximum - maximum objects of this class
* is_string - TRUE if names for this object are strings
* size - size of this object's control block
*
* Output parameters: NONE
@@ -65,15 +66,24 @@ void _Objects_Initialize_information(
Objects_Classes the_class,
boolean supports_global,
unsigned32 maximum,
unsigned32 size
unsigned32 size,
boolean is_string,
unsigned32 maximum_name_length
)
{
unsigned32 minimum_index;
unsigned32 index;
Objects_Control *the_object;
unsigned32 name_length;
void *name_area;
information->maximum = maximum;
information->the_class = the_class;
information->is_string = is_string;
/*
* Calculate minimum and maximum Id's
*/
if ( maximum == 0 ) minimum_index = 0;
else minimum_index = 1;
@@ -84,24 +94,45 @@ void _Objects_Initialize_information(
information->maximum_id =
_Objects_Build_id( the_class, _Objects_Local_node, maximum );
/*
* Allocate local pointer table
*/
information->local_table = _Workspace_Allocate_or_fatal_error(
(maximum + 1) * sizeof(Objects_Control *)
);
information->name_table = _Workspace_Allocate_or_fatal_error(
(maximum + 1) * sizeof(Objects_Name)
);
/*
* Allocate name table
*/
for ( index=0 ; index < maximum ; index++ ) {
name_length = maximum_name_length;
if (name_length & (OBJECTS_NAME_ALIGNMENT-1))
name_length = (name_length + OBJECTS_NAME_ALIGNMENT) &
~(OBJECTS_NAME_ALIGNMENT-1);
information->name_length = name_length;
name_area = _Workspace_Allocate_or_fatal_error( (maximum + 1) * name_length );
information->name_table = name_area;
/*
* Initialize local pointer table
*/
for ( index=0 ; index <= maximum ; index++ ) {
information->local_table[ index ] = NULL;
information->name_table[ index ] = 0;
}
/*
* Initialize objects .. if there are any
*/
if ( maximum == 0 ) {
_Chain_Initialize_empty( &information->Inactive );
} else {
_Chain_Initialize(
&information->Inactive,
_Workspace_Allocate_or_fatal_error( maximum * size ),
@@ -110,31 +141,151 @@ void _Objects_Initialize_information(
);
the_object = (Objects_Control *) information->Inactive.first;
for ( index=1;
index <= maximum ;
index++ ) {
for ( index=1; index <= maximum ; index++ ) {
the_object->id =
_Objects_Build_id( the_class, _Objects_Local_node, index );
the_object->name = (void *) name_area;
name_area = _Addresses_Add_offset( name_area, name_length );
the_object = (Objects_Control *) the_object->Node.next;
}
}
if ( supports_global == TRUE && _Configuration_Is_multiprocessing() ) {
/*
* Take care of multiprocessing
*/
information->global_table = _Workspace_Allocate_or_fatal_error(
(_Configuration_MP_table->maximum_nodes + 1) * sizeof(Chain_Control)
);
if ( supports_global == TRUE && _Configuration_Is_multiprocessing() ) {
for ( index=1;
index <= _Configuration_MP_table->maximum_nodes ;
index++ )
_Chain_Initialize_empty( &information->global_table[ index ] );
}
else
information->global_table = NULL;
information->global_table = _Workspace_Allocate_or_fatal_error(
(_Configuration_MP_table->maximum_nodes + 1) * sizeof(Chain_Control)
);
for ( index=1;
index <= _Configuration_MP_table->maximum_nodes ;
index++ )
_Chain_Initialize_empty( &information->global_table[ index ] );
}
else
information->global_table = NULL;
}
/*PAGE
*
* _Objects_Clear_name
*
* XXX
*/
void _Objects_Clear_name(
void *name,
unsigned32 length
)
{
unsigned32 index;
unsigned32 maximum = length / OBJECTS_NAME_ALIGNMENT;
unsigned32 *name_ptr = name;
for ( index=0 ; index < maximum ; index++ )
*name_ptr++ = 0;
}
/*PAGE
*
* _Objects_Copy_name_string
*
* XXX
*/
void _Objects_Copy_name_string(
void *source,
void *destination
)
{
unsigned8 *source_p = source;
unsigned8 *destination_p = destination;
do {
*destination_p++ = *source_p;
} while ( *source_p++ );
}
/*PAGE
*
* _Objects_Copy_name_raw
*
* XXX
*/
void _Objects_Copy_name_raw(
void *source,
void *destination,
unsigned32 length
)
{
unsigned32 *source_p = source;
unsigned32 *destination_p = destination;
unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
while ( tmp_length-- )
*destination_p++ = *source_p++;
}
/*PAGE
*
* _Objects_Compare_name_string
*
* XXX
*/
boolean _Objects_Compare_name_string(
void *name_1,
void *name_2,
unsigned32 length
)
{
unsigned8 *name_1_p = name_1;
unsigned8 *name_2_p = name_2;
unsigned32 tmp_length = length;
do {
if ( *name_1_p++ != *name_2_p++ )
return FALSE;
if ( !tmp_length-- )
return FALSE;
} while ( *name_1_p );
return TRUE;
}
/*PAGE
*
* _Objects_Compare_name_raw
*
* XXX
*/
boolean _Objects_Compare_name_raw(
void *name_1,
void *name_2,
unsigned32 length
)
{
unsigned32 *name_1_p = name_1;
unsigned32 *name_2_p = name_2;
unsigned32 tmp_length = length / OBJECTS_NAME_ALIGNMENT;
while ( tmp_length-- )
if ( *name_1_p++ != *name_2_p++ )
return FALSE;
return TRUE;
}
/*PAGE
*
* _Objects_Name_to_id
@@ -156,15 +307,17 @@ void _Objects_Initialize_information(
rtems_status_code _Objects_Name_to_id(
Objects_Information *information,
Objects_Name name,
unsigned32 node,
Objects_Id *id
Objects_Name name,
unsigned32 node,
Objects_Id *id
)
{
boolean search_local_node;
Objects_Control **objects;
Objects_Control *the_object;
unsigned32 index;
boolean search_local_node;
Objects_Control **objects;
Objects_Control *the_object;
unsigned32 index;
unsigned32 name_length;
Objects_Name_comparators compare_them;
if ( name == 0 )
return( RTEMS_INVALID_NAME );
@@ -179,6 +332,11 @@ rtems_status_code _Objects_Name_to_id(
if ( search_local_node ) {
objects = information->local_table;
name_length = information->name_length;
if ( information->is_string ) compare_them = _Objects_Compare_name_string;
else compare_them = _Objects_Compare_name_raw;
for ( index = 1; index <= information->maximum; index++ ) {
the_object = objects[ index ];
@@ -186,7 +344,7 @@ rtems_status_code _Objects_Name_to_id(
if ( !the_object || !the_object->name )
continue;
if ( name == *the_object->name ) {
if ( (*compare_them)( name, the_object->name, name_length ) ) {
*id = the_object->id;
return( RTEMS_SUCCESSFUL );
}

View File

@@ -53,12 +53,12 @@ void _Objects_MP_Handler_initialization (
boolean _Objects_MP_Open (
Objects_Information *information,
Objects_Name the_name,
unsigned32 the_name, /* XXX -- wrong for variable */
Objects_Id the_id,
boolean is_fatal_error
)
{
Objects_MP_Control *the_global_object;
Objects_MP_Control *the_global_object;
the_global_object = _Objects_MP_Allocate_global_object();
if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
@@ -139,6 +139,7 @@ rtems_status_code _Objects_MP_Global_name_search (
Chain_Control *the_chain;
Chain_Node *the_node;
Objects_MP_Control *the_object;
unsigned32 name_to_use = *(unsigned32 *)the_name; /* XXX variable */
if ( nodes_to_search > _Configuration_MP_table->maximum_nodes )
@@ -174,7 +175,7 @@ rtems_status_code _Objects_MP_Global_name_search (
the_object = (Objects_MP_Control *) the_node;
if ( the_object->name == the_name ) {
if ( the_object->name == name_to_use ) {
*the_id = the_object->Object.id;
_Thread_Enable_dispatch();
return ( RTEMS_SUCCESSFUL );

View File

@@ -58,11 +58,13 @@ void _Thread_Handler_initialization(
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
_Objects_Initialize_information(
&_Thread_Information,
OBJECTS_RTEMS_TASKS,
TRUE,
maximum_tasks,
sizeof( Thread_Control )
&_Thread_Information,
OBJECTS_RTEMS_TASKS,
TRUE,
maximum_tasks,
sizeof( Thread_Control ),
FALSE,
RTEMS_MAXIMUM_NAME_LENGTH
);
_Thread_Ready_chain = _Workspace_Allocate_or_fatal_error(

View File

@@ -0,0 +1,114 @@
/* bsp.h
*
* This include file contains all Papyrus board IO definitions.
*
* Author: Andrew Bray <andy@i-cubed.demon.co.uk>
*
* COPYRIGHT (c) 1995 by i-cubed ltd.
*
* To anyone who acknowledges that this file is provided "AS IS"
* without any express or implied warranty:
* permission to use, copy, modify, and distribute this file
* for any purpose is hereby granted without fee, provided that
* the above copyright notice and this notice appears in all
* copies, and that the name of i-cubed limited not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* i-cubed limited makes no representations about the suitability
* of this software for any purpose.
*
* Derived from c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* bsp.h,v 1.2 1995/05/31 16:56:13 joel Exp
*/
#ifndef __PAPYRUS_h
#define __PAPYRUS_h
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ASM
/* Definition of where to store registers in alignment handler */
#define ALIGN_REGS 0x0140
#else
#include <rtems.h>
/*
* Define the time limits for RTEMS Test Suite test durations.
* Long test and short test duration limits are provided. These
* values are in seconds and need to be converted to ticks for the
* application.
*
*/
#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
/*
* Stuff for Time Test 27
*/
#define MUST_WAIT_FOR_INTERRUPT 0
#define Install_tm27_vector( handler ) set_vector( (handler), PPC_IRQ_SCALL, 1 )
#define Cause_tm27_intr() asm volatile ("sc")
#define Clear_tm27_intr()
#define Lower_tm27_intr()
/*
* Simple spin delay in microsecond units for device drivers.
* This is very dependent on the clock speed of the target.
*/
#define delay( microseconds ) \
{ \
unsigned32 start, ticks, now; \
asm volatile ("mftblo %0" : "=r" (start)); \
ticks = (microseconds) * Cpu_table.clicks_per_usec; \
do \
asm volatile ("mftblo %0" : "=r" (now)); \
while (now - start < ticks); \
}
/* Constants */
#define RAM_START 0
#define RAM_END 0x00200000
/* miscellaneous stuff assumed to exist */
extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
extern rtems_cpu_table Cpu_table; /* owned by BSP */
/* functions */
void bsp_start( void );
void bsp_cleanup( void );
rtems_isr_entry set_vector( /* returns old vector */
rtems_isr_entry handler, /* isr routine */
rtems_vector_number vector, /* vector number */
int type /* RTEMS or RAW intr */
);
#endif /* ASM */
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,135 @@
/* coverhd.h
*
* This include file has defines to represent the overhead associated
* with calling a particular directive from C. These are used in the
* Timing Test Suite to ignore the overhead required to pass arguments
* to directives. On some CPUs and/or target boards, this overhead
* is significant and makes it difficult to distinguish internal
* RTEMS execution time from that used to call the directive.
* This file should be updated after running the C overhead timing
* test. Once this update has been performed, the RTEMS Time Test
* Suite should be rebuilt to account for these overhead times in the
* timing results.
*
* NOTE: If these are all zero, then the times reported include all
* all calling overhead including passing of arguments.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* coverhd.h,v 1.2 1995/05/31 16:56:15 joel Exp
*/
/*
* Updated for a 25MHz Papyrus by Andrew Bray <andy@i-cubed.demon.co.uk>
*
* Units are 100ns.
*
* These numbers are of questionable use, as they are developed by calling
* the routine many times, thus getting its entry veneer into the (small)
* cache on the 403GA. This in general is not true of the RTEMS timing
* tests, which usually call a routine only once, thus having no cache loaded
* advantage.
*
* Whether the directive times are useful after deducting the function call
* overhead is also questionable. The user is more interested generally
* in the total cost of a directive, not the cost if the procedure call
* is inlined! (In general this is not true).
*
* Andrew Bray 18/08/1995
*
*/
#ifndef __COVERHD_h
#define __COVERHD_h
#ifdef __cplusplus
extern "C" {
#endif
#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 1
#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
#define CALLING_OVERHEAD_TASK_CREATE 3
#define CALLING_OVERHEAD_TASK_IDENT 1
#define CALLING_OVERHEAD_TASK_START 1
#define CALLING_OVERHEAD_TASK_RESTART 1
#define CALLING_OVERHEAD_TASK_DELETE 1
#define CALLING_OVERHEAD_TASK_SUSPEND 1
#define CALLING_OVERHEAD_TASK_RESUME 1
#define CALLING_OVERHEAD_TASK_SET_PRIORITY 1
#define CALLING_OVERHEAD_TASK_MODE 1
#define CALLING_OVERHEAD_TASK_GET_NOTE 1
#define CALLING_OVERHEAD_TASK_SET_NOTE 1
#define CALLING_OVERHEAD_TASK_WAKE_WHEN 4
#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
#define CALLING_OVERHEAD_INTERRUPT_CATCH 1
#define CALLING_OVERHEAD_CLOCK_GET 4
#define CALLING_OVERHEAD_CLOCK_SET 3
#define CALLING_OVERHEAD_CLOCK_TICK 1
#define CALLING_OVERHEAD_TIMER_CREATE 1
#define CALLING_OVERHEAD_TIMER_IDENT 1
#define CALLING_OVERHEAD_TIMER_DELETE 1
#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 2
#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 5
#define CALLING_OVERHEAD_TIMER_RESET 1
#define CALLING_OVERHEAD_TIMER_CANCEL 1
#define CALLING_OVERHEAD_SEMAPHORE_CREATE 2
#define CALLING_OVERHEAD_SEMAPHORE_IDENT 1
#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 1
#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 2
#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 2
#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 1
#define CALLING_OVERHEAD_EVENT_SEND 1
#define CALLING_OVERHEAD_EVENT_RECEIVE 2
#define CALLING_OVERHEAD_SIGNAL_CATCH 1
#define CALLING_OVERHEAD_SIGNAL_SEND 1
#define CALLING_OVERHEAD_PARTITION_CREATE 3
#define CALLING_OVERHEAD_PARTITION_IDENT 1
#define CALLING_OVERHEAD_PARTITION_DELETE 1
#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 1
#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 1
#define CALLING_OVERHEAD_REGION_CREATE 3
#define CALLING_OVERHEAD_REGION_IDENT 1
#define CALLING_OVERHEAD_REGION_DELETE 1
#define CALLING_OVERHEAD_REGION_GET_SEGMENT 2
#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 1
#define CALLING_OVERHEAD_PORT_CREATE 2
#define CALLING_OVERHEAD_PORT_IDENT 1
#define CALLING_OVERHEAD_PORT_DELETE 1
#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 1
#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 2
#define CALLING_OVERHEAD_IO_INITIALIZE 2
#define CALLING_OVERHEAD_IO_OPEN 2
#define CALLING_OVERHEAD_IO_CLOSE 2
#define CALLING_OVERHEAD_IO_READ 2
#define CALLING_OVERHEAD_IO_WRITE 2
#define CALLING_OVERHEAD_IO_CONTROL 2
#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 1
#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -0,0 +1,44 @@
/* bsp_cleanup()
*
* This routine normally is part of start.s and usually returns
* control to a monitor.
*
* INPUT: NONE
*
* OUTPUT: NONE
*
* Author: Andrew Bray <andy@i-cubed.demon.co.uk>
*
* COPYRIGHT (c) 1995 by i-cubed ltd.
*
* To anyone who acknowledges that this file is provided "AS IS"
* without any express or implied warranty:
* permission to use, copy, modify, and distribute this file
* for any purpose is hereby granted without fee, provided that
* the above copyright notice and this notice appears in all
* copies, and that the name of i-cubed limited not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* i-cubed limited makes no representations about the suitability
* of this software for any purpose.
*
* Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c:
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* bspclean.c,v 1.2 1995/05/31 16:56:27 joel Exp
*/
#include <rtems.h>
#include <bsp.h>
void bsp_cleanup( void )
{
rtems_fatal_error_occurred(0);
}

View File

@@ -0,0 +1,194 @@
/* bsp_start()
*
* This routine starts the application. It includes application,
* board, and monitor specific initialization and configuration.
* The generic CPU dependent initialization has been performed
* before this routine is invoked.
*
* INPUT: NONE
*
* OUTPUT: NONE
*
* Author: Andrew Bray <andy@i-cubed.demon.co.uk>
*
* COPYRIGHT (c) 1995 by i-cubed ltd.
*
* To anyone who acknowledges that this file is provided "AS IS"
* without any express or implied warranty:
* permission to use, copy, modify, and distribute this file
* for any purpose is hereby granted without fee, provided that
* the above copyright notice and this notice appears in all
* copies, and that the name of i-cubed limited not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* i-cubed limited makes no representations about the suitability
* of this software for any purpose.
*
* Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c:
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* bspstart.c,v 1.2 1995/05/31 16:56:29 joel Exp
*/
#include <rtems.h>
#include <bsp.h>
#include <shm.h>
#include <libcsupport.h>
/*
* The original table from the application and our copy of it with
* some changes.
*/
extern rtems_configuration_table Configuration;
rtems_configuration_table BSP_Configuration;
rtems_cpu_table Cpu_table;
/* Initialize whatever libc we are using
* called from postdriver hook
*/
void bsp_libc_init()
{
extern int _end;
rtems_unsigned32 heap_start;
heap_start = (rtems_unsigned32) &_end;
if (heap_start & (CPU_ALIGNMENT-1))
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
/*
* The last parameter to RTEMS_Malloc_Initialize is the "chunk"
* size which a multiple of will be requested on each sbrk()
* call by malloc(). A value of 0 indicates that sbrk() should
* not be called to extend the heap.
*/
RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0);
/*
* Set up for the libc handling.
*/
if (BSP_Configuration.ticks_per_timeslice > 0)
libc_init(1); /* reentrant if possible */
else
libc_init(0); /* non-reentrant */
/*
* Initialize the stack bounds checker
*/
#ifdef STACK_CHECKER_ON
Stack_check_Initialize();
#endif
}
void bsp_start(void)
{
/*
* Allocate the memory for the RTEMS Work Space. This can come from
* a variety of places: hard coded address, malloc'ed from outside
* RTEMS world (e.g. simulator or primitive memory manager), or (as
* typically done by stock BSPs) by subtracting the required amount
* of work space from the last physical address on the CPU board.
*/
/*
* Copy the Configuration Table .. so we can change it
*/
BSP_Configuration = Configuration;
/*
* Add 1 region for the RTEMS Malloc
*/
BSP_Configuration.maximum_regions++;
/*
* Add 1 extension for newlib libc
*/
#ifdef RTEMS_NEWLIB
BSP_Configuration.maximum_extensions++;
#endif
/*
* Add 1 extension for stack checker
*/
#ifdef STACK_CHECKER_ON
BSP_Configuration.maximum_extensions++;
#endif
/*
* Need to "allocate" the memory for the RTEMS Workspace and
* tell the RTEMS configuration where it is. This memory is
* not malloc'ed. It is just "pulled from the air".
*/
/*BSP_Configuration.work_space_size *= 4;*/
BSP_Configuration.work_space_start = (void *)
RAM_END - BSP_Configuration.work_space_size;
/*
* initialize the CPU table for this BSP
*/
/*
* we do not use the pretasking_hook
*/
Cpu_table.pretasking_hook = NULL;
Cpu_table.predriver_hook = bsp_libc_init; /* RTEMS resources available */
Cpu_table.postdriver_hook = NULL;
Cpu_table.idle_task = NULL; /* do not override system IDLE task */
Cpu_table.do_zero_of_workspace = TRUE;
Cpu_table.interrupt_stack_size = 4 * 1024;
Cpu_table.extra_system_initialization_stack = 0;
/*
* Don't forget the other CPU Table entries.
*/
Cpu_table.clicks_per_usec = 10;
Cpu_table.serial_per_sec = 10000000;
Cpu_table.serial_external_clock = 1;
Cpu_table.serial_xon_xoff = 0;
Cpu_table.serial_cts_rts = 1;
Cpu_table.serial_rate = 9600;
Cpu_table.timer_average_overhead = 2;
Cpu_table.timer_least_valid = 3;
/*
* Start RTEMS
*/
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
bsp_cleanup();
}

View File

@@ -0,0 +1,58 @@
/* set_vector
*
* This routine installs an interrupt vector on the target Board/CPU.
* This routine is allowed to be as board dependent as necessary.
*
* INPUT:
* handler - interrupt handler entry point
* vector - vector number
* type - 0 indicates raw hardware connect
* 1 indicates RTEMS interrupt connect
*
* RETURNS:
* address of previous interrupt handler
*
* Author: Andrew Bray <andy@i-cubed.demon.co.uk>
*
* COPYRIGHT (c) 1995 by i-cubed ltd.
*
* To anyone who acknowledges that this file is provided "AS IS"
* without any express or implied warranty:
* permission to use, copy, modify, and distribute this file
* for any purpose is hereby granted without fee, provided that
* the above copyright notice and this notice appears in all
* copies, and that the name of i-cubed limited not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* i-cubed limited makes no representations about the suitability
* of this software for any purpose.
*
* Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
* On-Line Applications Research Corporation (OAR).
* All rights assigned to U.S. Government, 1994.
*
* This material may be reproduced by or for the U.S. Government pursuant
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* setvec.c,v 1.2 1995/05/31 16:56:35 joel Exp
*/
#include <rtems.h>
#include <bsp.h>
rtems_isr_entry set_vector( /* returns old vector */
rtems_isr_entry handler, /* isr routine */
rtems_vector_number vector, /* vector number */
int type /* RTEMS or RAW intr */
)
{
rtems_isr_entry previous_isr;
rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
return previous_isr;
}

View File

@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
* $Id$
*/
#ifndef __SHM_h

View File

@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
* $Id$
*/
#ifndef __SHM_h

View File

@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
* $Id$
*/
#include <rtems.h>

View File

@@ -11,7 +11,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
* __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
* $Id$
*/
#include <rtems.h>

View File

@@ -35,7 +35,7 @@
*
* NOTE:
*
* newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
* $Id$
*
*/

View File

@@ -0,0 +1,9 @@
This hierachy contains support routines for the various
PowerPC processors.
Since these routines can differ amongst different members
of the PowerPC family, an entry per CPU type is provided.
Currently only the PPC403 is supported.
Andrew Bray 18/8/1995

Some files were not shown because too many files have changed in this diff Show More