This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

kernel cleanup


Although the kernel itself never performs any dynamic memory
allocation, there is still a dependency on the memory allocation
package. This is for historical reasons. Originally the memory pool
support was part of the kernel, then it was moved to a separate
memalloc package. To avoid compatibility problems, <cyg/kernel/kapi.h>
#include'd a header from the memalloc package, so the kernel C API
required memalloc.

This patch makes it possible to have a configuration with the kernel
but no memalloc. Mainly, kapi.h now checks that the memalloc package
is actually present before #include'ing its header. There should be no
impact on configurations with both the kernel and memalloc so there
are no backwards compatibility problems, just increased choice.

Bart

2002-08-05  Bart Veer  <bartv@tymora.demon.co.uk>

	* cdl/kernel.cdl, include/kapidata.h, include/kapi.h:
	Allow configurations with the kernel but no malloc

Index: kernel.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/cdl/kernel.cdl,v
retrieving revision 1.15
diff -u -u -r1.15 kernel.cdl
--- kernel.cdl	29 May 2002 18:28:27 -0000	1.15
+++ kernel.cdl	5 Aug 2002 21:40:14 -0000
@@ -258,8 +258,6 @@
         cdl_option CYGFUN_KERNEL_API_C {
             display       "Provide C API"
             default_value 1
-            requires      CYGPKG_MEMALLOC
-            requires      CYGFUN_MEMALLOC_KAPI
             description   "
                 The eCos kernel is implemented in C++, but there is an
                 optional C API for use by application code. This C API can be
Index: kapi.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/include/kapi.h,v
retrieving revision 1.16
diff -u -u -r1.16 kapi.h
--- kapi.h	5 Jun 2002 13:14:34 -0000	1.16
+++ kapi.h	5 Aug 2002 21:40:41 -0000
@@ -56,6 +57,7 @@
 //
 //========================================================================*/
 
+#include <pkgconf/system.h>
 #include <pkgconf/kernel.h>
 
 #ifdef CYGFUN_KERNEL_API_C
@@ -479,7 +481,9 @@
 /* These definitions are found in the "memalloc" package as this is      */
 /* where the implementation lives.                                       */
 
-#include <cyg/memalloc/kapi.h>
+#ifdef CYGPKG_MEMALLOC
+# include <cyg/memalloc/kapi.h>
+#endif
 
 /*---------------------------------------------------------------------------*/
 /* Semaphores                                                                */
Index: kapidata.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/include/kapidata.h,v
retrieving revision 1.11
diff -u -u -r1.11 kapidata.h
--- kapidata.h	23 May 2002 23:06:47 -0000	1.11
+++ kapidata.h	5 Aug 2002 21:41:21 -0000
@@ -60,6 +61,7 @@
 //
 //==========================================================================*/
 
+#include <pkgconf/system.h>
 #include <pkgconf/kernel.h>
 
 #include <cyg/infra/cyg_type.h>
@@ -511,7 +513,9 @@
 /* Memory allocator types now come from the "memalloc" package which is   */
 /* where the implementation lives.                                        */
 
-#include <cyg/memalloc/kapidata.h>
+#ifdef CYGPKG_MEMALLOC
+# include <cyg/memalloc/kapidata.h>
+#endif
 
 #ifdef __cplusplus
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]