forked from Imagelibrary/rtems
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:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
*
|
||||
* NOTE:
|
||||
*
|
||||
* newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
rtems_packet_prefix Prefix;
|
||||
Region_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
rtems_name name;
|
||||
rtems_option option_set;
|
||||
unsigned32 size;
|
||||
Objects_Id proxy_id;
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
rtems_packet_prefix Prefix;
|
||||
Semaphore_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
80
c/src/exec/rtems/headers/support.h
Normal file
80
c/src/exec/rtems/headers/support.h
Normal 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 */
|
||||
@@ -56,7 +56,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
rtems_packet_prefix Prefix;
|
||||
RTEMS_tasks_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
rtems_name name;
|
||||
rtems_task_priority the_priority;
|
||||
unsigned32 notepad;
|
||||
unsigned32 note;
|
||||
@@ -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
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
56
c/src/exec/rtems/headers/types.h
Normal file
56
c/src/exec/rtems/headers/types.h
Normal 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 */
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
rtems_packet_prefix Prefix;
|
||||
Region_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
rtems_name name;
|
||||
rtems_option option_set;
|
||||
unsigned32 size;
|
||||
Objects_Id proxy_id;
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
rtems_packet_prefix Prefix;
|
||||
Semaphore_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
80
c/src/exec/rtems/include/rtems/rtems/support.h
Normal file
80
c/src/exec/rtems/include/rtems/rtems/support.h
Normal 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 */
|
||||
@@ -56,7 +56,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
rtems_packet_prefix Prefix;
|
||||
RTEMS_tasks_MP_Remote_operations operation;
|
||||
Objects_Name name;
|
||||
rtems_name name;
|
||||
rtems_task_priority the_priority;
|
||||
unsigned32 notepad;
|
||||
unsigned32 note;
|
||||
@@ -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
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
56
c/src/exec/rtems/include/rtems/rtems/types.h
Normal file
56
c/src/exec/rtems/include/rtems/rtems/types.h
Normal 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 */
|
||||
54
c/src/exec/rtems/inline/rtems/rtems/support.inl
Normal file
54
c/src/exec/rtems/inline/rtems/rtems/support.inl
Normal 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 */
|
||||
@@ -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
|
||||
|
||||
54
c/src/exec/rtems/inline/support.inl
Normal file
54
c/src/exec/rtems/inline/support.inl
Normal 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 */
|
||||
@@ -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
|
||||
|
||||
44
c/src/exec/rtems/macros/rtems/rtems/support.inl
Normal file
44
c/src/exec/rtems/macros/rtems/rtems/support.inl
Normal 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 */
|
||||
@@ -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
|
||||
|
||||
44
c/src/exec/rtems/macros/support.inl
Normal file
44
c/src/exec/rtems/macros/support.inl
Normal 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 */
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/support.h>
|
||||
#include <rtems/address.h>
|
||||
#include <rtems/dpmem.h>
|
||||
#include <rtems/object.h>
|
||||
@@ -40,7 +41,9 @@ void _Dual_ported_memory_Manager_initialization(
|
||||
OBJECTS_RTEMS_PORTS,
|
||||
FALSE,
|
||||
maximum_ports,
|
||||
sizeof( Dual_ported_memory_Control )
|
||||
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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/support.h>
|
||||
#include <rtems/isr.h>
|
||||
#include <rtems/object.h>
|
||||
#include <rtems/ratemon.h>
|
||||
@@ -44,7 +45,9 @@ void _Rate_monotonic_Manager_initialization(
|
||||
OBJECTS_RTEMS_PERIODS,
|
||||
FALSE,
|
||||
maximum_periods,
|
||||
sizeof( Rate_monotonic_Control )
|
||||
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
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/support.h>
|
||||
#include <rtems/config.h>
|
||||
#include <rtems/object.h>
|
||||
#include <rtems/options.h>
|
||||
@@ -42,7 +43,9 @@ void _Region_Manager_initialization(
|
||||
OBJECTS_RTEMS_REGIONS,
|
||||
FALSE,
|
||||
maximum_regions,
|
||||
sizeof( Region_Control )
|
||||
sizeof( Region_Control ),
|
||||
FALSE,
|
||||
RTEMS_MAXIMUM_NAME_LENGTH
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/support.h>
|
||||
#include <rtems/object.h>
|
||||
#include <rtems/thread.h>
|
||||
#include <rtems/timer.h>
|
||||
@@ -41,7 +42,9 @@ void _Timer_Manager_initialization(
|
||||
OBJECTS_RTEMS_TIMERS,
|
||||
FALSE,
|
||||
maximum_timers,
|
||||
sizeof( Timer_Control )
|
||||
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
|
||||
);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/support.h>
|
||||
#include <rtems/attr.h>
|
||||
#include <rtems/config.h>
|
||||
#include <rtems/isr.h>
|
||||
@@ -59,7 +60,9 @@ void _Semaphore_Manager_initialization(
|
||||
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
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/support.h>
|
||||
#include <rtems/object.h>
|
||||
#include <rtems/thread.h>
|
||||
#include <rtems/timer.h>
|
||||
@@ -41,7 +42,9 @@ void _Timer_Manager_initialization(
|
||||
OBJECTS_RTEMS_TIMERS,
|
||||
FALSE,
|
||||
maximum_timers,
|
||||
sizeof( Timer_Control )
|
||||
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
|
||||
);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/types.h>
|
||||
#include <rtems/config.h>
|
||||
#include <rtems/intr.h>
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rtems/types.h>
|
||||
#include <rtems/config.h>
|
||||
#include <rtems/intr.h>
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/support.h>
|
||||
#include <rtems/object.h>
|
||||
#include <rtems/thread.h>
|
||||
#include <rtems/extension.h>
|
||||
@@ -39,7 +40,9 @@ void _Extension_Manager_initialization(
|
||||
OBJECTS_RTEMS_EXTENSIONS,
|
||||
FALSE,
|
||||
maximum_extensions,
|
||||
sizeof( Extension_Control )
|
||||
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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -190,8 +157,11 @@ STATIC INLINE void _Objects_Open(
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
@@ -190,8 +157,11 @@ STATIC INLINE void _Objects_Open(
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,16 +141,23 @@ 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Take care of multiprocessing
|
||||
*/
|
||||
|
||||
if ( supports_global == TRUE && _Configuration_Is_multiprocessing() ) {
|
||||
|
||||
information->global_table = _Workspace_Allocate_or_fatal_error(
|
||||
@@ -135,6 +173,119 @@ void _Objects_Initialize_information(
|
||||
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
|
||||
@@ -165,6 +316,8 @@ rtems_status_code _Objects_Name_to_id(
|
||||
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 );
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ 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
|
||||
)
|
||||
@@ -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 );
|
||||
|
||||
@@ -62,7 +62,9 @@ void _Thread_Handler_initialization(
|
||||
OBJECTS_RTEMS_TASKS,
|
||||
TRUE,
|
||||
maximum_tasks,
|
||||
sizeof( Thread_Control )
|
||||
sizeof( Thread_Control ),
|
||||
FALSE,
|
||||
RTEMS_MAXIMUM_NAME_LENGTH
|
||||
);
|
||||
|
||||
_Thread_Ready_chain = _Workspace_Allocate_or_fatal_error(
|
||||
|
||||
114
c/src/lib/libbsp/powerpc/papyrus/include/bsp.h
Normal file
114
c/src/lib/libbsp/powerpc/papyrus/include/bsp.h
Normal 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 */
|
||||
135
c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h
Normal file
135
c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h
Normal 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 */
|
||||
44
c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c
Normal file
44
c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c
Normal 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);
|
||||
}
|
||||
194
c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c
Normal file
194
c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c
Normal 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();
|
||||
}
|
||||
58
c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c
Normal file
58
c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c
Normal 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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
*
|
||||
* NOTE:
|
||||
*
|
||||
* newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
9
c/src/lib/libcpu/powerpc/README
Normal file
9
c/src/lib/libcpu/powerpc/README
Normal 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
|
||||
18
c/src/lib/libcpu/powerpc/ppc403/README
Normal file
18
c/src/lib/libcpu/powerpc/ppc403/README
Normal file
@@ -0,0 +1,18 @@
|
||||
Various non BSP dependant support routines.
|
||||
|
||||
clock - Uses the 403 PIT (Programmable interval timer) to
|
||||
generate RTEMS clock ticks.
|
||||
|
||||
console - Uses the 403 Internal serial port to do RTEMS
|
||||
console I/O. Not ALL memebers of the 403 family
|
||||
have this.
|
||||
|
||||
include - Currently empty
|
||||
|
||||
timer - Uses the 403 timebase register for timing
|
||||
tests. Other PowerPCs have slightly different
|
||||
timebase register definitions.
|
||||
|
||||
vectors - PowerPC 403 specific vector entry points.
|
||||
Includes CPU dependant, application independant
|
||||
handlres: alignment.
|
||||
215
c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
Normal file
215
c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
Normal file
@@ -0,0 +1,215 @@
|
||||
/* clock.c
|
||||
*
|
||||
* This routine initializes the interval timer on the
|
||||
* PowerPC 403 CPU. The tick frequency is specified by the bsp.
|
||||
*
|
||||
* 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/libcpu/hppa1_1/clock/clock.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.
|
||||
*
|
||||
* clock.c,v 1.2 1995/05/31 16:59:06 joel Exp
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <clockdrv.h>
|
||||
|
||||
#include <stdlib.h> /* for atexit() */
|
||||
|
||||
extern rtems_cpu_table Cpu_table; /* owned by BSP */
|
||||
|
||||
volatile rtems_unsigned32 Clock_driver_ticks;
|
||||
static rtems_unsigned32 pit_value, tick_time;
|
||||
static rtems_boolean auto_restart;
|
||||
|
||||
rtems_device_driver Clock_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *pargp,
|
||||
rtems_id tid,
|
||||
rtems_unsigned32 *rval
|
||||
)
|
||||
{
|
||||
Install_clock(Clock_isr);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ReInstall_clock(rtems_isr_entry new_clock_isr)
|
||||
{
|
||||
rtems_isr_entry previous_isr;
|
||||
rtems_unsigned32 isrlevel = 0;
|
||||
|
||||
rtems_interrupt_disable(isrlevel);
|
||||
|
||||
rtems_interrupt_catch(new_clock_isr, PPC_IRQ_PIT,
|
||||
&previous_isr);
|
||||
|
||||
rtems_interrupt_enable(isrlevel);
|
||||
}
|
||||
|
||||
static INLINE rtems_unsigned32 get_itimer(void)
|
||||
{
|
||||
register rtems_unsigned32 rc;
|
||||
|
||||
asm volatile ("mftblo %0" : "=r" ((rc)));
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void Install_clock(rtems_isr_entry clock_isr)
|
||||
{
|
||||
rtems_isr_entry previous_isr;
|
||||
rtems_unsigned32 pvr, iocr;
|
||||
|
||||
Clock_driver_ticks = 0;
|
||||
|
||||
asm volatile ("mfiocr %0" : "=r" (iocr));
|
||||
iocr &= ~4;
|
||||
iocr |= 4; /* Select external timer clock */
|
||||
asm volatile ("mtiocr %0" : "=r" (iocr) : "0" (iocr));
|
||||
|
||||
asm volatile ("mfpvr %0" : "=r" ((pvr)));
|
||||
|
||||
if (((pvr & 0xffff0000) >> 16) != 0x0020)
|
||||
return; /* Not a ppc403 */
|
||||
|
||||
if ((pvr & 0xff00) == 0x0000) /* 403GA */
|
||||
auto_restart = (pvr & 0x00f0) > 0x0000 ? 1 : 0;
|
||||
else if ((pvr & 0xff00) == 0x0100) /* 403GB */
|
||||
auto_restart = 1;
|
||||
|
||||
pit_value = BSP_Configuration.microseconds_per_tick *
|
||||
Cpu_table.clicks_per_usec;
|
||||
|
||||
if (BSP_Configuration.ticks_per_timeslice)
|
||||
{
|
||||
register rtems_unsigned32 tcr;
|
||||
/*
|
||||
* initialize the interval here
|
||||
* First tick is set to right amount of time in the future
|
||||
* Future ticks will be incremented over last value set
|
||||
* in order to provide consistent clicks in the face of
|
||||
* interrupt overhead
|
||||
*/
|
||||
|
||||
rtems_interrupt_catch(clock_isr, PPC_IRQ_PIT,
|
||||
&previous_isr);
|
||||
|
||||
asm volatile ("mtpit %0" : : "r" (pit_value));
|
||||
|
||||
asm volatile ("mftcr %0" : "=r" ((tcr)));
|
||||
|
||||
tcr &= ~ 0x04400000;
|
||||
|
||||
tcr |= (auto_restart ? 0x04400000 : 0x04000000);
|
||||
|
||||
tick_time = get_itimer() + pit_value;
|
||||
|
||||
asm volatile ("mttcr %0" : "=r" ((tcr)) : "0" ((tcr)));
|
||||
}
|
||||
atexit(Clock_exit);
|
||||
}
|
||||
|
||||
|
||||
rtems_isr
|
||||
Clock_isr(rtems_vector_number vector)
|
||||
{
|
||||
if (!auto_restart)
|
||||
{
|
||||
rtems_unsigned32 clicks_til_next_interrupt;
|
||||
rtems_unsigned32 itimer_value;
|
||||
|
||||
/*
|
||||
* setup for next interrupt; making sure the new value is reasonably
|
||||
* in the future.... in case we lost out on an interrupt somehow
|
||||
*/
|
||||
|
||||
itimer_value = get_itimer();
|
||||
tick_time += pit_value;
|
||||
|
||||
/*
|
||||
* how far away is next interrupt *really*
|
||||
* It may be a long time; this subtraction works even if
|
||||
* Clock_clicks_interrupt < Clock_clicks_low_order via
|
||||
* the miracle of unsigned math.
|
||||
*/
|
||||
clicks_til_next_interrupt = tick_time - itimer_value;
|
||||
|
||||
/*
|
||||
* If it is too soon then bump it up.
|
||||
* This should only happen if CPU_HPPA_CLICKS_PER_TICK is too small.
|
||||
* But setting it low is useful for debug, so...
|
||||
*/
|
||||
|
||||
if (clicks_til_next_interrupt < 400)
|
||||
{
|
||||
tick_time = itimer_value + 1000;
|
||||
clicks_til_next_interrupt = 1000;
|
||||
/* XXX: count these! this should be rare */
|
||||
}
|
||||
|
||||
/*
|
||||
* If it is too late, that means we missed the interrupt somehow.
|
||||
* Rather than wait 35-50s for a wrap, we just fudge it here.
|
||||
*/
|
||||
|
||||
if (clicks_til_next_interrupt > pit_value)
|
||||
{
|
||||
tick_time = itimer_value + 1000;
|
||||
clicks_til_next_interrupt = 1000;
|
||||
/* XXX: count these! this should never happen :-) */
|
||||
}
|
||||
|
||||
asm volatile ("mtpit %0" :: "r" (clicks_til_next_interrupt));
|
||||
}
|
||||
|
||||
asm volatile ( "mttsr %0" :: "r" (0x08000000));
|
||||
|
||||
Clock_driver_ticks++;
|
||||
|
||||
rtems_clock_tick();
|
||||
}
|
||||
|
||||
/*
|
||||
* Called via atexit()
|
||||
* Remove the clock interrupt handler by setting handler to NULL
|
||||
*/
|
||||
|
||||
void
|
||||
Clock_exit(void)
|
||||
{
|
||||
if ( BSP_Configuration.ticks_per_timeslice )
|
||||
{
|
||||
register rtems_unsigned32 tcr;
|
||||
|
||||
asm volatile ("mftcr %0" : "=r" ((tcr)));
|
||||
|
||||
tcr &= ~ 0x04400000;
|
||||
|
||||
asm volatile ("mttcr %0" : "=r" ((tcr)) : "0" ((tcr)));
|
||||
|
||||
(void) set_vector(0, PPC_IRQ_PIT, 1);
|
||||
}
|
||||
}
|
||||
|
||||
327
c/src/lib/libcpu/powerpc/ppc403/console/console.c
Normal file
327
c/src/lib/libcpu/powerpc/ppc403/console/console.c
Normal file
@@ -0,0 +1,327 @@
|
||||
/*
|
||||
* This file contains the PowerPC 403GA console IO package.
|
||||
*
|
||||
* 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/console/console.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.
|
||||
*
|
||||
* console.c,v 1.2 1995/05/31 16:56:07 joel Exp
|
||||
*/
|
||||
|
||||
#define NO_BSP_INIT
|
||||
|
||||
#include <rtems.h>
|
||||
#include "console.h"
|
||||
#include "bsp.h"
|
||||
|
||||
extern rtems_cpu_table Cpu_table; /* owned by BSP */
|
||||
|
||||
struct async {
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Line Status Register.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
unsigned char SPLS;
|
||||
unsigned char SPLSset;
|
||||
#define LSRDataReady 0x80
|
||||
#define LSRFramingError 0x40
|
||||
#define LSROverrunError 0x20
|
||||
#define LSRParityError 0x10
|
||||
#define LSRBreakInterrupt 0x08
|
||||
#define LSRTxHoldEmpty 0x04
|
||||
#define LSRTxShiftEmpty 0x02
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Handshake Status Register.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
unsigned char SPHS;
|
||||
unsigned char SPHSset;
|
||||
#define HSRDsr 0x80
|
||||
#define HSRCts 0x40
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Baud rate divisor registers
|
||||
+-----------------------------------------------------------------------------*/
|
||||
unsigned char BRDH;
|
||||
unsigned char BRDL;
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Control Register.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
unsigned char SPCTL;
|
||||
#define CRNormal 0x00
|
||||
#define CRLoopback 0x40
|
||||
#define CRAutoEcho 0x80
|
||||
#define CRDtr 0x20
|
||||
#define CRRts 0x10
|
||||
#define CRWordLength7 0x00
|
||||
#define CRWordLength8 0x08
|
||||
#define CRParityDisable 0x00
|
||||
#define CRParityEnable 0x04
|
||||
#define CREvenParity 0x00
|
||||
#define CROddParity 0x02
|
||||
#define CRStopBitsOne 0x00
|
||||
#define CRStopBitsTwo 0x01
|
||||
#define CRDisableDtrRts 0x00
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Receiver Command Register.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
unsigned char SPRC;
|
||||
#define RCRDisable 0x00
|
||||
#define RCREnable 0x80
|
||||
#define RCRIntDisable 0x00
|
||||
#define RCRIntEnabled 0x20
|
||||
#define RCRDMACh2 0x40
|
||||
#define RCRDMACh3 0x60
|
||||
#define RCRErrorInt 0x10
|
||||
#define RCRPauseEnable 0x08
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Transmitter Command Register.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
unsigned char SPTC;
|
||||
#define TCRDisable 0x00
|
||||
#define TCREnable 0x80
|
||||
#define TCRIntDisable 0x00
|
||||
#define TCRIntEnabled 0x20
|
||||
#define TCRDMACh2 0x40
|
||||
#define TCRDMACh3 0x60
|
||||
#define TCRTxEmpty 0x10
|
||||
#define TCRErrorInt 0x08
|
||||
#define TCRStopPause 0x04
|
||||
#define TCRBreakGen 0x02
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| Miscellanies defines.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
unsigned char SPTB;
|
||||
#define SPRB SPTB
|
||||
};
|
||||
|
||||
#define XOFFchar 0x13
|
||||
#define XONchar 0x11
|
||||
|
||||
typedef volatile struct async *pasync;
|
||||
static const pasync port = (pasync)0x40000000;
|
||||
|
||||
/* console_initialize
|
||||
*
|
||||
* This routine initializes the console IO driver.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* Return values:
|
||||
*/
|
||||
|
||||
rtems_device_driver console_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg,
|
||||
rtems_id self,
|
||||
rtems_unsigned32 *status
|
||||
)
|
||||
{
|
||||
register unsigned tmp;
|
||||
|
||||
/* Initialise the serial port */
|
||||
asm volatile ("mfiocr %0" : "=r" (tmp));
|
||||
tmp &= ~3;
|
||||
tmp |= (Cpu_table.serial_external_clock ? 2 : 0) |
|
||||
(Cpu_table.serial_cts_rts ? 1 : 0);
|
||||
asm volatile ("mtiocr %0" : "=r" (tmp) : "0" (tmp));
|
||||
port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
|
||||
LSRParityError | LSRBreakInterrupt);
|
||||
tmp = Cpu_table.serial_per_sec / Cpu_table.serial_rate;
|
||||
tmp = ((tmp + 8) >> 4) - 1;
|
||||
port->BRDL = tmp & 0x255;
|
||||
port->BRDH = tmp >> 8;
|
||||
port->SPCTL = (CRNormal | CRDtr | CRRts | CRWordLength8 | CRParityDisable |
|
||||
CRStopBitsOne);
|
||||
port->SPRC = (RCREnable | RCRIntDisable | RCRPauseEnable);
|
||||
port->SPTC = (TCREnable | TCRIntDisable);
|
||||
port->SPHS = (HSRDsr | HSRCts);
|
||||
|
||||
*status = RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
/* is_character_ready
|
||||
*
|
||||
* This routine returns TRUE if a character is available.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* Return values:
|
||||
*/
|
||||
|
||||
rtems_boolean is_character_ready(
|
||||
char *ch
|
||||
)
|
||||
{
|
||||
unsigned char status;
|
||||
|
||||
if ((status = port->SPLS) & LSRDataReady)
|
||||
{
|
||||
*ch = port->SPRB;
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
/* Clean any dodgy status */
|
||||
if ((status & (LSRFramingError | LSROverrunError | LSRParityError |
|
||||
LSRBreakInterrupt)) != 0)
|
||||
{
|
||||
port->SPLS = (LSRFramingError | LSROverrunError | LSRParityError |
|
||||
LSRBreakInterrupt);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* inbyte
|
||||
*
|
||||
* This routine reads a character from the SOURCE.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* Return values:
|
||||
* character read from SOURCE
|
||||
*/
|
||||
|
||||
char inbyte( void )
|
||||
{
|
||||
unsigned char status;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if ((status = port->SPLS) & LSRDataReady)
|
||||
break;
|
||||
|
||||
/* Clean any dodgy status */
|
||||
if ((status & (LSRFramingError | LSROverrunError | LSRParityError |
|
||||
LSRBreakInterrupt)) != 0)
|
||||
{
|
||||
port->SPLS = (LSRFramingError | LSROverrunError | LSRParityError |
|
||||
LSRBreakInterrupt);
|
||||
}
|
||||
}
|
||||
|
||||
return port->SPRB;
|
||||
}
|
||||
|
||||
/* outbyte
|
||||
*
|
||||
* This routine transmits a character out the SOURCE. It may support
|
||||
* XON/XOFF flow control.
|
||||
*
|
||||
* Input parameters:
|
||||
* ch - character to be transmitted
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
void outbyte(
|
||||
char ch
|
||||
)
|
||||
{
|
||||
unsigned char status;
|
||||
|
||||
while (port->SPHS)
|
||||
port->SPHS = (HSRDsr | HSRCts);
|
||||
|
||||
while (1)
|
||||
{
|
||||
status = port->SPLS;
|
||||
|
||||
if (port->SPHS)
|
||||
port->SPHS = (HSRDsr | HSRCts);
|
||||
else if (status & LSRTxHoldEmpty)
|
||||
break;
|
||||
}
|
||||
|
||||
if (Cpu_table.serial_xon_xoff)
|
||||
while (is_character_ready(&status))
|
||||
{
|
||||
if (status == XOFFchar)
|
||||
do
|
||||
{
|
||||
while (!is_character_ready(&status));
|
||||
}
|
||||
while (status != XONchar);
|
||||
}
|
||||
|
||||
port->SPTB = ch;
|
||||
}
|
||||
|
||||
/*
|
||||
* __read -- read bytes from the serial port. Ignore fd, since
|
||||
* we only have stdin.
|
||||
*/
|
||||
|
||||
int __read(
|
||||
int fd,
|
||||
char *buf,
|
||||
int nbytes
|
||||
)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < nbytes; i++) {
|
||||
*(buf + i) = inbyte();
|
||||
if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
|
||||
(*(buf + i++)) = '\n';
|
||||
(*(buf + i)) = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
|
||||
/*
|
||||
* __write -- write bytes to the serial port. Ignore fd, since
|
||||
* stdout and stderr are the same. Since we have no filesystem,
|
||||
* open will only return an error.
|
||||
*/
|
||||
|
||||
int __write(
|
||||
int fd,
|
||||
char *buf,
|
||||
int nbytes
|
||||
)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nbytes; i++) {
|
||||
if (*(buf + i) == '\n') {
|
||||
outbyte ('\r');
|
||||
}
|
||||
outbyte (*(buf + i));
|
||||
}
|
||||
return (nbytes);
|
||||
}
|
||||
98
c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
Normal file
98
c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
Normal file
@@ -0,0 +1,98 @@
|
||||
/* timer.c
|
||||
*
|
||||
* This file manages the interval timer on the PowerPC 403*.
|
||||
* We shall use the bottom 32 bits of the timebase register,
|
||||
*
|
||||
* NOTE: It is important that the timer start/stop overhead be
|
||||
* determined when porting or modifying this code.
|
||||
*
|
||||
* 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/libcpu/hppa1_1/timer/timer.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.
|
||||
*
|
||||
* timer.c,v 1.2 1995/05/31 16:59:23 joel Exp
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <rtems.h>
|
||||
|
||||
extern rtems_cpu_table Cpu_table; /* owned by BSP */
|
||||
|
||||
static volatile rtems_unsigned32 Timer_starting;
|
||||
static rtems_boolean Timer_driver_Find_average_overhead;
|
||||
|
||||
/*
|
||||
* This is so small that this code will be reproduced where needed.
|
||||
*/
|
||||
static INLINE rtems_unsigned32 get_itimer(void)
|
||||
{
|
||||
rtems_unsigned32 ret;
|
||||
|
||||
asm volatile ("mftblo %0" : "=r" ((ret)));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Timer_initialize()
|
||||
{
|
||||
rtems_unsigned32 iocr;
|
||||
|
||||
asm volatile ("mfiocr %0" : "=r" (iocr));
|
||||
iocr &= ~4;
|
||||
iocr |= 4; /* Select external timer clock */
|
||||
asm volatile ("mtiocr %0" : "=r" (iocr) : "0" (iocr));
|
||||
|
||||
Timer_starting = get_itimer();
|
||||
}
|
||||
|
||||
int Read_timer()
|
||||
{
|
||||
rtems_unsigned32 clicks;
|
||||
rtems_unsigned32 total;
|
||||
|
||||
clicks = get_itimer();
|
||||
|
||||
total = clicks - Timer_starting;
|
||||
|
||||
if ( Timer_driver_Find_average_overhead == 1 )
|
||||
return total; /* in XXX microsecond units */
|
||||
|
||||
else {
|
||||
if ( total < Cpu_table.timer_least_valid )
|
||||
return 0; /* below timer resolution */
|
||||
return (total - Cpu_table.timer_average_overhead);
|
||||
}
|
||||
}
|
||||
|
||||
rtems_status_code Empty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void Set_find_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
Timer_driver_Find_average_overhead = find_flag;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user