Remove stray white spaces.

This commit is contained in:
Ralf Corsepius
2004-04-18 06:05:35 +00:00
parent 05279b84b4
commit 50f32b1165
115 changed files with 570 additions and 570 deletions

View File

@@ -1,5 +1,5 @@
/* chain.h /* chain.h
* *
* This include file contains all the constants and structures associated * This include file contains all the constants and structures associated
* with doubly linked chains. This file actually just provides an * with doubly linked chains. This file actually just provides an
* interface to the chain object in rtems. * interface to the chain object in rtems.
@@ -19,17 +19,17 @@
#include <rtems.h> #include <rtems.h>
/* /*
* Chain_Initialize * Chain_Initialize
* *
* This routine initializes the_chain structure to manage the * This routine initializes the_chain structure to manage the
* contiguous array of number_nodes nodes which starts at * contiguous array of number_nodes nodes which starts at
* starting_address. Each node is of node_size bytes. * starting_address. Each node is of node_size bytes.
* *
* Chain_Control *the_chain, * IN * * Chain_Control *the_chain, * IN *
* void *starting_address, * IN * * void *starting_address, * IN *
* uint32_t number_nodes, * IN * * uint32_t number_nodes, * IN *
* uint32_t node_size * IN * * uint32_t node_size * IN *
*/ */
#define Chain_Initialize( the_chain, starting_address, \ #define Chain_Initialize( the_chain, starting_address, \
@@ -38,17 +38,17 @@
number_nodes, node_size ) \ number_nodes, node_size ) \
/* /*
* Chain_Initialize_empty * Chain_Initialize_empty
* *
* This routine initializes the specified chain to contain zero nodes. * This routine initializes the specified chain to contain zero nodes.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Initialize_empty( the_chain ) \ #define Chain_Initialize_empty( the_chain ) \
_Chain_Initialize_empty( the_chain ) _Chain_Initialize_empty( the_chain )
/* /*
* Chain_Are_nodes_equal * Chain_Are_nodes_equal
@@ -56,43 +56,43 @@
* This function returns TRUE if LEFT and RIGHT are equal, * This function returns TRUE if LEFT and RIGHT are equal,
* and FALSE otherwise. * and FALSE otherwise.
* *
* Chain_Node *left, * IN * * Chain_Node *left, * IN *
* Chain_Node *right * IN * * Chain_Node *right * IN *
*/ */
#define Chain_Are_nodes_equal( left, right ) \ #define Chain_Are_nodes_equal( left, right ) \
_Chain_Are_nodes_equal( left, right ) _Chain_Are_nodes_equal( left, right )
/* /*
* Chain_Extract_unprotected * Chain_Extract_unprotected
* *
* This routine extracts the_node from the chain on which it resides. * This routine extracts the_node from the chain on which it resides.
* It does NOT disable interrupts to insure the atomicity of the * It does NOT disable interrupts to insure the atomicity of the
* extract operation. * extract operation.
* *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Extract_unprotected( the_node ) \ #define Chain_Extract_unprotected( the_node ) \
_Chain_Extract_unprotected( the_node ) _Chain_Extract_unprotected( the_node )
/* /*
* Chain_Extract * Chain_Extract
* *
* This routine extracts the_node from the chain on which it resides. * This routine extracts the_node from the chain on which it resides.
* It disables interrupts to insure the atomicity of the * It disables interrupts to insure the atomicity of the
* extract operation. * extract operation.
* *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Extract( the_node ) \ #define Chain_Extract( the_node ) \
_Chain_Extract( the_node ) _Chain_Extract( the_node )
/* /*
* Chain_Get_unprotected * Chain_Get_unprotected
* *
* This function removes the first node from the_chain and returns * This function removes the first node from the_chain and returns
@@ -100,14 +100,14 @@
* It does NOT disable interrupts to insure the atomicity of the * It does NOT disable interrupts to insure the atomicity of the
* get operation. * get operation.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Get_unprotected( the_chain ) \ #define Chain_Get_unprotected( the_chain ) \
_Chain_Get_unprotected( the_chain ) _Chain_Get_unprotected( the_chain )
/* /*
* Chain_Get * Chain_Get
* *
* This function removes the first node from the_chain and returns * This function removes the first node from the_chain and returns
@@ -115,239 +115,239 @@
* It disables interrupts to insure the atomicity of the * It disables interrupts to insure the atomicity of the
* get operation. * get operation.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Get( the_chain ) \ #define Chain_Get( the_chain ) \
_Chain_Get( the_chain ) _Chain_Get( the_chain )
/* /*
* Chain_Get_first_unprotected * Chain_Get_first_unprotected
* *
* This function removes the first node from the_chain and returns * This function removes the first node from the_chain and returns
* a pointer to that node. It does NOT disable interrupts to insure * a pointer to that node. It does NOT disable interrupts to insure
* the atomicity of the get operation. * the atomicity of the get operation.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Get_first_unprotected( the_chain ) \ #define Chain_Get_first_unprotected( the_chain ) \
_Chain_Get_first_unprotected( the_chain ) _Chain_Get_first_unprotected( the_chain )
/* /*
* Chain_Insert_unprotected * Chain_Insert_unprotected
* *
* This routine inserts the_node on a chain immediately following * This routine inserts the_node on a chain immediately following
* after_node. It does NOT disable interrupts to insure the atomicity * after_node. It does NOT disable interrupts to insure the atomicity
* of the extract operation. * of the extract operation.
* *
* Chain_Node *after_node, * IN * * Chain_Node *after_node, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Insert_unprotected( after_node, the_node ) \ #define Chain_Insert_unprotected( after_node, the_node ) \
_Chain_Insert_unprotected( after_node, the_node ) _Chain_Insert_unprotected( after_node, the_node )
/* /*
* Chain_Insert * Chain_Insert
* *
* This routine inserts the_node on a chain immediately following * This routine inserts the_node on a chain immediately following
* after_node. It disables interrupts to insure the atomicity * after_node. It disables interrupts to insure the atomicity
* of the extract operation. * of the extract operation.
* *
* Chain_Node *after_node, * IN * * Chain_Node *after_node, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Insert( after_node, the_node ) \ #define Chain_Insert( after_node, the_node ) \
_Chain_Insert( after_node, the_node ) _Chain_Insert( after_node, the_node )
/* /*
* Chain_Append_unprotected * Chain_Append_unprotected
* *
* This routine appends the_node onto the end of the_chain. * This routine appends the_node onto the end of the_chain.
* It does NOT disable interrupts to insure the atomicity of the * It does NOT disable interrupts to insure the atomicity of the
* append operation. * append operation.
* *
* Chain_Control *the_chain, * IN * * Chain_Control *the_chain, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Append_unprotected( the_chain, the_node ) \ #define Chain_Append_unprotected( the_chain, the_node ) \
_Chain_Append_unprotected( the_chain, the_node ) _Chain_Append_unprotected( the_chain, the_node )
/* /*
* Chain_Append * Chain_Append
* *
* This routine appends the_node onto the end of the_chain. * This routine appends the_node onto the end of the_chain.
* It disables interrupts to insure the atomicity of the * It disables interrupts to insure the atomicity of the
* append operation. * append operation.
* *
* Chain_Control *the_chain, * IN * * Chain_Control *the_chain, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Append( the_chain, the_node ) \ #define Chain_Append( the_chain, the_node ) \
_Chain_Append( the_chain, the_node ) _Chain_Append( the_chain, the_node )
/* /*
* Chain_Prepend_unprotected * Chain_Prepend_unprotected
* *
* This routine prepends the_node onto the front of the_chain. * This routine prepends the_node onto the front of the_chain.
* It does NOT disable interrupts to insure the atomicity of the * It does NOT disable interrupts to insure the atomicity of the
* prepend operation. * prepend operation.
* *
* Chain_Control *the_chain, * IN * * Chain_Control *the_chain, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Prepend_unprotected( the_chain, the_node ) \ #define Chain_Prepend_unprotected( the_chain, the_node ) \
_Chain_Prepend_unprotected( the_chain, the_node ) _Chain_Prepend_unprotected( the_chain, the_node )
/* /*
* Chain_Prepend * Chain_Prepend
* *
* This routine prepends the_node onto the front of the_chain. * This routine prepends the_node onto the front of the_chain.
* It disables interrupts to insure the atomicity of the * It disables interrupts to insure the atomicity of the
* prepend operation. * prepend operation.
* *
* Chain_Control *the_chain, * IN * * Chain_Control *the_chain, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Prepend( the_chain, the_node ) \ #define Chain_Prepend( the_chain, the_node ) \
_Chain_Prepend( the_chain, the_node ) _Chain_Prepend( the_chain, the_node )
/* /*
* Chain_Head * Chain_Head
* *
* This function returns a pointer to the first node on the chain. * This function returns a pointer to the first node on the chain.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Head( the_chain ) \ #define Chain_Head( the_chain ) \
_Chain_Head( the_chain ) _Chain_Head( the_chain )
/* /*
* Chain_Tail * Chain_Tail
* *
* This function returns a pointer to the last node on the chain. * This function returns a pointer to the last node on the chain.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Tail( the_chain ) \ #define Chain_Tail( the_chain ) \
_Chain_Tail( the_chain ) _Chain_Tail( the_chain )
/* /*
* Chain_Is_head * Chain_Is_head
* *
* This function returns TRUE if the_node is the head of the_chain and * This function returns TRUE if the_node is the head of the_chain and
* FALSE otherwise. * FALSE otherwise.
* *
* Chain_Control *the_chain, * IN * * Chain_Control *the_chain, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Is_head( the_chain, the_node ) \ #define Chain_Is_head( the_chain, the_node ) \
_Chain_Is_head( the_chain, the_node ) _Chain_Is_head( the_chain, the_node )
/* /*
* Chain_Is_tail * Chain_Is_tail
* *
* This function returns TRUE if the_node is the tail of the_chain and * This function returns TRUE if the_node is the tail of the_chain and
* FALSE otherwise. * FALSE otherwise.
* *
* Chain_Control *the_chain, * IN * * Chain_Control *the_chain, * IN *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Is_tail( the_chain, the_node ) \ #define Chain_Is_tail( the_chain, the_node ) \
_Chain_Is_tail( the_chain, the_node ) _Chain_Is_tail( the_chain, the_node )
/* /*
* Chain_Is_first * Chain_Is_first
* *
* This function returns TRUE if the_node is the first node on a chain and * This function returns TRUE if the_node is the first node on a chain and
* FALSE otherwise. * FALSE otherwise.
* *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Is_first( the_node ) \ #define Chain_Is_first( the_node ) \
_Chain_Is_first( the_node ) _Chain_Is_first( the_node )
/* /*
* Chain_Is_last * Chain_Is_last
* *
* This function returns TRUE if the_node is the last node on a chain and * This function returns TRUE if the_node is the last node on a chain and
* FALSE otherwise. * FALSE otherwise.
* *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Is_last( the_node ) \ #define Chain_Is_last( the_node ) \
_Chain_Is_last( the_node ) _Chain_Is_last( the_node )
/* /*
* Chain_Is_empty * Chain_Is_empty
* *
* This function returns TRUE if there are no nodes on the_chain and * This function returns TRUE if there are no nodes on the_chain and
* FALSE otherwise. * FALSE otherwise.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Is_empty( the_chain ) \ #define Chain_Is_empty( the_chain ) \
_Chain_Is_empty( the_chain ) _Chain_Is_empty( the_chain )
/* /*
* Chain_Has_only_one_node * Chain_Has_only_one_node
* *
* This function returns TRUE if there is only one node on the_chain and * This function returns TRUE if there is only one node on the_chain and
* FALSE otherwise. * FALSE otherwise.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Has_only_one_node( the_chain ) \ #define Chain_Has_only_one_node( the_chain ) \
_Chain_Has_only_one_node( the_chain ) _Chain_Has_only_one_node( the_chain )
/* /*
* Chain_Is_null * Chain_Is_null
* *
* This function returns TRUE if the_chain is NULL and FALSE otherwise. * This function returns TRUE if the_chain is NULL and FALSE otherwise.
* *
* Chain_Control *the_chain * IN * * Chain_Control *the_chain * IN *
*/ */
#define Chain_Is_null( the_chain ) \ #define Chain_Is_null( the_chain ) \
_Chain_Is_null( the_chain ) _Chain_Is_null( the_chain )
/* /*
* Chain_Is_null_node * Chain_Is_null_node
* *
* This function returns TRUE if the_node is NULL and FALSE otherwise. * This function returns TRUE if the_node is NULL and FALSE otherwise.
* *
* Chain_Node *the_node * IN * * Chain_Node *the_node * IN *
*/ */
#define Chain_Is_null_node( the_node ) \ #define Chain_Is_null_node( the_node ) \

View File

@@ -29,7 +29,7 @@ extern rtems_device_minor_number rtems_clock_minor;
#define CLOCK_DRIVER_TABLE_ENTRY \ #define CLOCK_DRIVER_TABLE_ENTRY \
{ Clock_initialize, NULL, NULL, NULL, NULL, Clock_control } { Clock_initialize, NULL, NULL, NULL, NULL, Clock_control }
rtems_device_driver Clock_initialize( rtems_device_driver Clock_initialize(
rtems_device_major_number, rtems_device_major_number,
rtems_device_minor_number, rtems_device_minor_number,

View File

@@ -83,15 +83,15 @@
#define MC68681_CLEAR 0x00 #define MC68681_CLEAR 0x00
#define MC68681_PORT_A 0 #define MC68681_PORT_A 0
#define MC68681_PORT_B 1 #define MC68681_PORT_B 1
/* /*
* DUART Command Register Definitions: * DUART Command Register Definitions:
* *
* MC68681_COMMAND_REG_A,MC68681_COMMAND_REG_B * MC68681_COMMAND_REG_A,MC68681_COMMAND_REG_B
*/ */
#define MC68681_MODE_REG_ENABLE_RX 0x01 #define MC68681_MODE_REG_ENABLE_RX 0x01
#define MC68681_MODE_REG_DISABLE_RX 0x02 #define MC68681_MODE_REG_DISABLE_RX 0x02
@@ -114,8 +114,8 @@
/* /*
* Mode Register Definitions * Mode Register Definitions
* *
* MC68681_MODE_REG_1A * MC68681_MODE_REG_1A
* MC68681_MODE_REG_1B * MC68681_MODE_REG_1B
*/ */
#define MC68681_5BIT_CHARS 0x00 #define MC68681_5BIT_CHARS 0x00
#define MC68681_6BIT_CHARS 0x01 #define MC68681_6BIT_CHARS 0x01
@@ -186,17 +186,17 @@
#define MC68681_RECEIVED_BREAK 0x80 #define MC68681_RECEIVED_BREAK 0x80
/* /*
* Interupt Status Register Definitions. * Interupt Status Register Definitions.
* *
* MC68681_INTERRUPT_STATUS_REG * MC68681_INTERRUPT_STATUS_REG
*/ */
/* /*
* Interupt Mask Register Definitions * Interupt Mask Register Definitions
* *
* MC68681_INTERRUPT_MASK_REG * MC68681_INTERRUPT_MASK_REG
*/ */
#define MC68681_IR_TX_READY_A 0x01 #define MC68681_IR_TX_READY_A 0x01
#define MC68681_IR_RX_READY_A 0x02 #define MC68681_IR_RX_READY_A 0x02
@@ -207,10 +207,10 @@
#define MC68681_IR_BREAK_B 0x40 #define MC68681_IR_BREAK_B 0x40
#define MC68681_IR_INPUT_PORT_CHANGE 0x80 #define MC68681_IR_INPUT_PORT_CHANGE 0x80
/* /*
* Status Register Definitions. * Status Register Definitions.
* *
* MC68681_STATUS_REG_A,MC68681_STATUS_REG_B * MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
*/ */
#define MC68681_STATUS_RXRDY 0x01 #define MC68681_STATUS_RXRDY 0x01
#define MC68681_STATUS_FFULL 0x02 #define MC68681_STATUS_FFULL 0x02
@@ -221,34 +221,34 @@
#define MC68681_STATUS_FRAMING_ERROR 0x40 #define MC68681_STATUS_FRAMING_ERROR 0x40
#define MC68681_STATUS_RECEIVED_BREAK 0x80 #define MC68681_STATUS_RECEIVED_BREAK 0x80
/* /*
* Definitions for the Interrupt Vector Register: * Definitions for the Interrupt Vector Register:
* *
* MC68681_INTERRUPT_VECTOR_REG * MC68681_INTERRUPT_VECTOR_REG
*/ */
#define MC68681_INTERRUPT_VECTOR_INIT 0x0f #define MC68681_INTERRUPT_VECTOR_INIT 0x0f
/* /*
* Definitions for the Auxiliary Control Register * Definitions for the Auxiliary Control Register
* *
* MC68681_AUX_CTRL_REG * MC68681_AUX_CTRL_REG
*/ */
#define MC68681_AUX_BRG_SET1 0x00 #define MC68681_AUX_BRG_SET1 0x00
#define MC68681_AUX_BRG_SET2 0x80 #define MC68681_AUX_BRG_SET2 0x80
/* /*
* The following Baud rates assume the X1 clock pin is driven with a * The following Baud rates assume the X1 clock pin is driven with a
* 3.6864 MHz signal. If a different frequency is used the DUART channel * 3.6864 MHz signal. If a different frequency is used the DUART channel
* is running at the follwoing baud rate: * is running at the follwoing baud rate:
* ((Table Baud Rate)*frequency)/3.6864 MHz * ((Table Baud Rate)*frequency)/3.6864 MHz
*/ */
/* /*
* Definitions for the Clock Select Register: * Definitions for the Clock Select Register:
*
* MC68681_CLOCK_SELECT_REG_A,MC68681_CLOCK_SELECT_REG_A
* *
* MC68681_CLOCK_SELECT_REG_A,MC68681_CLOCK_SELECT_REG_A
*
* Note: ACR[7] is the MSB of the Auxiliary Control register * Note: ACR[7] is the MSB of the Auxiliary Control register
* X is the extend bit. * X is the extend bit.
* CRA - 0x08 Set Rx BRG Select Extend Bit (X=1) * CRA - 0x08 Set Rx BRG Select Extend Bit (X=1)
@@ -260,8 +260,8 @@
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_75 0x00 /* ACR[7]=0,X=0 */ #define MC68681_BAUD_RATE_MASK_75 0x00 /* ACR[7]=0,X=0 */
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_110 0x01 #define MC68681_BAUD_RATE_MASK_110 0x01
#define MC68681_BAUD_RATE_MASK_134_5 0x02 #define MC68681_BAUD_RATE_MASK_134_5 0x02
#define MC68681_BAUD_RATE_MASK_150 0x03 /* ACR[7]=0,X=0 */ #define MC68681_BAUD_RATE_MASK_150 0x03 /* ACR[7]=0,X=0 */
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_200 0x03 /* ACR[7]=0,X=0 */ #define MC68681_BAUD_RATE_MASK_200 0x03 /* ACR[7]=0,X=0 */
@@ -280,10 +280,10 @@
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_3600 0x04 /* ACR[7]=0,X=0 */ #define MC68681_BAUD_RATE_MASK_3600 0x04 /* ACR[7]=0,X=0 */
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_4800 0x09 #define MC68681_BAUD_RATE_MASK_4800 0x09
#define MC68681_BAUD_RATE_MASK_7200 0x0a /* ACR[7]=0,X=0 */ #define MC68681_BAUD_RATE_MASK_7200 0x0a /* ACR[7]=0,X=0 */
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_9600 0xbb #define MC68681_BAUD_RATE_MASK_9600 0xbb
#define MC68681_BAUD_RATE_MASK_14_4K 0x05 /* ACR[7]=0,X=0 */ #define MC68681_BAUD_RATE_MASK_14_4K 0x05 /* ACR[7]=0,X=0 */
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
@@ -295,9 +295,9 @@
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_57_6K 0x07 /* ACR[7]=0,X=0 */ #define MC68681_BAUD_RATE_MASK_57_6K 0x07 /* ACR[7]=0,X=0 */
/* ARC[7]=1,X=1 */ /* ARC[7]=1,X=1 */
#define MC68681_BAUD_RATE_MASK_115_5K 0x08 #define MC68681_BAUD_RATE_MASK_115_5K 0x08
#define MC68681_BAUD_RATE_MASK_TIMER 0xdd #define MC68681_BAUD_RATE_MASK_TIMER 0xdd
#define MC68681_BAUD_RATE_MASK_TIMER_16X 0xee #define MC68681_BAUD_RATE_MASK_TIMER_16X 0xee
#define MC68681_BAUD_RATE_MASK_TIMER_1X 0xff #define MC68681_BAUD_RATE_MASK_TIMER_1X 0xff
#endif #endif

View File

@@ -1,5 +1,5 @@
/* /*
* ringbuf.h * ringbuf.h
* *
* This file provides simple ring buffer functionality. * This file provides simple ring buffer functionality.
* *
@@ -22,8 +22,8 @@ typedef struct {
#define Ring_buffer_Initialize( _buffer ) \ #define Ring_buffer_Initialize( _buffer ) \
do { \ do { \
(_buffer)->head = (_buffer)->tail = 0; \ (_buffer)->head = (_buffer)->tail = 0; \
} while ( 0 ) } while ( 0 )
#define Ring_buffer_Is_empty( _buffer ) \ #define Ring_buffer_Is_empty( _buffer ) \
( (_buffer)->head == (_buffer)->tail ) ( (_buffer)->head == (_buffer)->tail )
@@ -38,7 +38,7 @@ typedef struct {
(_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \ (_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
(_buffer)->buffer[ (_buffer)->tail ] = (_ch); \ (_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
rtems_interrupt_enable( isrlevel ); \ rtems_interrupt_enable( isrlevel ); \
} while ( 0 ) } while ( 0 )
#define Ring_buffer_Remove_character( _buffer, _ch ) \ #define Ring_buffer_Remove_character( _buffer, _ch ) \
do { \ do { \
@@ -48,6 +48,6 @@ typedef struct {
(_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \ (_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
(_ch) = (_buffer)->buffer[ (_buffer)->head ]; \ (_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
rtems_interrupt_enable( isrlevel ); \ rtems_interrupt_enable( isrlevel ); \
} while ( 0 ) } while ( 0 )
#endif #endif

View File

@@ -140,9 +140,9 @@ struct _rtems_filesystem_file_handlers_r {
/* /*
* XXX * XXX
* This routine does not allocate any space and rtems_filesystem_freenode_t * This routine does not allocate any space and rtems_filesystem_freenode_t
* is not called by the generic after calling this routine. * is not called by the generic after calling this routine.
* ie. node_access does not have to contain valid data when the * ie. node_access does not have to contain valid data when the
* routine returns. * routine returns.
*/ */
@@ -228,9 +228,9 @@ typedef int (*rtems_filesystem_symlink_t)(
); );
typedef int (*rtems_filesystem_readlink_t)( typedef int (*rtems_filesystem_readlink_t)(
rtems_filesystem_location_info_t *loc, /* IN */ rtems_filesystem_location_info_t *loc, /* IN */
char *buf, /* OUT */ char *buf, /* OUT */
size_t bufsize size_t bufsize
); );
/* /*
@@ -342,7 +342,7 @@ struct rtems_libio_tt {
off_t offset; /* current offset into file */ off_t offset; /* current offset into file */
uint32_t flags; uint32_t flags;
rtems_filesystem_location_info_t pathinfo; rtems_filesystem_location_info_t pathinfo;
Objects_Id sem; Objects_Id sem;
uint32_t data0; /* private to "driver" */ uint32_t data0; /* private to "driver" */
void *data1; /* ... */ void *data1; /* ... */
void *file_info; /* used by file handlers */ void *file_info; /* used by file handlers */
@@ -476,8 +476,8 @@ union __rtems_dev_t {
} __overlay; } __overlay;
}; };
static inline dev_t rtems_filesystem_make_dev_t( static inline dev_t rtems_filesystem_make_dev_t(
rtems_device_major_number _major, rtems_device_major_number _major,
rtems_device_minor_number _minor rtems_device_minor_number _minor
) )
{ {

View File

@@ -21,7 +21,7 @@ extern "C" {
#include <rtems.h> #include <rtems.h>
#include <rtems/libio.h> /* include before standard IO */ #include <rtems/libio.h> /* include before standard IO */
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
@@ -64,9 +64,9 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
#define rtems_libio_iop_to_descriptor(_iop) \ #define rtems_libio_iop_to_descriptor(_iop) \
((!(_iop)) ? -1 : (_iop - rtems_libio_iops)) ((!(_iop)) ? -1 : (_iop - rtems_libio_iops))
/* /*
* rtems_libio_check_is_open * rtems_libio_check_is_open
* *
* Macro to check if a file descriptor is actually open. * Macro to check if a file descriptor is actually open.
*/ */
@@ -190,8 +190,8 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
*/ */
#include <rtems/userenv.h> #include <rtems/userenv.h>
extern rtems_user_env_t * rtems_current_user_env; extern rtems_user_env_t * rtems_current_user_env;
extern rtems_user_env_t rtems_global_user_env; extern rtems_user_env_t rtems_global_user_env;
/* /*
* Instantiate a private copy of the per user information for the calling task. * Instantiate a private copy of the per user information for the calling task.
@@ -199,7 +199,7 @@ extern rtems_user_env_t rtems_global_user_env;
rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_set_private_env(void);
rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ;
/* /*
* File Descriptor Routine Prototypes * File Descriptor Routine Prototypes
*/ */

View File

@@ -37,7 +37,7 @@ struct rtems_termios_rawbuf {
volatile unsigned int Head; volatile unsigned int Head;
volatile unsigned int Tail; volatile unsigned int Tail;
volatile unsigned int Size; volatile unsigned int Size;
rtems_id Semaphore; rtems_id Semaphore;
}; };
/* /*
* Variables associated with each termios instance. * Variables associated with each termios instance.
@@ -112,8 +112,8 @@ struct rtems_termios_tty {
/* /*
* I/O task IDs (for task-driven drivers) * I/O task IDs (for task-driven drivers)
*/ */
rtems_id rxTaskId; rtems_id rxTaskId;
rtems_id txTaskId; rtems_id txTaskId;
/* /*
* line discipline related stuff * line discipline related stuff
*/ */
@@ -155,8 +155,8 @@ void rtems_termios_rxirq_occured(struct rtems_termios_tty *tty);
* FIXME: this should move to termios.h! * FIXME: this should move to termios.h!
* put a string to output ring buffer * put a string to output ring buffer
*/ */
void rtems_termios_puts (const char *buf, void rtems_termios_puts (const char *buf,
int len, int len,
struct rtems_termios_tty *tty); struct rtems_termios_tty *tty);
/* /*
* global hooks for line disciplines * global hooks for line disciplines

View File

@@ -1,4 +1,4 @@
/* /*
* stdint.h * stdint.h
* *
* ISO C99 integer types * ISO C99 integer types
@@ -16,7 +16,7 @@ extern "C" {
#include <rtems/score/types.h> #include <rtems/score/types.h>
/* /*
* map RTEMS internal types onto C99 types * map RTEMS internal types onto C99 types
*/ */
typedef signed8 int8_t; typedef signed8 int8_t;
typedef signed16 int16_t; typedef signed16 int16_t;

View File

@@ -1,4 +1,4 @@
/* sys/utsname.h /* sys/utsname.h
* *
* $Id$ * $Id$
*/ */
@@ -16,9 +16,9 @@ extern "C" {
/* /*
* 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90 * 4.4.1 Get System Name (Table 4-1), P1003.1b-1993, p. 90
* *
* NOTE: The lengths of the strings in this structure are * NOTE: The lengths of the strings in this structure are
* just long enough to reliably contain the RTEMS information. * just long enough to reliably contain the RTEMS information.
* For example, the fields are not long enough to support * For example, the fields are not long enough to support
* Internet hostnames. * Internet hostnames.
*/ */

View File

@@ -41,7 +41,7 @@ clock_t _times(
(void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks ); (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
/* /*
* RTEMS technically has no notion of system versus user time * RTEMS technically has no notion of system versus user time
* since there is no separation of OS from application tasks. * since there is no separation of OS from application tasks.
* But we can at least make a distinction between the number * But we can at least make a distinction between the number
* of ticks since boot and the number of ticks executed by this * of ticks since boot and the number of ticks executed by this

View File

@@ -27,7 +27,7 @@ rtems_assoc_ptr_by_name(
if (rtems_assoc_is_default(ap)) if (rtems_assoc_is_default(ap))
default_ap = ap++; default_ap = ap++;
for ( ; ap->name; ap++) for ( ; ap->name; ap++)
if (strcmp(ap->name, name) == 0) if (strcmp(ap->name, name) == 0)
return ap; return ap;
@@ -45,7 +45,7 @@ rtems_assoc_ptr_by_local(
if (rtems_assoc_is_default(ap)) if (rtems_assoc_is_default(ap))
default_ap = ap++; default_ap = ap++;
for ( ; ap->name; ap++) for ( ; ap->name; ap++)
if (ap->local_value == local_value) if (ap->local_value == local_value)
return ap; return ap;
@@ -64,7 +64,7 @@ rtems_assoc_ptr_by_remote(
if (rtems_assoc_is_default(ap)) if (rtems_assoc_is_default(ap))
default_ap = ap++; default_ap = ap++;
for ( ; ap->name; ap++) for ( ; ap->name; ap++)
if (ap->remote_value == remote_value) if (ap->remote_value == remote_value)
return ap; return ap;
@@ -77,7 +77,7 @@ rtems_assoc_ptr_by_remote(
* Get values * Get values
*/ */
uint32_t uint32_t
rtems_assoc_remote_by_local( rtems_assoc_remote_by_local(
const rtems_assoc_t *ap, const rtems_assoc_t *ap,
uint32_t local_value uint32_t local_value
@@ -87,11 +87,11 @@ rtems_assoc_remote_by_local(
nap = rtems_assoc_ptr_by_local(ap, local_value); nap = rtems_assoc_ptr_by_local(ap, local_value);
if (nap) if (nap)
return nap->remote_value; return nap->remote_value;
return 0; return 0;
} }
uint32_t uint32_t
rtems_assoc_local_by_remote( rtems_assoc_local_by_remote(
const rtems_assoc_t *ap, const rtems_assoc_t *ap,
uint32_t remote_value uint32_t remote_value
@@ -101,11 +101,11 @@ rtems_assoc_local_by_remote(
nap = rtems_assoc_ptr_by_remote(ap, remote_value); nap = rtems_assoc_ptr_by_remote(ap, remote_value);
if (nap) if (nap)
return nap->local_value; return nap->local_value;
return 0; return 0;
} }
uint32_t uint32_t
rtems_assoc_remote_by_name( rtems_assoc_remote_by_name(
const rtems_assoc_t *ap, const rtems_assoc_t *ap,
const char *name const char *name
@@ -115,11 +115,11 @@ rtems_assoc_remote_by_name(
nap = rtems_assoc_ptr_by_name(ap, name); nap = rtems_assoc_ptr_by_name(ap, name);
if (nap) if (nap)
return nap->remote_value; return nap->remote_value;
return 0; return 0;
} }
uint32_t uint32_t
rtems_assoc_local_by_name( rtems_assoc_local_by_name(
const rtems_assoc_t *ap, const rtems_assoc_t *ap,
const char *name const char *name
@@ -129,7 +129,7 @@ rtems_assoc_local_by_name(
nap = rtems_assoc_ptr_by_name(ap, name); nap = rtems_assoc_ptr_by_name(ap, name);
if (nap) if (nap)
return nap->local_value; return nap->local_value;
return 0; return 0;
} }
@@ -155,7 +155,7 @@ rtems_assoc_name_by_local(
nap = rtems_assoc_ptr_by_local(ap, local_value); nap = rtems_assoc_ptr_by_local(ap, local_value);
if (nap) if (nap)
return nap->name; return nap->name;
return rtems_assoc_name_bad(local_value); return rtems_assoc_name_bad(local_value);
} }
@@ -169,7 +169,7 @@ rtems_assoc_name_by_remote(
nap = rtems_assoc_ptr_by_remote(ap, remote_value); nap = rtems_assoc_ptr_by_remote(ap, remote_value);
if (nap) if (nap)
return nap->name; return nap->name;
return rtems_assoc_name_bad(remote_value); return rtems_assoc_name_bad(remote_value);
} }
@@ -182,14 +182,14 @@ uint32_t rtems_assoc_remote_by_local_bitfield(
const rtems_assoc_t *ap, const rtems_assoc_t *ap,
uint32_t local_value uint32_t local_value
) )
{ {
uint32_t b; uint32_t b;
uint32_t remote_value = 0; uint32_t remote_value = 0;
for (b = 1; b; b <<= 1) for (b = 1; b; b <<= 1)
if (b & local_value) if (b & local_value)
remote_value |= rtems_assoc_remote_by_local(ap, b); remote_value |= rtems_assoc_remote_by_local(ap, b);
return remote_value; return remote_value;
} }
@@ -198,14 +198,14 @@ uint32_t rtems_assoc_local_by_remote_bitfield(
const rtems_assoc_t *ap, const rtems_assoc_t *ap,
uint32_t remote_value uint32_t remote_value
) )
{ {
uint32_t b; uint32_t b;
uint32_t local_value = 0; uint32_t local_value = 0;
for (b = 1; b; b <<= 1) for (b = 1; b; b <<= 1)
if (b & remote_value) if (b & remote_value)
local_value |= rtems_assoc_local_by_remote(ap, b); local_value |= rtems_assoc_local_by_remote(ap, b);
return local_value; return local_value;
} }
@@ -215,7 +215,7 @@ rtems_assoc_name_by_remote_bitfield(
uint32_t value, uint32_t value,
char *buffer char *buffer
) )
{ {
uint32_t b; uint32_t b;
*buffer = 0; *buffer = 0;
@@ -227,7 +227,7 @@ rtems_assoc_name_by_remote_bitfield(
strcat(buffer, " "); strcat(buffer, " ");
strcat(buffer, rtems_assoc_name_by_remote(ap, b)); strcat(buffer, rtems_assoc_name_by_remote(ap, b));
} }
return buffer; return buffer;
} }
@@ -237,7 +237,7 @@ rtems_assoc_name_by_local_bitfield(
uint32_t value, uint32_t value,
char *buffer char *buffer
) )
{ {
uint32_t b; uint32_t b;
*buffer = 0; *buffer = 0;
@@ -249,6 +249,6 @@ rtems_assoc_name_by_local_bitfield(
strcat(buffer, " "); strcat(buffer, " ");
strcat(buffer, rtems_assoc_name_by_local(ap, b)); strcat(buffer, rtems_assoc_name_by_local(ap, b));
} }
return buffer; return buffer;
} }

View File

@@ -35,7 +35,7 @@ rtems_user_env_t * rtems_current_user_env = &rtems_global_user_env;
* rtems_filesystem_initialize * rtems_filesystem_initialize
* *
* Initialize the foundation of the file system. This is specified * Initialize the foundation of the file system. This is specified
* by the structure rtems_filesystem_mount_table. The usual * by the structure rtems_filesystem_mount_table. The usual
* configuration is a single instantiation of the IMFS or miniIMFS with * configuration is a single instantiation of the IMFS or miniIMFS with
* a single "/dev" directory in it. * a single "/dev" directory in it.
*/ */
@@ -50,7 +50,7 @@ void rtems_filesystem_initialize( void )
rtems_filesystem_mount_table_entry_t *entry; rtems_filesystem_mount_table_entry_t *entry;
rtems_filesystem_mount_table_t *mt; rtems_filesystem_mount_table_t *mt;
rtems_filesystem_location_info_t loc; rtems_filesystem_location_info_t loc;
/* /*
* Set the default umask to "022". * Set the default umask to "022".
*/ */
@@ -125,8 +125,8 @@ void rtems_filesystem_initialize( void )
/* /*
* This code if if'ed 0 out because you can't mount another * This code if if'ed 0 out because you can't mount another
* filesystem properly until the mount point it will be * filesystem properly until the mount point it will be
* mounted onto is created. Moreover, if it is going to * mounted onto is created. Moreover, if it is going to
* use a device, then it is REALLY unfair to attempt this * use a device, then it is REALLY unfair to attempt this
* before device drivers are initialized. * before device drivers are initialized.
*/ */

View File

@@ -1,4 +1,4 @@
/* /*
* chdir() - POSIX 1003.1b - 5.2.1 - Change Current Working Directory * chdir() - POSIX 1003.1b - 5.2.1 - Change Current Working Directory
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
@@ -34,7 +34,7 @@ int chdir(
* Get the node where we wish to go. * Get the node where we wish to go.
*/ */
result = rtems_filesystem_evaluate_path( result = rtems_filesystem_evaluate_path(
pathname, RTEMS_LIBIO_PERMS_SEARCH, &loc, TRUE ); pathname, RTEMS_LIBIO_PERMS_SEARCH, &loc, TRUE );
if ( result != 0 ) if ( result != 0 )
return -1; return -1;
@@ -52,10 +52,10 @@ int chdir(
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
rtems_set_errno_and_return_minus_one( ENOTDIR ); rtems_set_errno_and_return_minus_one( ENOTDIR );
} }
rtems_filesystem_freenode( &rtems_filesystem_current ); rtems_filesystem_freenode( &rtems_filesystem_current );
rtems_filesystem_current = loc; rtems_filesystem_current = loc;
return 0; return 0;
} }

View File

@@ -37,7 +37,7 @@ int chmod(
status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE ); status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE );
if ( status != 0 ) if ( status != 0 )
return -1; return -1;
if ( !loc.handlers ){ if ( !loc.handlers ){
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
rtems_set_errno_and_return_minus_one( EBADF ); rtems_set_errno_and_return_minus_one( EBADF );
@@ -51,6 +51,6 @@ int chmod(
result = (*loc.handlers->fchmod_h)( &loc, mode ); result = (*loc.handlers->fchmod_h)( &loc, mode );
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
return result; return result;
} }

View File

@@ -35,7 +35,7 @@ int chown(
if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) ) if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) )
return -1; return -1;
if ( !loc.ops->chown_h ) { if ( !loc.ops->chown_h ) {
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
@@ -44,6 +44,6 @@ int chown(
result = (*loc.ops->chown_h)( &loc, owner, group ); result = (*loc.ops->chown_h)( &loc, owner, group );
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
return result; return result;
} }

View File

@@ -1,4 +1,4 @@
/* /*
* chroot() - Change Root Directory * chroot() - Change Root Directory
* Author: fernando.ruiz@ctv.es * Author: fernando.ruiz@ctv.es
* *
@@ -30,13 +30,13 @@ int chroot(
{ {
int result; int result;
rtems_filesystem_location_info_t loc; rtems_filesystem_location_info_t loc;
/* an automatic call to new private env the first time */ /* an automatic call to new private env the first time */
if (rtems_current_user_env == &rtems_global_user_env) { if (rtems_current_user_env == &rtems_global_user_env) {
rtems_libio_set_private_env(); /* try to set a new private env*/ rtems_libio_set_private_env(); /* try to set a new private env*/
if (rtems_current_user_env == &rtems_global_user_env) /* not ok */ if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
}; };
result = chdir(pathname); result = chdir(pathname);
if (result) { if (result) {

View File

@@ -3,7 +3,7 @@
* *
* This was copied from Newlib 1.8.0. * This was copied from Newlib 1.8.0.
* *
* *
* Copyright (c) 1983 Regents of the University of California. * Copyright (c) 1983 Regents of the University of California.
* All rights reserved. * All rights reserved.
* *

View File

@@ -47,6 +47,6 @@ int dup2(
/* /*
* This fcntl handles everything else. * This fcntl handles everything else.
*/ */
return fcntl( fildes, F_DUPFD, fildes2 ); return fcntl( fildes, F_DUPFD, fildes2 );
} }

View File

@@ -1,6 +1,6 @@
/* /*
* Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 * Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002
* *
* $Id$ * $Id$
*/ */
@@ -33,7 +33,7 @@
* Used by the following functions: * Used by the following functions:
* findenv_r(), setenv_r(), and unsetenv_r() which are called by * findenv_r(), setenv_r(), and unsetenv_r() which are called by
* getenv(), getenv_r(), setenv(), and unsetenv(). * getenv(), getenv_r(), setenv(), and unsetenv().
* *
*/ */
#if defined(ENVLOCK_DEDIDCATED_MUTEX) #if defined(ENVLOCK_DEDIDCATED_MUTEX)

View File

@@ -13,7 +13,7 @@
* These routines provide general purpose error reporting. * These routines provide general purpose error reporting.
* rtems_error reports an error to stderr and allows use of * rtems_error reports an error to stderr and allows use of
* printf style formatting. A newline is appended to all messages. * printf style formatting. A newline is appended to all messages.
* *
* error_flag can be specified as any of the following: * error_flag can be specified as any of the following:
* *
* RTEMS_ERROR_ERRNO -- include errno text in output * RTEMS_ERROR_ERRNO -- include errno text in output
@@ -21,7 +21,7 @@
* RTEMS_ERROR_ABORT -- abort after output * RTEMS_ERROR_ABORT -- abort after output
* *
* It can also include a rtems_status value which can be OR'd * It can also include a rtems_status value which can be OR'd
* with the above flags. * * with the above flags. *
* *
* EXAMPLE * EXAMPLE
* #include <rtems.h> * #include <rtems.h>
@@ -135,11 +135,11 @@ static int rtems_verror(
if (_System_state_Is_multiprocessing) if (_System_state_Is_multiprocessing)
fprintf(stderr, "[%d] ", _Configuration_MP_table->node); fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
if (rtems_progname && *rtems_progname) if (rtems_progname && *rtems_progname)
chars_written += fprintf(stderr, "%s: ", rtems_progname); chars_written += fprintf(stderr, "%s: ", rtems_progname);
chars_written += vfprintf(stderr, printf_format, arglist); chars_written += vfprintf(stderr, printf_format, arglist);
if (status) if (status)
chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status)); chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
@@ -150,7 +150,7 @@ static int rtems_verror(
else else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno); chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
} }
chars_written += fprintf(stderr, "\n"); chars_written += fprintf(stderr, "\n");
(void) fflush(stderr); (void) fflush(stderr);
@@ -176,7 +176,7 @@ static int rtems_verror(
* Report an error. * Report an error.
* error_flag is as above; printf_format is a normal * error_flag is as above; printf_format is a normal
* printf(3) format string, with its concommitant arguments. * printf(3) format string, with its concommitant arguments.
* *
* Returns the number of characters written. * Returns the number of characters written.
*/ */
@@ -192,11 +192,11 @@ int rtems_error(
va_start(arglist, printf_format); va_start(arglist, printf_format);
chars_written = rtems_verror(error_flag, printf_format, arglist); chars_written = rtems_verror(error_flag, printf_format, arglist);
va_end(arglist); va_end(arglist);
return chars_written; return chars_written;
} }
/* /*
* rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...) * rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
*/ */

View File

@@ -41,7 +41,7 @@ int rtems_filesystem_evaluate_path(
if ( !pathloc ) if ( !pathloc )
rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
/* /*
* Evaluate the path using the optable evalpath. * Evaluate the path using the optable evalpath.
*/ */
@@ -80,7 +80,7 @@ int rtems_filesystem_evaluate_path(
* Let the FS implementation deal with this case. It * Let the FS implementation deal with this case. It
* should probably free pathloc in either case: * should probably free pathloc in either case:
* - if the link evaluation fails, it must free the * - if the link evaluation fails, it must free the
* original (valid) pathloc because we are going * original (valid) pathloc because we are going
* to return -1 and hence the FS generics won't * to return -1 and hence the FS generics won't
* cleanup pathloc. * cleanup pathloc.
* - if the link evaluation is successful, the updated * - if the link evaluation is successful, the updated
@@ -90,7 +90,7 @@ int rtems_filesystem_evaluate_path(
*/ */
result = (*pathloc->ops->eval_link_h)( pathloc, flags ); result = (*pathloc->ops->eval_link_h)( pathloc, flags );
} }
} }
@@ -108,7 +108,7 @@ int rtems_filesystem_evaluate_parent(
if ( !pathloc ) if ( !pathloc )
rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */ rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
if ( !pathloc->ops->evalpath_h ) if ( !pathloc->ops->evalpath_h )
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );

View File

@@ -30,7 +30,7 @@ int fchdir(
{ {
rtems_libio_t *iop; rtems_libio_t *iop;
rtems_filesystem_location_info_t loc, saved; rtems_filesystem_location_info_t loc, saved;
rtems_libio_check_fd( fd ); rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd ); iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop); rtems_libio_check_is_open(iop);
@@ -57,7 +57,7 @@ int fchdir(
RTEMS_FILESYSTEM_DIRECTORY ) { RTEMS_FILESYSTEM_DIRECTORY ) {
rtems_set_errno_and_return_minus_one( ENOTDIR ); rtems_set_errno_and_return_minus_one( ENOTDIR );
} }
/* /*
* FIXME : I feel there should be another call to * FIXME : I feel there should be another call to
@@ -71,10 +71,10 @@ int fchdir(
* share their rtems_filesystem_current better * share their rtems_filesystem_current better
* be synchronized! * be synchronized!
*/ */
saved = rtems_filesystem_current; saved = rtems_filesystem_current;
rtems_filesystem_current = iop->pathinfo; rtems_filesystem_current = iop->pathinfo;
/* clone the current node */ /* clone the current node */
if (rtems_filesystem_evaluate_path(".", 0, &loc, 0)) { if (rtems_filesystem_evaluate_path(".", 0, &loc, 0)) {
/* cloning failed; restore original and bail out */ /* cloning failed; restore original and bail out */
@@ -85,6 +85,6 @@ int fchdir(
rtems_filesystem_freenode( &saved ); rtems_filesystem_freenode( &saved );
rtems_filesystem_current = loc; rtems_filesystem_current = loc;
return 0; return 0;
} }

View File

@@ -30,7 +30,7 @@ int fchmod(
) )
{ {
rtems_libio_t *iop; rtems_libio_t *iop;
rtems_libio_check_fd( fd ); rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd ); iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop); rtems_libio_check_is_open(iop);

View File

@@ -35,7 +35,7 @@ static int vfcntl(
int flags; int flags;
int mask; int mask;
int ret = 0; int ret = 0;
rtems_libio_check_fd( fd ); rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd ); iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop); rtems_libio_check_is_open(iop);
@@ -78,7 +78,7 @@ static int vfcntl(
* Interpret the third argument as the "close on exec()" flag. * Interpret the third argument as the "close on exec()" flag.
* If this argument is 1, then the file descriptor is to be closed * If this argument is 1, then the file descriptor is to be closed
* if a new process is exec()'ed. Since RTEMS does not support * if a new process is exec()'ed. Since RTEMS does not support
* processes, then we can ignore this one except to make * processes, then we can ignore this one except to make
* F_GETFD work. * F_GETFD work.
*/ */
@@ -136,10 +136,10 @@ static int vfcntl(
/* /*
* If we got this far successfully, then we give the optional * If we got this far successfully, then we give the optional
* filesystem specific handler a chance to process this. * filesystem specific handler a chance to process this.
*/ */
if (ret >= 0) { if (ret >= 0) {
if (iop->handlers->fcntl_h) { if (iop->handlers->fcntl_h) {
int err = (*iop->handlers->fcntl_h)( cmd, iop ); int err = (*iop->handlers->fcntl_h)( cmd, iop );
if (err) { if (err) {

View File

@@ -28,7 +28,7 @@ int ftruncate(
{ {
rtems_libio_t *iop; rtems_libio_t *iop;
rtems_filesystem_location_info_t loc; rtems_filesystem_location_info_t loc;
rtems_libio_check_fd( fd ); rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd ); iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop); rtems_libio_check_is_open(iop);
@@ -36,7 +36,7 @@ int ftruncate(
/* /*
* Now process the ftruncate() request. * Now process the ftruncate() request.
*/ */
/* /*
* Make sure we are not working on a directory * Make sure we are not working on a directory
*/ */
@@ -44,7 +44,7 @@ int ftruncate(
loc = iop->pathinfo; loc = iop->pathinfo;
if ( !loc.ops->node_type_h ) if ( !loc.ops->node_type_h )
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY )
rtems_set_errno_and_return_minus_one( EISDIR ); rtems_set_errno_and_return_minus_one( EISDIR );

View File

@@ -47,7 +47,7 @@ int getdents(
loc = iop->pathinfo; loc = iop->pathinfo;
if ( !loc.ops->node_type_h ) if ( !loc.ops->node_type_h )
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR ); rtems_set_errno_and_return_minus_one( ENOTDIR );

View File

@@ -22,7 +22,7 @@ gid_t _POSIX_types_Egid = 0;
/*PAGE /*PAGE
* *
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84 * P1003.1b-1993, p. 84
*/ */

View File

@@ -23,7 +23,7 @@ uid_t _POSIX_types_Euid = 0;
/*PAGE /*PAGE
* *
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84 * P1003.1b-1993, p. 84
*/ */

View File

@@ -18,13 +18,13 @@
/* /*
* MACRO in userenv.h * MACRO in userenv.h
* *
gid_t _POSIX_types_Gid = 0; gid_t _POSIX_types_Gid = 0;
*/ */
/*PAGE /*PAGE
* *
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84 * P1003.1b-1993, p. 84
*/ */

View File

@@ -28,7 +28,7 @@
/* /*
* MACRO in userenv.h * MACRO in userenv.h
* *
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ]; static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
*/ */
@@ -50,7 +50,7 @@ int getlogin_r(
size_t namesize size_t namesize
) )
{ {
struct passwd *pw; struct passwd *pw;
if ( namesize < LOGIN_NAME_MAX ) if ( namesize < LOGIN_NAME_MAX )
return ERANGE; return ERANGE;

View File

@@ -226,7 +226,7 @@ int getpwnam_r(
return getpw_r(name, 0, pwd, buffer, bufsize, result); return getpw_r(name, 0, pwd, buffer, bufsize, result);
} }
struct passwd *getpwnam( struct passwd *getpwnam(
const char *name const char *name
) )
{ {
@@ -385,7 +385,7 @@ int getgrnam_r(
return getgr_r(name, 0, grp, buffer, bufsize, result); return getgr_r(name, 0, grp, buffer, bufsize, result);
} }
struct group *getgrnam( struct group *getgrnam(
const char *name const char *name
) )
{ {

View File

@@ -16,15 +16,15 @@
#include <rtems/userenv.h> #include <rtems/userenv.h>
/* /*
* MACRO in userenv.h * MACRO in userenv.h
* *
uid_t _POSIX_types_Uid = 0; uid_t _POSIX_types_Uid = 0;
*/ */
/*PAGE /*PAGE
* *
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs, * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84 * P1003.1b-1993, p. 84
*/ */

View File

@@ -13,7 +13,7 @@
* Eric sent some e-mail in the rtems-list as a start point for this * Eric sent some e-mail in the rtems-list as a start point for this
* module implementation. * module implementation.
* *
* *
*/ */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
@@ -32,7 +32,7 @@
#include <rtems/error.h> /* rtems_panic */ #include <rtems/error.h> /* rtems_panic */
#include <rtems/rtems/tasks.h> #include <rtems/rtems/tasks.h>
/* /*
* These typedefs should match with the ones defined in the file * These typedefs should match with the ones defined in the file
* gcc/gthr-rtems.h in the gcc distribution. * gcc/gthr-rtems.h in the gcc distribution.
*/ */
@@ -51,7 +51,7 @@ typedef void *__gthread_mutex_t;
/* local function to return the ID of the calling thread */ /* local function to return the ID of the calling thread */
static rtems_id get_tid( void ) static rtems_id get_tid( void )
{ {
rtems_id id = 0; rtems_id id = 0;
rtems_task_ident( RTEMS_SELF, 0, &id ); rtems_task_ident( RTEMS_SELF, 0, &id );
return id; return id;
} }
@@ -82,7 +82,7 @@ int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{ {
/* Ok, this can be a bit tricky. We are going to return a "key" as a /* Ok, this can be a bit tricky. We are going to return a "key" as a
* pointer to the buffer that will hold the value of the key itself. * pointer to the buffer that will hold the value of the key itself.
* We have to to this, becuase the others functions on this interface * We have to to this, becuase the others functions on this interface
* deal with the value of the key, as used with the POSIX API. * deal with the value of the key, as used with the POSIX API.
*/ */
/* Do not pull your hair, trust me this works. :-) */ /* Do not pull your hair, trust me this works. :-) */
@@ -195,7 +195,7 @@ int rtems_gxx_mutex_lock (__gthread_mutex_t *mutex)
#ifdef DEBUG_GXX_WRAPPERS #ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: lock mutex=%X\n", *mutex ); printk( "gxx_wrappers: lock mutex=%X\n", *mutex );
#endif #endif
return ( rtems_semaphore_obtain( (rtems_id)*mutex, return ( rtems_semaphore_obtain( (rtems_id)*mutex,
RTEMS_WAIT, RTEMS_NO_TIMEOUT ) == RTEMS_SUCCESSFUL) ? 0 : -1; RTEMS_WAIT, RTEMS_NO_TIMEOUT ) == RTEMS_SUCCESSFUL) ? 0 : -1;
} }
@@ -204,7 +204,7 @@ int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex)
#ifdef DEBUG_GXX_WRAPPERS #ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: trylock mutex=%X\n", *mutex ); printk( "gxx_wrappers: trylock mutex=%X\n", *mutex );
#endif #endif
return (rtems_semaphore_obtain ((rtems_id)*mutex, return (rtems_semaphore_obtain ((rtems_id)*mutex,
RTEMS_NO_WAIT, 0) == RTEMS_SUCCESSFUL) ? 0 : -1; RTEMS_NO_WAIT, 0) == RTEMS_SUCCESSFUL) ? 0 : -1;
} }

View File

@@ -29,8 +29,8 @@ int ioctl(
int fd, int fd,
int command, int command,
... ...
) )
{ {
va_list ap; va_list ap;
rtems_status_code rc; rtems_status_code rc;
rtems_libio_t *iop; rtems_libio_t *iop;

View File

@@ -1,7 +1,7 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE. * http://www.rtems.com/license/LICENSE.

View File

@@ -44,9 +44,9 @@
#include <rtems/libio.h> /* libio.h not pulled in by rtems */ #include <rtems/libio.h> /* libio.h not pulled in by rtems */
/* /*
* File descriptor Table Information * File descriptor Table Information
*/ */
extern uint32_t rtems_libio_number_iops; extern uint32_t rtems_libio_number_iops;
rtems_id rtems_libio_semaphore; rtems_id rtems_libio_semaphore;
@@ -102,7 +102,7 @@ void rtems_libio_init( void )
/* /*
* rtems_libio_fcntl_flags * rtems_libio_fcntl_flags
* *
* Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand * Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
*/ */
@@ -131,7 +131,7 @@ uint32_t rtems_libio_fcntl_flags(
/* /*
* Access mode is a small integer * Access mode is a small integer
*/ */
access_modes = fcntl_flags & O_ACCMODE; access_modes = fcntl_flags & O_ACCMODE;
fcntl_flags &= ~O_ACCMODE; fcntl_flags &= ~O_ACCMODE;
flags = rtems_assoc_local_by_remote( access_modes_assoc, access_modes ); flags = rtems_assoc_local_by_remote( access_modes_assoc, access_modes );
@@ -147,7 +147,7 @@ uint32_t rtems_libio_fcntl_flags(
/* /*
* rtems_libio_to_fcntl_flags * rtems_libio_to_fcntl_flags
* *
* Convert RTEMS internal flags to UNIX fnctl(2) flags * Convert RTEMS internal flags to UNIX fnctl(2) flags
*/ */
@@ -183,7 +183,7 @@ uint32_t rtems_libio_to_fcntl_flags(
/* /*
* rtems_libio_allocate * rtems_libio_allocate
* *
* This routine searches the IOP Table for an unused entry. If it * This routine searches the IOP Table for an unused entry. If it
* finds one, it returns it. Otherwise, it returns NULL. * finds one, it returns it. Otherwise, it returns NULL.
*/ */
@@ -191,7 +191,7 @@ rtems_libio_t *rtems_libio_allocate( void )
{ {
rtems_libio_t *iop, *next; rtems_libio_t *iop, *next;
rtems_status_code rc; rtems_status_code rc;
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
if (rtems_libio_iop_freelist) { if (rtems_libio_iop_freelist) {
@@ -211,10 +211,10 @@ rtems_libio_t *rtems_libio_allocate( void )
rtems_libio_iop_freelist = next; rtems_libio_iop_freelist = next;
goto done; goto done;
} }
failed: failed:
iop = 0; iop = 0;
done: done:
rtems_semaphore_release( rtems_libio_semaphore ); rtems_semaphore_release( rtems_libio_semaphore );
return iop; return iop;
@@ -250,7 +250,7 @@ void rtems_libio_free(
* are any active file descriptors that refer to the at least one node in the * are any active file descriptors that refer to the at least one node in the
* file system that we are trying to dismount. * file system that we are trying to dismount.
* *
* If there is at least one node in the file system referenced by the mount * If there is at least one node in the file system referenced by the mount
* table entry a 1 is returned, otherwise a 0 is returned. * table entry a 1 is returned, otherwise a 0 is returned.
*/ */
@@ -263,15 +263,15 @@ int rtems_libio_is_open_files_in_fs(
int i; int i;
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
/* /*
* Look for any active file descriptor entry. * Look for any active file descriptor entry.
*/ */
for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){
if ((iop->flags & LIBIO_FLAGS_OPEN) != 0) { if ((iop->flags & LIBIO_FLAGS_OPEN) != 0) {
/* /*
* Check if this node is under the file system that we * Check if this node is under the file system that we
* are trying to dismount. * are trying to dismount.
@@ -285,7 +285,7 @@ int rtems_libio_is_open_files_in_fs(
} }
rtems_semaphore_release( rtems_libio_semaphore ); rtems_semaphore_release( rtems_libio_semaphore );
return result; return result;
} }
@@ -294,7 +294,7 @@ int rtems_libio_is_open_files_in_fs(
* *
* This routine scans the entire file descriptor table to determine if the * This routine scans the entire file descriptor table to determine if the
* given file refers to an active file descriptor. * given file refers to an active file descriptor.
* *
* If the given file is open a 1 is returned, otherwise a 0 is returned. * If the given file is open a 1 is returned, otherwise a 0 is returned.
*/ */
@@ -311,10 +311,10 @@ int rtems_libio_is_file_open(
/* /*
* Look for any active file descriptor entry. * Look for any active file descriptor entry.
*/ */
for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){ for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){
if ((iop->flags & LIBIO_FLAGS_OPEN) != 0) { if ((iop->flags & LIBIO_FLAGS_OPEN) != 0) {
/* /*
* Check if this node is under the file system that we * Check if this node is under the file system that we
* are trying to dismount. * are trying to dismount.

View File

@@ -76,7 +76,7 @@ int link(
} }
result = (*parent_loc.ops->link_h)( &existing_loc, &parent_loc, name_start ); result = (*parent_loc.ops->link_h)( &existing_loc, &parent_loc, name_start );
rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &existing_loc );
rtems_filesystem_freenode( &parent_loc ); rtems_filesystem_freenode( &parent_loc );

View File

@@ -89,7 +89,7 @@ off_t lseek(
#include <reent.h> #include <reent.h>
off_t _lseek_r( off_t _lseek_r(
struct _reent *ptr, struct _reent *ptr,
int fd, int fd,
off_t offset, off_t offset,

View File

@@ -112,7 +112,7 @@ void RTEMS_Malloc_Initialize(
/* /*
* If the BSP is not clearing out the workspace, then it is most likely * If the BSP is not clearing out the workspace, then it is most likely
* not clearing out the initial memory for the heap. There is no * not clearing out the initial memory for the heap. There is no
* standard supporting zeroing out the heap memory. But much code * standard supporting zeroing out the heap memory. But much code
* with UNIX history seems to assume that memory malloc'ed during * with UNIX history seems to assume that memory malloc'ed during
* initialization (before any free's) is zero'ed. This is true most * initialization (before any free's) is zero'ed. This is true most
@@ -145,7 +145,7 @@ void RTEMS_Malloc_Initialize(
/* zero all the stats */ /* zero all the stats */
(void) memset( &rtems_malloc_stats, 0, sizeof(rtems_malloc_stats) ); (void) memset( &rtems_malloc_stats, 0, sizeof(rtems_malloc_stats) );
#endif #endif
MSBUMP(space_available, length); MSBUMP(space_available, length);
} }
@@ -173,11 +173,11 @@ void *malloc(
if (_System_state_Is_up(_System_state_Get())) { if (_System_state_Is_up(_System_state_Get())) {
if (_Thread_Dispatch_disable_level > 0) if (_Thread_Dispatch_disable_level > 0)
return (void *) 0; return (void *) 0;
if (_ISR_Nest_level > 0) if (_ISR_Nest_level > 0)
return (void *) 0; return (void *) 0;
} }
/* /*
* If some free's have been deferred, then do them now. * If some free's have been deferred, then do them now.
*/ */
@@ -212,7 +212,7 @@ void *malloc(
the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount); the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
if ((starting_address = (void *)sbrk(the_size)) if ((starting_address = (void *)sbrk(the_size))
== (void*) -1) == (void*) -1)
return (void *) 0; return (void *) 0;
@@ -226,7 +226,7 @@ void *malloc(
errno = ENOMEM; errno = ENOMEM;
return (void *) 0; return (void *) 0;
} }
MSBUMP(space_available, the_size); MSBUMP(space_available, the_size);
status = rtems_region_get_segment( status = rtems_region_get_segment(
@@ -302,11 +302,11 @@ void *realloc(
if (_System_state_Is_up(_System_state_Get())) { if (_System_state_Is_up(_System_state_Get())) {
if (_Thread_Dispatch_disable_level > 0) if (_Thread_Dispatch_disable_level > 0)
return (void *) 0; return (void *) 0;
if (_ISR_Nest_level > 0) if (_ISR_Nest_level > 0)
return (void *) 0; return (void *) 0;
} }
/* /*
* Continue with calloc(). * Continue with calloc().
*/ */
@@ -319,11 +319,11 @@ void *realloc(
} }
new_area = malloc( size ); new_area = malloc( size );
MSBUMP(malloc_calls, -1); /* subtract off the malloc */ MSBUMP(malloc_calls, -1); /* subtract off the malloc */
/* /*
* There used to be a free on this error case but it is wrong to * There used to be a free on this error case but it is wrong to
* free the memory per OpenGroup Single UNIX Specification V2 * free the memory per OpenGroup Single UNIX Specification V2
* and the C Standard. * and the C Standard.
*/ */
@@ -366,7 +366,7 @@ void free(
return; return;
} }
} }
#ifdef MALLOC_STATS #ifdef MALLOC_STATS
{ {
size_t size; size_t size;
@@ -376,7 +376,7 @@ void free(
} }
} }
#endif #endif
status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr ); status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
if ( status != RTEMS_SUCCESSFUL ) { if ( status != RTEMS_SUCCESSFUL ) {
errno = EINVAL; errno = EINVAL;
@@ -421,7 +421,7 @@ void malloc_walk(size_t source, size_t printf_enabled)
{ {
register Region_Control *the_region; register Region_Control *the_region;
Objects_Locations location; Objects_Locations location;
_RTEMS_Lock_allocator(); /* to prevent deletion */ _RTEMS_Lock_allocator(); /* to prevent deletion */
the_region = _Region_Get( RTEMS_Malloc_Heap, &location ); the_region = _Region_Get( RTEMS_Malloc_Heap, &location );
if ( location == OBJECTS_LOCAL ) if ( location == OBJECTS_LOCAL )
@@ -437,7 +437,7 @@ void malloc_dump(void)
{ {
return; return;
} }
void malloc_walk(size_t source, size_t printf_enabled) void malloc_walk(size_t source, size_t printf_enabled)
{ {
return; return;

View File

@@ -3,7 +3,7 @@
* *
* This routine is not defined in the POSIX 1003.1b standard but is * This routine is not defined in the POSIX 1003.1b standard but is
* commonly supported on most UNIX and POSIX systems. It is the * commonly supported on most UNIX and POSIX systems. It is the
* foundation for creating file system objects. * foundation for creating file system objects.
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
@@ -42,7 +42,7 @@ int mknod(
if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) ) if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
rtems_set_errno_and_return_minus_one( EINVAL ); rtems_set_errno_and_return_minus_one( EINVAL );
if ( S_ISFIFO(mode) ) if ( S_ISFIFO(mode) )
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
@@ -52,9 +52,9 @@ int mknod(
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
} }
result = (*temp_loc.ops->evalformake_h)( result = (*temp_loc.ops->evalformake_h)(
&pathname[i], &pathname[i],
&temp_loc, &temp_loc,
&name_start &name_start
); );
if ( result != 0 ) if ( result != 0 )

View File

@@ -3,8 +3,8 @@
* *
* XXX * XXX
* *
* XXX make sure no required ops are NULL * XXX make sure no required ops are NULL
* XXX make sure no optional ops you are using are NULL * XXX make sure no optional ops you are using are NULL
* XXX unmount should be required. * XXX unmount should be required.
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
@@ -55,8 +55,8 @@ static int Is_node_fs_root(
/* /*
* mount * mount
* *
* This routine will attempt to mount a new file system at the specified * This routine will attempt to mount a new file system at the specified
* mount point. A series of tests will be run to determine if any of the * mount point. A series of tests will be run to determine if any of the
* following reasons exist to prevent the mount operation: * following reasons exist to prevent the mount operation:
* *
* 1) The file system type or options are not valid * 1) The file system type or options are not valid
@@ -95,7 +95,7 @@ int mount(
* Are the file system options valid? * Are the file system options valid?
*/ */
if ( options != RTEMS_FILESYSTEM_READ_ONLY && if ( options != RTEMS_FILESYSTEM_READ_ONLY &&
options != RTEMS_FILESYSTEM_READ_WRITE ) { options != RTEMS_FILESYSTEM_READ_WRITE ) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
@@ -109,7 +109,7 @@ int mount(
/* /*
* Allocate a mount table entry * Allocate a mount table entry
*/ */
size = sizeof(rtems_filesystem_mount_table_entry_t); size = sizeof(rtems_filesystem_mount_table_entry_t);
@@ -133,12 +133,12 @@ int mount(
/* /*
* The mount_point should be a directory with read/write/execute * The mount_point should be a directory with read/write/execute
* permissions in the existing tree. * permissions in the existing tree.
*/ */
if ( mount_point ) { if ( mount_point ) {
if ( rtems_filesystem_evaluate_path( if ( rtems_filesystem_evaluate_path(
mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 ) mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 )
goto cleanup_and_bail; goto cleanup_and_bail;
@@ -153,12 +153,12 @@ int mount(
goto cleanup_and_bail; goto cleanup_and_bail;
} }
/* /*
* Test to see if it is a directory * Test to see if it is a directory
*/ */
if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
errno = ENOTDIR; errno = ENOTDIR;
goto cleanup_and_bail; goto cleanup_and_bail;
} }
@@ -170,11 +170,11 @@ int mount(
errno = EBUSY; errno = EBUSY;
goto cleanup_and_bail; goto cleanup_and_bail;
} }
/* /*
* This must be a good mount point, so move the location information * This must be a good mount point, so move the location information
* into the allocated mount entry. Note: the information that * into the allocated mount entry. Note: the information that
* may have been allocated in loc should not be sent to freenode * may have been allocated in loc should not be sent to freenode
* until the system is unmounted. It may be needed to correctly * until the system is unmounted. It may be needed to correctly
* traverse the tree. * traverse the tree.
*/ */
@@ -184,9 +184,9 @@ int mount(
temp_mt_entry->mt_point_node.ops = loc.ops; temp_mt_entry->mt_point_node.ops = loc.ops;
temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry; temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry;
/* /*
* This link to the parent is only done when we are dealing with system * This link to the parent is only done when we are dealing with system
* below the base file system * below the base file system
*/ */
if ( !loc.ops->mount_h ){ if ( !loc.ops->mount_h ){
@@ -199,9 +199,9 @@ int mount(
} }
} else { } else {
/* /*
* This is a mount of the base file system --> The * This is a mount of the base file system --> The
* mt_point_node.node_access will be set to null to indicate that this * mt_point_node.node_access will be set to null to indicate that this
* is the root of the entire file system. * is the root of the entire file system.
*/ */
@@ -224,7 +224,7 @@ int mount(
} }
/* /*
* Add the mount table entry to the mount table chain * Add the mount table entry to the mount table chain
*/ */
Chain_Append( &rtems_filesystem_mount_table_control, &temp_mt_entry->Node ); Chain_Append( &rtems_filesystem_mount_table_control, &temp_mt_entry->Node );
@@ -236,7 +236,7 @@ int mount(
cleanup_and_bail: cleanup_and_bail:
free( temp_mt_entry ); free( temp_mt_entry );
if ( loc_to_free ) if ( loc_to_free )
rtems_filesystem_freenode( loc_to_free ); rtems_filesystem_freenode( loc_to_free );
@@ -264,7 +264,7 @@ int init_fs_mount_table()
* This routine will run through the entries that currently exist in the * This routine will run through the entries that currently exist in the
* mount table chain. For each entry in the mount table chain it will * mount table chain. For each entry in the mount table chain it will
* compare the mount tables root node to the node describing the selected * compare the mount tables root node to the node describing the selected
* mount point. If any match is found true is returned else false is * mount point. If any match is found true is returned else false is
* returned. * returned.
* *
*/ */
@@ -276,8 +276,8 @@ static int Is_node_fs_root(
Chain_Node *the_node; Chain_Node *the_node;
rtems_filesystem_mount_table_entry_t *the_mount_entry; rtems_filesystem_mount_table_entry_t *the_mount_entry;
/* /*
* For each mount table entry * For each mount table entry
*/ */
for ( the_node = rtems_filesystem_mount_table_control.first; for ( the_node = rtems_filesystem_mount_table_control.first;

View File

@@ -41,11 +41,11 @@
* we just don't for now. * we just don't for now.
* Not sure if this is a problem with hpux, newlib, or something else. * Not sure if this is a problem with hpux, newlib, or something else.
*/ */
#if defined(RTEMS_UNIX) && !defined(hpux) #if defined(RTEMS_UNIX) && !defined(hpux)
#define NEED_SETVBUF #define NEED_SETVBUF
#endif #endif
#include <stdio.h> #include <stdio.h>
int _fwalk(struct _reent *ptr, int (*function) (FILE *) ); int _fwalk(struct _reent *ptr, int (*function) (FILE *) );
@@ -65,7 +65,7 @@ extern void _reclaim_reent(struct _reent *);
void libc_wrapup(void) void libc_wrapup(void)
{ {
/* /*
* In case RTEMS is already down, don't do this. It could be * In case RTEMS is already down, don't do this. It could be
* dangerous. * dangerous.
*/ */
@@ -87,7 +87,7 @@ void libc_wrapup(void)
#endif #endif
_REENT = &libc_global_reent; _REENT = &libc_global_reent;
} }
/* /*
* Try to drain output buffers. * Try to drain output buffers.
* *
@@ -100,7 +100,7 @@ void libc_wrapup(void)
fclose (stderr); fclose (stderr);
} }
/* /*
* reent struct allocation moved here from libc_start_hook() to avoid * reent struct allocation moved here from libc_start_hook() to avoid
* mutual exclusion problems when memory is allocated from the start hook. * mutual exclusion problems when memory is allocated from the start hook.
* *
@@ -129,14 +129,14 @@ rtems_boolean libc_create_hook(
#endif #endif
if (ptr) if (ptr)
{ {
#ifdef __GNUC__ #ifdef __GNUC__
/* GCC extension: structure constants */ /* GCC extension: structure constants */
_REENT_INIT_PTR((ptr)); _REENT_INIT_PTR((ptr));
#else #else
/* /*
* WARNING: THIS IS VERY DEPENDENT ON NEWLIB!!! * WARNING: THIS IS VERY DEPENDENT ON NEWLIB!!!
* Last visual check was against newlib 1.8.2 but last known * Last visual check was against newlib 1.8.2 but last known
* use was against 1.7.0. This is basically an exansion of * use was against 1.7.0. This is basically an exansion of
* REENT_INIT() in <sys/reent.h>. * REENT_INIT() in <sys/reent.h>.
@@ -171,7 +171,7 @@ rtems_extension libc_start_hook(
/* /*
* Called for all user TASKS (system tasks are MPCI Receive Server and IDLE) * Called for all user TASKS (system tasks are MPCI Receive Server and IDLE)
*/ */
#ifdef NEED_SETVBUF #ifdef NEED_SETVBUF
rtems_extension libc_begin_hook(rtems_tcb *current_task) rtems_extension libc_begin_hook(rtems_tcb *current_task)
{ {
@@ -248,7 +248,7 @@ rtems_extension libc_delete_hook(
*/ */
/* /*
* Just in case there are some buffers lying around. * Just in case there are some buffers lying around.
*/ */
_fwalk(ptr, newlib_free_buffers); _fwalk(ptr, newlib_free_buffers);
#if REENT_MALLOCED #if REENT_MALLOCED
free(ptr); free(ptr);

View File

@@ -52,10 +52,10 @@ int __kill( pid_t pid, int sig )
* 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
* *
* $Id$ * $Id$
*/ */
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include <rtems.h> #include <rtems.h>

View File

@@ -36,10 +36,10 @@
* EINTR - The open( operation was interrupted by a signal. * EINTR - The open( operation was interrupted by a signal.
* EINVAL - This implementation does not support synchronized IO for this * EINVAL - This implementation does not support synchronized IO for this
* file. * file.
* EISDIR - The named file is a directory and the flags argument * EISDIR - The named file is a directory and the flags argument
* specified write or read/write access. * specified write or read/write access.
* EMFILE - Too many file descriptors are in used by this process. * EMFILE - Too many file descriptors are in used by this process.
* ENAMETOOLONG - * ENAMETOOLONG -
* The length of the path exceeds PATH_MAX or a pathname * The length of the path exceeds PATH_MAX or a pathname
* component is longer than NAME_MAX while POSIX_NO_TRUNC * component is longer than NAME_MAX while POSIX_NO_TRUNC
* is in effect. * is in effect.
@@ -74,7 +74,7 @@ int open(
/* /*
* Set the Evaluation flags * Set the Evaluation flags
*/ */
eval_flags = 0; eval_flags = 0;
@@ -84,7 +84,7 @@ int open(
if ( ( status & _FWRITE ) == _FWRITE ) if ( ( status & _FWRITE ) == _FWRITE )
eval_flags |= RTEMS_LIBIO_PERMS_WRITE; eval_flags |= RTEMS_LIBIO_PERMS_WRITE;
va_start(ap, flags); va_start(ap, flags);
mode = va_arg( ap, int ); mode = va_arg( ap, int );
@@ -160,7 +160,7 @@ int open(
if ( !iop->handlers->open_h ) { if ( !iop->handlers->open_h ) {
rc = ENOTSUP; rc = ENOTSUP;
goto done; goto done;
} }
rc = (*iop->handlers->open_h)( iop, pathname, flags, mode ); rc = (*iop->handlers->open_h)( iop, pathname, flags, mode );
@@ -180,7 +180,7 @@ int open(
loc_to_free = NULL; loc_to_free = NULL;
} }
} }
/* /*
* Single exit and clean up path. * Single exit and clean up path.
*/ */

View File

@@ -3,7 +3,7 @@
* *
* This was copied from Newlib 1.8.0. * This was copied from Newlib 1.8.0.
* *
* *
* Copyright (c) 1983 Regents of the University of California. * Copyright (c) 1983 Regents of the University of California.
* All rights reserved. * All rights reserved.
* *

View File

@@ -31,7 +31,7 @@
| Description: print number in a given base. | Description: print number in a given base.
| Global Variables: None. | Global Variables: None.
| Arguments: num - number to print, base - base used to print the number. | Arguments: num - number to print, base - base used to print the number.
| Returns: Nothing. | Returns: Nothing.
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
static void static void
printNum(long unsigned int num, int base, int sign, int maxwidth, int lead) printNum(long unsigned int num, int base, int sign, int maxwidth, int lead)
@@ -45,7 +45,7 @@ printNum(long unsigned int num, int base, int sign, int maxwidth, int lead)
num = -num; num = -num;
if (maxwidth) maxwidth--; if (maxwidth) maxwidth--;
} }
count = 0; count = 0;
while ((n = num / base) > 0) { while ((n = num / base) > 0) {
toPrint[count++] = (num - (n*base)); toPrint[count++] = (num - (n*base));
@@ -70,7 +70,7 @@ printNum(long unsigned int num, int base, int sign, int maxwidth, int lead)
console is not yet initialized or in ISR's. console is not yet initialized or in ISR's.
| Global Variables: None. | Global Variables: None.
| Arguments: as in printf: fmt - format string, ... - unnamed arguments. | Arguments: as in printf: fmt - format string, ... - unnamed arguments.
| Returns: Nothing. | Returns: Nothing.
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
void void
vprintk(char *fmt, va_list ap) vprintk(char *fmt, va_list ap)
@@ -80,7 +80,7 @@ vprintk(char *fmt, va_list ap)
/* unsigned int level; */ /* unsigned int level; */
/* _CPU_ISR_Disable(level); */ /* _CPU_ISR_Disable(level); */
for (; *fmt != '\0'; fmt++) for (; *fmt != '\0'; fmt++)
{ {
lflag = 0; lflag = 0;
@@ -114,7 +114,7 @@ vprintk(char *fmt, va_list ap)
case 'u': case 'U': base = 10; sign = 0; break; case 'u': case 'U': base = 10; sign = 0; break;
case 'x': case 'X': base = 16; sign = 0; break; case 'x': case 'X': base = 16; sign = 0; break;
case 's': case 's':
for (str = va_arg(ap, char *); *str; str++) for (str = va_arg(ap, char *); *str; str++)
BSP_output_char(*str); BSP_output_char(*str);
break; break;
case 'c': case 'c':
@@ -150,7 +150,7 @@ void
printk(char *fmt, ...) printk(char *fmt, ...)
{ {
va_list ap; /* points to each unnamed argument in turn */ va_list ap; /* points to each unnamed argument in turn */
va_start(ap, fmt); /* make ap point to 1st unnamed arg */ va_start(ap, fmt); /* make ap point to 1st unnamed arg */
vprintk(fmt, ap); vprintk(fmt, ap);
va_end(ap); /* clean up when done */ va_end(ap); /* clean up when done */

View File

@@ -38,7 +38,7 @@ free_user_env(void *venv)
{ {
rtems_user_env_t *env = (rtems_user_env_t*) venv ; rtems_user_env_t *env = (rtems_user_env_t*) venv ;
if (env != &rtems_global_user_env if (env != &rtems_global_user_env
#ifdef HAVE_USERENV_REFCNT #ifdef HAVE_USERENV_REFCNT
&& --env->refcnt <= 0 && --env->refcnt <= 0
#endif #endif
@@ -76,11 +76,11 @@ rtems_status_code rtems_libio_set_private_env(void) {
return sc; return sc;
} }
rtems_current_user_env = tmp; rtems_current_user_env = tmp;
}; };
*rtems_current_user_env = rtems_global_user_env; /* get the global values*/ *rtems_current_user_env = rtems_global_user_env; /* get the global values*/
rtems_current_user_env->task_id=task_id; /* mark the local values*/ rtems_current_user_env->task_id=task_id; /* mark the local values*/
/* get a clean root */ /* get a clean root */
rtems_filesystem_root = THE_ROOT_FS_LOC; rtems_filesystem_root = THE_ROOT_FS_LOC;
@@ -127,11 +127,11 @@ rtems_status_code rtems_libio_share_private_env(rtems_id task_id) {
if (sc != RTEMS_SUCCESSFUL) return sc; if (sc != RTEMS_SUCCESSFUL) return sc;
if (rtems_current_user_env->task_id==current_task_id) { if (rtems_current_user_env->task_id==current_task_id) {
/* kill the current user env & task_var*/ /* kill the current user env & task_var*/
rtems_user_env_t *tmp = rtems_current_user_env; rtems_user_env_t *tmp = rtems_current_user_env;
sc = rtems_task_variable_delete(RTEMS_SELF,(void*)&rtems_current_user_env); sc = rtems_task_variable_delete(RTEMS_SELF,(void*)&rtems_current_user_env);
if (sc != RTEMS_SUCCESSFUL) return sc; if (sc != RTEMS_SUCCESSFUL) return sc;
free_user_env(tmp); free_user_env(tmp);
}; };
/* AT THIS POINT, rtems_current_user_env is DANGLING */ /* AT THIS POINT, rtems_current_user_env is DANGLING */
@@ -144,7 +144,7 @@ rtems_status_code rtems_libio_share_private_env(rtems_id task_id) {
sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env); sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
goto bailout; goto bailout;
/* the current_user_env is the same pointer that remote env */ /* the current_user_env is the same pointer that remote env */
rtems_current_user_env = shared_user_env; rtems_current_user_env = shared_user_env;

View File

@@ -3,7 +3,7 @@
* *
* This was copied from Newlib 1.8.0. * This was copied from Newlib 1.8.0.
* *
* *
* Copyright (c) 1983 Regents of the University of California. * Copyright (c) 1983 Regents of the University of California.
* All rights reserved. * All rights reserved.
* *
@@ -59,7 +59,7 @@ struct dirent *
readdir(dirp) readdir(dirp)
register DIR *dirp; { register DIR *dirp; {
register struct dirent *dp; register struct dirent *dp;
if ( !dirp ) if ( !dirp )
return NULL; return NULL;
@@ -68,7 +68,7 @@ register DIR *dirp; {
dirp->dd_size = getdents (dirp->dd_fd, dirp->dd_size = getdents (dirp->dd_fd,
dirp->dd_buf, dirp->dd_buf,
dirp->dd_len); dirp->dd_len);
if (dirp->dd_size <= 0) if (dirp->dd_size <= 0)
return NULL; return NULL;
} }

View File

@@ -33,7 +33,7 @@ int readlink(
result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE ); result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE );
if ( result != 0 ) if ( result != 0 )
return -1; return -1;
if ( !loc.ops->node_type_h ){ if ( !loc.ops->node_type_h ){
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
@@ -52,6 +52,6 @@ int readlink(
result = (*loc.ops->readlink_h)( &loc, buf, bufsize ); result = (*loc.ops->readlink_h)( &loc, buf, bufsize );
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
return result; return result;
} }

View File

@@ -31,7 +31,7 @@ void rewinddir(
return; return;
status = lseek( dirp->dd_fd, 0, SEEK_SET ); status = lseek( dirp->dd_fd, 0, SEEK_SET );
if( status == -1 ) if( status == -1 )
return; return;

View File

@@ -68,9 +68,9 @@ int rmdir(
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
} }
result = (*loc.handlers->rmnod_h)( &loc ); result = (*loc.handlers->rmnod_h)( &loc );
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
return result; return result;
} }

View File

@@ -3,7 +3,7 @@
* *
* This was copied from Newlib 1.8.0. * This was copied from Newlib 1.8.0.
* *
* *
* Copyright (c) 1983 Regents of the University of California. * Copyright (c) 1983 Regents of the University of California.
* All rights reserved. * All rights reserved.
* *
@@ -99,7 +99,7 @@ scandir(dirname, namelist, select, dcomp)
/* /*
* estimate the array size by taking the size of the directory file * estimate the array size by taking the size of the directory file
* and dividing it by a multiple of the minimum size entry. * and dividing it by a multiple of the minimum size entry.
*/ */
arraysz = (stb.st_size / 24); arraysz = (stb.st_size / 24);
names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *)); names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *));
@@ -145,7 +145,7 @@ cleanup_and_bail:
if ( dirp ) if ( dirp )
closedir( dirp ); closedir( dirp );
if ( names ) { if ( names ) {
for (i=0; i < nitems; i++ ) for (i=0; i < nitems; i++ )
free( names[i] ); free( names[i] );

View File

@@ -37,7 +37,7 @@ void seekdir(
* This is not a nice way to error out, but we have no choice here. * This is not a nice way to error out, but we have no choice here.
*/ */
if ( status == -1 ) if ( status == -1 )
return; return;
dirp->dd_loc = 0; dirp->dd_loc = 0;

View File

@@ -62,7 +62,7 @@ int _STAT_NAME(
status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS ); status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
if ( status != 0 ) if ( status != 0 )
return -1; return -1;
if ( !loc.handlers->fstat_h ){ if ( !loc.handlers->fstat_h ){
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
rtems_set_errno_and_return_minus_one( ENOTSUP ); rtems_set_errno_and_return_minus_one( ENOTSUP );
@@ -78,7 +78,7 @@ int _STAT_NAME(
status = (*loc.handlers->fstat_h)( &loc, buf ); status = (*loc.handlers->fstat_h)( &loc, buf );
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
return status; return status;
} }
#endif #endif

View File

@@ -1,13 +1,13 @@
/* /*
* telldir() - XXX * telldir() - XXX
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE. * http://www.rtems.com/license/LICENSE.
* *
*/ */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
@@ -31,7 +31,7 @@ long telldir(
rtems_libio_t *iop; rtems_libio_t *iop;
if ( !dirp ) if ( !dirp )
rtems_set_errno_and_return_minus_one( EBADF ); rtems_set_errno_and_return_minus_one( EBADF );
/* /*
* Get the file control block structure associated with the * Get the file control block structure associated with the

View File

@@ -236,7 +236,7 @@ rtems_termios_open (
rtems_build_name ('T', 'x', 'T', c), rtems_build_name ('T', 'x', 'T', c),
TERMIOS_TXTASK_PRIO, TERMIOS_TXTASK_PRIO,
TERMIOS_TXTASK_STACKSIZE, TERMIOS_TXTASK_STACKSIZE,
RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
RTEMS_NO_ASR, RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->txTaskId); &tty->txTaskId);
@@ -246,13 +246,13 @@ rtems_termios_open (
rtems_build_name ('R', 'x', 'T', c), rtems_build_name ('R', 'x', 'T', c),
TERMIOS_RXTASK_PRIO, TERMIOS_RXTASK_PRIO,
TERMIOS_RXTASK_STACKSIZE, TERMIOS_RXTASK_STACKSIZE,
RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
RTEMS_NO_ASR, RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->rxTaskId); &tty->rxTaskId);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc); rtems_fatal_error_occurred (sc);
} }
if ((tty->device.pollRead == NULL) || if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){ (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
@@ -316,7 +316,7 @@ rtems_termios_open (
(rtems_task_argument)tty); (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL) if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc); rtems_fatal_error_occurred (sc);
sc = rtems_task_start(tty->txTaskId, sc = rtems_task_start(tty->txTaskId,
rtems_termios_txdaemon, rtems_termios_txdaemon,
(rtems_task_argument)tty); (rtems_task_argument)tty);
@@ -376,8 +376,8 @@ rtems_termios_close (void *arg)
*/ */
drainOutput (tty); drainOutput (tty);
} }
if (tty->device.outputUsesInterrupts if (tty->device.outputUsesInterrupts
== TERMIOS_TASK_DRIVEN) { == TERMIOS_TASK_DRIVEN) {
/* /*
* send "terminate" to I/O tasks * send "terminate" to I/O tasks
@@ -440,12 +440,12 @@ rtems_status_code rtems_termios_bufsize (
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
static void static void
termios_set_flowctrl(struct rtems_termios_tty *tty) termios_set_flowctrl(struct rtems_termios_tty *tty)
{ {
rtems_interrupt_level level; rtems_interrupt_level level;
/* /*
* check for flow control options to be switched off * check for flow control options to be switched off
*/ */
/* check for outgoing XON/XOFF flow control switched off */ /* check for outgoing XON/XOFF flow control switched off */
@@ -483,17 +483,17 @@ termios_set_flowctrl(struct rtems_termios_tty *tty)
!(tty->termios.c_cflag & CRTSCTS)) { !(tty->termios.c_cflag & CRTSCTS)) {
/* clear related flags in flow_ctrl */ /* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDRTS); tty->flow_ctrl &= ~(FL_MDRTS);
/* restart remote Tx, if it was stopped */ /* restart remote Tx, if it was stopped */
if ((tty->flow_ctrl & FL_IRTSOFF) && if ((tty->flow_ctrl & FL_IRTSOFF) &&
(tty->device.startRemoteTx != NULL)) { (tty->device.startRemoteTx != NULL)) {
tty->device.startRemoteTx(tty->minor); tty->device.startRemoteTx(tty->minor);
} }
tty->flow_ctrl &= ~(FL_IRTSOFF); tty->flow_ctrl &= ~(FL_IRTSOFF);
} }
/* /*
* check for flow control options to be switched on * check for flow control options to be switched on
*/ */
/* check for incoming RTS/CTS flow control switched on */ /* check for incoming RTS/CTS flow control switched on */
if (tty->termios.c_cflag & CRTSCTS) { if (tty->termios.c_cflag & CRTSCTS) {
@@ -608,9 +608,9 @@ rtems_termios_ioctl (void *arg)
sc = linesw[tty->t_line].l_open(tty); sc = linesw[tty->t_line].l_open(tty);
} }
break; break;
case TIOCGETD: case TIOCGETD:
*(int*)(args->buffer)=tty->t_line; *(int*)(args->buffer)=tty->t_line;
break; break;
#endif #endif
case FIONREAD: case FIONREAD:
/* Half guess that this is the right operation */ /* Half guess that this is the right operation */
@@ -672,7 +672,7 @@ rtems_termios_puts (const char *buf, int len, struct rtems_termios_tty *tty)
} }
else { else {
/* remember that output has been stopped due to flow ctrl*/ /* remember that output has been stopped due to flow ctrl*/
tty->flow_ctrl |= FL_OSTOP; tty->flow_ctrl |= FL_OSTOP;
} }
tty->rawOutBufState = rob_busy; tty->rawOutBufState = rob_busy;
} }
@@ -1031,12 +1031,12 @@ fillBufferQueue (struct rtems_termios_tty *tty)
&& ((tty->rawOutBufState == rob_idle) && ((tty->rawOutBufState == rob_idle)
|| (tty->flow_ctrl & FL_OSTOP))) { || (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */ /* XON should be sent now... */
(*tty->device.write)(tty->minor, (*tty->device.write)(tty->minor,
&(tty->termios.c_cc[VSTART]), &(tty->termios.c_cc[VSTART]),
1); 1);
} }
else if (tty->flow_ctrl & FL_MDRTS) { else if (tty->flow_ctrl & FL_MDRTS) {
tty->flow_ctrl &= ~FL_IRTSOFF; tty->flow_ctrl &= ~FL_IRTSOFF;
/* activate RTS line */ /* activate RTS line */
if (tty->device.startRemoteTx != NULL) { if (tty->device.startRemoteTx != NULL) {
tty->device.startRemoteTx(tty->minor); tty->device.startRemoteTx(tty->minor);
@@ -1144,7 +1144,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
c = *buf++; c = *buf++;
linesw[tty->t_line].l_rint(c,tty); linesw[tty->t_line].l_rint(c,tty);
} }
/* /*
* check to see if rcv wakeup callback was set * check to see if rcv wakeup callback was set
*/ */
@@ -1159,7 +1159,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
c = *buf++; c = *buf++;
/* FIXME: implement IXANY: any character restarts output */ /* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */ /* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) { if (tty->flow_ctrl & FL_MDXON) {
/* if received char is V_STOP and V_START (both are equal value) */ /* if received char is V_STOP and V_START (both are equal value) */
if (c == tty->termios.c_cc[VSTOP]) { if (c == tty->termios.c_cc[VSTOP]) {
if (c == tty->termios.c_cc[VSTART]) { if (c == tty->termios.c_cc[VSTART]) {
@@ -1196,20 +1196,20 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
/* reenable interrupts */ /* reenable interrupts */
rtems_interrupt_enable(level); rtems_interrupt_enable(level);
} }
} }
else { else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size; newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
/* if chars_in_buffer > highwater */ /* if chars_in_buffer > highwater */
rtems_interrupt_disable(level); rtems_interrupt_disable(level);
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size) if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
% tty->rawInBuf.Size) % tty->rawInBuf.Size)
> tty->highwater) && > tty->highwater) &&
!(tty->flow_ctrl & FL_IREQXOF)) { !(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */ /* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF; tty->flow_ctrl |= FL_IREQXOF;
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF)) if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
== (FL_MDXOF ) ){ == (FL_MDXOF ) ){
if ((tty->flow_ctrl & FL_OSTOP) || if ((tty->flow_ctrl & FL_OSTOP) ||
(tty->rawOutBufState == rob_idle)) { (tty->rawOutBufState == rob_idle)) {
/* if tx is stopped due to XOFF or out of data */ /* if tx is stopped due to XOFF or out of data */
/* call write function here */ /* call write function here */
@@ -1219,9 +1219,9 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
1); 1);
} }
} }
else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF))
== (FL_MDRTS ) ) { == (FL_MDRTS ) ) {
tty->flow_ctrl |= FL_IRTSOFF; tty->flow_ctrl |= FL_IRTSOFF;
/* deactivate RTS line */ /* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) { if (tty->device.stopRemoteTx != NULL) {
tty->device.stopRemoteTx(tty->minor); tty->device.stopRemoteTx(tty->minor);
@@ -1237,7 +1237,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
else { else {
tty->rawInBuf.theBuf[newTail] = c; tty->rawInBuf.theBuf[newTail] = c;
tty->rawInBuf.Tail = newTail; tty->rawInBuf.Tail = newTail;
/* /*
* check to see if rcv wakeup callback was set * check to see if rcv wakeup callback was set
*/ */
@@ -1245,7 +1245,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg); (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1; tty->tty_rcvwakeup = 1;
} }
} }
} }
} }
tty->rawInBufDropped += dropped; tty->rawInBufDropped += dropped;
@@ -1269,7 +1269,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF)) if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
== (FL_MDXOF | FL_IREQXOF)) { == (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */ /* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (*tty->device.write)(tty->minor,
&(tty->termios.c_cc[VSTOP]), 1); &(tty->termios.c_cc[VSTOP]), 1);
rtems_interrupt_disable(level); rtems_interrupt_disable(level);
@@ -1284,12 +1284,12 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
/* NOTE: send XON even, if no longer in XON/XOFF mode... */ /* NOTE: send XON even, if no longer in XON/XOFF mode... */
/* XON should be sent now... */ /* XON should be sent now... */
/* /*
* FIXME: this .write call will generate another * FIXME: this .write call will generate another
* dequeue callback. This will advance the "Tail" in the data * dequeue callback. This will advance the "Tail" in the data
* buffer, although the corresponding data is not yet out! * buffer, although the corresponding data is not yet out!
* Therefore the dequeue "length" should be reduced by 1 * Therefore the dequeue "length" should be reduced by 1
*/ */
(*tty->device.write)(tty->minor, (*tty->device.write)(tty->minor,
&(tty->termios.c_cc[VSTART]), 1); &(tty->termios.c_cc[VSTART]), 1);
rtems_interrupt_disable(level); rtems_interrupt_disable(level);
@@ -1305,12 +1305,12 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
* buffer was empty * buffer was empty
*/ */
if (tty->rawOutBufState == rob_wait) { if (tty->rawOutBufState == rob_wait) {
/* /*
* this should never happen... * this should never happen...
*/ */
rtems_semaphore_release (tty->rawOutBuf.Semaphore); rtems_semaphore_release (tty->rawOutBuf.Semaphore);
} }
return 0; return 0;
} }
rtems_interrupt_disable(level); rtems_interrupt_disable(level);
@@ -1321,7 +1321,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size; newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
tty->rawOutBuf.Tail = newTail; tty->rawOutBuf.Tail = newTail;
if (tty->rawOutBufState == rob_wait) { if (tty->rawOutBufState == rob_wait) {
/* /*
* wake up any pending writer task * wake up any pending writer task
*/ */
rtems_semaphore_release (tty->rawOutBuf.Semaphore); rtems_semaphore_release (tty->rawOutBuf.Semaphore);
@@ -1332,7 +1332,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
*/ */
tty->rawOutBufState = rob_idle; tty->rawOutBufState = rob_idle;
nToSend = 0; nToSend = 0;
/* /*
* check to see if snd wakeup callback was set * check to see if snd wakeup callback was set
*/ */
@@ -1341,7 +1341,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
} }
} }
/* check, whether output should stop due to received XOFF */ /* check, whether output should stop due to received XOFF */
else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF)) else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF))
== (FL_MDXON | FL_ORCVXOF)) { == (FL_MDXON | FL_ORCVXOF)) {
/* Buffer not empty, but output stops due to XOFF */ /* Buffer not empty, but output stops due to XOFF */
/* set flag, that output has been stopped */ /* set flag, that output has been stopped */
@@ -1366,8 +1366,8 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
nToSend = 1; nToSend = 1;
} }
tty->rawOutBufState = rob_busy; /*apm*/ tty->rawOutBufState = rob_busy; /*apm*/
(*tty->device.write)(tty->minor, (*tty->device.write)(tty->minor,
(char *)&tty->rawOutBuf.theBuf[newTail], (char *)&tty->rawOutBuf.theBuf[newTail],
nToSend); nToSend);
} }
tty->rawOutBuf.Tail = newTail; /*apm*/ tty->rawOutBuf.Tail = newTail; /*apm*/
@@ -1381,7 +1381,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
* device transmit interrupt handler. * device transmit interrupt handler.
* The second argument is the number of characters transmitted so far. * The second argument is the number of characters transmitted so far.
* This value will always be 1 for devices which generate an interrupt * This value will always be 1 for devices which generate an interrupt
* for each transmitted character. * for each transmitted character.
* It returns number of characters left to transmit * It returns number of characters left to transmit
*/ */
int int
@@ -1431,7 +1431,7 @@ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument)
/* /*
* wait for rtems event * wait for rtems event
*/ */
rtems_event_receive((TERMIOS_TX_START_EVENT | rtems_event_receive((TERMIOS_TX_START_EVENT |
TERMIOS_TX_TERMINATE_EVENT), TERMIOS_TX_TERMINATE_EVENT),
RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, RTEMS_NO_TIMEOUT,
@@ -1468,7 +1468,7 @@ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument)
/* /*
* wait for rtems event * wait for rtems event
*/ */
rtems_event_receive((TERMIOS_RX_PROC_EVENT | rtems_event_receive((TERMIOS_RX_PROC_EVENT |
TERMIOS_RX_TERMINATE_EVENT), TERMIOS_RX_TERMINATE_EVENT),
RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, RTEMS_NO_TIMEOUT,

View File

@@ -41,7 +41,7 @@ void libc_init(int reentrant)
} }
#else #else
/* remove ANSI errors. /* remove ANSI errors.
* A program must contain at least one external-declaration * A program must contain at least one external-declaration
* (X3.159-1989 p.82,L3). * (X3.159-1989 p.82,L3).

View File

@@ -20,8 +20,8 @@
#include <rtems/libio_.h> #include <rtems/libio_.h>
#include <rtems/seterr.h> #include <rtems/seterr.h>
int unlink( int unlink(
const char *path const char *path
) )
{ {
rtems_filesystem_location_info_t loc; rtems_filesystem_location_info_t loc;
@@ -34,7 +34,7 @@ int unlink(
result = rtems_filesystem_evaluate_path( path, 0, &loc, FALSE ); result = rtems_filesystem_evaluate_path( path, 0, &loc, FALSE );
if ( result != 0 ) if ( result != 0 )
return -1; return -1;
result = rtems_filesystem_evaluate_parent(RTEMS_LIBIO_PERMS_WRITE, &loc ); result = rtems_filesystem_evaluate_parent(RTEMS_LIBIO_PERMS_WRITE, &loc );
if (result != 0){ if (result != 0){
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
@@ -59,7 +59,7 @@ int unlink(
result = (*loc.ops->unlink_h)( &loc ); result = (*loc.ops->unlink_h)( &loc );
rtems_filesystem_freenode( &loc ); rtems_filesystem_freenode( &loc );
return result; return result;
} }

View File

@@ -1,7 +1,7 @@
/* /*
* unmount() - Unmount a File System * unmount() - Unmount a File System
* *
* This routine is not defined in the POSIX 1003.1b standard but * This routine is not defined in the POSIX 1003.1b standard but
* in some form is supported on most UNIX and POSIX systems. This * in some form is supported on most UNIX and POSIX systems. This
* routine is necessary to mount instantiations of a file system * routine is necessary to mount instantiations of a file system
* into the file system name space. * into the file system name space.
@@ -43,7 +43,7 @@ int search_mt_for_mount_point(
rtems_filesystem_location_info_t *location_of_mount_point rtems_filesystem_location_info_t *location_of_mount_point
); );
rtems_boolean rtems_filesystem_nodes_equal( rtems_boolean rtems_filesystem_nodes_equal(
const rtems_filesystem_location_info_t *loc1, const rtems_filesystem_location_info_t *loc1,
const rtems_filesystem_location_info_t *loc2 const rtems_filesystem_location_info_t *loc2
){ ){
@@ -59,11 +59,11 @@ rtems_boolean rtems_filesystem_nodes_equal(
* compare the mount tables mt_fs_root to the new_fs_root_node. If any of the * compare the mount tables mt_fs_root to the new_fs_root_node. If any of the
* mount table file system root nodes matches the new file system root node * mount table file system root nodes matches the new file system root node
* this indicates that we are trying to mount a file system that has already * this indicates that we are trying to mount a file system that has already
* been mounted. This is not a permitted operation. temp_loc is set to * been mounted. This is not a permitted operation. temp_loc is set to
* the root node of the file system being unmounted. * the root node of the file system being unmounted.
*/ */
rtems_boolean file_systems_below_this_mountpoint( rtems_boolean file_systems_below_this_mountpoint(
const char *path, const char *path,
rtems_filesystem_location_info_t *fs_root_loc, rtems_filesystem_location_info_t *fs_root_loc,
rtems_filesystem_mount_table_entry_t *fs_to_unmount rtems_filesystem_mount_table_entry_t *fs_to_unmount
@@ -91,7 +91,7 @@ rtems_boolean file_systems_below_this_mountpoint(
/* /*
* unmount * unmount
* *
* This routine will attempt to unmount the file system that has been * This routine will attempt to unmount the file system that has been
* is mounted a path. If the operation is successful, 0 will * is mounted a path. If the operation is successful, 0 will
* be returned to the calling routine. Otherwise, 1 will be returned. * be returned to the calling routine. Otherwise, 1 will be returned.
@@ -119,7 +119,7 @@ int unmount(
mt_entry = loc.mt_entry; mt_entry = loc.mt_entry;
fs_mount_loc = &mt_entry->mt_point_node; fs_mount_loc = &mt_entry->mt_point_node;
fs_root_loc = &mt_entry->mt_fs_root; fs_root_loc = &mt_entry->mt_fs_root;
/* /*
* Verify this is the root node for the file system to be unmounted. * Verify this is the root node for the file system to be unmounted.
*/ */
@@ -167,12 +167,12 @@ int unmount(
/* /*
* Run the file descriptor table to determine if there are any file * Run the file descriptor table to determine if there are any file
* descriptors that are currently active and reference nodes in the * descriptors that are currently active and reference nodes in the
* file system that we are trying to unmount * file system that we are trying to unmount
*/ */
if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 ) if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 )
rtems_set_errno_and_return_minus_one( EBUSY ); rtems_set_errno_and_return_minus_one( EBUSY );
/* /*
* Allow the file system being unmounted on to do its cleanup. * Allow the file system being unmounted on to do its cleanup.
* If it fails it will set the errno to the approprate value * If it fails it will set the errno to the approprate value
@@ -191,7 +191,7 @@ int unmount(
* directory node. * directory node.
* *
* NOTE: Fatal error is called in a case which should never happen * NOTE: Fatal error is called in a case which should never happen
* This was response was questionable but the best we could * This was response was questionable but the best we could
* come up with. * come up with.
*/ */

View File

@@ -46,7 +46,7 @@ int uname(
strcpy( name->release, RTEMS_VERSION ); strcpy( name->release, RTEMS_VERSION );
strcpy( name->version, "" ); strcpy( name->version, "" );
sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME ); sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );
return 0; return 0;

View File

@@ -20,7 +20,7 @@
/* /*
* write * write
* *
* This routine writes count bytes from from buffer pointed to by buffer * This routine writes count bytes from from buffer pointed to by buffer
* to the file associated with the open file descriptor, fildes. * to the file associated with the open file descriptor, fildes.
*/ */

View File

@@ -26,8 +26,8 @@ extern "C" {
* Unless told otherwise, the RTEMS include files will hide some stuff * Unless told otherwise, the RTEMS include files will hide some stuff
* from normal application code. Defining this crosses a boundary which * from normal application code. Defining this crosses a boundary which
* is undesirable since it means your application is using RTEMS features * is undesirable since it means your application is using RTEMS features
* which are not included in the formally defined and supported API. * which are not included in the formally defined and supported API.
* Define this at your own risk. * Define this at your own risk.
*/ */
#if (!defined(__RTEMS_VIOLATE_KERNEL_VISIBILITY__)) && (!defined(__RTEMS_INSIDE__)) #if (!defined(__RTEMS_VIOLATE_KERNEL_VISIBILITY__)) && (!defined(__RTEMS_INSIDE__))
@@ -70,22 +70,22 @@ extern "C" {
/* /*
* The following define the constants which may be used in name searches. * The following define the constants which may be used in name searches.
*/ */
#define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES #define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES
#define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES #define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES
#define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE #define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE
#define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I #define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I
/* /*
* Parameters and return id's for _Objects_Get_next * Parameters and return id's for _Objects_Get_next
*/ */
#define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX #define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX
#define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX #define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX
#define RTEMS_OBJECT_ID_INITIAL(api, class, node) OBJECTS_ID_INITIAL(api, class, node) #define RTEMS_OBJECT_ID_INITIAL(api, class, node) OBJECTS_ID_INITIAL(api, class, node)
#define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL #define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL
/* /*
* The following constant defines the minimum stack size which every * The following constant defines the minimum stack size which every
* thread must exceed. * thread must exceed.
@@ -102,9 +102,9 @@ extern "C" {
/* /*
* An MPCI must support packets of at least this size. * An MPCI must support packets of at least this size.
*/ */
#define RTEMS_MINIMUM_PACKET_SIZE MP_PACKET_MINIMUM_PACKET_SIZE #define RTEMS_MINIMUM_PACKET_SIZE MP_PACKET_MINIMUM_PACKET_SIZE
/* /*
* The following constant defines the number of uint32_t 's * The following constant defines the number of uint32_t 's
* in a packet which must be converted to native format in a * in a packet which must be converted to native format in a
@@ -112,13 +112,13 @@ extern "C" {
* MP_PACKET_MINIMUN_HETERO_CONVERSION uint32_t 's, some of the "extra" data * MP_PACKET_MINIMUN_HETERO_CONVERSION uint32_t 's, some of the "extra" data
* may a user message buffer which is not automatically endian swapped. * may a user message buffer which is not automatically endian swapped.
*/ */
#define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION #define RTEMS_MINIMUN_HETERO_CONVERSION MP_PACKET_MINIMUN_HETERO_CONVERSION
/* /*
* rtems_object_id_to_name * rtems_object_id_to_name
* *
* This directive returns the name associated with the specified * This directive returns the name associated with the specified
* object ID. * object ID.
* *
* Input parameters: * Input parameters:

View File

@@ -14,11 +14,11 @@
* are divided into data cache and instruction cache functions. Data cache * are divided into data cache and instruction cache functions. Data cache
* functions are only meaningful if a data cache is supported. Instruction * functions are only meaningful if a data cache is supported. Instruction
* cache functions are only meaningful if an instruction cache is supported. * cache functions are only meaningful if an instruction cache is supported.
* *
* The functions below are implemented with CPU dependent support routines * The functions below are implemented with CPU dependent support routines
* implemented as part of libcpu. In the event that a CPU does not support a * implemented as part of libcpu. In the event that a CPU does not support a
* specific function, the CPU dependent routine does nothing (but does exist). * specific function, the CPU dependent routine does nothing (but does exist).
* *
* At this point, the Cache Manager makes no considerations, and provides no * At this point, the Cache Manager makes no considerations, and provides no
* support for BSP specific issues such as a secondary cache. In such a system, * support for BSP specific issues such as a secondary cache. In such a system,
* the CPU dependent routines would have to be modified, or a BSP layer added * the CPU dependent routines would have to be modified, or a BSP layer added

View File

@@ -60,7 +60,7 @@ typedef enum {
* *
* This routine performs the initialization necessary for this manager. * This routine performs the initialization necessary for this manager.
*/ */
void _Event_Manager_initialization( void ); void _Event_Manager_initialization( void );
/* /*

View File

@@ -32,19 +32,19 @@ typedef ISR_Level rtems_interrupt_level;
* The following type defines the control block used to manage * The following type defines the control block used to manage
* the vectors. * the vectors.
*/ */
typedef ISR_Vector_number rtems_vector_number; typedef ISR_Vector_number rtems_vector_number;
/* /*
* Return type for ISR Handler * Return type for ISR Handler
*/ */
typedef void rtems_isr; typedef void rtems_isr;
/* /*
* Pointer to an ISR Handler * Pointer to an ISR Handler
*/ */
typedef rtems_isr ( *rtems_isr_entry )( typedef rtems_isr ( *rtems_isr_entry )(
rtems_vector_number rtems_vector_number
); );
@@ -88,7 +88,7 @@ rtems_status_code rtems_interrupt_catch(
#define rtems_interrupt_disable( _isr_cookie ) \ #define rtems_interrupt_disable( _isr_cookie ) \
_ISR_Disable(_isr_cookie) _ISR_Disable(_isr_cookie)
/* /*
* rtems_interrupt_enable * rtems_interrupt_enable
* *
@@ -100,7 +100,7 @@ rtems_status_code rtems_interrupt_catch(
#define rtems_interrupt_enable( _isr_cookie ) \ #define rtems_interrupt_enable( _isr_cookie ) \
_ISR_Enable(_isr_cookie) _ISR_Enable(_isr_cookie)
/* /*
* rtems_interrupt_flash * rtems_interrupt_flash
* *
@@ -123,7 +123,7 @@ rtems_status_code rtems_interrupt_catch(
* that the caller is an interrupt service routine, NOT a thread. The * that the caller is an interrupt service routine, NOT a thread. The
* directives available to an interrupt service routine are restricted. * directives available to an interrupt service routine are restricted.
*/ */
#define rtems_interrupt_is_in_progress() \ #define rtems_interrupt_is_in_progress() \
_ISR_Is_in_progress() _ISR_Is_in_progress()

View File

@@ -45,7 +45,7 @@ extern "C" {
* may be submitted to a message queue. The message may be posted * may be submitted to a message queue. The message may be posted
* in a send or urgent fashion. * in a send or urgent fashion.
*/ */
typedef enum { typedef enum {
MESSAGE_QUEUE_SEND_REQUEST = 0, MESSAGE_QUEUE_SEND_REQUEST = 0,
MESSAGE_QUEUE_URGENT_REQUEST = 1 MESSAGE_QUEUE_URGENT_REQUEST = 1
@@ -182,7 +182,7 @@ rtems_status_code rtems_message_queue_urgent(
* *
* This routine implements the rtems_message_queue_broadcast directive. * This routine implements the rtems_message_queue_broadcast directive.
* This directive sends the message buffer to all of the tasks blocked * This directive sends the message buffer to all of the tasks blocked
* waiting for a message on the message queue indicated by ID. * waiting for a message on the message queue indicated by ID.
* If no tasks are waiting, then the message buffer will not be queued. * If no tasks are waiting, then the message buffer will not be queued.
*/ */
@@ -237,8 +237,8 @@ rtems_status_code rtems_message_queue_flush(
* DESCRIPTION: * DESCRIPTION:
* *
* This routine implements the rtems_message_queue_get_number_pending * This routine implements the rtems_message_queue_get_number_pending
* directive. This directive returns the number of pending * directive. This directive returns the number of pending
* messages for the message queue indicated by ID * messages for the message queue indicated by ID
* chain. The number of messages pending is returned in COUNT. * chain. The number of messages pending is returned in COUNT.
*/ */
@@ -260,7 +260,7 @@ rtems_status_code rtems_message_queue_get_number_pending(
* at the rear of the queue or it will be processed as an urgent message * at the rear of the queue or it will be processed as an urgent message
* which will be inserted at the front of the queue. * which will be inserted at the front of the queue.
*/ */
rtems_status_code _Message_queue_Submit( rtems_status_code _Message_queue_Submit(
Objects_Id id, Objects_Id id,
void *buffer, void *buffer,
@@ -290,7 +290,7 @@ Message_queue_Control *_Message_queue_Allocate (
* This function returns a RTEMS status code based on the core message queue * This function returns a RTEMS status code based on the core message queue
* status code specified. * status code specified.
*/ */
rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
uint32_t the_message_queue_status uint32_t the_message_queue_status
); );
@@ -305,7 +305,7 @@ rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
* *
* Output parameters: NONE * Output parameters: NONE
*/ */
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
void _Message_queue_Core_message_queue_mp_support ( void _Message_queue_Core_message_queue_mp_support (
Thread_Control *the_thread, Thread_Control *the_thread,

View File

@@ -74,7 +74,7 @@ typedef uint32_t Modes_Control;
#define RTEMS_INTERRUPT_LEVEL( _mode_set ) \ #define RTEMS_INTERRUPT_LEVEL( _mode_set ) \
( (_mode_set) & RTEMS_INTERRUPT_MASK ) ( (_mode_set) & RTEMS_INTERRUPT_MASK )
#ifndef __RTEMS_APPLICATION__ #ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/modes.inl> #include <rtems/rtems/modes.inl>

View File

@@ -55,9 +55,9 @@ typedef enum {
#define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT #define RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT
/* /*
* The following defines the period status structure. * The following defines the period status structure.
*/ */
typedef struct { typedef struct {
rtems_rate_monotonic_period_states state; rtems_rate_monotonic_period_states state;

View File

@@ -12,10 +12,10 @@
* *
* $Id$ * $Id$
*/ */
#ifndef __RTEMS_API_h #ifndef __RTEMS_API_h
#define __RTEMS_API_h #define __RTEMS_API_h
#include <rtems/config.h> #include <rtems/config.h>
/*PAGE /*PAGE
@@ -26,7 +26,7 @@
* routine for each RTEMS manager with the appropriate parameters * routine for each RTEMS manager with the appropriate parameters
* from the configuration_table. * from the configuration_table.
*/ */
void _RTEMS_API_Initialize( void _RTEMS_API_Initialize(
rtems_configuration_table *configuration_table rtems_configuration_table *configuration_table
); );

View File

@@ -195,7 +195,7 @@ boolean _Semaphore_Seize(
* This function returns a RTEMS status code based on the mutex * This function returns a RTEMS status code based on the mutex
* status code specified. * status code specified.
*/ */
rtems_status_code _Semaphore_Translate_core_mutex_return_code ( rtems_status_code _Semaphore_Translate_core_mutex_return_code (
uint32_t the_mutex_status uint32_t the_mutex_status
); );
@@ -208,11 +208,11 @@ rtems_status_code _Semaphore_Translate_core_mutex_return_code (
* This function returns a RTEMS status code based on the semaphore * This function returns a RTEMS status code based on the semaphore
* status code specified. * status code specified.
*/ */
rtems_status_code _Semaphore_Translate_core_semaphore_return_code ( rtems_status_code _Semaphore_Translate_core_semaphore_return_code (
uint32_t the_mutex_status uint32_t the_mutex_status
); );
/*PAGE /*PAGE
* *
* _Semaphore_Core_mutex_mp_support * _Semaphore_Core_mutex_mp_support
@@ -237,11 +237,11 @@ void _Semaphore_Core_mutex_mp_support (
* *
* DESCRIPTION: * DESCRIPTION:
* *
* This function processes the global actions necessary for remote * This function processes the global actions necessary for remote
* accesses to a global semaphore based on a core semaphore. This function * accesses to a global semaphore based on a core semaphore. This function
* is called by the core. * is called by the core.
*/ */
void _Semaphore_Core_semaphore_mp_support ( void _Semaphore_Core_semaphore_mp_support (
Thread_Control *the_thread, Thread_Control *the_thread,
rtems_id id rtems_id id

View File

@@ -39,7 +39,7 @@ extern "C" {
* *
* This routine performs the initialization necessary for this manager. * This routine performs the initialization necessary for this manager.
*/ */
void _Signal_Manager_initialization( void ); void _Signal_Manager_initialization( void );
/* /*

View File

@@ -35,10 +35,10 @@ extern "C" {
* This must be implemented as a macro for use in Configuration Tables. * This must be implemented as a macro for use in Configuration Tables.
* *
*/ */
#define rtems_build_name( _C1, _C2, _C3, _C4 ) \ #define rtems_build_name( _C1, _C2, _C3, _C4 ) \
( (uint32_t )(_C1) << 24 | (uint32_t )(_C2) << 16 | (uint32_t )(_C3) << 8 | (uint32_t )(_C4) ) ( (uint32_t )(_C1) << 24 | (uint32_t )(_C2) << 16 | (uint32_t )(_C3) << 8 | (uint32_t )(_C4) )
/* /*
* rtems_get_class * rtems_get_class
* *
@@ -47,10 +47,10 @@ extern "C" {
* This function returns the class portion of the ID. * This function returns the class portion of the ID.
* *
*/ */
#define rtems_get_class( _id ) \ #define rtems_get_class( _id ) \
_Objects_Get_class( _id ) _Objects_Get_class( _id )
/* /*
* rtems_get_node * rtems_get_node
* *
@@ -59,10 +59,10 @@ extern "C" {
* This function returns the node portion of the ID. * This function returns the node portion of the ID.
* *
*/ */
#define rtems_get_node( _id ) \ #define rtems_get_node( _id ) \
_Objects_Get_node( _id ) _Objects_Get_node( _id )
/* /*
* rtems_get_index * rtems_get_index
* *
@@ -71,7 +71,7 @@ extern "C" {
* This function returns the index portion of the ID. * This function returns the index portion of the ID.
* *
*/ */
#define rtems_get_index( _id ) \ #define rtems_get_index( _id ) \
_Objects_Get_index( _id ) _Objects_Get_index( _id )

View File

@@ -75,12 +75,12 @@ typedef Priority_Control rtems_task_priority;
* caller wants to obtain the current priority. * caller wants to obtain the current priority.
*/ */
#define RTEMS_CURRENT_PRIORITY PRIORITY_MINIMUM #define RTEMS_CURRENT_PRIORITY PRIORITY_MINIMUM
/* /*
* Notepads constants (indices into notepad array) * Notepads constants (indices into notepad array)
*/ */
#define RTEMS_NOTEPAD_FIRST 0 /* lowest numbered notepad */ #define RTEMS_NOTEPAD_FIRST 0 /* lowest numbered notepad */
#define RTEMS_NOTEPAD_0 0 /* notepad location 0 */ #define RTEMS_NOTEPAD_0 0 /* notepad location 0 */
#define RTEMS_NOTEPAD_1 1 /* notepad location 1 */ #define RTEMS_NOTEPAD_1 1 /* notepad location 1 */
@@ -99,7 +99,7 @@ typedef Priority_Control rtems_task_priority;
#define RTEMS_NOTEPAD_14 14 /* notepad location 14 */ #define RTEMS_NOTEPAD_14 14 /* notepad location 14 */
#define RTEMS_NOTEPAD_15 15 /* notepad location 15 */ #define RTEMS_NOTEPAD_15 15 /* notepad location 15 */
#define RTEMS_NOTEPAD_LAST RTEMS_NOTEPAD_15 /* highest numbered notepad */ #define RTEMS_NOTEPAD_LAST RTEMS_NOTEPAD_15 /* highest numbered notepad */
#define RTEMS_NUMBER_NOTEPADS (RTEMS_NOTEPAD_LAST+1) #define RTEMS_NUMBER_NOTEPADS (RTEMS_NOTEPAD_LAST+1)
/* /*
@@ -111,30 +111,30 @@ typedef Thread_Control rtems_tcb;
/* /*
* The following defines the "return type" of an RTEMS task. * The following defines the "return type" of an RTEMS task.
*/ */
typedef void rtems_task; typedef void rtems_task;
/* /*
* The following defines the argument to an RTEMS task. * The following defines the argument to an RTEMS task.
*/ */
typedef uint32_t rtems_task_argument; typedef uint32_t rtems_task_argument;
/* /*
* The following defines the type for the entry point of an RTEMS task. * The following defines the type for the entry point of an RTEMS task.
*/ */
typedef rtems_task ( *rtems_task_entry )( typedef rtems_task ( *rtems_task_entry )(
rtems_task_argument rtems_task_argument
); );
/* /*
* The following records define the Initialization Tasks Table. * The following records define the Initialization Tasks Table.
* Each entry contains the information required by RTEMS to * Each entry contains the information required by RTEMS to
* create and start a user task automatically at executive * create and start a user task automatically at executive
* initialization time. * initialization time.
*/ */
typedef struct { typedef struct {
rtems_name name; /* task name */ rtems_name name; /* task name */
uint32_t stack_size; /* task stack size */ uint32_t stack_size; /* task stack size */
@@ -150,7 +150,7 @@ typedef struct {
* the RTEMS API to function correctly. * the RTEMS API to function correctly.
*/ */
typedef struct { typedef struct {
uint32_t Notepads[ RTEMS_NUMBER_NOTEPADS ]; uint32_t Notepads[ RTEMS_NUMBER_NOTEPADS ];
rtems_event_set pending_events; rtems_event_set pending_events;
@@ -169,7 +169,7 @@ RTEMS_EXTERN Objects_Information _RTEMS_tasks_Information;
* These are used to manage the user initialization tasks. * These are used to manage the user initialization tasks.
*/ */
RTEMS_EXTERN rtems_initialization_tasks_table RTEMS_EXTERN rtems_initialization_tasks_table
*_RTEMS_tasks_User_initialization_tasks; *_RTEMS_tasks_User_initialization_tasks;
RTEMS_EXTERN uint32_t _RTEMS_tasks_Number_of_initialization_tasks; RTEMS_EXTERN uint32_t _RTEMS_tasks_Number_of_initialization_tasks;
@@ -180,7 +180,7 @@ RTEMS_EXTERN uint32_t _RTEMS_tasks_Number_of_initialization_tasks;
* *
* This routine initializes all Task Manager related data structures. * This routine initializes all Task Manager related data structures.
*/ */
void _RTEMS_tasks_Manager_initialization( void _RTEMS_tasks_Manager_initialization(
uint32_t maximum_tasks, uint32_t maximum_tasks,
uint32_t number_of_initialization_tasks, uint32_t number_of_initialization_tasks,
@@ -449,7 +449,7 @@ rtems_status_code rtems_task_variable_delete(
* *
* Output parameters: NONE * Output parameters: NONE
*/ */
void _RTEMS_tasks_Initialize_user_tasks( void ); void _RTEMS_tasks_Initialize_user_tasks( void );
#ifndef __RTEMS_APPLICATION__ #ifndef __RTEMS_APPLICATION__

View File

@@ -10,7 +10,7 @@
* + create a timer * + create a timer
* + get an ID of a timer * + get an ID of a timer
* + delete a timer * + delete a timer
* + set timer to fire in context of clock tick * + set timer to fire in context of clock tick
* - after a number of ticks have passed * - after a number of ticks have passed
* - when a specified date and time has been reached * - when a specified date and time has been reached
* + initiate the timer server task * + initiate the timer server task
@@ -58,9 +58,9 @@ typedef enum {
/* /*
* The following types define a pointer to a timer service routine. * The following types define a pointer to a timer service routine.
*/ */
typedef void rtems_timer_service_routine; typedef void rtems_timer_service_routine;
typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )( typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
rtems_id, rtems_id,
void * void *
@@ -81,17 +81,17 @@ RTEMS_EXTERN Objects_Information _Timer_Information;
RTEMS_EXTERN Thread_Control *_Timer_Server; RTEMS_EXTERN Thread_Control *_Timer_Server;
/* /*
* The following chains contain the list of interval timers that are * The following chains contain the list of interval timers that are
* executed in the context of the Timer Server. * executed in the context of the Timer Server.
* *
* NOTE: These are extern'ed because they do not have to be in the * NOTE: These are extern'ed because they do not have to be in the
* minimum footprint. They are only really required when * minimum footprint. They are only really required when
* task-based timers are used. Since task-based timers can * task-based timers are used. Since task-based timers can
* not be started until the server is initiated, these structures * not be started until the server is initiated, these structures
* do not have to be initialized until then. They are declared * do not have to be initialized until then. They are declared
* in the same file as _Timer_Server_body. * in the same file as _Timer_Server_body.
*/ */
extern Chain_Control _Timer_Ticks_chain; extern Chain_Control _Timer_Ticks_chain;
extern Chain_Control _Timer_Seconds_chain; extern Chain_Control _Timer_Seconds_chain;
@@ -311,9 +311,9 @@ rtems_status_code rtems_timer_initiate_server(
typedef struct { typedef struct {
Timer_Classes the_class; Timer_Classes the_class;
Watchdog_Interval initial; Watchdog_Interval initial;
Watchdog_Interval start_time; Watchdog_Interval start_time;
Watchdog_Interval stop_time; Watchdog_Interval stop_time;
} rtems_timer_information; } rtems_timer_information;
rtems_status_code rtems_timer_get_information( rtems_status_code rtems_timer_get_information(

View File

@@ -72,7 +72,7 @@ typedef CPU_Interrupt_frame rtems_interrupt_frame;
typedef Heap_Information_block region_information_block; typedef Heap_Information_block region_information_block;
/* /*
* Time related * Time related
*/ */
typedef Watchdog_Interval rtems_interval; typedef Watchdog_Interval rtems_interval;
@@ -81,7 +81,7 @@ typedef TOD_Control rtems_time_of_day;
/* /*
* Define the type for an RTEMS API task mode. * Define the type for an RTEMS API task mode.
*/ */
typedef Modes_Control rtems_mode; typedef Modes_Control rtems_mode;
/* /*

View File

@@ -69,7 +69,7 @@ rtems_status_code rtems_port_create(
the_port->external_base = external_start; the_port->external_base = external_start;
the_port->length = length - 1; the_port->length = length - 1;
_Objects_Open( _Objects_Open(
&_Dual_ported_memory_Information, &_Dual_ported_memory_Information,
&the_port->Object, &the_port->Object,
(Objects_Name) name (Objects_Name) name

View File

@@ -29,15 +29,15 @@
* *
* This routine performs the initialization necessary for this manager. * This routine performs the initialization necessary for this manager.
*/ */
void _Event_Manager_initialization( void ) void _Event_Manager_initialization( void )
{ {
_Event_Sync_state = EVENT_SYNC_SYNCHRONIZED; _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
/* /*
* Register the MP Process Packet routine. * Register the MP Process Packet routine.
*/ */
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
_MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet ); _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
#endif #endif

View File

@@ -64,7 +64,7 @@ void _Event_Surrender(
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
api->pending_events = api->pending_events =
_Event_sets_Clear( pending_events, seized_events ); _Event_sets_Clear( pending_events, seized_events );
(rtems_event_set) the_thread->Wait.count = 0; (rtems_event_set) the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
_ISR_Flash( level ); _ISR_Flash( level );
@@ -87,14 +87,14 @@ void _Event_Surrender(
case EVENT_SYNC_SYNCHRONIZED: case EVENT_SYNC_SYNCHRONIZED:
case EVENT_SYNC_SATISFIED: case EVENT_SYNC_SATISFIED:
break; break;
case EVENT_SYNC_NOTHING_HAPPENED: case EVENT_SYNC_NOTHING_HAPPENED:
case EVENT_SYNC_TIMEOUT: case EVENT_SYNC_TIMEOUT:
if ( !_Thread_Is_executing( the_thread ) ) if ( !_Thread_Is_executing( the_thread ) )
break; break;
if ( seized_events == event_condition || _Options_Is_any(option_set) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
api->pending_events = api->pending_events =
_Event_sets_Clear( pending_events,seized_events ); _Event_sets_Clear( pending_events,seized_events );
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
_Event_Sync_state = EVENT_SYNC_SATISFIED; _Event_Sync_state = EVENT_SYNC_SATISFIED;

View File

@@ -49,12 +49,12 @@ void _Event_Timeout(
case OBJECTS_ERROR: case OBJECTS_ERROR:
break; break;
case OBJECTS_LOCAL: case OBJECTS_LOCAL:
/* /*
* If the event manager is not synchronized, then it is either * If the event manager is not synchronized, then it is either
* "nothing happened", "timeout", or "satisfied". If the_thread * "nothing happened", "timeout", or "satisfied". If the_thread
* is the executing thread, then it is in the process of blocking * is the executing thread, then it is in the process of blocking
* and it is the thread which is responsible for the synchronization * and it is the thread which is responsible for the synchronization
* process. * process.
* *
* If it is not satisfied, then it is "nothing happened" and * If it is not satisfied, then it is "nothing happened" and
@@ -65,7 +65,7 @@ void _Event_Timeout(
_ISR_Disable( level ); _ISR_Disable( level );
if ( the_thread->Wait.count ) { /* verify thread is waiting */ if ( the_thread->Wait.count ) { /* verify thread is waiting */
the_thread->Wait.count = 0; the_thread->Wait.count = 0;
if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED && if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
_Thread_Is_executing( the_thread ) ) { _Thread_Is_executing( the_thread ) ) {
if ( _Event_Sync_state != EVENT_SYNC_SATISFIED ) { if ( _Event_Sync_state != EVENT_SYNC_SATISFIED ) {
_Event_Sync_state = EVENT_SYNC_TIMEOUT; _Event_Sync_state = EVENT_SYNC_TIMEOUT;
@@ -79,7 +79,7 @@ void _Event_Timeout(
} }
else { else {
_ISR_Enable( level ); _ISR_Enable( level );
} }
_Thread_Unnest_dispatch(); _Thread_Unnest_dispatch();
break; break;

View File

@@ -132,7 +132,7 @@ rtems_status_code _Message_queue_MP_Send_request_packet (
/* /*
* Copy the data into place if needed * Copy the data into place if needed
*/ */
if (buffer) { if (buffer) {
the_packet->Buffer.size = *size_p; the_packet->Buffer.size = *size_p;
_CORE_message_queue_Copy_buffer( _CORE_message_queue_Copy_buffer(
@@ -166,7 +166,7 @@ rtems_status_code _Message_queue_MP_Send_request_packet (
_Thread_Executing->Wait.return_argument = (uint32_t *)buffer; _Thread_Executing->Wait.return_argument = (uint32_t *)buffer;
_Thread_Executing->Wait.return_argument_1 = size_p; _Thread_Executing->Wait.return_argument_1 = size_p;
return (rtems_status_code) _MPCI_Send_request_packet( return (rtems_status_code) _MPCI_Send_request_packet(
rtems_get_node(message_queue_id), rtems_get_node(message_queue_id),
&the_packet->Prefix, &the_packet->Prefix,
@@ -226,7 +226,7 @@ void _Message_queue_MP_Send_response_packet (
if (operation == MESSAGE_QUEUE_MP_RECEIVE_RESPONSE) if (operation == MESSAGE_QUEUE_MP_RECEIVE_RESPONSE)
the_packet->Prefix.length += the_packet->size; the_packet->Prefix.length += the_packet->size;
_MPCI_Send_response_packet( _MPCI_Send_response_packet(
rtems_get_node( the_packet->Prefix.source_tid ), rtems_get_node( the_packet->Prefix.source_tid ),
&the_packet->Prefix &the_packet->Prefix
@@ -318,7 +318,7 @@ void _Message_queue_MP_Process_packet (
the_thread = _MPCI_Process_response( the_packet_prefix ); the_thread = _MPCI_Process_response( the_packet_prefix );
if (the_packet->Prefix.return_code == RTEMS_SUCCESSFUL) { if (the_packet->Prefix.return_code == RTEMS_SUCCESSFUL) {
*(uint32_t *)the_thread->Wait.return_argument_1 = *(uint32_t *)the_thread->Wait.return_argument_1 =
the_packet->size; the_packet->size;
_CORE_message_queue_Copy_buffer( _CORE_message_queue_Copy_buffer(

View File

@@ -35,7 +35,7 @@
* _Message_queue_Allocate * _Message_queue_Allocate
* *
* Allocate a message queue and the space for its messages * Allocate a message queue and the space for its messages
* *
* Input parameters: * Input parameters:
* the_message_queue - the message queue to allocate message buffers * the_message_queue - the message queue to allocate message buffers
* count - maximum message and reserved buffer count * count - maximum message and reserved buffer count
@@ -50,7 +50,7 @@ Message_queue_Control *_Message_queue_Allocate (
uint32_t max_message_size uint32_t max_message_size
) )
{ {
return return
(Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information); (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
} }

View File

@@ -93,9 +93,9 @@ rtems_status_code rtems_message_queue_broadcast(
#endif #endif
count count
); );
_Thread_Enable_dispatch(); _Thread_Enable_dispatch();
return return
_Message_queue_Translate_core_message_queue_return_code( core_status ); _Message_queue_Translate_core_message_queue_return_code( core_status );
} }

View File

@@ -68,7 +68,7 @@ rtems_status_code rtems_message_queue_create(
return RTEMS_INVALID_NAME; return RTEMS_INVALID_NAME;
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
if ( (is_global = _Attributes_Is_global( attribute_set ) ) && if ( (is_global = _Attributes_Is_global( attribute_set ) ) &&
!_System_state_Is_multiprocessing ) !_System_state_Is_multiprocessing )
return RTEMS_MP_NOT_CONFIGURED; return RTEMS_MP_NOT_CONFIGURED;
#endif #endif
@@ -86,12 +86,12 @@ rtems_status_code rtems_message_queue_create(
* It seems reasonable to create a que with a large max size, * It seems reasonable to create a que with a large max size,
* and then just send smaller msgs from remote (or all) nodes. * and then just send smaller msgs from remote (or all) nodes.
*/ */
if ( is_global && (_MPCI_table->maximum_packet_size < max_message_size) ) if ( is_global && (_MPCI_table->maximum_packet_size < max_message_size) )
return RTEMS_INVALID_SIZE; return RTEMS_INVALID_SIZE;
#endif #endif
#endif #endif
_Thread_Disable_dispatch(); /* protects object pointer */ _Thread_Disable_dispatch(); /* protects object pointer */
the_message_queue = _Message_queue_Allocate( count, max_message_size ); the_message_queue = _Message_queue_Allocate( count, max_message_size );

View File

@@ -60,7 +60,7 @@ rtems_status_code rtems_message_queue_ident(
&_Message_queue_Information, &_Message_queue_Information,
(Objects_Name) name, (Objects_Name) name,
node, node,
id id
); );
return _Status_Object_name_errors_to_status[ status ]; return _Status_Object_name_errors_to_status[ status ];

View File

@@ -60,7 +60,7 @@ rtems_status_code rtems_message_queue_receive(
register Message_queue_Control *the_message_queue; register Message_queue_Control *the_message_queue;
Objects_Locations location; Objects_Locations location;
boolean wait; boolean wait;
the_message_queue = _Message_queue_Get( id, &location ); the_message_queue = _Message_queue_Get( id, &location );
switch ( location ) { switch ( location ) {
@@ -84,7 +84,7 @@ rtems_status_code rtems_message_queue_receive(
wait = FALSE; wait = FALSE;
else else
wait = TRUE; wait = TRUE;
_CORE_message_queue_Seize( _CORE_message_queue_Seize(
&the_message_queue->message_queue, &the_message_queue->message_queue,
the_message_queue->Object.id, the_message_queue->Object.id,

View File

@@ -138,7 +138,7 @@ rtems_status_code _Message_queue_Submit(
return return
_Message_queue_Translate_core_message_queue_return_code( msg_status ); _Message_queue_Translate_core_message_queue_return_code( msg_status );
} }
return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */ return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
} }

View File

@@ -41,7 +41,7 @@
* rtems status code - translated RTEMS status code * rtems status code - translated RTEMS status code
* *
*/ */
rtems_status_code _Message_queue_Translate_core_return_code_[] = { rtems_status_code _Message_queue_Translate_core_return_code_[] = {
RTEMS_SUCCESSFUL, /* CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL */ RTEMS_SUCCESSFUL, /* CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL */
RTEMS_INVALID_SIZE, /* CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE */ RTEMS_INVALID_SIZE, /* CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE */

View File

@@ -64,7 +64,7 @@ rtems_status_code rtems_partition_create(
return RTEMS_INVALID_ADDRESS; return RTEMS_INVALID_ADDRESS;
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
if ( _Attributes_Is_global( attribute_set ) && if ( _Attributes_Is_global( attribute_set ) &&
!_System_state_Is_multiprocessing ) !_System_state_Is_multiprocessing )
return RTEMS_MP_NOT_CONFIGURED; return RTEMS_MP_NOT_CONFIGURED;
#endif #endif

View File

@@ -43,8 +43,8 @@ rtems_status_code rtems_rate_monotonic_cancel(
the_period = _Rate_monotonic_Get( id, &location ); the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) { switch ( location ) {
case OBJECTS_REMOTE: case OBJECTS_REMOTE:
return RTEMS_INTERNAL_ERROR; /* should never return this */ return RTEMS_INTERNAL_ERROR; /* should never return this */
case OBJECTS_ERROR: case OBJECTS_ERROR:
return RTEMS_INVALID_ID; return RTEMS_INVALID_ID;

View File

@@ -24,7 +24,7 @@
* *
* rtems_rate_monotonic_get_status * rtems_rate_monotonic_get_status
* *
* This directive allows a thread to obtain status information on a * This directive allows a thread to obtain status information on a
* period. * period.
* *
* Input parameters: * Input parameters:

View File

@@ -115,9 +115,9 @@ rtems_status_code rtems_rate_monotonic_period(
_Thread_Executing->Wait.id = the_period->Object.id; _Thread_Executing->Wait.id = the_period->Object.id;
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
/* /*
* Did the watchdog timer expire while we were actually blocking * Did the watchdog timer expire while we were actually blocking
* on it? * on it?
*/ */

View File

@@ -86,7 +86,7 @@ rtems_status_code rtems_region_create(
_Thread_queue_Initialize( _Thread_queue_Initialize(
&the_region->Wait_queue, &the_region->Wait_queue,
_Attributes_Is_priority( attribute_set ) ? _Attributes_Is_priority( attribute_set ) ?
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
STATES_WAITING_FOR_SEGMENT, STATES_WAITING_FOR_SEGMENT,
RTEMS_TIMEOUT RTEMS_TIMEOUT

View File

@@ -101,7 +101,7 @@ rtems_status_code rtems_region_return_segment(
break; break;
the_segment = (void **) _Region_Allocate_segment( the_segment = (void **) _Region_Allocate_segment(
the_region, the_region,
the_thread->Wait.count the_thread->Wait.count
); );

View File

@@ -21,7 +21,7 @@
* *
* rtems_object_id_to_name * rtems_object_id_to_name
* *
* This directive returns the name associated with the specified * This directive returns the name associated with the specified
* object ID. * object ID.
* *
* Input parameters: * Input parameters:

View File

@@ -75,11 +75,11 @@ void _Semaphore_Manager_initialization(
_Semaphore_MP_Send_extract_proxy /* Proxy extraction support callout */ _Semaphore_MP_Send_extract_proxy /* Proxy extraction support callout */
#endif #endif
); );
/* /*
* Register the MP Process Packet routine. * Register the MP Process Packet routine.
*/ */
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
_MPCI_Register_packet_processor( _MPCI_Register_packet_processor(
MP_PACKET_SEMAPHORE, MP_PACKET_SEMAPHORE,

View File

@@ -56,7 +56,7 @@
* name - user defined semaphore name * name - user defined semaphore name
* count - initial count of semaphore * count - initial count of semaphore
* attribute_set - semaphore attributes * attribute_set - semaphore attributes
* priority_ceiling - semaphore's ceiling priority * priority_ceiling - semaphore's ceiling priority
* id - pointer to semaphore id * id - pointer to semaphore id
* *
* Output parameters: * Output parameters:
@@ -90,15 +90,15 @@ rtems_status_code rtems_semaphore_create(
if ( _Attributes_Is_inherit_priority( attribute_set ) ) if ( _Attributes_Is_inherit_priority( attribute_set ) )
return RTEMS_NOT_DEFINED; return RTEMS_NOT_DEFINED;
} else } else
#endif #endif
if ( _Attributes_Is_inherit_priority( attribute_set ) || if ( _Attributes_Is_inherit_priority( attribute_set ) ||
_Attributes_Is_priority_ceiling( attribute_set ) ) { _Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! ( (_Attributes_Is_binary_semaphore( attribute_set ) || if ( ! ( (_Attributes_Is_binary_semaphore( attribute_set ) ||
_Attributes_Is_simple_binary_semaphore( attribute_set )) && _Attributes_Is_simple_binary_semaphore( attribute_set )) &&
_Attributes_Is_priority( attribute_set ) ) ) _Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED; return RTEMS_NOT_DEFINED;
@@ -129,7 +129,7 @@ rtems_status_code rtems_semaphore_create(
the_semaphore->attribute_set = attribute_set; the_semaphore->attribute_set = attribute_set;
/* /*
* If it is not a counting semaphore, then it is either a * If it is not a counting semaphore, then it is either a
* simple binary semaphore or a more powerful mutex style binary * simple binary semaphore or a more powerful mutex style binary
* semaphore. * semaphore.
*/ */

View File

@@ -95,13 +95,13 @@ rtems_status_code rtems_semaphore_delete(
return RTEMS_RESOURCE_IN_USE; return RTEMS_RESOURCE_IN_USE;
} }
_CORE_mutex_Flush( _CORE_mutex_Flush(
&the_semaphore->Core_control.mutex, &the_semaphore->Core_control.mutex,
SEMAPHORE_MP_OBJECT_WAS_DELETED, SEMAPHORE_MP_OBJECT_WAS_DELETED,
CORE_MUTEX_WAS_DELETED CORE_MUTEX_WAS_DELETED
); );
} else { } else {
_CORE_semaphore_Flush( _CORE_semaphore_Flush(
&the_semaphore->Core_control.semaphore, &the_semaphore->Core_control.semaphore,
SEMAPHORE_MP_OBJECT_WAS_DELETED, SEMAPHORE_MP_OBJECT_WAS_DELETED,
CORE_SEMAPHORE_WAS_DELETED CORE_SEMAPHORE_WAS_DELETED
); );

View File

@@ -77,15 +77,15 @@ rtems_status_code rtems_semaphore_flush(
return RTEMS_INVALID_ID; return RTEMS_INVALID_ID;
case OBJECTS_LOCAL: case OBJECTS_LOCAL:
if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
_CORE_mutex_Flush( _CORE_mutex_Flush(
&the_semaphore->Core_control.mutex, &the_semaphore->Core_control.mutex,
SEND_OBJECT_WAS_DELETED, SEND_OBJECT_WAS_DELETED,
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT
); );
} else { } else {
_CORE_semaphore_Flush( _CORE_semaphore_Flush(
&the_semaphore->Core_control.semaphore, &the_semaphore->Core_control.semaphore,
SEND_OBJECT_WAS_DELETED, SEND_OBJECT_WAS_DELETED,
CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT
); );

View File

@@ -70,13 +70,13 @@ rtems_status_code rtems_semaphore_ident(
) )
{ {
Objects_Name_or_id_lookup_errors status; Objects_Name_or_id_lookup_errors status;
status = _Objects_Name_to_id( status = _Objects_Name_to_id(
&_Semaphore_Information, &_Semaphore_Information,
(Objects_Name) name, (Objects_Name) name,
node, node,
id id
); );
return _Status_Object_name_errors_to_status[ status ]; return _Status_Object_name_errors_to_status[ status ];
} }

View File

@@ -316,7 +316,7 @@ Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void )
* *
* Output parameters: NONE * Output parameters: NONE
*/ */
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
void _Semaphore_Core_mutex_mp_support ( void _Semaphore_Core_mutex_mp_support (
Thread_Control *the_thread, Thread_Control *the_thread,
@@ -324,7 +324,7 @@ void _Semaphore_Core_mutex_mp_support (
) )
{ {
the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL; the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
_Semaphore_MP_Send_response_packet( _Semaphore_MP_Send_response_packet(
SEMAPHORE_MP_OBTAIN_RESPONSE, SEMAPHORE_MP_OBTAIN_RESPONSE,
id, id,
@@ -344,7 +344,7 @@ void _Semaphore_Core_mutex_mp_support (
* *
* Output parameters: NONE * Output parameters: NONE
*/ */
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
void _Semaphore_Core_semaphore_mp_support ( void _Semaphore_Core_semaphore_mp_support (
Thread_Control *the_thread, Thread_Control *the_thread,
@@ -352,7 +352,7 @@ void _Semaphore_Core_semaphore_mp_support (
) )
{ {
the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL; the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
_Semaphore_MP_Send_response_packet( _Semaphore_MP_Send_response_packet(
SEMAPHORE_MP_OBTAIN_RESPONSE, SEMAPHORE_MP_OBTAIN_RESPONSE,
id, id,

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