Commit Graph

216 Commits

Author SHA1 Message Date
Joel Sherrill
c3db01d0f3 2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/include/rtems/libcsupport.h, libcsupport/src/newlibc.c,
	sapi/Makefile.am, sapi/include/confdefs.h, sapi/src/exinit.c,
	score/Makefile.am, score/preinstall.am,
	score/include/rtems/score/userext.h, score/src/chain.c,
	score/src/userext.c: Switch to newlib reentrancy extension being
	installed in the initial set instead of using rtems_extension_create.
	While implementing this, noticed that user extensions and chain code
	had multiple functions in a single file which is not desirable in the
	SuperCore and API portions of RTEMS, so split these into multiple
	files with one function per file. Also noticed that some of user
	extension code was inlined for no particular reason so moved that to
	C bodies.  Split executive shutdown from initialization since not
	every application shuts down.  Moved __fini call to executive shutdown
	to be more symmetrical with where it is called at startup.
	* sapi/src/exshutdown.c, score/src/chainappend.c,
	score/src/chainextract.c, score/src/chainget.c,
	score/src/chaininsert.c, score/src/userextaddapiset.c,
	score/src/userextaddset.c, score/src/userextremoveset.c,
	score/src/userextthreadbegin.c, score/src/userextthreadcreate.c,
	score/src/userextthreaddelete.c, score/src/userextthreadrestart.c,
	score/src/userextthreadstart.c, score/src/userextthreadswitch.c: New
	files.
	* score/inline/rtems/score/userext.inl: Removed.
2007-05-09 18:27:26 +00:00
Ralf Corsepius
728a0bd3aa Use size_t for stacksizes. 2007-05-08 10:43:06 +00:00
Joel Sherrill
e746a88b22 2007-05-03 Joel Sherrill <joel@OARcorp.com>
* ChangeLog, libcsupport/src/malloc.c,
	libcsupport/src/mallocfreespace.c, sapi/include/confdefs.h,
	score/Makefile.am, score/preinstall.am: malloc never blocks so the
	Region Manager is quite heavy for implementing this. This patch
	implements the C Program Heap directly in terms of the new Protected
	Heap handler. This handler is a direct use of a SuperCore Heap in
	conjunction with the Allocator Mutex used internally by RTEMS. This
	saves 3184 bytes on most SPARC test executables.
	* score/include/rtems/score/protectedheap.h, score/src/pheapallocate.c,
	score/src/pheapallocatealigned.c, score/src/pheapextend.c,
	score/src/pheapfree.c, score/src/pheapgetblocksize.c,
	score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c,
	score/src/pheapinit.c, score/src/pheapresizeblock.c,
	score/src/pheapwalk.c: New files.
2007-05-03 21:33:39 +00:00
Ralf Corsepius
3c86f88536 Use Context_Control_fp* instead of void* for fp_contexts. 2007-04-17 04:55:44 +00:00
Ralf Corsepius
7a5e8fb6ce 2007-04-13 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/include/rtems/score/object.h: Use size_t for byte sizes.
2007-04-13 03:10:03 +00:00
Joel Sherrill
63f786e7c8 2007-04-05 Joel Sherrill <joel@OARcorp.com>
* itron/src/itrontime.c: Fix typo.
	* score/include/rtems/score/tod.h: Add TOD_TICKS_PER_SECOND macro.
	* score/src/iterateoverthreads.c: Safely take NULL as argument.
	* score/src/threaddispatch.c: Formatting.
2007-04-05 22:13:08 +00:00
Joel Sherrill
412dbff629 2007-04-05 Joel Sherrill <joel@OARcorp.com>
* posix/Makefile.am, posix/include/rtems/posix/time.h,
	posix/src/adjtime.c, posix/src/alarm.c, posix/src/clockgetres.c,
	posix/src/condtimedwait.c, posix/src/mqueuetimedreceive.c,
	posix/src/mqueuetimedsend.c, posix/src/mutextimedlock.c,
	posix/src/nanosleep.c, posix/src/posixtimespecabsolutetimeout.c,
	posix/src/pthread.c, posix/src/pthreadcreate.c,
	posix/src/pthreadsetschedparam.c, posix/src/ptimer1.c,
	posix/src/sched.c, posix/src/semtimedwait.c,
	posix/src/sigtimedwait.c, posix/src/ualarm.c,
	rtems/src/clocktodtoseconds.c, score/Makefile.am,
	score/preinstall.am, score/include/rtems/score/tod.h,
	score/inline/rtems/score/tod.inl, score/src/coretod.c,
	score/src/coretodget.c, score/src/coretodgetuptime.c,
	score/src/coretodset.c, score/src/coretodtickle.c: Provide timespec
	manipulation routines in the SuperCore. Use them everywhere possible.
	This lead to significant cleanup in the API routines and eliminated
	some of the same code from the POSIX API. At this point, the
	SuperCore keeps time in POSIX timespec format properly from 1970. You
	just cannot set it before 1988 in keeping with RTEMS traditional
	behavior.
	* score/include/rtems/score/timespec.h, score/src/timespecaddto.c,
	score/src/timespecfromticks.c, score/src/timespecisvalid.c,
	score/src/timespeclessthan.c, score/src/timespecsubtract.c,
	score/src/timespectoticks.c: New files.
	* posix/src/posixintervaltotimespec.c,
	posix/src/posixtimespecsubtract.c,
	posix/src/posixtimespectointerval.c: Removed.
2007-04-05 21:17:27 +00:00
Joel Sherrill
fc054cabb5 2007-04-04 Joel Sherrill <joel@OARcorp.com>
* score/Makefile.am, score/include/rtems/score/tod.h,
	score/inline/rtems/score/tod.inl: Make _TOD_Tickle_ticks a real
	non-inlined routine. It should only be used once so there is little
	advantage to inlining it.
	* score/src/coretodtickle.c: New file.
2007-04-04 13:54:10 +00:00
Joel Sherrill
f6e09342ee 2007-04-02 Joel Sherrill <joel@OARcorp.com>
* posix/include/rtems/posix/timer.h, posix/src/alarm.c,
	posix/src/posixtimespectointerval.c, posix/src/ptimer1.c,
	posix/src/sysconf.c, posix/src/ualarm.c, rtems/src/clockget.c,
	rtems/src/clocktodvalidate.c, score/include/rtems/score/tod.h,
	score/inline/rtems/score/tod.inl, score/src/coretod.c: Eliminate
	TOD_Ticks_per_second variable.
2007-04-02 21:51:52 +00:00
Joel Sherrill
812da54688 2007-04-02 Joel Sherrill <joel@OARcorp.com>
* itron/src/itrontime.c, libcsupport/src/__gettod.c,
	posix/include/rtems/posix/time.h, posix/include/rtems/posix/timer.h,
	posix/src/clockgettime.c, posix/src/clocksettime.c,
	posix/src/nanosleep.c, posix/src/posixtimespecsubtract.c,
	posix/src/posixtimespectointerval.c, posix/src/ptimer1.c,
	posix/src/sleep.c, rtems/Makefile.am,
	rtems/include/rtems/rtems/clock.h, rtems/include/rtems/rtems/timer.h,
	rtems/include/rtems/rtems/types.h, rtems/src/clockget.c,
	rtems/src/clockset.c, rtems/src/clocktodtoseconds.c,
	rtems/src/clocktodvalidate.c, rtems/src/taskwakewhen.c,
	score/Makefile.am, score/include/rtems/score/tod.h,
	score/inline/rtems/score/tod.inl, score/src/coretod.c,
	score/src/coretodset.c: Convert from Classic API style TOD_Control as
	fundamental time structure to POSIX struct timespec. Add
	clock_get_uptime().
	* rtems/src/clockgetuptime.c, score/src/coretodget.c,
	score/src/coretodgetuptime.c: New files.
	* score/src/coretodtickle.c, score/src/coretodtoseconds.c,
	score/src/coretodvalidate.c: Removed.
2007-04-02 18:23:59 +00:00
Joel Sherrill
4b6546f0bb 2007-03-28 Chris Johns <chrisj@rtems.org>
* rtems/Makefile.am, rtems/include/rtems/rtems/clock.h,
	score/include/rtems/score/watchdog.h: Add support for a handler to
	obtain the number of nanoseconds since the last clock tick. The
	primary interface for this is rtems_clock_set_nanoseconds_extension.
	Subsequent commits from Joel will redo the TOD support to use this
	capability.
	* rtems/src/clocksetnsecshandler.c: New file.
2007-03-28 19:56:14 +00:00
Ralf Corsepius
37c7bfcbd2 Change _Workspace_Handler_initialization and _Workspace_Allocate_or_fatal_error to using size_t. 2007-03-16 07:19:24 +00:00
Ralf Corsepius
83d01d54d7 2007-03-13 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/include/rtems/score/stack.h: Use size_t for stack sizes.
2007-03-13 05:38:21 +00:00
Ralf Corsepius
d38ac0e614 2007-03-13 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/include/rtems/score/chain.h, score/src/chain.c:
	Change _Chain_Initialize to using size_t.
2007-03-13 05:17:12 +00:00
Joel Sherrill
96d0b64c62 2007-03-05 Joel Sherrill <joel@OARcorp.com>
PR 1222/cpukit
	* score/Makefile.am, score/include/rtems/score/coremutex.h,
	score/include/rtems/score/threadq.h,
	score/inline/rtems/score/coremutex.inl, score/src/coremsgsubmit.c,
	score/src/coremutexsurrender.c, score/src/threadchangepriority.c,
	score/src/threadclearstate.c, score/src/threadhandler.c,
	score/src/threadinitialize.c, score/src/threadqdequeuefifo.c,
	score/src/threadqdequeuepriority.c, score/src/threadqenqueue.c,
	score/src/threadqenqueuefifo.c, score/src/threadqenqueuepriority.c,
	score/src/threadqextractfifo.c, score/src/threadqextractpriority.c,
	score/src/threadsetstate.c: Enhance so that when the prioirity of a
	thread that is blocked on a priority based thread queue is changed,
	that its placement in the queue is reevaluated based upon the new
	priority. This enhancement includes modifications to the SuperCore as
	well as new test cases.
	* score/src/threadqrequeue.c: New file.
2007-03-05 21:01:40 +00:00
Ralf Corsepius
59c44c6b95 More size_t for heap-sizes. 2007-02-11 08:35:15 +00:00
Ralf Corsepius
8022a681a3 Use size_t for heap-sizes. 2007-02-11 04:52:37 +00:00
Ralf Corsepius
32e101ba3a Use size_t for sizes. 2007-02-05 15:35:36 +00:00
Ralf Corsepius
8db96e56f9 Remove __RTEMS_MAJOR__,
__RTEMS_MINOR__, __RTEMS_REVISION__ (moved to cpuopt.h).
2007-01-27 07:21:05 +00:00
Ralf Corsepius
0454464692 2007-01-26 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/include/rtems/system.h:
	#define __RTEMS_MINOR__ 7 (BZ 1206).
2007-01-26 05:52:43 +00:00
Ralf Corsepius
f5c5a1db6a Add const qualifiers, use size_t where appropriate. 2006-12-06 09:46:46 +00:00
Joel Sherrill
047d67ab25 2006-11-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/termios.c, posix/Makefile.am, posix/preinstall.am,
	posix/include/rtems/posix/config.h, posix/include/rtems/posix/time.h,
	sapi/src/posixapi.c, score/Makefile.am, score/preinstall.am,
	score/include/rtems/score/corerwlock.h,
	score/include/rtems/score/threadq.h,
	score/src/corerwlockobtainread.c, score/src/threadqenqueue.c,
	score/src/threadqtimeout.c: Adding POSIX barriers, POSIX spinlocks,
	and partial implementation of POSIX rwlocks.
	* posix/include/rtems/posix/barrier.h,
	posix/include/rtems/posix/rwlock.h,
	posix/include/rtems/posix/spinlock.h,
	posix/inline/rtems/posix/barrier.inl,
	posix/inline/rtems/posix/rwlock.inl,
	posix/inline/rtems/posix/spinlock.inl,
	posix/src/barrierattrdestroy.c, posix/src/barrierattrgetpshared.c,
	posix/src/barrierattrinit.c, posix/src/barrierattrsetpshared.c,
	posix/src/pbarrier.c, posix/src/pbarrierdestroy.c,
	posix/src/pbarrierinit.c, posix/src/pbarriertranslatereturncode.c,
	posix/src/pbarrierwait.c, posix/src/prwlock.c,
	posix/src/prwlockdestroy.c, posix/src/prwlockinit.c,
	posix/src/prwlockrdlock.c, posix/src/prwlocktimedrdlock.c,
	posix/src/prwlocktimedwrlock.c,
	posix/src/prwlocktranslatereturncode.c, posix/src/prwlocktryrdlock.c,
	posix/src/prwlocktrywrlock.c, posix/src/prwlockunlock.c,
	posix/src/prwlockwrlock.c, posix/src/pspin.c,
	posix/src/pspindestroy.c, posix/src/pspininit.c,
	posix/src/pspinlock.c, posix/src/pspinlocktranslatereturncode.c,
	posix/src/pspintrylock.c, posix/src/pspinunlock.c,
	posix/src/rwlockattrdestroy.c, posix/src/rwlockattrgetpshared.c,
	posix/src/rwlockattrinit.c, posix/src/rwlockattrsetpshared.c: New files.
2006-11-15 14:08:49 +00:00
Joel Sherrill
0c2ec7f52c 2006-10-30 Joel Sherrill <joel@OARcorp.com>
PR 841/rtems
	* itron/inline/rtems/itron/semaphore.inl, itron/src/twai_sem.c,
	posix/include/rtems/posix/semaphore.h,
	posix/inline/rtems/posix/semaphore.inl,
	posix/src/semaphorewaitsupp.c, posix/src/semtimedwait.c,
	posix/src/semwait.c, rtems/src/semobtain.c,
	rtems/src/semtranslatereturncode.c,
	score/include/rtems/score/coresem.h, score/src/coresemseize.c: Make
	sem_timedwait more conformant to Open Group specification.
2006-10-30 22:21:23 +00:00
Joel Sherrill
04dba496a6 2006-10-19 Joel Sherrill <joel@OARcorp.com>
* configure.ac, itron/Makefile.am, itron/preinstall.am,
	posix/Makefile.am, posix/preinstall.am, rtems/Makefile.am,
	rtems/preinstall.am, sapi/Makefile.am, sapi/preinstall.am,
	score/Makefile.am, score/preinstall.am, score/include/rtems/system.h,
	score/include/rtems/score/chain.h,
	score/include/rtems/score/thread.h, score/src/chain.c,
	score/src/coremutexseize.c, score/src/threadget.c: Remove all macro
	implementations and use only the static inline. Static inline
	functions are now well supported so there is no reason for duplicate
	maintenance.
	* itron/macros/rtems/itron/eventflags.inl,
	itron/macros/rtems/itron/fmempool.inl,
	itron/macros/rtems/itron/intr.inl, itron/macros/rtems/itron/mbox.inl,
	itron/macros/rtems/itron/msgbuffer.inl,
	itron/macros/rtems/itron/network.inl,
	itron/macros/rtems/itron/port.inl,
	itron/macros/rtems/itron/semaphore.inl,
	itron/macros/rtems/itron/sysmgmt.inl,
	itron/macros/rtems/itron/task.inl, itron/macros/rtems/itron/time.inl,
	itron/macros/rtems/itron/vmempool.inl,
	posix/macros/rtems/posix/cond.inl, posix/macros/rtems/posix/key.inl,
	posix/macros/rtems/posix/mqueue.inl,
	posix/macros/rtems/posix/mutex.inl,
	posix/macros/rtems/posix/priority.inl,
	posix/macros/rtems/posix/pthread.inl,
	posix/macros/rtems/posix/semaphore.inl,
	posix/macros/rtems/posix/timer.inl, rtems/macros/rtems/rtems/asr.inl,
	rtems/macros/rtems/rtems/attr.inl,
	rtems/macros/rtems/rtems/barrier.inl,
	rtems/macros/rtems/rtems/dpmem.inl,
	rtems/macros/rtems/rtems/event.inl,
	rtems/macros/rtems/rtems/eventset.inl,
	rtems/macros/rtems/rtems/message.inl,
	rtems/macros/rtems/rtems/modes.inl,
	rtems/macros/rtems/rtems/options.inl,
	rtems/macros/rtems/rtems/part.inl,
	rtems/macros/rtems/rtems/ratemon.inl,
	rtems/macros/rtems/rtems/region.inl,
	rtems/macros/rtems/rtems/sem.inl,
	rtems/macros/rtems/rtems/status.inl,
	rtems/macros/rtems/rtems/support.inl,
	rtems/macros/rtems/rtems/tasks.inl,
	rtems/macros/rtems/rtems/timer.inl, sapi/macros/rtems/extension.inl,
	score/macros/README, score/macros/rtems/score/address.inl,
	score/macros/rtems/score/chain.inl,
	score/macros/rtems/score/corebarrier.inl,
	score/macros/rtems/score/coremsg.inl,
	score/macros/rtems/score/coremutex.inl,
	score/macros/rtems/score/corerwlock.inl,
	score/macros/rtems/score/coresem.inl,
	score/macros/rtems/score/corespinlock.inl,
	score/macros/rtems/score/heap.inl, score/macros/rtems/score/isr.inl,
	score/macros/rtems/score/mppkt.inl,
	score/macros/rtems/score/object.inl,
	score/macros/rtems/score/objectmp.inl,
	score/macros/rtems/score/priority.inl,
	score/macros/rtems/score/stack.inl,
	score/macros/rtems/score/states.inl,
	score/macros/rtems/score/sysstate.inl,
	score/macros/rtems/score/thread.inl,
	score/macros/rtems/score/threadmp.inl,
	score/macros/rtems/score/tod.inl,
	score/macros/rtems/score/tqdata.inl,
	score/macros/rtems/score/userext.inl,
	score/macros/rtems/score/watchdog.inl,
	score/macros/rtems/score/wkspace.inl: Removed.
2006-10-19 19:20:10 +00:00
Joel Sherrill
9c191eea63 * score/Makefile.am, score/preinstall.am,
score/include/rtems/score/coresem.h,
	score/include/rtems/score/object.h,
	score/include/rtems/score/states.h,
	score/inline/rtems/score/coresem.inl: Add SuperCore Barriers,
	SpinLocks and a partial implementation of RWLocks.
	* score/include/rtems/score/corebarrier.h,
	score/include/rtems/score/corerwlock.h,
	score/include/rtems/score/corespinlock.h,
	score/inline/rtems/score/corebarrier.inl,
	score/inline/rtems/score/corerwlock.inl,
	score/inline/rtems/score/corespinlock.inl,
	score/macros/rtems/score/corebarrier.inl,
	score/macros/rtems/score/corerwlock.inl,
	score/macros/rtems/score/corespinlock.inl, score/src/corebarrier.c,
	score/src/corebarrierrelease.c, score/src/corebarrierwait.c,
	score/src/corerwlock.c, score/src/corerwlockobtainread.c,
	score/src/corerwlockobtainwrite.c, score/src/corerwlockrelease.c,
	score/src/corespinlock.c, score/src/corespinlockrelease.c,
	score/src/corespinlockwait.c: New files.
2006-09-25 13:36:58 +00:00
Joel Sherrill
cf04e8aca9 *** empty log message *** 2006-09-01 19:10:01 +00:00
Joel Sherrill
0337a9c5e9 2006-08-29 Joel Sherrill <joel@OARcorp.com>
* score/include/rtems/score/object.h: _Objects_Local_node is a uint16_t
	so cast the _Objects_Local_node constant to 1.
2006-08-29 21:54:36 +00:00
Joel Sherrill
83df49f697 2006-07-11 Joel Sherrill <joel@OARcorp.com>
PR 1124/rtems
	* score/include/rtems/score/threadq.h, score/src/coremutexseize.c,
	score/src/coremutexsurrender.c, score/src/threadqenqueue.c,
	score/src/threadqenqueuefifo.c, score/src/threadqenqueuepriority.c:
	The placement of the changing a thread's priority when using priority
	ceiling should be on the successful transfer of the mutex -- not when
	the thread tries to acquire. Plus the lack of a dispatch disable
	point lead to the potential for a thread timing out and already
	having inherited the ceiling priority.
2006-07-11 21:05:12 +00:00
Joel Sherrill
0243b0d8d3 2006-06-08 Joel Sherrill <joel@OARcorp.com>
* posix/Makefile.am, posix/preinstall.am,
	posix/include/rtems/posix/timer.h, posix/src/ptimer.c,
	posix/src/ptimer1.c, sapi/src/posixapi.c,
	score/include/rtems/score/object.h:
2006-06-08 20:47:48 +00:00
Joel Sherrill
5250299424 2006-04-05 Joel Sherrill <joel@OARcorp.com>
Victor V. Vengerov <Victor.Vengerov@oktetlabs.ru>

	* score/include/rtems/score/mpci.h,
	score/include/rtems/score/threadmp.h,
	score/inline/rtems/score/threadmp.inl,
	score/macros/rtems/score/threadmp.inl, score/src/threadmp.c,
	score/src/threadqenqueue.c: Victor spotted the problem that
	_MPCI_Receive_server_tcb and _Thread_MP_Receive were duplicate
	variables and needed to be set to the same value.  I took that
	idea and just removed _Thread_MP_Receive.  All uses are now
	_MPCI_Receive_server_tcb.
2006-04-05 20:08:59 +00:00
Joel Sherrill
f0ad529d28 2006-03-07 Joel Sherrill <joel@OARcorp.com>
PR 866/rtems
	* score/include/rtems/system.h, score/include/rtems/score/isr.h,
	score/inline/rtems/score/thread.inl,
	score/macros/rtems/score/thread.inl: Added memory barriers to enter
	and exit of dispatching and interrupt critical sections so GCC will
	not optimize and reorder code out of a critical section.
2006-03-07 20:47:53 +00:00
Joel Sherrill
6a074363a2 2006-01-16 Joel Sherrill <joel@OARcorp.com>
Large patch to improve Doxygen output.  As a side-effect, grammar and
	spelling errors were corrected, spacing errors were address, and some
	variable names were improved.
	* libmisc/monitor/mon-object.c, libmisc/monitor/monitor.h:
	Account for changing OBJECTS_NO_CLASS to OBJECTS_CLASSIC_NO_CLASS.
	* score/Doxyfile: Set output directory.  Predefine some macro values.
	Turn on graphical output.
	* score/include/rtems/debug.h, score/include/rtems/seterr.h,
	score/include/rtems/system.h, score/include/rtems/score/address.h,
	score/include/rtems/score/apiext.h,
	score/include/rtems/score/apimutex.h,
	score/include/rtems/score/bitfield.h,
	score/include/rtems/score/chain.h,
	score/include/rtems/score/context.h,
	score/include/rtems/score/coremsg.h,
	score/include/rtems/score/coremutex.h,
	score/include/rtems/score/coresem.h,
	score/include/rtems/score/heap.h, score/include/rtems/score/interr.h,
	score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h,
	score/include/rtems/score/mppkt.h,
	score/include/rtems/score/object.h,
	score/include/rtems/score/objectmp.h,
	score/include/rtems/score/priority.h,
	score/include/rtems/score/stack.h,
	score/include/rtems/score/states.h,
	score/include/rtems/score/sysstate.h,
	score/include/rtems/score/thread.h,
	score/include/rtems/score/threadmp.h,
	score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h,
	score/include/rtems/score/tqdata.h,
	score/include/rtems/score/userext.h,
	score/include/rtems/score/watchdog.h,
	score/include/rtems/score/wkspace.h,
	score/inline/rtems/score/address.inl,
	score/inline/rtems/score/chain.inl,
	score/inline/rtems/score/coremutex.inl,
	score/inline/rtems/score/coresem.inl,
	score/inline/rtems/score/heap.inl,
	score/inline/rtems/score/object.inl,
	score/inline/rtems/score/stack.inl,
	score/inline/rtems/score/thread.inl,
	score/inline/rtems/score/tqdata.inl, score/macros/README,
	score/src/heap.c, score/src/threadmp.c, score/src/threadready.c,
	score/src/threadstartmultitasking.c: Improve generated Doxygen
	output. Fix spelling and grammar errors in comments. Correct names of
	some variables and propagate changes.
2006-01-16 15:13:58 +00:00
Joel Sherrill
80f2885b70 2005-05-14 Sergei Organov <osv@topconrd.ru>
PR 746/rtems
	Optimize realloc(). The problem is that realloc() can neither grow
	nor shrink efficiently the current memory region without support
	from underlying heap/region modules. The patch introduces one new
	routine for each of heap and region modules, _Heap_Resize_block(),
	and rtems_region_resize_segment(), respectively, and uses the
	latter to optimize realloc().

	The implementation of _Heap_Resize_block() lead to changing of the
	heap allocation strategy: now the heap manager, when splits larger
	free block into used and new free parts, makes the first part of
	the block used, not the last one as it was before. Due to this new
	strategy, _Heap_Resize_block() never needs to change the user
	pointer.

	Caveat: unlike previous heap implementation, first few bytes of
	the contents of the memory allocated from the heap are now almost
	never all zero. This can trigger bugs in client code that have not
	been visible before this patch.

	* libcsupport/src/malloc.c (realloc): try to resize segment in
	place using new rtems_region_resize_segment() routine before
	falling back to the malloc()/free() method.
	* score/src/heap.c:
	(_Heap_Initialize): change initial heap layout to reflect new
	allocation strategy of using of the lower part of a previously
	free block when splitting it for the purpose of allocation.
	(_Heap_Block_allocate): when split, make the lower part used, and
	leave the upper part free. Return type changed from Heap_Block* to
	uint32_t.
	* score/include/rtems/score/heap.h:
	(Heap_Statistics): added 'resizes' field.
	(Heap_Resize_status): new enum.
	(_Heap_Resize_block): new routine.
	(_Heap_Block_allocate): return type changed from Heap_Block* to
	uint32_t.
	* score/src/heapwalk.c: reflect new heap layout in checks.
	* score/src/heapsizeofuserarea.c: more assertions added.
	* score/src/heapresizeblock.c: new file.
	(_Heap_Resize_block): new routine.
	* score/src/heapfree.c: reverse the checks _Heap_Is_block_in() and
	_Heap_Is_prev_used() on entry to be in this order.
	* score/src/heapallocate.c, score/src/heapallocatealigned.c:
	ignore return value of _Heap_Block_allocate().
	* score/Makefile.am (HEAP_C_FILES): added src/heapresizeblock.c.
	* rtems/include/rtems/rtems/region.h:
	(rtems_region_resize_segment): new interface routine.
	(_Region_Process_queue): new internal routine called from
	rtems_region_resize_segment() and rtems_region_return_segment().
	* rtems/src/regionreturnsegment.c: move queue management code into
	the new internal routine _Region_Process_queue() and call it.

	* rtems/src/regionresizesegment.c: new file.
	(rtems_region_resize_segment): new interface routine.
	* rtems/src/regionprocessqueue.c: new file.
	(_Region_Process_queue): new internal routine containing queue
	management code factored out from 'regionreturnsegment.c'.
	* rtems/Makefile.am (REGION_C_FILES): Added
	src/regionresizesegment.c, and src/regionprocessqueue.c.
	* ada/rtems.adb, ada/rtems.ads: Added Region_Resize_Segment.
2005-05-20 19:15:41 +00:00
Joel Sherrill
50269c464a 2005-02-10 Joel Sherrill <joel@OARcorp.com>
PR 753/rtems
	* score/include/rtems/score/object.h,
	score/src/objectinitializeinformation.c: Configured number of objects
	needs to be of a type with more bits than Objects_Maximum to support
	configuring unlimited objects. The type for configuring the maximum
	number of objects should probably always be the same fundamental type
	as Object Id. For 16-bit Id configurations, the constant
	OBJECTS_UNLIMITED_OBJECTS was changed to 0x8000 to move in this
	direction.
2005-02-10 21:46:23 +00:00
Ralf Corsepius
092f142af3 New header guard. 2005-01-28 05:00:21 +00:00
Ralf Corsepius
14426c8fb8 2005-01-24 Ralf Corsepius <ralf.corsepius@rtems.org>
* score/include/rtems/score/heap.h: Use uintptr_t for _H_uptr_t.
	* score/inline/rtems/score/address.inl: Remove
	RTEMS_CPU_HAS_16_BIT_ADDRESSES.
	Use uintptr_t for void* to address cast.
2005-01-24 15:05:14 +00:00
Joel Sherrill
962e894f4e 2005-01-20 Sergei Organov <osv@topconrd.ru>
PR 536/rtems
	Heap manager re-implementation to consume less memory and still satisfy
	alignment requirements.
	
	* score/src/heap.c, score/src/heapallocate.c, score/src/heapextend.c,
	score/src/heapfree.c, score/src/heapgetinfo.c,
	score/src/heapgetfreeinfo.c, core/src/heapsizeofuserarea.c,
	score/src/heapwalk.c, core/macros/rtems/score/heap.inl,
	score/inline/rtems/score/heap.inl,
	score/include/rtems/score/heap.h: Reimplemented.
	* score/src/heapallocatealigned.c: new file
	* score/Makefile.am: HEAP_C_FILES: add score/src/heapallocatealigned.c
2005-01-20 18:22:29 +00:00
Ralf Corsepius
ee0815066d 2005-01-18 Ralf Corsepius <ralf.corsepius@rtems.org>
* sapi/include/rtems/fatal.h, score/include/rtems/score/interr.h:
	Remove volatile on return type (GCC-4.0 complains about them).
2005-01-18 12:21:06 +00:00
Ralf Corsepius
a6d749ba45 2005-01-14 Ralf Corsepius <ralf.corsepius@rtems.org>
PR 742/rtems
	* score/include/rtems/system.h: Remove stringify().
2005-01-14 05:13:32 +00:00
Ralf Corsepius
9c8195a014 2004-12-29 Ralf Corsepius <ralf.corsepius@rtems.org>
* score/include/rtems/score/chain.h:
	Use uint32_t instead of unsigned32.
	* score/src/chain.c: Remove superfluous type cast.
2004-12-29 09:58:54 +00:00
Ralf Corsepius
f44f0c7dd5 2004-12-09 Ralf Corsepius <ralf.corsepius@rtems.org>
* score/include/rtems/system.h: Don't define NULL, include
	<stddef.h>.
2004-12-09 17:08:52 +00:00
Joel Sherrill
9b3f187a02 2004-11-29 Joel Sherrill <joel@OARcorp.com>
* libcsupport/src/mallocfreespace.c, rtems/Makefile.am,
	rtems/include/rtems/rtems/region.h, score/Makefile.am,
	score/include/rtems/score/heap.h, score/src/heapgetinfo.c: Add
	capability to return information about just the free blocks in a
	region or heap.  Also changed the semantics of free space available
	to be the largest block of memory that can be allocated.
	* rtems/src/regiongetfreeinfo.c, score/src/heapgetfreeinfo.c: New files.
	: score/include/rtems/score/object.h,
	score/src/objectinitializeinformation.c: Remove warning.
2004-11-29 22:45:43 +00:00
Joel Sherrill
712fe158d9 2004-11-22 Joel Sherrill <joel@OARcorp.com>
* score/include/rtems/score/object.h, score/src/objectclearname.c,
	score/src/objectcopynamestring.c: Fixing warning led to making
	changes to multiple prototypes for object support routines.
2004-11-22 22:43:55 +00:00
Ralf Corsepius
118745615a Adjust doxygen @file. 2004-11-21 07:17:38 +00:00
Joel Sherrill
c7b7f38098 2004-11-01 Joel Sherrill <joel@OARcorp.com>
* score/include/rtems/score/object.h, score/src/object.c,
	score/src/objectallocatebyindex.c, score/src/objectcomparenameraw.c,
	score/src/objectcomparenamestring.c, score/src/objectcopynameraw.c,
	score/src/objectinitializeinformation.c: Fix bugs in previous commit.
	Now compiles.
2004-11-01 15:28:22 +00:00
Ralf Corsepius
b05ecca4b2 Fix typo. 2004-11-01 14:24:09 +00:00
Ralf Corsepius
59297bb7c2 Fix typo. 2004-11-01 13:50:59 +00:00
Ralf Corsepius
92100147e1 Fix typo. 2004-11-01 13:44:54 +00:00
Joel Sherrill
baff4dafe1 2004-11-01 Joel Sherrill <joel@oarcorp.com>
* score/cpu/no_cpu/rtems/score/cpu.h, score/include/rtems/debug.h,
	score/include/rtems/seterr.h, score/include/rtems/system.h,
	score/include/rtems/score/address.h,
	score/include/rtems/score/apiext.h,
	score/include/rtems/score/apimutex.h,
	score/include/rtems/score/bitfield.h,
	score/include/rtems/score/chain.h,
	score/include/rtems/score/context.h,
	score/include/rtems/score/copyrt.h,
	score/include/rtems/score/coremsg.h,
	score/include/rtems/score/coremutex.h,
	score/include/rtems/score/coresem.h,
	score/include/rtems/score/heap.h, score/include/rtems/score/interr.h,
	score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h,
	score/include/rtems/score/mppkt.h,
	score/include/rtems/score/objectmp.h,
	score/include/rtems/score/priority.h,
	score/include/rtems/score/stack.h,
	score/include/rtems/score/states.h,
	score/include/rtems/score/sysstate.h,
	score/include/rtems/score/thread.h,
	score/include/rtems/score/threadmp.h,
	score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h,
	score/include/rtems/score/tqdata.h,
	score/include/rtems/score/userext.h,
	score/include/rtems/score/watchdog.h,
	score/include/rtems/score/wkspace.h,
	score/inline/rtems/score/address.inl,
	score/inline/rtems/score/chain.inl,
	score/inline/rtems/score/coremsg.inl,
	score/inline/rtems/score/coremutex.inl,
	score/inline/rtems/score/coresem.inl,
	score/inline/rtems/score/heap.inl, score/inline/rtems/score/isr.inl,
	score/inline/rtems/score/mppkt.inl,
	score/inline/rtems/score/objectmp.inl,
	score/inline/rtems/score/priority.inl,
	score/inline/rtems/score/stack.inl,
	score/inline/rtems/score/states.inl,
	score/inline/rtems/score/sysstate.inl,
	score/inline/rtems/score/thread.inl,
	score/inline/rtems/score/threadmp.inl,
	score/inline/rtems/score/tod.inl,
	score/inline/rtems/score/tqdata.inl,
	score/inline/rtems/score/userext.inl,
	score/inline/rtems/score/watchdog.inl,
	score/inline/rtems/score/wkspace.inl: Add Doxygen comments -- working
	modifications which are not complete and may have broken code.
	Committing so work and testing can proceed.
	* score/Doxyfile, score/mainpage.h: New files.
2004-11-01 13:22:41 +00:00
Joel Sherrill
85b7605b32 2004-11-01 Joel Sherrill <joel@oarcorp.com>
* score/include/rtems/score/object.h,
	score/inline/rtems/score/object.inl,
	score/macros/rtems/score/object.inl: Add first cut of optional
	16 bit object Id as space reduction for small systems (TinyRTEMS).
2004-11-01 13:15:40 +00:00