mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
Compare commits
25 Commits
4.5.0
...
4.5.1-pre1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42d03c5e07 | ||
|
|
a7b8de0589 | ||
|
|
3efa52954d | ||
|
|
36d90eec36 | ||
|
|
2b31cc882c | ||
|
|
b68cc333d3 | ||
|
|
6f1118a0c5 | ||
|
|
ca739de315 | ||
|
|
770f6e99fb | ||
|
|
45e1417c51 | ||
|
|
cbdb14497c | ||
|
|
b3a6713265 | ||
|
|
5ccb03b887 | ||
|
|
6559511b4e | ||
|
|
256226b87e | ||
|
|
3bb9542cd6 | ||
|
|
b748fff9c5 | ||
|
|
ca4c387054 | ||
|
|
079b1f4c2c | ||
|
|
99cfdc2dea | ||
|
|
e5aeae7b30 | ||
|
|
0b18036afc | ||
|
|
74835d7880 | ||
|
|
289f822131 | ||
|
|
d7d1096c78 |
@@ -29,6 +29,7 @@ ER snd_msg(
|
||||
Objects_Locations location;
|
||||
unsigned32 message_priority;
|
||||
void *message_contents;
|
||||
CORE_message_queue_Status msg_status;
|
||||
|
||||
if ( !pk_msg )
|
||||
return E_PAR;
|
||||
@@ -46,7 +47,7 @@ ER snd_msg(
|
||||
message_priority = CORE_MESSAGE_QUEUE_SEND_REQUEST;
|
||||
|
||||
message_contents = pk_msg;
|
||||
_CORE_message_queue_Submit(
|
||||
msg_status = _CORE_message_queue_Submit(
|
||||
&the_mailbox->message_queue,
|
||||
&message_contents,
|
||||
sizeof(T_MSG *),
|
||||
@@ -60,8 +61,6 @@ ER snd_msg(
|
||||
}
|
||||
|
||||
_ITRON_return_errorno(
|
||||
_ITRON_Mailbox_Translate_core_message_queue_return_code(
|
||||
_Thread_Executing->Wait.return_code
|
||||
)
|
||||
_ITRON_Mailbox_Translate_core_message_queue_return_code( msg_status )
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ ER tsnd_mbf(
|
||||
Objects_Locations location;
|
||||
Watchdog_Interval interval;
|
||||
boolean wait;
|
||||
CORE_message_queue_Status msg_status;
|
||||
|
||||
if (msgsz <= 0 || !msg)
|
||||
return E_PAR;
|
||||
@@ -57,7 +58,7 @@ ER tsnd_mbf(
|
||||
|
||||
case OBJECTS_LOCAL:
|
||||
/* XXX Submit needs to take into account blocking */
|
||||
_CORE_message_queue_Submit(
|
||||
msg_status = _CORE_message_queue_Submit(
|
||||
&the_message_buffer->message_queue,
|
||||
msg,
|
||||
msgsz,
|
||||
@@ -69,7 +70,7 @@ ER tsnd_mbf(
|
||||
);
|
||||
_Thread_Enable_dispatch();
|
||||
return _ITRON_Message_buffer_Translate_core_message_buffer_return_code(
|
||||
_Thread_Executing->Wait.return_code
|
||||
msg_status
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ int _POSIX_Message_queue_Send_support(
|
||||
{
|
||||
register POSIX_Message_queue_Control *the_mq;
|
||||
Objects_Locations location;
|
||||
CORE_message_queue_Status msg_status;
|
||||
|
||||
/*
|
||||
* Validate the priority.
|
||||
@@ -70,7 +71,7 @@ int _POSIX_Message_queue_Send_support(
|
||||
set_errno_and_return_minus_one( EBADF );
|
||||
}
|
||||
|
||||
_CORE_message_queue_Submit(
|
||||
msg_status = _CORE_message_queue_Submit(
|
||||
&the_mq->Message_queue,
|
||||
(void *) msg_ptr,
|
||||
msg_len,
|
||||
@@ -86,12 +87,23 @@ int _POSIX_Message_queue_Send_support(
|
||||
);
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
if ( !_Thread_Executing->Wait.return_code )
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If we had to block, then this is where the task returns
|
||||
* after it wakes up. The returned status is correct for
|
||||
* non-blocking operations but if we blocked, then we need
|
||||
* to look at the status in our TCB.
|
||||
*/
|
||||
|
||||
if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT )
|
||||
msg_status = _Thread_Executing->Wait.return_code;
|
||||
|
||||
if ( !msg_status )
|
||||
return msg_status;
|
||||
|
||||
set_errno_and_return_minus_one(
|
||||
_POSIX_Message_queue_Translate_core_message_queue_return_code(
|
||||
_Thread_Executing->Wait.return_code
|
||||
msg_status
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task(
|
||||
rtems_attribute attribute_set
|
||||
)
|
||||
{
|
||||
return ( attribute_set & RTEMS_PRIORITY_CEILING );
|
||||
return ( attribute_set & RTEMS_SYSTEM_TASK );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -65,6 +65,7 @@ void _Event_Surrender(
|
||||
api->pending_events =
|
||||
_Event_sets_Clear( pending_events, seized_events );
|
||||
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
|
||||
(rtems_event_set) the_thread->Wait.count = 0; /* FIX 26MAR01 */
|
||||
|
||||
_ISR_Flash( level );
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ rtems_status_code _Message_queue_Submit(
|
||||
{
|
||||
register Message_queue_Control *the_message_queue;
|
||||
Objects_Locations location;
|
||||
CORE_message_queue_Status msg_status;
|
||||
|
||||
the_message_queue = _Message_queue_Get( id, &location );
|
||||
switch ( location )
|
||||
@@ -97,7 +98,7 @@ rtems_status_code _Message_queue_Submit(
|
||||
case OBJECTS_LOCAL:
|
||||
switch ( submit_type ) {
|
||||
case MESSAGE_QUEUE_SEND_REQUEST:
|
||||
_CORE_message_queue_Send(
|
||||
msg_status = _CORE_message_queue_Send(
|
||||
&the_message_queue->message_queue,
|
||||
buffer,
|
||||
size,
|
||||
@@ -112,7 +113,7 @@ rtems_status_code _Message_queue_Submit(
|
||||
);
|
||||
break;
|
||||
case MESSAGE_QUEUE_URGENT_REQUEST:
|
||||
_CORE_message_queue_Urgent(
|
||||
msg_status = _CORE_message_queue_Urgent(
|
||||
&the_message_queue->message_queue,
|
||||
buffer,
|
||||
size,
|
||||
@@ -131,9 +132,13 @@ rtems_status_code _Message_queue_Submit(
|
||||
}
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
return _Message_queue_Translate_core_message_queue_return_code(
|
||||
_Thread_Executing->Wait.return_code
|
||||
);
|
||||
/*
|
||||
* Since this API does not allow for blocking sends, we can directly
|
||||
* return the returned msg_status.
|
||||
*/
|
||||
|
||||
return
|
||||
_Message_queue_Translate_core_message_queue_return_code( msg_status );
|
||||
|
||||
}
|
||||
return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file contains all assembly code for the MC68020 implementation
|
||||
* of RTEMS.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2001.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -68,7 +68,7 @@ SYM (_CPU_Context_save_fp):
|
||||
moval a1@,a0 | a0 = Save context area
|
||||
fsave a0@- | save 68881/68882 state frame
|
||||
tstb a0@ | check for a null frame
|
||||
beq nosv | Yes, skip save of user model
|
||||
beq.b nosv | Yes, skip save of user model
|
||||
fmovem fp0-fp7,a0@- | save data registers (fp0-fp7)
|
||||
fmovem fpc/fps/fpi,a0@- | and save control registers
|
||||
movl #-1,a0@- | place not-null flag on stack
|
||||
@@ -83,7 +83,7 @@ SYM (_CPU_Context_restore_fp):
|
||||
moval a7@(FPCONTEXT_ARG),a1 | a1 = &ptr to context area
|
||||
moval a1@,a0 | a0 = address of saved context
|
||||
tstb a0@ | Null context frame?
|
||||
beq norst | Yes, skip fp restore
|
||||
beq.b norst | Yes, skip fp restore
|
||||
addql #4,a0 | throwaway non-null flag
|
||||
fmovem a0@+,fpc/fps/fpi | restore control registers
|
||||
fmovem a0@+,fp0-fp7 | restore data regs (fp0-fp7)
|
||||
@@ -101,24 +101,12 @@ norst: frestore a0@+ | restore the fp state frame
|
||||
* NOTE:
|
||||
* Upon entry, the master stack will contain an interrupt stack frame
|
||||
* back to the interrupted thread and the interrupt stack will contain
|
||||
* a throwaway interrupt stack frame. If dispatching is enabled, this
|
||||
* is the outer most interrupt, and (a context switch is necessary or
|
||||
* the current thread has signals), then set up the master stack to
|
||||
* a throwaway interrupt stack frame. If dispatching is enabled, and this
|
||||
* is the outer most interrupt, and a context switch is necessary or
|
||||
* the current thread has pending signals, then set up the master stack to
|
||||
* transfer control to the interrupt dispatcher.
|
||||
*/
|
||||
|
||||
/*
|
||||
* With this approach, lower priority interrupts may
|
||||
* execute twice if a higher priority interrupt is
|
||||
* acknowledged before _Thread_Dispatch_disable is
|
||||
* incremented and the higher priority interrupt
|
||||
* performs a context switch after executing. The lower
|
||||
* priority interrupt will execute (1) at the end of the
|
||||
* higher priority interrupt in the new context if
|
||||
* permitted by the new interrupt level mask, and (2) when
|
||||
* the original context regains the cpu.
|
||||
*/
|
||||
|
||||
#if ( M68K_COLDFIRE_ARCH == 1 )
|
||||
.set SR_OFFSET, 2 | Status register offset
|
||||
.set PC_OFFSET, 4 | Program Counter offset
|
||||
@@ -142,45 +130,31 @@ SYM (_ISR_Handler):
|
||||
addql #1,SYM (_Thread_Dispatch_disable_level) | disable multitasking
|
||||
#if ( M68K_COLDFIRE_ARCH == 0 )
|
||||
moveml d0-d1/a0-a1,a7@- | save d0-d1,a0-a1
|
||||
movew a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO
|
||||
andl #0x0fff,d0 | d0 = vector offset in vbr
|
||||
#else
|
||||
lea a7@(-SAVED),a7
|
||||
movm.l d0-d1/a0-a1,a7@ | save d0-d1,a0-a1
|
||||
#endif
|
||||
movew a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO
|
||||
andl #0x0ffc,d0 | d0 = vector offset in vbr
|
||||
#endif
|
||||
|
||||
|
||||
#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
|
||||
#if ( M68K_COLDFIRE_ARCH == 0 )
|
||||
movew sr,d1 | Save status register
|
||||
oriw #0x700,sr | Disable interrupts
|
||||
#else
|
||||
move.l d0,a7@- | Save d0 value
|
||||
move.l #0x700,d0 | Load in disable ints value
|
||||
move.w sr,d1 | Grab SR
|
||||
or.l d1,d0 | Create new SR
|
||||
move.w d0,sr | Disable interrupts
|
||||
move.l a7@+,d0 | Restore d0 value
|
||||
#endif
|
||||
|
||||
tstl SYM (_ISR_Nest_level) | Interrupting an interrupt handler?
|
||||
bne 1f | Yes, just skip over stack switch code
|
||||
movel SYM(_CPU_Interrupt_stack_high),a0 | End of interrupt stack
|
||||
movel a7,a0@- | Save task stack pointer
|
||||
movel a0,a7 | Switch to interrupt stack
|
||||
movel _CPU_Interrupt_stack_high,a0 | a0 now point just above interrupt stack
|
||||
cmpl _CPU_Interrupt_stack_low,a7 | stack below interrupt stack?
|
||||
bcs.b 1f | yes, switch to interrupt stack
|
||||
cmpl a0,a7 | stack above interrupt stack?
|
||||
bcs.b 2f | no, do not switch stacks
|
||||
1:
|
||||
addql #1,SYM(_ISR_Nest_level) | one nest level deeper
|
||||
movew d1,sr | Restore status register
|
||||
#else
|
||||
addql #1,SYM (_ISR_Nest_level) | one nest level deeper
|
||||
movel a7,a1 | copy task stack pointer
|
||||
movel a0,a7 | switch to interrupt stack
|
||||
movel a1,a7@- | store task stack pointer on interrupt stack
|
||||
2:
|
||||
#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
|
||||
|
||||
#if ( M68K_HAS_PREINDEXING == 1 )
|
||||
movel @( SYM (_ISR_Vector_table),d0:w:1),a0| fetch the ISR
|
||||
#else
|
||||
movel # SYM (_ISR_Vector_table),a0 | a0 = base of RTEMS table
|
||||
movel # SYM (_ISR_Vector_table),a0 | a0 = base of RTEMS table
|
||||
addal d0,a0 | a0 = address of vector
|
||||
movel (a0),a0 | a0 = address of user routine
|
||||
#endif
|
||||
@@ -191,45 +165,44 @@ SYM (_ISR_Handler):
|
||||
addql #4,a7 | remove vector number
|
||||
|
||||
#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
|
||||
#if ( M68K_COLDFIRE_ARCH == 0 )
|
||||
movew sr,d0 | Save status register
|
||||
oriw #0x700,sr | Disable interrupts
|
||||
#else
|
||||
move.l #0x700,d1 | Load in disable int value
|
||||
move.w sr,d0 | Grab SR
|
||||
or.l d0,d1 | Create new SR
|
||||
move.w d1,sr | Load to disable interrupts
|
||||
#endif
|
||||
|
||||
subql #1,SYM(_ISR_Nest_level) | Reduce interrupt-nesting count
|
||||
bne 1f | Skip if return to interrupt
|
||||
movel _CPU_Interrupt_stack_high,a0
|
||||
subql #4,a0
|
||||
cmpl a0,a7 | At top of interrupt stack?
|
||||
bne.b 1f | No, do not restore task stack pointer
|
||||
movel (a7),a7 | Restore task stack pointer
|
||||
1:
|
||||
movew d0,sr | Restore status register
|
||||
#else
|
||||
subql #1,SYM (_ISR_Nest_level) | one less nest level
|
||||
#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
|
||||
|
||||
subql #1,SYM (_Thread_Dispatch_disable_level)
|
||||
| unnest multitasking
|
||||
bne exit | If dispatch disabled, exit
|
||||
bne.b exit | If dispatch disabled, exit
|
||||
|
||||
#if ( M68K_HAS_SEPARATE_STACKS == 1 )
|
||||
movew #0xf000,d0 | isolate format nibble
|
||||
andw a7@(SAVED+FVO_OFFSET),d0 | get F/VO
|
||||
cmpiw #0x1000,d0 | is it a throwaway isf?
|
||||
bne exit | NOT outer level, so branch
|
||||
bne.b exit | NOT outer level, so branch
|
||||
#else
|
||||
/*
|
||||
* If we have a CPU which allows a higher-priority interrupt to preempt a
|
||||
* lower priority handler before the lower-priority handler can increment
|
||||
* _Thread_Dispatch_disable_level then we must check the PC on the stack to
|
||||
* see if it is _ISR_Handler. If it is we have the case of nesting interrupts
|
||||
* without the dispatch level being incremented.
|
||||
*/
|
||||
#if ( M68K_COLDFIRE_ARCH == 0 && M68K_MC68060_ARCH == 0 )
|
||||
cmpl #_ISR_Handler,a7@(SAVED+PC_OFFSET)
|
||||
beq.b exit
|
||||
#endif
|
||||
#endif
|
||||
|
||||
tstl SYM (_Context_Switch_necessary)
|
||||
| Is thread switch necessary?
|
||||
bne bframe | Yes, invoke dispatcher
|
||||
bne.b bframe | Yes, invoke dispatcher
|
||||
|
||||
tstl SYM (_ISR_Signals_to_thread_executing)
|
||||
| signals sent to Run_thread
|
||||
| while in interrupt handler?
|
||||
beq exit | No, then exit
|
||||
|
||||
beq.b exit | No, then exit
|
||||
|
||||
bframe: clrl SYM (_ISR_Signals_to_thread_executing)
|
||||
| If sent, will be processed
|
||||
|
||||
@@ -95,7 +95,8 @@ typedef enum {
|
||||
CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED,
|
||||
CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT,
|
||||
CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED,
|
||||
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
|
||||
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT,
|
||||
CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT
|
||||
} CORE_message_queue_Status;
|
||||
|
||||
/*
|
||||
@@ -239,7 +240,7 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast(
|
||||
*
|
||||
*/
|
||||
|
||||
void _CORE_message_queue_Submit(
|
||||
CORE_message_queue_Status _CORE_message_queue_Submit(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
void *buffer,
|
||||
unsigned32 size,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* This routine sends a message to the end of the specified message queue.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _CORE_message_queue_Send(
|
||||
RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
void *buffer,
|
||||
unsigned32 size,
|
||||
@@ -37,7 +37,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Send(
|
||||
Watchdog_Interval timeout
|
||||
)
|
||||
{
|
||||
_CORE_message_queue_Submit(
|
||||
return _CORE_message_queue_Submit(
|
||||
the_message_queue,
|
||||
buffer,
|
||||
size,
|
||||
@@ -62,7 +62,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Send(
|
||||
* This routine sends a message to the front of the specified message queue.
|
||||
*/
|
||||
|
||||
RTEMS_INLINE_ROUTINE void _CORE_message_queue_Urgent(
|
||||
RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
void *buffer,
|
||||
unsigned32 size,
|
||||
@@ -72,7 +72,7 @@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Urgent(
|
||||
Watchdog_Interval timeout
|
||||
)
|
||||
{
|
||||
_CORE_message_queue_Submit(
|
||||
return _CORE_message_queue_Submit(
|
||||
the_message_queue,
|
||||
buffer,
|
||||
size,
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
void _CORE_message_queue_Submit(
|
||||
CORE_message_queue_Status _CORE_message_queue_Submit(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
void *buffer,
|
||||
unsigned32 size,
|
||||
@@ -67,14 +67,9 @@ void _CORE_message_queue_Submit(
|
||||
ISR_Level level;
|
||||
CORE_message_queue_Buffer_control *the_message;
|
||||
Thread_Control *the_thread;
|
||||
Thread_Control *executing;
|
||||
|
||||
_Thread_Executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
|
||||
|
||||
if ( size > the_message_queue->maximum_message_size ) {
|
||||
_Thread_Executing->Wait.return_code =
|
||||
CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
|
||||
return;
|
||||
return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -96,7 +91,7 @@ void _CORE_message_queue_Submit(
|
||||
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
|
||||
(*api_message_queue_mp_support) ( the_thread, id );
|
||||
#endif
|
||||
return;
|
||||
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,10 +109,9 @@ void _CORE_message_queue_Submit(
|
||||
/*
|
||||
* NOTE: If the system is consistent, this error should never occur.
|
||||
*/
|
||||
|
||||
if ( !the_message ) {
|
||||
_Thread_Executing->Wait.return_code =
|
||||
CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED;
|
||||
return;
|
||||
return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED;
|
||||
}
|
||||
|
||||
_CORE_message_queue_Copy_buffer(
|
||||
@@ -133,7 +127,7 @@ void _CORE_message_queue_Submit(
|
||||
the_message,
|
||||
submit_type
|
||||
);
|
||||
return;
|
||||
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -143,20 +137,39 @@ void _CORE_message_queue_Submit(
|
||||
*/
|
||||
|
||||
if ( !wait ) {
|
||||
_Thread_Executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_TOO_MANY;
|
||||
return;
|
||||
return CORE_MESSAGE_QUEUE_STATUS_TOO_MANY;
|
||||
}
|
||||
|
||||
executing = _Thread_Executing;
|
||||
/*
|
||||
* Do NOT block on a send if the caller is in an ISR. It is
|
||||
* deadly to block in an ISR.
|
||||
*/
|
||||
|
||||
_ISR_Disable( level );
|
||||
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
|
||||
executing->Wait.queue = &the_message_queue->Wait_queue;
|
||||
executing->Wait.id = id;
|
||||
executing->Wait.return_argument = (void *)buffer;
|
||||
executing->Wait.return_argument_1 = (void *)size;
|
||||
executing->Wait.count = submit_type;
|
||||
_ISR_Enable( level );
|
||||
if ( _ISR_Is_in_progress() ) {
|
||||
return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED;
|
||||
}
|
||||
|
||||
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
|
||||
/*
|
||||
* WARNING!! executing should NOT be used prior to this point.
|
||||
* Thus the unusual choice to open a new scope and declare
|
||||
* it as a variable. Doing this emphasizes how dangerous it
|
||||
* would be to use this variable prior to here.
|
||||
*/
|
||||
|
||||
{
|
||||
Thread_Control *executing = _Thread_Executing;
|
||||
|
||||
_ISR_Disable( level );
|
||||
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
|
||||
executing->Wait.queue = &the_message_queue->Wait_queue;
|
||||
executing->Wait.id = id;
|
||||
executing->Wait.return_argument = (void *)buffer;
|
||||
executing->Wait.return_argument_1 = (void *)size;
|
||||
executing->Wait.count = submit_type;
|
||||
_ISR_Enable( level );
|
||||
|
||||
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
|
||||
}
|
||||
|
||||
return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,9 @@ void _CORE_mutex_Initialize(
|
||||
the_mutex->nest_count = 1;
|
||||
the_mutex->holder = _Thread_Executing;
|
||||
the_mutex->holder_id = _Thread_Executing->Object.id;
|
||||
_Thread_Executing->resource_count++;
|
||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) )
|
||||
_Thread_Executing->resource_count++;
|
||||
} else {
|
||||
the_mutex->nest_count = 0;
|
||||
the_mutex->holder = NULL;
|
||||
|
||||
@@ -53,17 +53,11 @@ void _CORE_mutex_Seize(
|
||||
ISR_Level level;
|
||||
|
||||
executing = _Thread_Executing;
|
||||
switch ( the_mutex->Attributes.discipline ) {
|
||||
case CORE_MUTEX_DISCIPLINES_FIFO:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
|
||||
break;
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
|
||||
if ( executing->current_priority <
|
||||
the_mutex->Attributes.priority_ceiling) {
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
|
||||
return;
|
||||
}
|
||||
if ( _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
|
||||
if ( executing->current_priority < the_mutex->Attributes.priority_ceiling) {
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
|
||||
return;
|
||||
}
|
||||
}
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
|
||||
_ISR_Disable( level );
|
||||
@@ -72,17 +66,17 @@ void _CORE_mutex_Seize(
|
||||
the_mutex->holder = executing;
|
||||
the_mutex->holder_id = executing->Object.id;
|
||||
the_mutex->nest_count = 1;
|
||||
executing->resource_count++;
|
||||
if ( _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ||
|
||||
_CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) )
|
||||
executing->resource_count++;
|
||||
_ISR_Enable( level );
|
||||
switch ( the_mutex->Attributes.discipline ) {
|
||||
case CORE_MUTEX_DISCIPLINES_FIFO:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
|
||||
/* already the highest priority */
|
||||
break;
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
|
||||
if ( the_mutex->Attributes.priority_ceiling <
|
||||
executing->current_priority ) {
|
||||
/*
|
||||
* if CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT then nothing to do
|
||||
* because this task is already the highest priority.
|
||||
*/
|
||||
|
||||
if ( _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
|
||||
if (the_mutex->Attributes.priority_ceiling < executing->current_priority){
|
||||
_Thread_Change_priority(
|
||||
the_mutex->holder,
|
||||
the_mutex->Attributes.priority_ceiling,
|
||||
@@ -120,40 +114,27 @@ void _CORE_mutex_Seize(
|
||||
executing->Wait.id = id;
|
||||
_ISR_Enable( level );
|
||||
|
||||
switch ( the_mutex->Attributes.discipline ) {
|
||||
case CORE_MUTEX_DISCIPLINES_FIFO:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
|
||||
break;
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
|
||||
if ( the_mutex->holder->current_priority > executing->current_priority ) {
|
||||
_Thread_Change_priority(
|
||||
the_mutex->holder,
|
||||
executing->current_priority,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
break;
|
||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ) {
|
||||
if ( the_mutex->holder->current_priority > executing->current_priority ) {
|
||||
_Thread_Change_priority(
|
||||
the_mutex->holder,
|
||||
executing->current_priority,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_Thread_queue_Enqueue( &the_mutex->Wait_queue, timeout );
|
||||
|
||||
if ( _Thread_Executing->Wait.return_code == CORE_MUTEX_STATUS_SUCCESSFUL ) {
|
||||
switch ( the_mutex->Attributes.discipline ) {
|
||||
case CORE_MUTEX_DISCIPLINES_FIFO:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
|
||||
break;
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
|
||||
if ( the_mutex->Attributes.priority_ceiling <
|
||||
executing->current_priority ) {
|
||||
_Thread_Change_priority(
|
||||
executing,
|
||||
the_mutex->Attributes.priority_ceiling,
|
||||
FALSE
|
||||
);
|
||||
};
|
||||
break;
|
||||
if ( _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
|
||||
if (the_mutex->Attributes.priority_ceiling < executing->current_priority){
|
||||
_Thread_Change_priority(
|
||||
executing,
|
||||
the_mutex->Attributes.priority_ceiling,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,9 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
}
|
||||
}
|
||||
|
||||
_Thread_Executing->resource_count--;
|
||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) )
|
||||
holder->resource_count--;
|
||||
the_mutex->holder = NULL;
|
||||
the_mutex->holder_id = 0;
|
||||
|
||||
@@ -96,20 +98,14 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
* mutex (i.e. resource) this task has.
|
||||
*/
|
||||
|
||||
switch ( the_mutex->Attributes.discipline ) {
|
||||
case CORE_MUTEX_DISCIPLINES_FIFO:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY:
|
||||
break;
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
|
||||
case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
|
||||
if ( holder->resource_count == 0 &&
|
||||
holder->real_priority != holder->current_priority ) {
|
||||
_Thread_Change_priority( holder, holder->real_priority, TRUE );
|
||||
}
|
||||
break;
|
||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
|
||||
if ( holder->resource_count == 0 &&
|
||||
holder->real_priority != holder->current_priority ) {
|
||||
_Thread_Change_priority( holder, holder->real_priority, TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) {
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
|
||||
@@ -43,7 +43,15 @@ void *_Heap_Allocate(
|
||||
Heap_Block *temporary_block;
|
||||
void *ptr;
|
||||
unsigned32 offset;
|
||||
|
||||
|
||||
/*
|
||||
* Catch the case of a user allocating close to the limit of the
|
||||
* unsigned32.
|
||||
*/
|
||||
|
||||
if ( size >= (-1 - HEAP_BLOCK_USED_OVERHEAD) )
|
||||
return( NULL );
|
||||
|
||||
excess = size % the_heap->page_size;
|
||||
the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ Objects_Control *_Objects_Get_by_index(
|
||||
* With just an index, you can't access a remote object.
|
||||
*/
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
*location = OBJECTS_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ SECTIONS
|
||||
*(.dtors)
|
||||
LONG(0)
|
||||
__DTOR_END__ = .;
|
||||
_rodata_start 5 . ;
|
||||
_rodata_start = . ;
|
||||
*(.rodata)
|
||||
*(.gnu.linkonce.r*)
|
||||
_erodata = ALIGN( 0x10 ) ;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -12,7 +12,7 @@ C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
|
||||
OBJS = $(C_O_FILES)
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
anclude $(top_srcdir)/../../../../../../automake/lib.am
|
||||
include $(top_srcdir)/../../../../../../automake/lib.am
|
||||
|
||||
#
|
||||
# (OPTIONAL) Add local stuff here using +=
|
||||
|
||||
@@ -64,8 +64,8 @@ SECTIONS
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
} >RAM
|
||||
.init : { *(.init) } >RAM
|
||||
.fini : { *(.fini) } >RAM
|
||||
.init : { __init = .; *(.init) } >RAM
|
||||
.fini : { __fini = .; *(.fini) } >RAM
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) } >RAM
|
||||
.rodata1 : { *(.rodata1) } >RAM
|
||||
PROVIDE (_etext = .);
|
||||
|
||||
@@ -78,17 +78,16 @@ __rtems_entry_point:
|
||||
isync
|
||||
|
||||
/*
|
||||
* we now have the 1st 64M of ram mapped with the bats.
|
||||
* we now have the 1st 64M of ram mapped with the bats. We are still
|
||||
* running on the bootloader stack and cannot switch to an RTEMS allocated
|
||||
* init stack before copying the residual data that may have been set just after
|
||||
* rtems_end address. This bug has been experienced on MVME2304. Thank to
|
||||
* Till Straumann <strauman@SLAC.Stanford.EDU> for hunting it and suggesting
|
||||
* the appropriate code.
|
||||
*/
|
||||
|
||||
enter_C_code:
|
||||
bl MMUon
|
||||
/*
|
||||
* stack = &__rtems_end + 4096
|
||||
*/
|
||||
addis r9,r0, __rtems_end+(4096-CPU_MINIMUM_STACK_FRAME_SIZE)@ha
|
||||
addi r9,r9, __rtems_end+(4096-CPU_MINIMUM_STACK_FRAME_SIZE)@l
|
||||
mr r1, r9
|
||||
bl zero_bss
|
||||
/*
|
||||
* restore prep boot params
|
||||
@@ -99,6 +98,15 @@ enter_C_code:
|
||||
mr r6,r28
|
||||
mr r7,r27
|
||||
bl save_boot_params
|
||||
/*
|
||||
* stack = &__rtems_end + 4096
|
||||
*/
|
||||
addis r9,r0, __rtems_end+(4096-CPU_MINIMUM_STACK_FRAME_SIZE)@ha
|
||||
addi r9,r9, __rtems_end+(4096-CPU_MINIMUM_STACK_FRAME_SIZE)@l
|
||||
mr r1, r9
|
||||
/*
|
||||
* We are know in a environment that is totally independent from bootloader setup.
|
||||
*/
|
||||
bl boot_card
|
||||
bl _return_to_ppcbug
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ do
|
||||
TEST_TYPE="single"
|
||||
|
||||
case $tname in
|
||||
monitor)
|
||||
monitor*)
|
||||
if [ $run_to_completion = "yes" ]
|
||||
then
|
||||
warn "Skipping $tname; it is interactive"
|
||||
|
||||
@@ -33,6 +33,11 @@ int chmod(
|
||||
if ( status != 0 )
|
||||
return -1;
|
||||
|
||||
if ( !loc.handlers ){
|
||||
rtems_filesystem_freenode( &loc );
|
||||
set_errno_and_return_minus_one( EBADF );
|
||||
}
|
||||
|
||||
if ( !loc.handlers->fchmod ){
|
||||
rtems_filesystem_freenode( &loc );
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
@@ -43,6 +43,9 @@ int rtems_filesystem_evaluate_path(
|
||||
|
||||
rtems_filesystem_get_start_loc( pathname, &i, pathloc );
|
||||
|
||||
if ( !pathloc->ops->evalpath )
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
result = (*pathloc->ops->evalpath)( &pathname[i], flags, pathloc );
|
||||
|
||||
/*
|
||||
|
||||
@@ -131,10 +131,16 @@ int fcntl(
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
if ((ret >= 0) && iop->handlers->fcntl) {
|
||||
int err = (*iop->handlers->fcntl)( cmd, iop );
|
||||
if (err) {
|
||||
errno = err;
|
||||
if (ret >= 0) {
|
||||
if (iop->handlers->fcntl) {
|
||||
int err = (*iop->handlers->fcntl)( cmd, iop );
|
||||
if (err) {
|
||||
errno = err;
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
errno = ENOTSUP;
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@ int fsync(
|
||||
* Now process the fsync().
|
||||
*/
|
||||
|
||||
if ( !iop->handlers )
|
||||
set_errno_and_return_minus_one( EBADF );
|
||||
|
||||
if ( !iop->handlers->fsync )
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ getcwd (pt, size)
|
||||
size_t size;
|
||||
{
|
||||
register struct dirent *dp;
|
||||
register DIR *dir;
|
||||
register DIR *dir = 0;
|
||||
register dev_t dev;
|
||||
register ino_t ino;
|
||||
register int first;
|
||||
@@ -254,6 +254,7 @@ getcwd (pt, size)
|
||||
bpt -= strlen (dp->d_name);
|
||||
bcopy (dp->d_name, bpt, strlen (dp->d_name));
|
||||
(void) _closedir (dir);
|
||||
dir = 0;
|
||||
|
||||
/* Truncate any file name. */
|
||||
*bup = '\0';
|
||||
@@ -271,6 +272,8 @@ notfound:
|
||||
/* FALLTHROUGH */
|
||||
|
||||
err:
|
||||
if(dir)
|
||||
(void) _closedir (dir);
|
||||
if (ptsize)
|
||||
free (pt);
|
||||
free (up);
|
||||
|
||||
@@ -33,6 +33,9 @@ int ioctl(
|
||||
* Now process the ioctl().
|
||||
*/
|
||||
|
||||
if ( !iop->handlers )
|
||||
set_errno_and_return_minus_one( EBADF );
|
||||
|
||||
if ( !iop->handlers->ioctl )
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
|
||||
@@ -80,6 +80,11 @@ rtems_status_code rtems_io_lookup_name(
|
||||
result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE );
|
||||
the_jnode = loc.node_access;
|
||||
|
||||
if ( !loc.ops->node_type ) {
|
||||
rtems_filesystem_freenode( &loc );
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
}
|
||||
|
||||
node_type = (*loc.ops->node_type)( &loc );
|
||||
|
||||
if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) {
|
||||
|
||||
@@ -473,10 +473,16 @@ typedef int (*rtems_libio_lseek_t)(
|
||||
#define rtems_filesystem_make_dev_t( _major, _minor ) \
|
||||
((((dev_t)(_major)) << 32) | (dev_t)(_minor))
|
||||
|
||||
#define rtems_filesystem_dev_major_t( _dev ) \
|
||||
(rtems_device_major_number) ((_dev) >> 32)
|
||||
|
||||
#define rtems_filesystem_dev_minor_t( _dev ) \
|
||||
(rtems_device_minor_number) ((_dev) & 0xFFFFFFFF)
|
||||
|
||||
#define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
|
||||
do { \
|
||||
(_major) = (rtems_device_major_number) ((_dev) >> 32); \
|
||||
(_minor) = (rtems_device_minor_number) ((_dev) & 0xFFFFFFFF); \
|
||||
(_major) = rtems_filesystem_dev_major_t ( _dev ); \
|
||||
(_minor) = rtems_filesystem_dev_minor_t( _dev ); \
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
|
||||
@@ -32,6 +32,13 @@ struct socket *rtems_bsdnet_fdToSocket(
|
||||
return NULL;
|
||||
}
|
||||
iop = &rtems_libio_iops[fd];
|
||||
|
||||
/* same as rtems_libio_check_is_open(iop) but different return */
|
||||
if ((iop->flags & LIBIO_FLAGS_OPEN) == 0) {
|
||||
errno = EBADF;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (iop->data1 == NULL)
|
||||
errno = EBADF;
|
||||
return iop->data1;
|
||||
|
||||
@@ -41,8 +41,16 @@ int link(
|
||||
*/
|
||||
|
||||
rtems_filesystem_get_start_loc( new, &i, &parent_loc );
|
||||
|
||||
if ( !parent_loc.ops->evalformake ) {
|
||||
rtems_filesystem_freenode( &existing_loc );
|
||||
rtems_filesystem_freenode( &parent_loc );
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
}
|
||||
|
||||
result = (*parent_loc.ops->evalformake)( &new[i], &parent_loc, &name_start );
|
||||
if ( result != 0 ) {
|
||||
rtems_filesystem_freenode( &existing_loc );
|
||||
rtems_filesystem_freenode( &parent_loc );
|
||||
set_errno_and_return_minus_one( result );
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "libio_.h"
|
||||
@@ -22,15 +26,25 @@ off_t lseek(
|
||||
)
|
||||
{
|
||||
rtems_libio_t *iop;
|
||||
off_t old_offset;
|
||||
off_t status;
|
||||
|
||||
rtems_libio_check_fd( fd );
|
||||
iop = rtems_libio_iop( fd );
|
||||
rtems_libio_check_is_open(iop);
|
||||
|
||||
/*
|
||||
* Check as many errors as possible before touching iop->offset.
|
||||
*/
|
||||
|
||||
if ( !iop->handlers->lseek )
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
|
||||
/*
|
||||
* Now process the lseek().
|
||||
*/
|
||||
|
||||
old_offset = iop->offset;
|
||||
switch ( whence ) {
|
||||
case SEEK_SET:
|
||||
iop->offset = offset;
|
||||
@@ -41,18 +55,27 @@ off_t lseek(
|
||||
break;
|
||||
|
||||
case SEEK_END:
|
||||
iop->offset = iop->size - offset;
|
||||
iop->offset = iop->size + offset;
|
||||
break;
|
||||
|
||||
default:
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
set_errno_and_return_minus_one( EINVAL );
|
||||
}
|
||||
|
||||
if ( !iop->handlers->lseek )
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
/*
|
||||
* At this time, handlers assume iop->offset has the desired
|
||||
* new offset.
|
||||
*/
|
||||
|
||||
return (*iop->handlers->lseek)( iop, offset, whence );
|
||||
status = (*iop->handlers->lseek)( iop, offset, whence );
|
||||
if ( status == (off_t) -1 )
|
||||
iop->offset = old_offset;
|
||||
|
||||
/*
|
||||
* So if the operation failed, we have to restore iop->offset.
|
||||
*/
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -112,6 +112,9 @@ int memfile_close(
|
||||
|
||||
the_jnode = iop->file_info;
|
||||
|
||||
if (iop->flags & LIBIO_FLAGS_APPEND)
|
||||
iop->offset = the_jnode->info.file.size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -340,7 +343,6 @@ MEMFILE_STATIC int IMFS_memfile_addblock(
|
||||
#endif
|
||||
|
||||
memory = memfile_alloc_block();
|
||||
assert( memory );
|
||||
if ( !memory )
|
||||
return 1;
|
||||
*block_entry_ptr = memory;
|
||||
@@ -497,6 +499,8 @@ int IMFS_memfile_remove(
|
||||
if ( info->triply_indirect ) {
|
||||
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
|
||||
p = (block_p *) info->triply_indirect[i];
|
||||
if (!p) /* ensure we have a valid pointer */
|
||||
break;
|
||||
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
|
||||
if ( p[j] ) {
|
||||
memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
|
||||
|
||||
@@ -43,6 +43,11 @@ int mknod(
|
||||
|
||||
rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
|
||||
|
||||
if ( !temp_loc.ops->evalformake ) {
|
||||
rtems_filesystem_freenode( &temp_loc );
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
}
|
||||
|
||||
result = (*temp_loc.ops->evalformake)(
|
||||
&pathname[i],
|
||||
&temp_loc,
|
||||
|
||||
@@ -95,6 +95,7 @@ int mount(
|
||||
rtems_filesystem_location_info_t loc;
|
||||
rtems_filesystem_mount_table_entry_t *temp_mt_entry;
|
||||
rtems_filesystem_location_info_t *loc_to_free = NULL;
|
||||
size_t size;
|
||||
|
||||
/* XXX add code to check for required operations */
|
||||
|
||||
@@ -121,7 +122,10 @@ int mount(
|
||||
* Allocate a mount table entry
|
||||
*/
|
||||
|
||||
temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) );
|
||||
size = sizeof(rtems_filesystem_mount_table_entry_t);
|
||||
if ( device )
|
||||
size += strlen( device ) + 1;
|
||||
temp_mt_entry = malloc( size );
|
||||
|
||||
if ( !temp_mt_entry ) {
|
||||
errno = ENOMEM;
|
||||
@@ -130,9 +134,11 @@ int mount(
|
||||
|
||||
temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
|
||||
temp_mt_entry->options = options;
|
||||
if ( device )
|
||||
if ( device ) {
|
||||
temp_mt_entry->dev =
|
||||
(char *)temp_mt_entry + sizeof( rtems_filesystem_mount_table_entry_t );
|
||||
strcpy( temp_mt_entry->dev, device );
|
||||
else
|
||||
} else
|
||||
temp_mt_entry->dev = 0;
|
||||
|
||||
/*
|
||||
|
||||
@@ -112,7 +112,7 @@ scandir(dirname, namelist, select, dcomp)
|
||||
p->d_ino = d->d_ino;
|
||||
p->d_reclen = d->d_reclen;
|
||||
p->d_namlen = d->d_namlen;
|
||||
strncpy(d->d_name, p->d_name, p->d_namlen + 1);
|
||||
strncpy(p->d_name, d->d_name, p->d_namlen + 1);
|
||||
/*
|
||||
* Check to make sure the array has space left and
|
||||
* realloc the maximum size.
|
||||
|
||||
@@ -28,6 +28,11 @@ int symlink(
|
||||
if ( result != 0 )
|
||||
return -1;
|
||||
|
||||
if ( !loc.ops->symlink ) {
|
||||
rtems_filesystem_freenode( &loc );
|
||||
set_errno_and_return_minus_one( ENOTSUP );
|
||||
}
|
||||
|
||||
result = (*loc.ops->symlink)( &loc, actualpath, name_start);
|
||||
|
||||
rtems_filesystem_freenode( &loc );
|
||||
|
||||
@@ -728,7 +728,7 @@ ipxcp_rejci(f, p, len)
|
||||
#define REJCINODE(opt,neg,val) REJCICHARS(opt,neg,val,sizeof(val))
|
||||
#define REJCINAME(opt,neg,val) REJCICHARS(opt,neg,val,strlen(val))
|
||||
|
||||
#define REJCIVOID(gpt, neg! \
|
||||
#define REJCIVOID(opt, neg) \
|
||||
if (neg && p[0] == opt) { \
|
||||
if ((len -= CILEN_VOID) < 0) \
|
||||
break; \
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,5 +1,5 @@
|
||||
*** TEST 13 ***
|
||||
TA1 - rtems_message_queue_ident - qid => 18010001
|
||||
TA1 - rtems_message_queue_ident - qid => 1c010001
|
||||
TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1
|
||||
TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1
|
||||
TA1 - rtems_task_wake_after - sleep 5 seconds
|
||||
|
||||
@@ -53,6 +53,7 @@ rtems_task Task_3(
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_MEMORY_OVERHEAD 32
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
@@ -100,8 +100,6 @@ rtems_task Task_2(
|
||||
|
||||
Fill_buffer( "BUFFER 2 TO Q 2", (long *)buffer );
|
||||
puts( "TA2 - rtems_message_queue_send - BUFFER 2 TO Q 2" );
|
||||
directive_failed( status, "rtems_message_queue_send" );
|
||||
|
||||
status = rtems_message_queue_send( Queue_id[ 2 ], buffer, MESSAGE_SIZE );
|
||||
directive_failed( status, "rtems_message_queue_send" );
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void Get_all_counters( void );
|
||||
#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (15 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (6 * 3 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
|
||||
@@ -91,8 +91,10 @@ extern "C" {
|
||||
do { \
|
||||
check_dispatch_disable_level( _level ); \
|
||||
if ( (_stat) != (_desired) ) { \
|
||||
printf( "\n%s FAILED -- expected (%s) got (%s)\n", \
|
||||
(_msg), strerror(_desired), strerror(_stat) ); \
|
||||
printf( "\n%s FAILED -- expected (%d - %s) got (%d - %s)\n", \
|
||||
(_msg), _desired, strerror(_desired), _stat, strerror(_stat) ); \
|
||||
printf( "\n FAILED -- errno (%d - %s)\n", \
|
||||
errno, strerror(errno) ); \
|
||||
fflush(stdout); \
|
||||
exit( _stat ); \
|
||||
} \
|
||||
|
||||
@@ -44,7 +44,7 @@ This is the files for gcc and newlib that are shared by all targets.
|
||||
if test -d $RPM_INSTALL_PREFIX/rtems/info;
|
||||
then
|
||||
rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
|
||||
f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info&gz'`
|
||||
f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
|
||||
test -n "$f" && for i in $f; do
|
||||
install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
|
||||
done
|
||||
|
||||
@@ -18,7 +18,7 @@ Autoreqprov: on
|
||||
Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
|
||||
|
||||
Version: gcc@gcc_version@newlib@newlib_version@
|
||||
Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz
|
||||
Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-everything-@gcc_version@.tar.gz
|
||||
Source1: ftp://sourceware.cygnus/com/pub/newlib/newlib-@newlib_version@.tar.gz
|
||||
Patch0: gcc-@gcc_version@-rtems-@gcc_patch_version@.diff
|
||||
Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
binutils_version=2.9.5.0.24
|
||||
binutils_patch_version=20000207
|
||||
binutils_rpm_release=1
|
||||
binutils_version=2.10
|
||||
binutils_patch_version=20001107
|
||||
binutils_rpm_release=3
|
||||
newlib_version=1.8.2
|
||||
newlib_patch_version=20000606
|
||||
gcc_version=2.95.2
|
||||
gcc_patch_version=20000531
|
||||
gccnewlib_rpm_release=7
|
||||
gcc_version=2.95.3
|
||||
gcc_patch_version=20010622a
|
||||
gccnewlib_rpm_release=450_1
|
||||
gdb_version=4.18
|
||||
gdb_patch_version=20000524
|
||||
gdb_rpm_release=4
|
||||
|
||||
Reference in New Issue
Block a user