Compare commits

...

25 Commits

Author SHA1 Message Date
cvs2git
42d03c5e07 This commit was manufactured by cvs2svn to create tag 'rtems-4-5-1-pre1'.
Sprout from rtems-4-5-branch 2001-08-30 19:12:24 UTC Joel Sherrill <joel.sherrill@OARcorp.com> 'changed version to 4.5.1-pre1'
Delete:
    c/src/lib/libbsp/mips/p4000/liblnk/.cvsignore
    c/src/librdbg/src/powerpc/new_exception_processing/.cvsignore
2001-08-30 19:12:25 +00:00
Joel Sherrill
a7b8de0589 changed version to 4.5.1-pre1 2001-08-30 19:12:24 +00:00
Joel Sherrill
3efa52954d changed version to 4.5.1-pre1 2001-08-30 18:54:18 +00:00
Joel Sherrill
36d90eec36 changed version to 4.5.1-pre1 2001-08-30 18:42:03 +00:00
Joel Sherrill
2b31cc882c changed version to 4.5.1-pre1 2001-08-30 18:41:42 +00:00
Joel Sherrill
b68cc333d3 2001-08-30 Joel Sherrill <joel@OARcorp.com>
* libc/lseek.c: Modified to reflect 4.5 placement of libio_.h.
2001-08-30 18:35:01 +00:00
Joel Sherrill
6f1118a0c5 2001-08-30 Joel Sherrill <joel@OARcorp.com>
* src/coremutex.c, src/coremutexseize.c, src/coremutexsurrender.c:
	The per thread field resource_count should only be manipulated
	when a mutex is priority ceiling or priority inherit.  This
	was reported by Chris Johns <ccj@acm.org> who also noticed that
	the use of switches for all disciplines generated less efficient
	code than using explicit tests for the one or two cases we were
	really interested in.  Further review of his modifications made
	it apparent that the "isa" methods to test mutex discipline were
	not being used so this modification was swept into the code as well.
2001-08-30 18:32:12 +00:00
Joel Sherrill
ca739de315 2001-08-30 Joel Sherrill <joel@OARcorp.com>
* inline/rtems/rtems/attr.inl: Correct typo and use correct
	attribute RTEMS_SYSTEM_TASK. Reported by Chris Johns <ccj@acm.org>.
2001-08-30 18:27:52 +00:00
Joel Sherrill
770f6e99fb 2001-08-17 Joel Sherrill <joel@OARcorp.com>
* libc/lseek.c: Fix minor bug introduced by misinterpretation of
	return code.
2001-08-17 13:17:04 +00:00
Joel Sherrill
45e1417c51 2001-08-16 Joel Sherrill <joel@OARcorp.com>
* src/mqueuesendsupp.c: Account for possibly blocking during the
	core send operation.


2001-08-16	Joel Sherrill <joel@OARcorp.com>

	* src/msgqsubmit.c: Add a comment indicating that we do not have
	to account for possibly blocking during the core send operation
	because Classic API message queue send is always non-blocking.

2001-08-16	Joel Sherrill <joel@OARcorp.com>

	* include/rtems/score/coremsg.h, src/coremsgsubmit.c: Add a new
	return status to account for blocking sends.  Otherwise, the
	caller will think that the returned message status will have
	the ultimate results of the operation.  If the send times out,
	the final status will be in the return_code of the thread.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * src/coremutexsurrender.c: Use holder thread not executing
        thread because even though they may and often are the same
        it is not guaranteed unless the proper attribute is set.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * startup/linkcmds: Modified to work better with gcc 2.8.1 and
        gnat 3.13p.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * tools/runtest.in: Recognize debug variant of monitor test.


2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * sp13/sp13.scn: Id in screen had wrong class field value.
        * sp13/system.h: Account for message buffer memory.
        * sp13/task2.c: Remove unnecessary check for failure.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * sp20/system.h: Account for extra task stacks properly.


2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * include/tmacros.h: Attempt to print errno as further information.
2001-08-16 22:22:16 +00:00
Joel Sherrill
cbdb14497c 2001-08-16 Joel Sherrill <joel@OARcorp.com>
* libc/lseek.c: Modified after discussion with Eugeny S. Mints
	<jack@oktet.ru> to correct the behavior.  There were two mistakes.
	First, iop->offset was incorrectly set for SEEK_END.  Second,
	iop->offset should be left unmodified if there are errors.
	This modification attempts to fix both situations.
2001-08-16 22:15:35 +00:00
Joel Sherrill
b3a6713265 2001-08-16 Joel Sherrill <joel@OARcorp.com>
* src/mqueuesendsupp.c: Account for possibly blocking during the
	core send operation.


2001-08-16	Joel Sherrill <joel@OARcorp.com>

	* src/msgqsubmit.c: Add a comment indicating that we do not have
	to account for possibly blocking during the core send operation
	because Classic API message queue send is always non-blocking.

2001-08-16	Joel Sherrill <joel@OARcorp.com>

	* include/rtems/score/coremsg.h, src/coremsgsubmit.c: Add a new
	return status to account for blocking sends.  Otherwise, the
	caller will think that the returned message status will have
	the ultimate results of the operation.  If the send times out,
	the final status will be in the return_code of the thread.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * src/coremutexsurrender.c: Use holder thread not executing
        thread because even though they may and often are the same
        it is not guaranteed unless the proper attribute is set.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * startup/linkcmds: Modified to work better with gcc 2.8.1 and
        gnat 3.13p.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * tools/runtest.in: Recognize debug variant of monitor test.


2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * sp13/sp13.scn: Id in screen had wrong class field value.
        * sp13/system.h: Account for message buffer memory.
        * sp13/task2.c: Remove unnecessary check for failure.

2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * sp20/system.h: Account for extra task stacks properly.


2001-08-16      Joel Sherrill <joel@OARcorp.com>

        * include/tmacros.h: Attempt to print errno as further information.
2001-08-16 21:36:15 +00:00
Joel Sherrill
5ccb03b887 2001-08-09 Joel Sherrill <joel@OARcorp.com>
* scripts/setup.def, scripts/gccnewlib/base-gcc.add,
 	scripts/gccnewlib/gccnewlib.add, scripts-ada/buildall.in:
	Updated to reflect new versions.
2001-08-09 21:25:48 +00:00
Joel Sherrill
6559511b4e 2001-08-09 Joel Sherrill <joel@OARcorp.com>
* c/src/lib/libbsp/i386/i386ex/startup/linkcmds,
	c/src/lib/libbsp/powerpc/eth_comm/canbus/Makefile.am,
	c/src/libnetworking/pppd/ipxcp.c: These files had latent single
	bit mistakes from the CVS server's RAM failure.
2001-08-09 21:23:42 +00:00
Joel Sherrill
256226b87e 2001-08-09 Chris Johns <ccj@acm.org>
* cpu_asm.S: This patch was co-developed with Eric Norum
	<eric.norum@usask.ca>.  It closes a one instruction window
	on some m68k CPU cores.  It fixes symptoms seen as:
	    1) No more `interrupt handler invoked twice for
	       a single interrupt'.
	    2) No more `lockup when mc68360 CPM and PIT interrupts
	       are at different levels'.
	It does insert a little more overhead on machines without hardware
	interrupt stacks but correctness has a price.
2001-08-09 21:09:52 +00:00
Joel Sherrill
3bb9542cd6 2001-08-09 Joel Sherrill <joel@OARcorp.com>
* c/src/exec/itron/src/snd_mbx.c, c/src/exec/itron/src/tsnd_mbf.c
	c/src/exec/posix/src/mqueuesendsupp.c,
	c/src/exec/rtems/src/msgqsubmit.c,
	c/src/exec/score/include/rtems/score/coremsg.h,
	c/src/exec/score/inline/rtems/score/coremsg.inl,
	c/src/exec/score/src/coremsgsubmit.c: Unblocking message queue
	operations should NOT use _Thread_Executing for return status
	since it is permissible to invoke message send operations from
	an ISR.  This was reported by Suvrat Gupta <suvrat@utstar.com>.
2001-08-09 21:08:50 +00:00
Joel Sherrill
b748fff9c5 2001-03-26 Zoltan Kocsi <zoltan@bendor.com.au>
* src/eventsurrender.c: Clear event condition when task is unblocked.
	This makes sure that subsequent event send thinks the task is still
	blocked and overwrites the initial events received.
2001-03-29 15:51:54 +00:00
Joel Sherrill
ca4c387054 2000-11-28 Joel Sherrill <joel@OARcorp.com>
* src/imfs/memfile.c: Bug report from Sturniolo Jose
	<jsturnio@nec.com.ar> where NULL pointer was dereferenced.
2000-11-28 21:52:53 +00:00
Joel Sherrill
079b1f4c2c 2000-11-28 Sergei Organov <osv@javad.ru>
* libc/getcwd.c: Ensure _closedir(dir) is called even on
	error exit from the routine.
2000-11-28 21:49:50 +00:00
Joel Sherrill
99cfdc2dea 2000-11-28 Chris Johns <ccj@acm.org>
* src/heapallocate.c: Do not allow the size to overflow when
	adjusting it.  A test allocated a stack of -1 (~0). This
	actually resulted in a stack being allocated but with a
	size of 0xb. The allocator did not test the size to see if
	it rolled through 0 and so allowed the allocation to happen, the
	thread to get created. The task crashed as you would expect.
2000-11-28 21:47:27 +00:00
Joel Sherrill
e5aeae7b30 2000-11-20 Dmitry Kargapolov <dk@gentex.ru>
* libc/mount.c: Make sure there is space allocated for a device name
	in the mount table entry.
2000-11-20 13:30:03 +00:00
Joel Sherrill
0b18036afc 2000-09-20 Joel Sherrill <joel@OARcorp.com>
* src/objectgetbyindex.c: Do not enable dispatching on an
	error path it was not disabled on.
2000-09-20 13:27:47 +00:00
Joel Sherrill
74835d7880 2000-08-11 Chris Johns <ccj@acm.org>
* libc/chmod.c: Return ENOTSUP if filesystem does not have handler.
	* libc/eval.c: Ditto.
	* libc/fcntl.c: Ditto.
	* libc/fsync.c: Ditto.
	* libc/ioctl.c: Ditto.
	* libc/ioman.c: Ditto.
	* libc/link.c: Ditto.
	* libc/memfile.c: Ditto.
	* libc/mknod.c: Ditto.
	* libc/symlink.c: Ditto.
	* libc/libio.h(rtems_filesystem_dev_major_t): New macro.
	* libc/libio.h(rtems_filesystem_dev_minor_t): New macro.
2000-08-11 20:04:03 +00:00
Joel Sherrill
289f822131 IEEE
====
-4 = {d = -4, i = {0xc0100000, 0x0}} s=1 e=0x80 m=0x100000 (0x0900000)
-3 = {d = -3, i = {0xc0080000, 0x0}} s=1 e=0x80 m=0x080000 (0x0880000)
-2 = {d = -2, i = {0xc0000000, 0x0}} s=1 e=0x80 m=0x000000 (0x0800000)
-1 = {d = -1, i = {0xbff00000, 0x0}} s=1 e=0x7f m=0x000000 (0x0800000)
 0 = {d =  0, i = {0x00000000, 0x0}} s=0 e=0    m=0x000000 (0x0800000)
 1 = {d =  1, i = {0x3ff00000, 0x0}} s=0 e=0x7f m=0x000000 (0x0800000)
 2 = {d =  2, i = {0x40000000, 0x0}} s=0 e=0    m=0x000000 (0x0800000)
 3 = {d =  3, i = {0x40080000, 0x0}} s=0 e=0    m=0x080000 (0x0880000)

C4X
===
-4 = {d = -4, i = {0x01800000, 0x0}} s=1 e=1    m=0x800000 (0x1000000)
-3 = {d = -3, i = {0x01c00000, 0x0}} s=1 e=1    m=0xa00000 (0x1400000)
-2 = {d = -2, i = {0x00800000, 0x0}} s=1 e=0    m=0x800000 (0x1000000)
-1 = {d = -1, i = {0xff800000, 0x0}} s=1 e=0xff m=0x000000 (0x1000000)
 0 = {d =  0, i = {0x80000000, 0x0}} s=0 e=0    m=0x000000 (0x0800000)
 1 = {d =  1, i = {0x00000000, 0x0}} s=0 e=0x7f m=0x000000 (0x0800000)
 2 = {d =  2, i = {0x01000000, 0x0}} s=0 e=1    m=0x400000 (0x0800000)
 3 = {d =  3, i = {0x01400000, 0x0}} s=0 e=1    m=0x600000 (0x0c00000)
 4 = {d =  4, i = {0x02000000, 0x0}} s=0 e=2    m=0xXXXXXX (0x0000000)

0x1010 0000
  0101 0000
  0010 1002
2000-08-03 14:43:43 +00:00
Joel Sherrill
d7d1096c78 Patch from Eric Valette <valette@crf.canon.fr> with debugging
by Till Straumann <strauman@SLAC.Stanford.EDU>.  With this
patch, the motorola_shared BSP should also support the MVME2303.
2000-07-24 19:17:34 +00:00
48 changed files with 314 additions and 226 deletions

View File

@@ -4,4 +4,4 @@
# $Id$
#
RTEMS Version 4.5.0
RTEMS Version 4.5.1-pre1

View File

@@ -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 )
);
}

View File

@@ -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
);
}

View File

@@ -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
)
);
}

View File

@@ -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

View File

@@ -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 );

View File

@@ -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 */

View File

@@ -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

View File

@@ -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,

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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
);
}
}
}
}

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -112,7 +112,7 @@ SECTIONS
*(.dtors)
LONG(0)
__DTOR_END__ = .;
_rodata_start 5 . ;
_rodata_start = . ;
*(.rodata)
*(.gnu.linkonce.r*)
_erodata = ALIGN( 0x10 ) ;

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -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 +=

View File

@@ -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 = .);

View File

@@ -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

View File

@@ -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"

View File

@@ -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 );

View File

@@ -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 );
/*

View File

@@ -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;
}
}

View File

@@ -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 );

View File

@@ -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);

View File

@@ -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 );

View File

@@ -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 ) {

View File

@@ -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)
/*

View File

@@ -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;

View File

@@ -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 );
}

View File

@@ -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;
}
/*

View File

@@ -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);

View File

@@ -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,

View File

@@ -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;
/*

View File

@@ -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.

View File

@@ -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 );

View File

@@ -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; \

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -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

View File

@@ -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>

View File

@@ -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" );

View File

@@ -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>

View File

@@ -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 ); \
} \

View File

@@ -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

View File

@@ -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

View File

@@ -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