From 00adcd9afaafdafb57d2d371b52cfe94dcce206a Mon Sep 17 00:00:00 2001 From: Bora Sahin Date: Thu, 29 Oct 2009 22:00:38 +0200 Subject: [PATCH] libl4thread skeleton is introduced. With this library, it is aimed at easing thread manipulation, utcb handling etc. --- SConstruct.userlibs | 4 ++++ conts/libl4thread/SConscript | 25 +++++++++++++++++++++ conts/libl4thread/include/l4thread/thread.h | 9 ++++++++ conts/libl4thread/src/thread.c | 10 +++++++++ 4 files changed, 48 insertions(+) create mode 100644 conts/libl4thread/SConscript create mode 100644 conts/libl4thread/include/l4thread/thread.h create mode 100644 conts/libl4thread/src/thread.c diff --git a/SConstruct.userlibs b/SConstruct.userlibs index 330883b..599b814 100644 --- a/SConstruct.userlibs +++ b/SConstruct.userlibs @@ -44,9 +44,13 @@ libmm, libmc, libmalloc = SConscript('conts/libmem/SConscript', \ duplicate = 0, variant_dir = \ join(BUILDDIR, os.path.relpath('conts/libmem', PROJROOT))) +libl4thread = SConscript('conts/libl4thread/SConscript', \ + exports = { 'env' : env }, duplicate = 0, \ + variant_dir = join(BUILDDIR, os.path.relpath('conts/libl4thread', PROJROOT))) Alias('libl4', libl4) Alias('libc', libc) Alias('libmm', libmm) Alias('libmc', libmc) Alias('libmalloc', libmalloc) +Alias('libl4thread', libl4thread) diff --git a/conts/libl4thread/SConscript b/conts/libl4thread/SConscript new file mode 100644 index 0000000..2ca1bf8 --- /dev/null +++ b/conts/libl4thread/SConscript @@ -0,0 +1,25 @@ +# -*- mode: python; coding: utf-8; -*- +# +# Codezero -- Virtualization microkernel for embedded systems. +# +# Copyright © 2009 B Labs Ltd + +import os, sys + +# Get global paths +PROJRELROOT = '../..' + +sys.path.append(PROJRELROOT) + +from config.projpaths import * + +Import('env') + +e = env.Clone() +e.Append(CPPPATH = ['include/l4thread']) + +source = [Glob('*.[cS]') + Glob('src/*.[cS]')] +objects = e.StaticObject(source) +library = e.StaticLibrary('l4thread', objects) + +Return('library') diff --git a/conts/libl4thread/include/l4thread/thread.h b/conts/libl4thread/include/l4thread/thread.h new file mode 100644 index 0000000..31ced16 --- /dev/null +++ b/conts/libl4thread/include/l4thread/thread.h @@ -0,0 +1,9 @@ +/* + * + */ +#ifndef __LIB_THREAD_H__ +#define __LIB_THREAD_H__ + +void l4thread_print(void); + +#endif /* __LIB_THREAD_H__ */ diff --git a/conts/libl4thread/src/thread.c b/conts/libl4thread/src/thread.c new file mode 100644 index 0000000..21b574a --- /dev/null +++ b/conts/libl4thread/src/thread.c @@ -0,0 +1,10 @@ +/* + * + */ + +#include + +void l4thread_print(void) +{ + printf("Hello world from libl4thread!\n"); +}