This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
fileio w/o kernel
- From: Jani Monoses <jani at iv dot ro>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Fri, 12 Nov 2004 17:10:13 +0200
- Subject: fileio w/o kernel
Hello
this patch makes fileio (more exactly devfs ) compile without the kernel. It did not have
an actual dependency on it but some kernel headers were included nonetheless.Also make the
fileio tests build w/o kernel.
Was there a reason for using a thread in fat/tests/fileio instead of regular main startup?
With the other tests in fileio which need the kernel (socket and testfs) I am not sure
which patch to take:make their building conditional in the CDL or put ifdefs in them so
they build but print NOT_AVALAIBLE at runtime. Which is the preferred method?
Comments?
thanks
Jani
--- orig/packages/fs/fat/current/tests/fileio1.c
+++ mod/packages/fs/fat/current/tests/fileio1.c
@@ -58,11 +58,9 @@
//==========================================================================
#include <pkgconf/hal.h>
-#include <pkgconf/kernel.h>
#include <pkgconf/io_fileio.h>
#include <pkgconf/fs_fat.h>
-#include <cyg/kernel/ktypes.h> // base kernel types
#include <cyg/infra/cyg_trac.h> // tracing macros
#include <cyg/infra/cyg_ass.h> // assertion macros
@@ -429,7 +427,7 @@
//==========================================================================
// main
-void fileio1_main( CYG_ADDRESS id )
+int main( int argc, char **argv )
{
int err;
int existingdirents=-1;
@@ -744,29 +742,4 @@
}
// -------------------------------------------------------------------------
-
-#include <cyg/kernel/kapi.h>
-
-static char stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
-static cyg_handle_t thread_handle;
-static cyg_thread thread;
-
-externC void
-cyg_start( void )
-{
- cyg_thread_create(3, // Priority - just a number
- fileio1_main, // entry
- 0, // index
- 0, // no name
- &stack[0], // Stack
- sizeof(stack), // Size
- &thread_handle, // Handle
- &thread // Thread data structure
- );
- cyg_thread_resume(thread_handle);
-
- cyg_scheduler_start();
-}
-
-// -------------------------------------------------------------------------
// EOF fileio1.c
--- orig/packages/io/fileio/current/src/devfs.cxx
+++ mod/packages/io/fileio/current/src/devfs.cxx
@@ -56,10 +56,8 @@
//==========================================================================
#include <pkgconf/hal.h>
-#include <pkgconf/kernel.h>
#include <pkgconf/io_fileio.h>
-#include <cyg/kernel/ktypes.h> // base kernel types
#include <cyg/infra/cyg_trac.h> // tracing macros
#include <cyg/infra/cyg_ass.h> // assertion macros
--- orig/packages/io/fileio/current/tests/fileio1.c
+++ mod/packages/io/fileio/current/tests/fileio1.c
@@ -58,10 +58,8 @@
//==========================================================================
#include <pkgconf/hal.h>
-#include <pkgconf/kernel.h>
#include <pkgconf/io_fileio.h>
-#include <cyg/kernel/ktypes.h> // base kernel types
#include <cyg/infra/cyg_trac.h> // tracing macros
#include <cyg/infra/cyg_ass.h> // assertion macros