Commit Graph

56 Commits

Author SHA1 Message Date
Ralf Corsepius
18daff9b95 Whitespace removal. 2009-11-29 13:35:32 +00:00
Joel Sherrill
bd5984deb7 2008-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/free.c, libcsupport/src/malloc.c,
	libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h,
	libcsupport/src/malloc_sbrk_helpers.c,
	libcsupport/src/malloc_statistics_helpers.c,
	libcsupport/src/malloc_walk.c, libcsupport/src/mallocfreespace.c,
	libcsupport/src/mallocinfo.c, libcsupport/src/realloc.c,
	libcsupport/src/rtems_memalign.c, sapi/include/confdefs.h,
	score/inline/rtems/score/thread.inl: Add support for optionally
	having a unified work area. In other words, the RTEMS Workspace and C
	Program Heap are the same pool of memory.
2008-09-17 18:37:55 +00:00
Ralf Corsepius
4088d01d9f Convert using "bool". 2008-09-01 11:42:19 +00:00
Joel Sherrill
635865aefd 2008-01-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h,
	libcsupport/src/free.c, libcsupport/src/malloc.c,
	libcsupport/src/malloc_deferred.c,
	libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h,
	libcsupport/src/malloc_sbrk_helpers.c,
	libcsupport/src/posix_memalign.c: Place all deferred free code and
	place it in subroutines. Add plugin for dirtying allocated memory to
	assist in debugging. Clean up comments and spacing as needed.
	* libcsupport/src/malloc_dirtier.c: New file.
2008-01-09 21:08:36 +00:00
Joel Sherrill
cfcc4e202d 2008-01-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/Makefile.am: Add malloc_sbrk_helpers.c.
	* libcsupport/include/rtems/malloc.h,
	libcsupport/src/malloc.c, libcsupport/src/malloc_initialize.c,
	libcsupport/src/malloc_p.h,
	libcsupport/src/malloc_statistics_helpers.c: Make sbrk()
	support pluggable and optional.  This eliminates the need for
	heap extend and sbrk in the minimum footprint which is ~2.5K on
	the SPARC.
	* sapi/include/confdefs.h: Add the following configuration points:
	  + CONFIGURE_MALLOC_STATISTICS
	  + CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
	* libcsupport/src/malloc_sbrk_helpers.c: New file.
2008-01-08 22:59:14 +00:00
Joel Sherrill
8e30a269a2 2007-12-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h,
	libcsupport/src/free.c, libcsupport/src/malloc.c,
	libcsupport/src/malloc_p.h,
	libcsupport/src/malloc_report_statistics_plugin.c,
	libmisc/shell/shell.c, libmisc/shell/shell.h,
	score/src/objectinitializeinformation.c: Add posix_memalign. Split
	out management of deferred frees to subroutines.
	* libcsupport/src/malloc_deferred.c, libcsupport/src/posix_memalign.c: New files.
2007-12-19 16:03:54 +00:00
Joel Sherrill
543fe82061 2007-12-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/Makefile.am, libcsupport/preinstall.am,
	libcsupport/src/malloc.c, libcsupport/src/mallocinfo.c,
	libmisc/Makefile.am, libmisc/shell/main_mallocinfo.c,
	libmisc/shell/shellconfig.h: Split malloc.c into multiple files with
	one function per file. Also split out statistics into a separate file
	which can be plugged in dynamically. Right now, it is always in. I
	suspect that splitting the file removed more code than leaving
	statistics in. I tinkered with malloc information command in the
	shell. I resurrected the malloc arena code as malloc boundary. This
	code is now compiled all the time even though it does not appear to
	work.
	* libcsupport/include/rtems/malloc.h, libcsupport/src/_calloc_r.c,
	libcsupport/src/_free_r.c, libcsupport/src/_malloc_r.c,
	libcsupport/src/_realloc_r.c, libcsupport/src/calloc.c,
	libcsupport/src/free.c, libcsupport/src/malloc_boundary.c,
	libcsupport/src/malloc_get_statistics.c,
	libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h,
	libcsupport/src/malloc_report_statistics.c,
	libcsupport/src/malloc_report_statistics_plugin.c,
	libcsupport/src/malloc_statistics_helpers.c,
	libcsupport/src/malloc_walk.c, libcsupport/src/realloc.c,
	libmisc/shell/main_perioduse.c: New files.
2007-12-18 20:36:40 +00:00
Joel Sherrill
976162a69f 2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/malloc.c, libmisc/monitor/mon-command.c,
	posix/preinstall.am, posix/include/rtems/posix/cond.h,
	posix/include/rtems/posix/mqueue.h,
	posix/include/rtems/posix/mutex.h,
	posix/include/rtems/posix/pthread.h,
	posix/include/rtems/posix/semaphore.h, posix/src/conddestroy.c,
	posix/src/mutexdestroy.c, posix/src/mutexinit.c,
	posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c,
	sapi/include/confdefs.h, sapi/include/rtems/config.h,
	sapi/include/rtems/init.h, sapi/include/rtems/sptables.h,
	sapi/src/exinit.c, score/include/rtems/system.h,
	score/include/rtems/score/mpci.h, score/src/mpci.c,
	score/src/thread.c, score/src/threadcreateidle.c,
	score/src/threadstackallocate.c, score/src/threadstackfree.c,
	score/src/wkspace.c: Moved most of the remaining CPU Table fields to
	the Configuration Table. This included pretasking_hook,
	predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace,
	extra_mpci_receive_server_stack, stack_allocate_hook, and
	stack_free_hook. As a side-effect of this effort some multiprocessing
	code was made conditional and some style clean up occurred.
2007-12-03 22:23:13 +00:00
Joel Sherrill
85f3b4c1e4 2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc.c: Do not assert on free of bad pointer.
2007-11-26 21:11:19 +00:00
Joel Sherrill
1f49f77158 2007-09-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc.c: If RTEMS_HEAP_DEBUG is defined, add heap
	walk on init, malloc, and free. The ability to walk the heap appears
	to disappeared during the rework of the C Program heap to skip the
	Region.
2007-09-07 21:42:14 +00:00
Joel Sherrill
55d7626db7 2007-07-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc.c: Clean up Malloc debug code.
	* score/include/rtems/score/heap.h: Spacing.
	* score/inline/rtems/score/thread.inl:
	* score/src/heapfree.c. Clean up and add explicit check of the address
	being freed actually being in the heap.
	* score/src/heapwalk.c: Switch to printk and do not call abort.
2007-07-11 20:56:10 +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
7d6701d3b6 Fix typo in yesterday's patch. 2006-11-19 02:17:10 +00:00
Ralf Corsepius
2751cbe005 Use uintmax_t instead of uint64_t for MALLOC_STATS statistics.
Use inttypes.h PRIxXXX macros for printing.
2006-11-18 05:32:29 +00:00
Joel Sherrill
b3ee778ea9 2006-09-01 Joel Sherrill <joel@OARcorp.com>
* libcsupport/src/malloc.c, libnetworking/rtems/rtems_glue.c,
	libnetworking/sys/mbuf.h: Remove warnings -- use uintptr_t or
	properly sized integers.
2006-09-01 15:37:47 +00:00
Eric Norum
be31de713f Provide customisable mbuf allocation.
Patch from Steven Johnson <sjohnson@sakuraindustries.com>
2006-05-25 17:36:31 +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
Ralf Corsepius
50f32b1165 Remove stray white spaces. 2004-04-18 06:05:35 +00:00
Ralf Corsepius
ebbe119eb5 2004-04-01 Ralf Corsepius <ralf_corsepius@rtems.org>
* libblock/include/rtems/bdbuf.h: Include <rtems/chain.h> instead of <chain.h>.
	* libblock/include/rtems/ide_part_table.h: Include <rtems/chain.h> instead of <chain.h>.
	* libcsupport/src/malloc.c: Include <rtems/chain.h> instead of <chain.h>.
	* libcsupport/src/mount.c: Include <rtems/chain.h> instead of <chain.h>.
	* libcsupport/src/unmount.c: Include <rtems/chain.h> instead of <chain.h>.
	* libfs/src/imfs/imfs.h: Include <rtems/chain.h> instead of <chain.h>.
	* libfs/src/imfs/imfs_directory.c: Include <rtems/chain.h> instead of <chain.h>.
	* libfs/src/imfs/imfs_load_tar.c: Include <rtems/chain.h> instead of <chain.h>.
	* sapi/include/confdefs.h: Include <rtems/clockdrv.h> instead of <clockdrv.h>.
	* sapi/include/confdefs.h: Include <rtems/console.h> instead of <console.h>.
	* libfs/src/imfs/imfs_load_tar.c: Include <rtems/imfs.h> instead of <imfs.h>.
	* libmisc/shell/cmds.c: Include <rtems/imfs.h> instead of <imfs.h>.
	* libmisc/fsmount/fsmount.c: Include <rtems/imfs.h> instead of <imfs.h>.
	* sapi/include/confdefs.h: Include <rtems/imfs.h> instead of <imfs.h>.
	* itron/src/can_wup.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/chg_pri.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/cre_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/cre_mbx.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/cre_sem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/cre_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/del_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/del_mbx.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/del_sem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/del_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/dis_dsp.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/ena_dsp.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/eventflags.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/exd_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/ext_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/fmempool.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/frsm_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/get_tid.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/itronintr.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/itronsem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/itrontime.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/mbox.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/mboxtranslatereturncode.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/msgbuffer.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/msgbuffertranslatereturncode.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/network.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/port.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/prcv_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/prcv_mbx.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/preq_sem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/psnd_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/rcv_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/rcv_mbx.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/ref_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/ref_mbx.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/ref_sem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/ref_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/rel_wai.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/rot_rdq.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/rsm_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/sig_sem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/slp_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/snd_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/snd_mbx.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/sta_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/sus_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/sysmgmt.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/task.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/ter_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/trcv_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/trcv_mbx.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/tslp_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/tsnd_mbf.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/twai_sem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/vmempool.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/wai_sem.c: Include <rtems/itron.h> instead of <itron.h>.
	* itron/src/wup_tsk.c: Include <rtems/itron.h> instead of <itron.h>.
	* sapi/include/rtems/config.h: Include <rtems/itron.h> instead of <itron.h>.
	* sapi/include/confdefs.h: Include <rtems/itron.h> instead of <itron.h>.
	* sapi/src/itronapi.c: Include <rtems/itron.h> instead of <itron.h>.
	* sapi/include/confdefs.h: Include <rtems/rtc.h> instead of <rtc.h>.
	* sapi/include/confdefs.h: Include <rtems/timerdrv.h> instead of <timerdrv.h>.
2004-04-01 10:14:23 +00:00
Ralf Corsepius
6cd05d2aa2 2004-03-30 Ralf Corsepius <ralf_corsepius@rtems.org>
* rtems/include/rtems/rtems/region.h:
	Include stddef.h for size_t.
	(rtems_region_get_segment_size):  Use size_t instead of uint32_t for "size" (3rd arg).
	* rtems/src/regiongetsegmentsize.c: Reflect changes above.
	* libcsupport/src/malloc.c: Reflect changes above.
2004-03-30 15:23:50 +00:00
Ralf Corsepius
e7ceef9168 2004-03-23 Ralf Corsepius <ralf_corsepius@rtems.org>
* libcsupport/src/malloc.c: Remove lvalue casts.
2004-03-23 12:16:30 +00:00
Ralf Corsepius
83c5fc1bb9 2004-03-23 Ralf Corsepius <ralf_corsepius@rtems.org>
* libcsupport/include/chain.h, libcsupport/include/clockdrv.h,
	libcsupport/include/ringbuf.h, libcsupport/include/spurious.h,
	libcsupport/include/timerdrv.h, libcsupport/include/vmeintr.h,
	libcsupport/include/motorola/mc68230.h,
	libcsupport/include/rtems/assoc.h, libcsupport/include/rtems/libio.h,
	libcsupport/include/rtems/libio_.h,
	libcsupport/include/rtems/termiostypes.h,
	libcsupport/include/zilog/z8036.h, libcsupport/include/zilog/z8530.h,
	libcsupport/include/zilog/z8536.h, libcsupport/src/__gettod.c,
	libcsupport/src/assoc.c, libcsupport/src/assocnamebad.c,
	libcsupport/src/error.c,  libcsupport/src/libio.c,
	libcsupport/src/libio_sockets.c, libcsupport/src/malloc.c,
	libcsupport/src/no_libc.c, libcsupport/src/termios.c,
	libcsupport/src/termiosreserveresources.c: Convert to using c99
	fixed-size types.
2004-03-23 06:07:53 +00:00
Joel Sherrill
690861c3c6 2003-11-26 Joel Sherrill <joel@OARcorp.com>
PR 523/filesystem
	* src/malloc.c: Make malloc family safer for use from ISRs and
	dispatching critical sections. If in a critical section while doing
	a free(), then the free is deferred until the next malloc() attempt.
2003-11-26 17:50:53 +00:00
Joel Sherrill
aab4664d77 2003-10-22 Joel Sherrill <joel@OARcorp.com>
PR 511/filesystem
	* src/malloc.c: Add deferred free and protect against C Program Heap
	operations while in a dispatch disable critical section or ISR.
2003-10-22 16:53:55 +00:00
Joel Sherrill
0eae36c7c7 2003-09-04 Joel Sherrill <joel@OARcorp.com>
* include/chain.h, include/clockdrv.h, include/console.h,
	include/iosupp.h, include/rtc.h, include/spurious.h,
	include/timerdrv.h, include/vmeintr.h, include/motorola/mc68230.h,
	include/rtems/libcsupport.h, include/rtems/libio.h,
	include/rtems/libio_.h, include/rtems/termiostypes.h,
	include/sys/termios.h, include/zilog/z8036.h, include/zilog/z8530.h,
	include/zilog/z8536.h, src/__brk.c, src/__gettod.c, src/__sbrk.c,
	src/__times.c, src/access.c, src/base_fs.c, src/cfgetispeed.c,
	src/cfgetospeed.c, src/cfsetispeed.c, src/cfsetospeed.c, src/chdir.c,
	src/chmod.c, src/chown.c, src/chroot.c, src/close.c, src/ctermid.c,
	src/dup.c, src/dup2.c, src/eval.c, src/fchdir.c, src/fchmod.c,
	src/fcntl.c, src/fdatasync.c, src/fpathconf.c,
	src/fs_null_handlers.c, src/fstat.c, src/fsync.c, src/ftruncate.c,
	src/getdents.c, src/getpwent.c, src/hosterr.c, src/ioctl.c,
	src/isatty.c, src/libio.c, src/libio_sockets.c, src/link.c,
	src/lseek.c, src/lstat.c, src/malloc.c, src/mallocfreespace.c,
	src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mount.c, src/newlibc.c,
	src/no_libc.c, src/no_posix.c, src/open.c, src/pathconf.c,
	src/pipe.c, src/privateenv.c, src/read.c, src/readlink.c,
	src/rewinddir.c, src/rmdir.c, src/seekdir.c, src/stat.c,
	src/symlink.c, src/sync.c, src/tcdrain.c, src/tcflow.c,
	src/tcflush.c, src/tcgetattr.c, src/tcgetprgrp.c, src/tcsendbreak.c,
	src/tcsetattr.c, src/tcsetpgrp.c, src/telldir.c, src/termios.c,
	src/termiosinitialize.c, src/truncate.c, src/umask.c, src/unixlibc.c,
	src/unlink.c, src/unmount.c, src/utime.c, src/write.c: URL for
	license changed.
2003-09-04 18:54:13 +00:00
Joel Sherrill
d9c3805a73 2003-09-04 Joel Sherrill <joel@OARcorp.com>
PR 479/rtems_misc
	* src/malloc.c: Per multiple standards realloc does not free the
	original memory if the allocation of the requested larger block
	fails.
2003-09-04 13:02:57 +00:00
Joel Sherrill
a561f47be8 2003-09-02 Joel Sherrill <joel@OARcorp.com>
* src/malloc.c: Remove test define left in.
2003-09-02 21:02:29 +00:00
Joel Sherrill
d5031cbbca 2003-09-02 Ilya Alexeev <ilya@continuum.ru>
PR 472/filesystem
	src/malloc.c: Need to include apimutex.h when MALLOC_STATS is defined.
2003-09-02 21:01:21 +00:00
Joel Sherrill
83333e9473 2002-12-06 Joel Sherrill <joel@OARcorp.com>
* src/malloc.c: Fixed code that incorrected did a disable dispatch
	instead of locking and unlocking the allocator mutex.
2002-12-06 13:49:57 +00:00
Joel Sherrill
9c49db4d6a 2001-01-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.in: Add libc/config.h
	* libc/Makefile.am: Add INCLUDES += -I. to pickup config.h
	* libc/.cvsignore: Add config.h and stamp-h
	* libc/*.c: Add config.h support.
2001-01-08 18:26:44 +00:00
Joel Sherrill
3ba74c733f 2000-11-01 Joel Sherrill <joel@OARcorp.com>
* include/Makefile.am, include/rtems/libio_.h, libc/Makefile.am,
	libc/assoc.c, libc/assocnamebad.c, libc/base_fs.c, libc/cfsetispeed.c,
	libc/cfsetospeed.c, libc/chdir.c, libc/chmod.c, libc/chown.c,
	libc/close.c, libc/closedir.c, libc/dup2.c, libc/error.c, libc/eval.c,
	libc/fchdir.c, libc/fchmod.c, libc/fcntl.c, libc/fdatasync.c,
	libc/fpathconf.c, libc/fstat.c, libc/fsync.c, libc/ftruncate.c,
	libc/getdents.c, libc/ioctl.c, libc/libio.c, libc/libio_sockets.c,
	libc/link.c, libc/lseek.c, libc/malloc.c, libc/mallocfreespace.c,
	libc/mknod.c, libc/mount.c, libc/newlibc.c, libc/no_libc.c,
	libc/open.c, libc/read.c, libc/readlink.c, libc/rmdir.c, libc/stat.c,
	libc/symlink.c, libc/tcsetattr.c, libc/telldir.c, libc/ttyname.c,
	libc/ttyname_r.c, libc/umask.c, libc/unlink.c, libc/unmount.c,
	libc/utime.c, libc/write.c:
	assoc.h, error.h, libio_.h, libio.h, and libcsupport.h moved
	from libc to lib/include/rtems and now must be referenced as
	<rtems/XXX.h>.
	* include/rtems/Makefile.am, include/rtems/.cvsignore: New file.
	* include/rtems/assoc.h, include/rtems/error.h,
	include/rtems/libcsupport.h, include/rtems/libio.h,
	include/rtems/libio_.h: New/moved files.
2000-11-01 21:08:14 +00:00
Joel Sherrill
ca7858bb88 Port of RTEMS to the Texas Instruments C3x/C4x DSP families including
a BSP (c4xsim) supporting the simulator included with gdb.  This port
was done by Joel Sherrill and Jennifer Averett of OAR Corporation.
Also included with this port is a space/time optimization to eliminate
FP context switch management on CPUs without hardware or software FP.

An issue with this port was that sizeof(unsigned32) = sizeof(unsigned8)
on this CPU.  This required addressing alignment checks and assumptions
as well as fixing code that assumed sizeof(unsigned32) == 4.
2000-07-26 19:28:11 +00:00
Joel Sherrill
cf1f72ea33 Moved i386 and m68k cache management code to libcpu. Everything
now is an implementation of the prototypes in rtems/rtems/cache.h.
The libcpu/i386/wrapup directory is no longer needed.
The PowerPC needs this done to it.
2000-06-13 21:53:38 +00:00
Joel Sherrill
8ef38186fa Patch from John Cotton <john.cotton@nrc.ca>, Charles-Antoine Gauthier
<charles.gauthier@iit.nrc.ca>, and Darlene A. Stewart
<Darlene.Stewart@nrc.ca> to add support for a number of very
significant things:

  + BSPs for many variations on the Motorola MBX8xx board series
  + Cache Manager including initial support for m68040
    and PowerPC
  + Rework of mpc8xx libcpu code so all mpc8xx CPUs now use
    same code base.
  + Rework of eth_comm BSP to utiltize above.

John reports this works on the 821 and 860
2000-06-12 19:57:02 +00:00
Joel Sherrill
df49c60c96 Merged from 4.5.0-beta3a 2000-06-12 15:00:15 +00:00
Joel Sherrill
08311cc3a9 Updated copyright notice. 1999-11-17 17:51:34 +00:00
Joel Sherrill
458bd343e2 This is another pass at making sure that nothing outside the BSP
unnecessarily uses any variables defined by the BSP.  On this
sweep, use of BSP_Configuration and Cpu_table was eliminated.

A significant part of this modification was the addition of
macros to access fields in the RTEMS configuration structures.

This is necessary to strengthen the division between the BSP independent
parts of RTEMS and the BSPs themselves.  This started after
comments and analysis by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
1999-11-05 16:44:02 +00:00
Joel Sherrill
6fc973e39b Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
Here is another fix, which addresses a few more or less severe bugs in
    configuration and unix/posix:

    * Configuration fix: c/src/lib/configure.in didn't handle RDBG correctly

    * Configuration fix: make depend was non-functional in
      c/src/lib/libc/Makefile.in
    * Configuration fix: stray comment removed from aclocal/target.m4

    * RTEMS fix: termios support for unix/posix now uses the host's headers
      only (was completely broken).
    - Don't install RTEMS's newlib sys/termios.h for unix (sys/termios.h
      apparently is a newlib specific header)
    - To be able to compile RTEMS's  termios.c with glibc2.1, glibc-2.1
      needs __USE_MISC, which is a private define from gcc's features.h, being
      defined only when _BSD_SOURCE of _SVID_SOURCE is defined.  RTEMS's
      termios apparently implements BSD, thus -D_BSD_SOURCE was added to
      Linux-posix.cfg.
    - Conflicting definitions for  __USE_MISC and _BSD_SOURCE inside of
      RTEMS codes removed due to definition of _BSD_SOURCE on the toplevel.

    This fix has been tested with linux/posix (primary glibc2.1 native),
    linux/posix (secondary libc5 native), sh/gensh1, i386/pc386 and a couple
    of other bsp's/CPU.

    To apply:

        cd <srcdir>
        patch -p1 < rtems-rc-19990709-9.diff

    and
        aclocal -I aclocal && automake && autoconf
        cd c/src/lib; autoconf

    or
        ./autogen
1999-08-18 16:49:52 +00:00
Joel Sherrill
07a3253de2 Added base version of file system infrastructure. This includes a major
overhaul of the RTEMS system call interface.  This base file system is
the "In-Memory File System" aka IMFS.

The design and implementation was done by the following people:

  + Joel Sherrill (joel@OARcorp.com)
  + Jennifer Averett (jennifer@OARcorp.com)
  + Steve "Mr Mount" Salitasc (salitasc@OARcorp.com)
  + Kerwin Wade (wade@OARcorp.com)

PROBLEMS
========
  + It is VERY likely that merging this will break the UNIX port.  This
    can/will be fixed.

  + There is likely some reentrancy/mutual exclusion needed.

  + Eventually, there should be a "mini-IMFS" description table to
    eliminate links, symlinks, etc to save memory.  All you need to
    have "classic RTEMS" functionality is technically directories
    and device IO.  All the rest could be left out to save memory.
1998-11-23 19:07:58 +00:00
Joel Sherrill
388be68fbc Patch from Ian Lance Taylor <ian@airs.com>:
The reentrant versions of the malloc functions in
        c/src/lib/libc/malloc.c
    do not match the definitions in newlib.  These will be used if you use
    newlib routines such as fdopen.  I believe this patch to malloc.c is
    needed to provide the correct versions.
1998-10-01 21:44:31 +00:00
Joel Sherrill
3b93a2dee1 Modifed to zero out the C heap if the CPU Table indicates that the
RTEMS workspace is to be zeroed out.
1998-09-23 16:34:23 +00:00
Joel Sherrill
60b791ada1 updated copyright to 1998 1998-02-17 23:46:28 +00:00
Joel Sherrill
421dfef68e Corrected Linux port for glibc2 1998-01-30 20:59:22 +00:00
Joel Sherrill
c7ca28cf37 Removed warning under linux port. 1997-11-18 22:32:55 +00:00
Joel Sherrill
4fd617952e Added casts and fixed line break. 1997-10-21 16:17:12 +00:00
Joel Sherrill
98e4ebf594 Fixed typo in the pointer to the license terms. 1997-10-08 15:45:54 +00:00
Joel Sherrill
03f2154e51 headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.
1997-04-22 17:20:27 +00:00
Joel Sherrill
dcec5a4d60 Merged newlib's libgloss support for rtems into this directory. This
should simplify the build process.
1997-01-29 00:29:25 +00:00
Joel Sherrill
1f2d5dfcb3 added malloc_walk
miscellaneous corrections in casting.
1996-09-18 20:52:47 +00:00
Joel Sherrill
8b2ecf8546 updates from Tony Bennett 1996-05-23 15:37:38 +00:00