Commit Graph

26 Commits

Author SHA1 Message Date
Sebastian Huber
80cf60efec Canonicalize config.h include
Use the following variant which was already used by most source files:

  #ifdef HAVE_CONFIG_H
  #include "config.h"
  #endif
2020-04-16 07:30:00 +02:00
Sebastian Huber
eea21eaca1 bsps: Rework work area initialization
The work area initialization was done by the BSP through
bsp_work_area_initialize(). This approach predated the system
initialization through the system initialization linker set. The
workspace and C program heap were unconditionally initialized.  The aim
is to support RTEMS application configurations which do not need the
workspace and C program heap.  In these configurations, the workspace
and C prgram heap should not get initialized.

Change all bsp_work_area_initialize() to implement _Memory_Get()
instead.  Move the dirty memory, sbrk(), per-CPU data, workspace, and
malloc() heap initialization into separate system initialization steps.
This makes it also easier to test the individual initialization steps.

This change adds a dependency to _Heap_Extend() to all BSPs.  This
dependency will be removed in a follow up change.

Update #3838.
2020-02-04 06:06:41 +01:00
Sebastian Huber
3a659b0481 score: Introduce _Internal_error() 2016-12-12 08:03:29 +01:00
Sebastian Huber
b6606e8d99 score: Remove fatal is internal indicator
The fatal is internal indicator is redundant since the fatal source and
error code uniquely identify a fatal error.  Keep the fatal user
extension is internal parameter for backward compatibility and set it to
false always.

Update #2825.
2016-12-09 08:47:51 +01:00
Sebastian Huber
01557b0c6e libcsupport: Delete malloc statistics
Use the heap handler statistics instead.  Add heap walk option to MALLOC
shell command.

close #1367
2014-11-28 11:23:53 +01:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
83bf105486 score: Rename _Internal_error_Occurred()
Rename _Internal_error_Occurred() into _Terminate().
2014-02-21 09:38:24 +01:00
Sebastian Huber
47a3cd8f73 score: Work area initialization API change
The work areas (RTEMS work space and C program heap) will be initialized
now in a separate step and are no longer part of
rtems_initialize_data_structures().  Initialization is performed with
tables of Heap_Area entries.  This allows usage of scattered memory
areas present on various small scale micro-controllers.

The sbrk() support API changes also.  The bsp_sbrk_init() must now deal
with a minimum size for the first memory chunk to take the configured
work space size into account.
2012-10-25 14:54:06 +02:00
Sebastian Huber
3b978e190d libcsupport: malloc_deferred_frees_initialize()
Remove this function and statically initialize RTEMS_Malloc_GC_list.
2012-10-25 14:54:05 +02:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Sebastian Huber
b4f635e9d0 2011-11-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1924/cpukit
	* sapi/include/rtems/config.h: New fields stack_space_size,
	unified_work_area, and stack_allocator_avoids_work_space in
	rtems_configuration_table.
	* sapi/include/confdefs.h: Removed rtems_unified_work_area (this is
	now part of the Configuration).  Separate work space and stack space
	estimate.  Added CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
	configuration option.
	* libmisc/shell/main_wkspaceinfo.c, score/src/wkspace.c,
	libcsupport/src/malloc_initialize.c: Update due to API changes.
2011-11-10 14:40:13 +00:00
Joel Sherrill
7d647c09e9 2011-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc_initialize.c: After discussion with Till
	Straumann, revert the change from r1.12 to r1.13. This broke BSPs
	with sbrk() support once the libbsp sbrk() framework was enhanced.
	psim runs now.
2011-07-01 18:23:09 +00:00
Sebastian Huber
1b5a0ecef7 2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/free.c, libcsupport/src/malloc.c,
	libcsupport/src/malloc_initialize.c: Remove heap walks in case
	RTEMS_DEBUG is defined.
2010-08-25 14:30:01 +00:00
Joel Sherrill
3c1be2fad4 2010-07-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc_initialize.c: Clean up sbrk path now that a
	test is available.
2010-07-08 20:09:56 +00:00
Joel Sherrill
7c658feb2e 2010-06-30 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1472/cpukit
	* libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h,
	libcsupport/src/free.c, libcsupport/src/malloc.c,
	libcsupport/src/malloc_initialize.c, libcsupport/src/realloc.c,
	libcsupport/src/rtems_memalign.c: Remove malloc boundary code. It has
	not been used since before 4.6 and is bitrotted.
	* libcsupport/src/malloc_boundary.c: Removed.
2010-06-30 15:36:48 +00:00
Ralf Corsepius
18daff9b95 Whitespace removal. 2009-11-29 13:35:32 +00:00
Joel Sherrill
7c411bda5b 2009-09-14 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* score/src/wkspace.c: Removed work space area consistency checks.
	* libblock/include/rtems/ide_part_table.h: Functions are now
	deprecated.
	* libcsupport/include/rtems/libcsupport.h, libcsupport/src/calloc.c,
	libcsupport/src/malloc_boundary.c,
	libcsupport/src/malloc_initialize.c,
	libcsupport/src/malloc_report_statistics_plugin.c,
	libcsupport/src/malloc_statistics_helpers.c,
	libcsupport/src/malloc_walk.c, libcsupport/src/realloc.c,
	rtems/inline/rtems/rtems/region.inl: Update for heap API changes.

2009-09-14      Christian Mauderer <christian.mauderer@embedded-brains.de>

	* libcsupport/src/vprintk.c: Fixed warnings. Print nothing in case the
	pointer to the string is NULL.
2009-09-14 14:48:38 +00:00
Joel Sherrill
b99a35a8fc 2009-08-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/malloc_initialize.c, sapi/src/exinit.c,
	score/src/threadstartmultitasking.c: Fix spacing.
	* libmisc/stackchk/check.c: Move variable into compiler specific conditional.
2009-08-28 18:26:05 +00:00
Ralf Corsepius
8a02424004 2009-04-15 Wei-Tsun Sun <wsun013@gmail.com>
* libcsupport/src/malloc_initialize.c: Add dummy
	  RTEMS_Malloc_Initialize.
2009-04-15 08:34:45 +00:00
Joel Sherrill
eb7ee96a75 2009-03-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/malloc_initialize.c: Fixed invalid function
	parameter.
2009-03-05 12:16:22 +00:00
Joel Sherrill
7246c8e997 2009-03-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc_initialize.c, score/Makefile.am,
	score/include/rtems/score/protectedheap.h,
	score/inline/rtems/score/heap.inl: Get total heap size correct when
	using unified C Program Heap and RTEMS Workspace.
	* score/src/pheapgetsize.c: New file.
2009-03-02 18:10:34 +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
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