mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-24 09:08:39 +08:00
Remove stray white spaces.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* chain.h
|
||||
*
|
||||
*
|
||||
* This include file contains all the constants and structures associated
|
||||
* with doubly linked chains. This file actually just provides an
|
||||
* interface to the chain object in rtems.
|
||||
@@ -19,17 +19,17 @@
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Initialize
|
||||
*
|
||||
* This routine initializes the_chain structure to manage the
|
||||
* contiguous array of number_nodes nodes which starts at
|
||||
* starting_address. Each node is of node_size bytes.
|
||||
*
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* void *starting_address, * IN *
|
||||
* uint32_t number_nodes, * IN *
|
||||
* uint32_t node_size * IN *
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* void *starting_address, * IN *
|
||||
* uint32_t number_nodes, * IN *
|
||||
* uint32_t node_size * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Initialize( the_chain, starting_address, \
|
||||
@@ -38,17 +38,17 @@
|
||||
number_nodes, node_size ) \
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Initialize_empty
|
||||
*
|
||||
* 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 ) \
|
||||
_Chain_Initialize_empty( the_chain )
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Chain_Are_nodes_equal
|
||||
@@ -56,43 +56,43 @@
|
||||
* This function returns TRUE if LEFT and RIGHT are equal,
|
||||
* and FALSE otherwise.
|
||||
*
|
||||
* Chain_Node *left, * IN *
|
||||
* Chain_Node *right * IN *
|
||||
* Chain_Node *left, * IN *
|
||||
* Chain_Node *right * IN *
|
||||
*/
|
||||
|
||||
|
||||
#define Chain_Are_nodes_equal( left, right ) \
|
||||
_Chain_Are_nodes_equal( left, right )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Extract_unprotected
|
||||
*
|
||||
* This routine extracts the_node from the chain on which it resides.
|
||||
* It does NOT disable interrupts to insure the atomicity of the
|
||||
* extract operation.
|
||||
*
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Extract_unprotected( the_node ) \
|
||||
_Chain_Extract_unprotected( the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Extract
|
||||
*
|
||||
* This routine extracts the_node from the chain on which it resides.
|
||||
* It disables interrupts to insure the atomicity of the
|
||||
* extract operation.
|
||||
*
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Extract( the_node ) \
|
||||
_Chain_Extract( the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Get_unprotected
|
||||
*
|
||||
* 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
|
||||
* get operation.
|
||||
*
|
||||
* Chain_Control *the_chain * IN *
|
||||
* Chain_Control *the_chain * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Get_unprotected( the_chain ) \
|
||||
_Chain_Get_unprotected( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Get
|
||||
*
|
||||
* This function removes the first node from the_chain and returns
|
||||
@@ -115,239 +115,239 @@
|
||||
* It disables interrupts to insure the atomicity of the
|
||||
* get operation.
|
||||
*
|
||||
* Chain_Control *the_chain * IN *
|
||||
* Chain_Control *the_chain * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Get( the_chain ) \
|
||||
_Chain_Get( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Get_first_unprotected
|
||||
*
|
||||
* This function removes the first node from the_chain and returns
|
||||
* a pointer to that node. It does NOT disable interrupts to insure
|
||||
* the atomicity of the get operation.
|
||||
*
|
||||
* Chain_Control *the_chain * IN *
|
||||
* Chain_Control *the_chain * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Get_first_unprotected( the_chain ) \
|
||||
_Chain_Get_first_unprotected( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Insert_unprotected
|
||||
*
|
||||
* This routine inserts the_node on a chain immediately following
|
||||
* after_node. It does NOT disable interrupts to insure the atomicity
|
||||
* of the extract operation.
|
||||
*
|
||||
* Chain_Node *after_node, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Node *after_node, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Insert_unprotected( after_node, the_node ) \
|
||||
_Chain_Insert_unprotected( after_node, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Insert
|
||||
*
|
||||
* This routine inserts the_node on a chain immediately following
|
||||
* after_node. It disables interrupts to insure the atomicity
|
||||
* of the extract operation.
|
||||
*
|
||||
* Chain_Node *after_node, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Node *after_node, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Insert( after_node, the_node ) \
|
||||
_Chain_Insert( after_node, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Append_unprotected
|
||||
*
|
||||
* This routine appends the_node onto the end of the_chain.
|
||||
* It does NOT disable interrupts to insure the atomicity of the
|
||||
* append operation.
|
||||
*
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Append_unprotected( the_chain, the_node ) \
|
||||
_Chain_Append_unprotected( the_chain, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Append
|
||||
*
|
||||
* This routine appends the_node onto the end of the_chain.
|
||||
* It disables interrupts to insure the atomicity of the
|
||||
* append operation.
|
||||
*
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Append( the_chain, the_node ) \
|
||||
_Chain_Append( the_chain, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Prepend_unprotected
|
||||
*
|
||||
* This routine prepends the_node onto the front of the_chain.
|
||||
* It does NOT disable interrupts to insure the atomicity of the
|
||||
* prepend operation.
|
||||
*
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Prepend_unprotected( the_chain, the_node ) \
|
||||
_Chain_Prepend_unprotected( the_chain, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Prepend
|
||||
*
|
||||
* This routine prepends the_node onto the front of the_chain.
|
||||
* It disables interrupts to insure the atomicity of the
|
||||
* prepend operation.
|
||||
*
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Prepend( the_chain, the_node ) \
|
||||
_Chain_Prepend( the_chain, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Head
|
||||
*
|
||||
* 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 ) \
|
||||
_Chain_Head( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Tail
|
||||
*
|
||||
* 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 ) \
|
||||
_Chain_Tail( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Is_head
|
||||
*
|
||||
* This function returns TRUE if the_node is the head of the_chain and
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Is_head( the_chain, the_node ) \
|
||||
_Chain_Is_head( the_chain, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Is_tail
|
||||
*
|
||||
* This function returns TRUE if the_node is the tail of the_chain and
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Control *the_chain, * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Is_tail( the_chain, the_node ) \
|
||||
_Chain_Is_tail( the_chain, the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Is_first
|
||||
*
|
||||
* This function returns TRUE if the_node is the first node on a chain and
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Is_first( the_node ) \
|
||||
_Chain_Is_first( the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Is_last
|
||||
*
|
||||
* This function returns TRUE if the_node is the last node on a chain and
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* Chain_Node *the_node * IN *
|
||||
* Chain_Node *the_node * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Is_last( the_node ) \
|
||||
_Chain_Is_last( the_node )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Is_empty
|
||||
*
|
||||
* This function returns TRUE if there are no nodes on the_chain and
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* Chain_Control *the_chain * IN *
|
||||
* Chain_Control *the_chain * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Is_empty( the_chain ) \
|
||||
_Chain_Is_empty( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Has_only_one_node
|
||||
*
|
||||
* This function returns TRUE if there is only one node on the_chain and
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* Chain_Control *the_chain * IN *
|
||||
* Chain_Control *the_chain * IN *
|
||||
*/
|
||||
|
||||
#define Chain_Has_only_one_node( the_chain ) \
|
||||
_Chain_Has_only_one_node( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Is_null
|
||||
*
|
||||
* 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 ) \
|
||||
_Chain_Is_null( the_chain )
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Chain_Is_null_node
|
||||
*
|
||||
* 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 ) \
|
||||
|
||||
@@ -29,7 +29,7 @@ extern rtems_device_minor_number rtems_clock_minor;
|
||||
|
||||
#define CLOCK_DRIVER_TABLE_ENTRY \
|
||||
{ Clock_initialize, NULL, NULL, NULL, NULL, Clock_control }
|
||||
|
||||
|
||||
rtems_device_driver Clock_initialize(
|
||||
rtems_device_major_number,
|
||||
rtems_device_minor_number,
|
||||
|
||||
@@ -83,15 +83,15 @@
|
||||
|
||||
|
||||
|
||||
#define MC68681_CLEAR 0x00
|
||||
#define MC68681_CLEAR 0x00
|
||||
|
||||
#define MC68681_PORT_A 0
|
||||
#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_DISABLE_RX 0x02
|
||||
@@ -114,8 +114,8 @@
|
||||
/*
|
||||
* Mode Register Definitions
|
||||
*
|
||||
* MC68681_MODE_REG_1A
|
||||
* MC68681_MODE_REG_1B
|
||||
* MC68681_MODE_REG_1A
|
||||
* MC68681_MODE_REG_1B
|
||||
*/
|
||||
#define MC68681_5BIT_CHARS 0x00
|
||||
#define MC68681_6BIT_CHARS 0x01
|
||||
@@ -186,17 +186,17 @@
|
||||
#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_RX_READY_A 0x02
|
||||
@@ -207,10 +207,10 @@
|
||||
#define MC68681_IR_BREAK_B 0x40
|
||||
#define MC68681_IR_INPUT_PORT_CHANGE 0x80
|
||||
|
||||
/*
|
||||
* Status Register Definitions.
|
||||
*
|
||||
* MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
|
||||
/*
|
||||
* Status Register Definitions.
|
||||
*
|
||||
* MC68681_STATUS_REG_A,MC68681_STATUS_REG_B
|
||||
*/
|
||||
#define MC68681_STATUS_RXRDY 0x01
|
||||
#define MC68681_STATUS_FFULL 0x02
|
||||
@@ -221,34 +221,34 @@
|
||||
#define MC68681_STATUS_FRAMING_ERROR 0x40
|
||||
#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
|
||||
|
||||
/*
|
||||
* 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_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
|
||||
* 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
|
||||
* X is the extend bit.
|
||||
* CRA - 0x08 Set Rx BRG Select Extend Bit (X=1)
|
||||
@@ -260,8 +260,8 @@
|
||||
/* ARC[7]=1,X=1 */
|
||||
#define MC68681_BAUD_RATE_MASK_75 0x00 /* ACR[7]=0,X=0 */
|
||||
/* ARC[7]=1,X=1 */
|
||||
#define MC68681_BAUD_RATE_MASK_110 0x01
|
||||
#define MC68681_BAUD_RATE_MASK_134_5 0x02
|
||||
#define MC68681_BAUD_RATE_MASK_110 0x01
|
||||
#define MC68681_BAUD_RATE_MASK_134_5 0x02
|
||||
#define MC68681_BAUD_RATE_MASK_150 0x03 /* ACR[7]=0,X=0 */
|
||||
/* ARC[7]=1,X=1 */
|
||||
#define MC68681_BAUD_RATE_MASK_200 0x03 /* ACR[7]=0,X=0 */
|
||||
@@ -280,10 +280,10 @@
|
||||
/* ARC[7]=1,X=1 */
|
||||
#define MC68681_BAUD_RATE_MASK_3600 0x04 /* ACR[7]=0,X=0 */
|
||||
/* 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 */
|
||||
/* 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 */
|
||||
/* ARC[7]=1,X=1 */
|
||||
@@ -295,9 +295,9 @@
|
||||
/* ARC[7]=1,X=1 */
|
||||
#define MC68681_BAUD_RATE_MASK_57_6K 0x07 /* ACR[7]=0,X=0 */
|
||||
/* ARC[7]=1,X=1 */
|
||||
#define MC68681_BAUD_RATE_MASK_115_5K 0x08
|
||||
#define MC68681_BAUD_RATE_MASK_TIMER 0xdd
|
||||
#define MC68681_BAUD_RATE_MASK_TIMER_16X 0xee
|
||||
#define MC68681_BAUD_RATE_MASK_TIMER_1X 0xff
|
||||
#define MC68681_BAUD_RATE_MASK_115_5K 0x08
|
||||
#define MC68681_BAUD_RATE_MASK_TIMER 0xdd
|
||||
#define MC68681_BAUD_RATE_MASK_TIMER_16X 0xee
|
||||
#define MC68681_BAUD_RATE_MASK_TIMER_1X 0xff
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ringbuf.h
|
||||
* ringbuf.h
|
||||
*
|
||||
* This file provides simple ring buffer functionality.
|
||||
*
|
||||
@@ -22,8 +22,8 @@ typedef struct {
|
||||
#define Ring_buffer_Initialize( _buffer ) \
|
||||
do { \
|
||||
(_buffer)->head = (_buffer)->tail = 0; \
|
||||
} while ( 0 )
|
||||
|
||||
} while ( 0 )
|
||||
|
||||
#define Ring_buffer_Is_empty( _buffer ) \
|
||||
( (_buffer)->head == (_buffer)->tail )
|
||||
|
||||
@@ -38,7 +38,7 @@ typedef struct {
|
||||
(_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
|
||||
(_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
|
||||
rtems_interrupt_enable( isrlevel ); \
|
||||
} while ( 0 )
|
||||
} while ( 0 )
|
||||
|
||||
#define Ring_buffer_Remove_character( _buffer, _ch ) \
|
||||
do { \
|
||||
@@ -48,6 +48,6 @@ typedef struct {
|
||||
(_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
|
||||
(_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
|
||||
rtems_interrupt_enable( isrlevel ); \
|
||||
} while ( 0 )
|
||||
} while ( 0 )
|
||||
|
||||
#endif
|
||||
|
||||
@@ -140,9 +140,9 @@ struct _rtems_filesystem_file_handlers_r {
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@@ -228,9 +228,9 @@ typedef int (*rtems_filesystem_symlink_t)(
|
||||
);
|
||||
|
||||
typedef int (*rtems_filesystem_readlink_t)(
|
||||
rtems_filesystem_location_info_t *loc, /* IN */
|
||||
char *buf, /* OUT */
|
||||
size_t bufsize
|
||||
rtems_filesystem_location_info_t *loc, /* IN */
|
||||
char *buf, /* OUT */
|
||||
size_t bufsize
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -342,7 +342,7 @@ struct rtems_libio_tt {
|
||||
off_t offset; /* current offset into file */
|
||||
uint32_t flags;
|
||||
rtems_filesystem_location_info_t pathinfo;
|
||||
Objects_Id sem;
|
||||
Objects_Id sem;
|
||||
uint32_t data0; /* private to "driver" */
|
||||
void *data1; /* ... */
|
||||
void *file_info; /* used by file handlers */
|
||||
@@ -476,8 +476,8 @@ union __rtems_dev_t {
|
||||
} __overlay;
|
||||
};
|
||||
|
||||
static inline dev_t rtems_filesystem_make_dev_t(
|
||||
rtems_device_major_number _major,
|
||||
static inline dev_t rtems_filesystem_make_dev_t(
|
||||
rtems_device_major_number _major,
|
||||
rtems_device_minor_number _minor
|
||||
)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ extern "C" {
|
||||
#include <rtems.h>
|
||||
#include <rtems/libio.h> /* include before standard IO */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
@@ -64,9 +64,9 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
|
||||
#define rtems_libio_iop_to_descriptor(_iop) \
|
||||
((!(_iop)) ? -1 : (_iop - rtems_libio_iops))
|
||||
|
||||
/*
|
||||
/*
|
||||
* rtems_libio_check_is_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>
|
||||
|
||||
extern rtems_user_env_t * rtems_current_user_env;
|
||||
extern rtems_user_env_t rtems_global_user_env;
|
||||
extern rtems_user_env_t * rtems_current_user_env;
|
||||
extern rtems_user_env_t rtems_global_user_env;
|
||||
|
||||
/*
|
||||
* 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_share_private_env(rtems_id task_id) ;
|
||||
|
||||
|
||||
/*
|
||||
* File Descriptor Routine Prototypes
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ struct rtems_termios_rawbuf {
|
||||
volatile unsigned int Head;
|
||||
volatile unsigned int Tail;
|
||||
volatile unsigned int Size;
|
||||
rtems_id Semaphore;
|
||||
rtems_id Semaphore;
|
||||
};
|
||||
/*
|
||||
* Variables associated with each termios instance.
|
||||
@@ -112,8 +112,8 @@ struct rtems_termios_tty {
|
||||
/*
|
||||
* I/O task IDs (for task-driven drivers)
|
||||
*/
|
||||
rtems_id rxTaskId;
|
||||
rtems_id txTaskId;
|
||||
rtems_id rxTaskId;
|
||||
rtems_id txTaskId;
|
||||
/*
|
||||
* 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!
|
||||
* put a string to output ring buffer
|
||||
*/
|
||||
void rtems_termios_puts (const char *buf,
|
||||
int len,
|
||||
void rtems_termios_puts (const char *buf,
|
||||
int len,
|
||||
struct rtems_termios_tty *tty);
|
||||
/*
|
||||
* global hooks for line disciplines
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* stdint.h
|
||||
*
|
||||
* ISO C99 integer types
|
||||
@@ -16,7 +16,7 @@ extern "C" {
|
||||
#include <rtems/score/types.h>
|
||||
|
||||
/*
|
||||
* map RTEMS internal types onto C99 types
|
||||
* map RTEMS internal types onto C99 types
|
||||
*/
|
||||
typedef signed8 int8_t;
|
||||
typedef signed16 int16_t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* sys/utsname.h
|
||||
/* sys/utsname.h
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
@@ -16,9 +16,9 @@ extern "C" {
|
||||
/*
|
||||
* 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.
|
||||
* For example, the fields are not long enough to support
|
||||
* For example, the fields are not long enough to support
|
||||
* Internet hostnames.
|
||||
*/
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ clock_t _times(
|
||||
(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.
|
||||
* But we can at least make a distinction between the number
|
||||
* of ticks since boot and the number of ticks executed by this
|
||||
|
||||
@@ -27,7 +27,7 @@ rtems_assoc_ptr_by_name(
|
||||
|
||||
if (rtems_assoc_is_default(ap))
|
||||
default_ap = ap++;
|
||||
|
||||
|
||||
for ( ; ap->name; ap++)
|
||||
if (strcmp(ap->name, name) == 0)
|
||||
return ap;
|
||||
@@ -45,7 +45,7 @@ rtems_assoc_ptr_by_local(
|
||||
|
||||
if (rtems_assoc_is_default(ap))
|
||||
default_ap = ap++;
|
||||
|
||||
|
||||
for ( ; ap->name; ap++)
|
||||
if (ap->local_value == local_value)
|
||||
return ap;
|
||||
@@ -64,7 +64,7 @@ rtems_assoc_ptr_by_remote(
|
||||
|
||||
if (rtems_assoc_is_default(ap))
|
||||
default_ap = ap++;
|
||||
|
||||
|
||||
for ( ; ap->name; ap++)
|
||||
if (ap->remote_value == remote_value)
|
||||
return ap;
|
||||
@@ -77,7 +77,7 @@ rtems_assoc_ptr_by_remote(
|
||||
* Get values
|
||||
*/
|
||||
|
||||
uint32_t
|
||||
uint32_t
|
||||
rtems_assoc_remote_by_local(
|
||||
const rtems_assoc_t *ap,
|
||||
uint32_t local_value
|
||||
@@ -87,11 +87,11 @@ rtems_assoc_remote_by_local(
|
||||
nap = rtems_assoc_ptr_by_local(ap, local_value);
|
||||
if (nap)
|
||||
return nap->remote_value;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
uint32_t
|
||||
rtems_assoc_local_by_remote(
|
||||
const rtems_assoc_t *ap,
|
||||
uint32_t remote_value
|
||||
@@ -101,11 +101,11 @@ rtems_assoc_local_by_remote(
|
||||
nap = rtems_assoc_ptr_by_remote(ap, remote_value);
|
||||
if (nap)
|
||||
return nap->local_value;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
uint32_t
|
||||
rtems_assoc_remote_by_name(
|
||||
const rtems_assoc_t *ap,
|
||||
const char *name
|
||||
@@ -115,11 +115,11 @@ rtems_assoc_remote_by_name(
|
||||
nap = rtems_assoc_ptr_by_name(ap, name);
|
||||
if (nap)
|
||||
return nap->remote_value;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
uint32_t
|
||||
rtems_assoc_local_by_name(
|
||||
const rtems_assoc_t *ap,
|
||||
const char *name
|
||||
@@ -129,7 +129,7 @@ rtems_assoc_local_by_name(
|
||||
nap = rtems_assoc_ptr_by_name(ap, name);
|
||||
if (nap)
|
||||
return nap->local_value;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ rtems_assoc_name_by_local(
|
||||
nap = rtems_assoc_ptr_by_local(ap, local_value);
|
||||
if (nap)
|
||||
return nap->name;
|
||||
|
||||
|
||||
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);
|
||||
if (nap)
|
||||
return nap->name;
|
||||
|
||||
|
||||
return rtems_assoc_name_bad(remote_value);
|
||||
}
|
||||
|
||||
@@ -182,14 +182,14 @@ uint32_t rtems_assoc_remote_by_local_bitfield(
|
||||
const rtems_assoc_t *ap,
|
||||
uint32_t local_value
|
||||
)
|
||||
{
|
||||
{
|
||||
uint32_t b;
|
||||
uint32_t remote_value = 0;
|
||||
|
||||
for (b = 1; b; b <<= 1)
|
||||
if (b & local_value)
|
||||
remote_value |= rtems_assoc_remote_by_local(ap, b);
|
||||
|
||||
|
||||
return remote_value;
|
||||
}
|
||||
|
||||
@@ -198,14 +198,14 @@ uint32_t rtems_assoc_local_by_remote_bitfield(
|
||||
const rtems_assoc_t *ap,
|
||||
uint32_t remote_value
|
||||
)
|
||||
{
|
||||
{
|
||||
uint32_t b;
|
||||
uint32_t local_value = 0;
|
||||
|
||||
for (b = 1; b; b <<= 1)
|
||||
if (b & remote_value)
|
||||
local_value |= rtems_assoc_local_by_remote(ap, b);
|
||||
|
||||
|
||||
return local_value;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ rtems_assoc_name_by_remote_bitfield(
|
||||
uint32_t value,
|
||||
char *buffer
|
||||
)
|
||||
{
|
||||
{
|
||||
uint32_t b;
|
||||
|
||||
*buffer = 0;
|
||||
@@ -227,7 +227,7 @@ rtems_assoc_name_by_remote_bitfield(
|
||||
strcat(buffer, " ");
|
||||
strcat(buffer, rtems_assoc_name_by_remote(ap, b));
|
||||
}
|
||||
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ rtems_assoc_name_by_local_bitfield(
|
||||
uint32_t value,
|
||||
char *buffer
|
||||
)
|
||||
{
|
||||
{
|
||||
uint32_t b;
|
||||
|
||||
*buffer = 0;
|
||||
@@ -249,6 +249,6 @@ rtems_assoc_name_by_local_bitfield(
|
||||
strcat(buffer, " ");
|
||||
strcat(buffer, rtems_assoc_name_by_local(ap, b));
|
||||
}
|
||||
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ rtems_user_env_t * rtems_current_user_env = &rtems_global_user_env;
|
||||
* rtems_filesystem_initialize
|
||||
*
|
||||
* 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
|
||||
* 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_t *mt;
|
||||
rtems_filesystem_location_info_t loc;
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
* filesystem properly until the mount point it will be
|
||||
* mounted onto is created. Moreover, if it is going to
|
||||
* filesystem properly until the mount point it will be
|
||||
* mounted onto is created. Moreover, if it is going to
|
||||
* use a device, then it is REALLY unfair to attempt this
|
||||
* before device drivers are initialized.
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* chdir() - POSIX 1003.1b - 5.2.1 - Change Current Working Directory
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
@@ -34,7 +34,7 @@ int chdir(
|
||||
* 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 );
|
||||
if ( result != 0 )
|
||||
return -1;
|
||||
@@ -52,10 +52,10 @@ int chdir(
|
||||
rtems_filesystem_freenode( &loc );
|
||||
rtems_set_errno_and_return_minus_one( ENOTDIR );
|
||||
}
|
||||
|
||||
|
||||
rtems_filesystem_freenode( &rtems_filesystem_current );
|
||||
|
||||
|
||||
rtems_filesystem_current = loc;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ int chmod(
|
||||
status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE );
|
||||
if ( status != 0 )
|
||||
return -1;
|
||||
|
||||
|
||||
if ( !loc.handlers ){
|
||||
rtems_filesystem_freenode( &loc );
|
||||
rtems_set_errno_and_return_minus_one( EBADF );
|
||||
@@ -51,6 +51,6 @@ int chmod(
|
||||
result = (*loc.handlers->fchmod_h)( &loc, mode );
|
||||
|
||||
rtems_filesystem_freenode( &loc );
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ int chown(
|
||||
|
||||
if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) )
|
||||
return -1;
|
||||
|
||||
|
||||
if ( !loc.ops->chown_h ) {
|
||||
rtems_filesystem_freenode( &loc );
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
@@ -44,6 +44,6 @@ int chown(
|
||||
result = (*loc.ops->chown_h)( &loc, owner, group );
|
||||
|
||||
rtems_filesystem_freenode( &loc );
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* chroot() - Change Root Directory
|
||||
* Author: fernando.ruiz@ctv.es
|
||||
*
|
||||
@@ -30,13 +30,13 @@ int chroot(
|
||||
{
|
||||
int result;
|
||||
rtems_filesystem_location_info_t loc;
|
||||
|
||||
|
||||
/* an automatic call to new private env the first time */
|
||||
if (rtems_current_user_env == &rtems_global_user_env) {
|
||||
rtems_libio_set_private_env(); /* try to set a new private env*/
|
||||
if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
};
|
||||
};
|
||||
|
||||
result = chdir(pathname);
|
||||
if (result) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* This was copied from Newlib 1.8.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1983 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
|
||||
@@ -47,6 +47,6 @@ int dup2(
|
||||
/*
|
||||
* This fcntl handles everything else.
|
||||
*/
|
||||
|
||||
|
||||
return fcntl( fildes, F_DUPFD, fildes2 );
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* Used by the following functions:
|
||||
* findenv_r(), setenv_r(), and unsetenv_r() which are called by
|
||||
* getenv(), getenv_r(), setenv(), and unsetenv().
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(ENVLOCK_DEDIDCATED_MUTEX)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* These routines provide general purpose error reporting.
|
||||
* rtems_error reports an error to stderr and allows use of
|
||||
* printf style formatting. A newline is appended to all messages.
|
||||
*
|
||||
*
|
||||
* error_flag can be specified as any of the following:
|
||||
*
|
||||
* RTEMS_ERROR_ERRNO -- include errno text in output
|
||||
@@ -21,7 +21,7 @@
|
||||
* RTEMS_ERROR_ABORT -- abort after output
|
||||
*
|
||||
* It can also include a rtems_status value which can be OR'd
|
||||
* with the above flags. *
|
||||
* with the above flags. *
|
||||
*
|
||||
* EXAMPLE
|
||||
* #include <rtems.h>
|
||||
@@ -135,11 +135,11 @@ static int rtems_verror(
|
||||
|
||||
if (_System_state_Is_multiprocessing)
|
||||
fprintf(stderr, "[%d] ", _Configuration_MP_table->node);
|
||||
|
||||
|
||||
if (rtems_progname && *rtems_progname)
|
||||
chars_written += fprintf(stderr, "%s: ", rtems_progname);
|
||||
chars_written += vfprintf(stderr, printf_format, arglist);
|
||||
|
||||
|
||||
if (status)
|
||||
chars_written += fprintf(stderr, " (status: %s)", rtems_status_text(status));
|
||||
|
||||
@@ -150,7 +150,7 @@ static int rtems_verror(
|
||||
else
|
||||
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
|
||||
}
|
||||
|
||||
|
||||
chars_written += fprintf(stderr, "\n");
|
||||
|
||||
(void) fflush(stderr);
|
||||
@@ -176,7 +176,7 @@ static int rtems_verror(
|
||||
* Report an error.
|
||||
* error_flag is as above; printf_format is a normal
|
||||
* printf(3) format string, with its concommitant arguments.
|
||||
*
|
||||
*
|
||||
* Returns the number of characters written.
|
||||
*/
|
||||
|
||||
@@ -192,11 +192,11 @@ int rtems_error(
|
||||
va_start(arglist, printf_format);
|
||||
chars_written = rtems_verror(error_flag, printf_format, arglist);
|
||||
va_end(arglist);
|
||||
|
||||
|
||||
return chars_written;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* rtems_panic is shorthand for rtems_error(RTEMS_ERROR_PANIC, ...)
|
||||
*/
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ int rtems_filesystem_evaluate_path(
|
||||
|
||||
if ( !pathloc )
|
||||
rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
* should probably free pathloc in either case:
|
||||
* - 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
|
||||
* cleanup pathloc.
|
||||
* - 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 );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ int rtems_filesystem_evaluate_parent(
|
||||
|
||||
if ( !pathloc )
|
||||
rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
|
||||
|
||||
|
||||
if ( !pathloc->ops->evalpath_h )
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ int fchdir(
|
||||
{
|
||||
rtems_libio_t *iop;
|
||||
rtems_filesystem_location_info_t loc, saved;
|
||||
|
||||
|
||||
rtems_libio_check_fd( fd );
|
||||
iop = rtems_libio_iop( fd );
|
||||
rtems_libio_check_is_open(iop);
|
||||
@@ -57,7 +57,7 @@ int fchdir(
|
||||
RTEMS_FILESYSTEM_DIRECTORY ) {
|
||||
rtems_set_errno_and_return_minus_one( ENOTDIR );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* FIXME : I feel there should be another call to
|
||||
@@ -71,10 +71,10 @@ int fchdir(
|
||||
* share their rtems_filesystem_current better
|
||||
* be synchronized!
|
||||
*/
|
||||
|
||||
|
||||
saved = rtems_filesystem_current;
|
||||
rtems_filesystem_current = iop->pathinfo;
|
||||
|
||||
|
||||
/* clone the current node */
|
||||
if (rtems_filesystem_evaluate_path(".", 0, &loc, 0)) {
|
||||
/* cloning failed; restore original and bail out */
|
||||
@@ -85,6 +85,6 @@ int fchdir(
|
||||
rtems_filesystem_freenode( &saved );
|
||||
|
||||
rtems_filesystem_current = loc;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ int fchmod(
|
||||
)
|
||||
{
|
||||
rtems_libio_t *iop;
|
||||
|
||||
|
||||
rtems_libio_check_fd( fd );
|
||||
iop = rtems_libio_iop( fd );
|
||||
rtems_libio_check_is_open(iop);
|
||||
|
||||
@@ -35,7 +35,7 @@ static int vfcntl(
|
||||
int flags;
|
||||
int mask;
|
||||
int ret = 0;
|
||||
|
||||
|
||||
rtems_libio_check_fd( fd );
|
||||
iop = rtems_libio_iop( fd );
|
||||
rtems_libio_check_is_open(iop);
|
||||
@@ -78,7 +78,7 @@ static int vfcntl(
|
||||
* Interpret the third argument as the "close on exec()" flag.
|
||||
* 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
|
||||
* processes, then we can ignore this one except to make
|
||||
* processes, then we can ignore this one except to make
|
||||
* F_GETFD work.
|
||||
*/
|
||||
|
||||
@@ -136,10 +136,10 @@ static int vfcntl(
|
||||
|
||||
/*
|
||||
* 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) {
|
||||
int err = (*iop->handlers->fcntl_h)( cmd, iop );
|
||||
if (err) {
|
||||
|
||||
@@ -28,7 +28,7 @@ int ftruncate(
|
||||
{
|
||||
rtems_libio_t *iop;
|
||||
rtems_filesystem_location_info_t loc;
|
||||
|
||||
|
||||
rtems_libio_check_fd( fd );
|
||||
iop = rtems_libio_iop( fd );
|
||||
rtems_libio_check_is_open(iop);
|
||||
@@ -36,7 +36,7 @@ int ftruncate(
|
||||
/*
|
||||
* Now process the ftruncate() request.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Make sure we are not working on a directory
|
||||
*/
|
||||
@@ -44,7 +44,7 @@ int ftruncate(
|
||||
loc = iop->pathinfo;
|
||||
if ( !loc.ops->node_type_h )
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
|
||||
if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY )
|
||||
rtems_set_errno_and_return_minus_one( EISDIR );
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ int getdents(
|
||||
loc = iop->pathinfo;
|
||||
if ( !loc.ops->node_type_h )
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
|
||||
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY )
|
||||
rtems_set_errno_and_return_minus_one( ENOTDIR );
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ gid_t _POSIX_types_Egid = 0;
|
||||
|
||||
/*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
|
||||
*/
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ uid_t _POSIX_types_Euid = 0;
|
||||
|
||||
/*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
|
||||
*/
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
/*
|
||||
* MACRO in userenv.h
|
||||
*
|
||||
*
|
||||
gid_t _POSIX_types_Gid = 0;
|
||||
*/
|
||||
|
||||
/*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
|
||||
*/
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/*
|
||||
* MACRO in userenv.h
|
||||
*
|
||||
*
|
||||
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ int getlogin_r(
|
||||
size_t namesize
|
||||
)
|
||||
{
|
||||
struct passwd *pw;
|
||||
struct passwd *pw;
|
||||
if ( namesize < LOGIN_NAME_MAX )
|
||||
return ERANGE;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ int getpwnam_r(
|
||||
return getpw_r(name, 0, pwd, buffer, bufsize, result);
|
||||
}
|
||||
|
||||
struct passwd *getpwnam(
|
||||
struct passwd *getpwnam(
|
||||
const char *name
|
||||
)
|
||||
{
|
||||
@@ -385,7 +385,7 @@ int getgrnam_r(
|
||||
return getgr_r(name, 0, grp, buffer, bufsize, result);
|
||||
}
|
||||
|
||||
struct group *getgrnam(
|
||||
struct group *getgrnam(
|
||||
const char *name
|
||||
)
|
||||
{
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
#include <rtems/userenv.h>
|
||||
|
||||
/*
|
||||
* MACRO in userenv.h
|
||||
/*
|
||||
* MACRO in userenv.h
|
||||
*
|
||||
uid_t _POSIX_types_Uid = 0;
|
||||
*/
|
||||
|
||||
/*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
|
||||
*/
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Eric sent some e-mail in the rtems-list as a start point for this
|
||||
* module implementation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <rtems/error.h> /* rtems_panic */
|
||||
#include <rtems/rtems/tasks.h>
|
||||
|
||||
/*
|
||||
/*
|
||||
* These typedefs should match with the ones defined in the file
|
||||
* 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 */
|
||||
static rtems_id get_tid( void )
|
||||
{
|
||||
rtems_id id = 0;
|
||||
rtems_id id = 0;
|
||||
rtems_task_ident( RTEMS_SELF, 0, &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
|
||||
* 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.
|
||||
*/
|
||||
/* 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
|
||||
printk( "gxx_wrappers: lock mutex=%X\n", *mutex );
|
||||
#endif
|
||||
return ( rtems_semaphore_obtain( (rtems_id)*mutex,
|
||||
return ( rtems_semaphore_obtain( (rtems_id)*mutex,
|
||||
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
|
||||
printk( "gxx_wrappers: trylock mutex=%X\n", *mutex );
|
||||
#endif
|
||||
return (rtems_semaphore_obtain ((rtems_id)*mutex,
|
||||
return (rtems_semaphore_obtain ((rtems_id)*mutex,
|
||||
RTEMS_NO_WAIT, 0) == RTEMS_SUCCESSFUL) ? 0 : -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ int ioctl(
|
||||
int fd,
|
||||
int command,
|
||||
...
|
||||
)
|
||||
{
|
||||
)
|
||||
{
|
||||
va_list ap;
|
||||
rtems_status_code rc;
|
||||
rtems_libio_t *iop;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
|
||||
#include <rtems/libio.h> /* libio.h not pulled in by rtems */
|
||||
|
||||
/*
|
||||
/*
|
||||
* File descriptor Table Information
|
||||
*/
|
||||
*/
|
||||
|
||||
extern uint32_t rtems_libio_number_iops;
|
||||
rtems_id rtems_libio_semaphore;
|
||||
@@ -102,7 +102,7 @@ void rtems_libio_init( void )
|
||||
|
||||
/*
|
||||
* rtems_libio_fcntl_flags
|
||||
*
|
||||
*
|
||||
* 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_modes = fcntl_flags & O_ACCMODE;
|
||||
fcntl_flags &= ~O_ACCMODE;
|
||||
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
|
||||
*
|
||||
*
|
||||
* Convert RTEMS internal flags to UNIX fnctl(2) flags
|
||||
*/
|
||||
|
||||
@@ -183,7 +183,7 @@ uint32_t rtems_libio_to_fcntl_flags(
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@@ -191,7 +191,7 @@ rtems_libio_t *rtems_libio_allocate( void )
|
||||
{
|
||||
rtems_libio_t *iop, *next;
|
||||
rtems_status_code rc;
|
||||
|
||||
|
||||
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
|
||||
|
||||
if (rtems_libio_iop_freelist) {
|
||||
@@ -211,10 +211,10 @@ rtems_libio_t *rtems_libio_allocate( void )
|
||||
rtems_libio_iop_freelist = next;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
failed:
|
||||
iop = 0;
|
||||
|
||||
|
||||
done:
|
||||
rtems_semaphore_release( rtems_libio_semaphore );
|
||||
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
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@@ -263,15 +263,15 @@ int rtems_libio_is_open_files_in_fs(
|
||||
int i;
|
||||
|
||||
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
|
||||
|
||||
|
||||
/*
|
||||
* Look for any active file descriptor entry.
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
for (iop=rtems_libio_iops,i=0; i < rtems_libio_number_iops; iop++, i++){
|
||||
|
||||
|
||||
if ((iop->flags & LIBIO_FLAGS_OPEN) != 0) {
|
||||
|
||||
|
||||
/*
|
||||
* Check if this node is under the file system that we
|
||||
* are trying to dismount.
|
||||
@@ -285,7 +285,7 @@ int rtems_libio_is_open_files_in_fs(
|
||||
}
|
||||
|
||||
rtems_semaphore_release( rtems_libio_semaphore );
|
||||
|
||||
|
||||
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
|
||||
* given file refers to an active file descriptor.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
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) {
|
||||
|
||||
|
||||
/*
|
||||
* Check if this node is under the file system that we
|
||||
* are trying to dismount.
|
||||
|
||||
@@ -76,7 +76,7 @@ int link(
|
||||
}
|
||||
|
||||
result = (*parent_loc.ops->link_h)( &existing_loc, &parent_loc, name_start );
|
||||
|
||||
|
||||
rtems_filesystem_freenode( &existing_loc );
|
||||
rtems_filesystem_freenode( &parent_loc );
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ off_t lseek(
|
||||
|
||||
#include <reent.h>
|
||||
|
||||
off_t _lseek_r(
|
||||
off_t _lseek_r(
|
||||
struct _reent *ptr,
|
||||
int fd,
|
||||
off_t offset,
|
||||
|
||||
@@ -112,7 +112,7 @@ void RTEMS_Malloc_Initialize(
|
||||
|
||||
/*
|
||||
* 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
|
||||
* with UNIX history seems to assume that memory malloc'ed during
|
||||
* initialization (before any free's) is zero'ed. This is true most
|
||||
@@ -145,7 +145,7 @@ void RTEMS_Malloc_Initialize(
|
||||
/* zero all the stats */
|
||||
(void) memset( &rtems_malloc_stats, 0, sizeof(rtems_malloc_stats) );
|
||||
#endif
|
||||
|
||||
|
||||
MSBUMP(space_available, length);
|
||||
}
|
||||
|
||||
@@ -173,11 +173,11 @@ void *malloc(
|
||||
if (_System_state_Is_up(_System_state_Get())) {
|
||||
if (_Thread_Dispatch_disable_level > 0)
|
||||
return (void *) 0;
|
||||
|
||||
|
||||
if (_ISR_Nest_level > 0)
|
||||
return (void *) 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
if ((starting_address = (void *)sbrk(the_size))
|
||||
if ((starting_address = (void *)sbrk(the_size))
|
||||
== (void*) -1)
|
||||
return (void *) 0;
|
||||
|
||||
@@ -226,7 +226,7 @@ void *malloc(
|
||||
errno = ENOMEM;
|
||||
return (void *) 0;
|
||||
}
|
||||
|
||||
|
||||
MSBUMP(space_available, the_size);
|
||||
|
||||
status = rtems_region_get_segment(
|
||||
@@ -302,11 +302,11 @@ void *realloc(
|
||||
if (_System_state_Is_up(_System_state_Get())) {
|
||||
if (_Thread_Dispatch_disable_level > 0)
|
||||
return (void *) 0;
|
||||
|
||||
|
||||
if (_ISR_Nest_level > 0)
|
||||
return (void *) 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Continue with calloc().
|
||||
*/
|
||||
@@ -319,11 +319,11 @@ void *realloc(
|
||||
}
|
||||
|
||||
new_area = malloc( size );
|
||||
|
||||
|
||||
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
|
||||
* and the C Standard.
|
||||
*/
|
||||
@@ -366,7 +366,7 @@ void free(
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef MALLOC_STATS
|
||||
{
|
||||
size_t size;
|
||||
@@ -376,7 +376,7 @@ void free(
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
|
||||
if ( status != RTEMS_SUCCESSFUL ) {
|
||||
errno = EINVAL;
|
||||
@@ -421,7 +421,7 @@ void malloc_walk(size_t source, size_t printf_enabled)
|
||||
{
|
||||
register Region_Control *the_region;
|
||||
Objects_Locations location;
|
||||
|
||||
|
||||
_RTEMS_Lock_allocator(); /* to prevent deletion */
|
||||
the_region = _Region_Get( RTEMS_Malloc_Heap, &location );
|
||||
if ( location == OBJECTS_LOCAL )
|
||||
@@ -437,7 +437,7 @@ void malloc_dump(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void malloc_walk(size_t source, size_t printf_enabled)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* This routine is not defined in the POSIX 1003.1b standard but is
|
||||
* 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.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
@@ -42,7 +42,7 @@ int mknod(
|
||||
|
||||
if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
|
||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
||||
|
||||
|
||||
if ( S_ISFIFO(mode) )
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
@@ -52,9 +52,9 @@ int mknod(
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
}
|
||||
|
||||
result = (*temp_loc.ops->evalformake_h)(
|
||||
result = (*temp_loc.ops->evalformake_h)(
|
||||
&pathname[i],
|
||||
&temp_loc,
|
||||
&temp_loc,
|
||||
&name_start
|
||||
);
|
||||
if ( result != 0 )
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*
|
||||
* XXX
|
||||
*
|
||||
* XXX make sure no required ops are NULL
|
||||
* XXX make sure no optional ops you are using are NULL
|
||||
* XXX make sure no required ops are NULL
|
||||
* XXX make sure no optional ops you are using are NULL
|
||||
* XXX unmount should be required.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
@@ -55,8 +55,8 @@ static int Is_node_fs_root(
|
||||
/*
|
||||
* mount
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* following reasons exist to prevent the mount operation:
|
||||
*
|
||||
* 1) The file system type or options are not valid
|
||||
@@ -95,7 +95,7 @@ int mount(
|
||||
* Are the file system options valid?
|
||||
*/
|
||||
|
||||
if ( options != RTEMS_FILESYSTEM_READ_ONLY &&
|
||||
if ( options != RTEMS_FILESYSTEM_READ_ONLY &&
|
||||
options != RTEMS_FILESYSTEM_READ_WRITE ) {
|
||||
errno = EINVAL;
|
||||
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);
|
||||
@@ -133,12 +133,12 @@ int mount(
|
||||
|
||||
/*
|
||||
* 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 ( rtems_filesystem_evaluate_path(
|
||||
if ( rtems_filesystem_evaluate_path(
|
||||
mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 )
|
||||
goto cleanup_and_bail;
|
||||
|
||||
@@ -153,12 +153,12 @@ int mount(
|
||||
goto cleanup_and_bail;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Test to see if it is a directory
|
||||
*/
|
||||
|
||||
if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
|
||||
errno = ENOTDIR;
|
||||
errno = ENOTDIR;
|
||||
goto cleanup_and_bail;
|
||||
}
|
||||
|
||||
@@ -170,11 +170,11 @@ int mount(
|
||||
errno = EBUSY;
|
||||
goto cleanup_and_bail;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This must be a good mount point, so move the location information
|
||||
* 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
|
||||
* traverse the tree.
|
||||
*/
|
||||
@@ -184,9 +184,9 @@ int mount(
|
||||
temp_mt_entry->mt_point_node.ops = loc.ops;
|
||||
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
|
||||
* below the base file system
|
||||
/*
|
||||
* This link to the parent is only done when we are dealing with system
|
||||
* below the base file system
|
||||
*/
|
||||
|
||||
if ( !loc.ops->mount_h ){
|
||||
@@ -199,9 +199,9 @@ int mount(
|
||||
}
|
||||
} else {
|
||||
|
||||
/*
|
||||
* This is a mount of the base file system --> The
|
||||
* mt_point_node.node_access will be set to null to indicate that this
|
||||
/*
|
||||
* This is a mount of the base file system --> The
|
||||
* mt_point_node.node_access will be set to null to indicate that this
|
||||
* 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 );
|
||||
@@ -236,7 +236,7 @@ int mount(
|
||||
cleanup_and_bail:
|
||||
|
||||
free( temp_mt_entry );
|
||||
|
||||
|
||||
if ( 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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
@@ -276,8 +276,8 @@ static int Is_node_fs_root(
|
||||
Chain_Node *the_node;
|
||||
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;
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
* we just don't for now.
|
||||
* Not sure if this is a problem with hpux, newlib, or something else.
|
||||
*/
|
||||
|
||||
|
||||
#if defined(RTEMS_UNIX) && !defined(hpux)
|
||||
#define NEED_SETVBUF
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int _fwalk(struct _reent *ptr, int (*function) (FILE *) );
|
||||
@@ -65,7 +65,7 @@ extern void _reclaim_reent(struct _reent *);
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -87,7 +87,7 @@ void libc_wrapup(void)
|
||||
#endif
|
||||
_REENT = &libc_global_reent;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Try to drain output buffers.
|
||||
*
|
||||
@@ -100,7 +100,7 @@ void libc_wrapup(void)
|
||||
fclose (stderr);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* reent struct allocation moved here from libc_start_hook() to avoid
|
||||
* mutual exclusion problems when memory is allocated from the start hook.
|
||||
*
|
||||
@@ -129,14 +129,14 @@ rtems_boolean libc_create_hook(
|
||||
#endif
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* GCC extension: structure constants */
|
||||
_REENT_INIT_PTR((ptr));
|
||||
#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
|
||||
* use was against 1.7.0. This is basically an exansion of
|
||||
* 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)
|
||||
*/
|
||||
|
||||
|
||||
#ifdef NEED_SETVBUF
|
||||
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.
|
||||
*/
|
||||
*/
|
||||
_fwalk(ptr, newlib_free_buffers);
|
||||
#if REENT_MALLOCED
|
||||
free(ptr);
|
||||
|
||||
@@ -52,10 +52,10 @@ int __kill( pid_t pid, int sig )
|
||||
* 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
* EINTR - The open( operation was interrupted by a signal.
|
||||
* EINVAL - This implementation does not support synchronized IO for this
|
||||
* 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.
|
||||
* EMFILE - Too many file descriptors are in used by this process.
|
||||
* ENAMETOOLONG -
|
||||
* ENAMETOOLONG -
|
||||
* The length of the path exceeds PATH_MAX or a pathname
|
||||
* component is longer than NAME_MAX while POSIX_NO_TRUNC
|
||||
* is in effect.
|
||||
@@ -74,7 +74,7 @@ int open(
|
||||
|
||||
|
||||
/*
|
||||
* Set the Evaluation flags
|
||||
* Set the Evaluation flags
|
||||
*/
|
||||
|
||||
eval_flags = 0;
|
||||
@@ -84,7 +84,7 @@ int open(
|
||||
if ( ( status & _FWRITE ) == _FWRITE )
|
||||
eval_flags |= RTEMS_LIBIO_PERMS_WRITE;
|
||||
|
||||
|
||||
|
||||
va_start(ap, flags);
|
||||
|
||||
mode = va_arg( ap, int );
|
||||
@@ -160,7 +160,7 @@ int open(
|
||||
|
||||
if ( !iop->handlers->open_h ) {
|
||||
rc = ENOTSUP;
|
||||
goto done;
|
||||
goto done;
|
||||
}
|
||||
|
||||
rc = (*iop->handlers->open_h)( iop, pathname, flags, mode );
|
||||
@@ -180,7 +180,7 @@ int open(
|
||||
loc_to_free = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Single exit and clean up path.
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* This was copied from Newlib 1.8.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1983 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
| Description: print number in a given base.
|
||||
| Global Variables: None.
|
||||
| Arguments: num - number to print, base - base used to print the number.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void
|
||||
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;
|
||||
if (maxwidth) maxwidth--;
|
||||
}
|
||||
|
||||
|
||||
count = 0;
|
||||
while ((n = num / base) > 0) {
|
||||
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.
|
||||
| Global Variables: None.
|
||||
| Arguments: as in printf: fmt - format string, ... - unnamed arguments.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void
|
||||
vprintk(char *fmt, va_list ap)
|
||||
@@ -80,7 +80,7 @@ vprintk(char *fmt, va_list ap)
|
||||
/* unsigned int level; */
|
||||
|
||||
/* _CPU_ISR_Disable(level); */
|
||||
|
||||
|
||||
for (; *fmt != '\0'; fmt++)
|
||||
{
|
||||
lflag = 0;
|
||||
@@ -114,7 +114,7 @@ vprintk(char *fmt, va_list ap)
|
||||
case 'u': case 'U': base = 10; sign = 0; break;
|
||||
case 'x': case 'X': base = 16; sign = 0; break;
|
||||
case 's':
|
||||
for (str = va_arg(ap, char *); *str; str++)
|
||||
for (str = va_arg(ap, char *); *str; str++)
|
||||
BSP_output_char(*str);
|
||||
break;
|
||||
case 'c':
|
||||
@@ -150,7 +150,7 @@ void
|
||||
printk(char *fmt, ...)
|
||||
{
|
||||
va_list ap; /* points to each unnamed argument in turn */
|
||||
|
||||
|
||||
va_start(ap, fmt); /* make ap point to 1st unnamed arg */
|
||||
vprintk(fmt, ap);
|
||||
va_end(ap); /* clean up when done */
|
||||
|
||||
@@ -38,7 +38,7 @@ free_user_env(void *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
|
||||
&& --env->refcnt <= 0
|
||||
#endif
|
||||
@@ -76,11 +76,11 @@ rtems_status_code rtems_libio_set_private_env(void) {
|
||||
return sc;
|
||||
}
|
||||
rtems_current_user_env = tmp;
|
||||
};
|
||||
};
|
||||
|
||||
*rtems_current_user_env = rtems_global_user_env; /* get the global values*/
|
||||
rtems_current_user_env->task_id=task_id; /* mark the local values*/
|
||||
|
||||
|
||||
/* get a clean root */
|
||||
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 (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;
|
||||
sc = rtems_task_variable_delete(RTEMS_SELF,(void*)&rtems_current_user_env);
|
||||
if (sc != RTEMS_SUCCESSFUL) return sc;
|
||||
free_user_env(tmp);
|
||||
free_user_env(tmp);
|
||||
};
|
||||
|
||||
/* 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);
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
goto bailout;
|
||||
|
||||
|
||||
/* the current_user_env is the same pointer that remote env */
|
||||
rtems_current_user_env = shared_user_env;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* This was copied from Newlib 1.8.0.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1983 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -59,7 +59,7 @@ struct dirent *
|
||||
readdir(dirp)
|
||||
register DIR *dirp; {
|
||||
register struct dirent *dp;
|
||||
|
||||
|
||||
if ( !dirp )
|
||||
return NULL;
|
||||
|
||||
@@ -68,7 +68,7 @@ register DIR *dirp; {
|
||||
dirp->dd_size = getdents (dirp->dd_fd,
|
||||
dirp->dd_buf,
|
||||
dirp->dd_len);
|
||||
|
||||
|
||||
if (dirp->dd_size <= 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ int readlink(
|
||||
result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE );
|
||||
if ( result != 0 )
|
||||
return -1;
|
||||
|
||||
|
||||
if ( !loc.ops->node_type_h ){
|
||||
rtems_filesystem_freenode( &loc );
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
@@ -52,6 +52,6 @@ int readlink(
|
||||
result = (*loc.ops->readlink_h)( &loc, buf, bufsize );
|
||||
|
||||
rtems_filesystem_freenode( &loc );
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void rewinddir(
|
||||
return;
|
||||
|
||||
status = lseek( dirp->dd_fd, 0, SEEK_SET );
|
||||
|
||||
|
||||
if( status == -1 )
|
||||
return;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user