mirror of
https://github.com/drasko/codezero.git
synced 2026-07-11 01:44:13 +02:00
Test and Threads_demo containers interchanged by mistake earlier.
Corrected
This commit is contained in:
@@ -13,10 +13,11 @@ sys.path.append(PROJRELROOT)
|
|||||||
|
|
||||||
from config.projpaths import *
|
from config.projpaths import *
|
||||||
from config.configuration import *
|
from config.configuration import *
|
||||||
|
from config.lib import *
|
||||||
|
|
||||||
config = configuration_retrieve()
|
config = configuration_retrieve()
|
||||||
platform = config.platform
|
|
||||||
arch = config.arch
|
arch = config.arch
|
||||||
|
platform = config.platform
|
||||||
gcc_cpu_flag = config.gcc_cpu_flag
|
gcc_cpu_flag = config.gcc_cpu_flag
|
||||||
|
|
||||||
LIBL4_RELDIR = 'conts/libl4'
|
LIBL4_RELDIR = 'conts/libl4'
|
||||||
@@ -38,32 +39,19 @@ LIBDEV_LIBPATH = join(join(BUILDDIR, LIBDEV_RELDIR), 'sys-userspace')
|
|||||||
LIBDEV_INCLUDE = [join(LIBDEV_DIR, 'uart/include')]
|
LIBDEV_INCLUDE = [join(LIBDEV_DIR, 'uart/include')]
|
||||||
LIBDEV_CCFLAGS = '-DPLATFORM_' + platform.upper()
|
LIBDEV_CCFLAGS = '-DPLATFORM_' + platform.upper()
|
||||||
|
|
||||||
LIBL4THREAD_RELDIR = 'conts/libl4thread'
|
|
||||||
LIBL4THREAD_DIR = join(PROJROOT, LIBL4THREAD_RELDIR)
|
|
||||||
LIBL4THREAD_LIBPATH = join(BUILDDIR, LIBL4THREAD_RELDIR)
|
|
||||||
LIBL4THREAD_INCLUDE = join(LIBL4THREAD_DIR, 'include')
|
|
||||||
|
|
||||||
LIBMEM_RELDIR = 'conts/libmem'
|
|
||||||
LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR)
|
|
||||||
LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR)
|
|
||||||
LIBMEM_INCLUDE = LIBMEM_DIR
|
|
||||||
|
|
||||||
env = Environment(CC = config.user_toolchain + 'gcc',
|
env = Environment(CC = config.user_toolchain + 'gcc',
|
||||||
# We don't use -nostdinc because sometimes we need standard headers,
|
# We don't use -nostdinc because sometimes we need standard headers,
|
||||||
# such as stdarg.h e.g. for variable args, as in printk().
|
# such as stdarg.h e.g. for variable args, as in printk().
|
||||||
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \
|
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \
|
||||||
'-Werror', ('-mcpu=' + gcc_cpu_flag), LIBDEV_CCFLAGS],
|
'-Werror', ('-mcpu=' + gcc_cpu_flag), LIBDEV_CCFLAGS],
|
||||||
LINKFLAGS = ['-nostdlib', '-T' + "include/linker.lds", "-u_start"],
|
LINKFLAGS = ['-nostdlib', '-T' + "include/linker.lds", "-u_start"],\
|
||||||
ASFLAGS = ['-D__ASSEMBLY__'],
|
ASFLAGS = ['-D__ASSEMBLY__'], \
|
||||||
PROGSUFFIX = '.elf', # The suffix to use for final executable
|
PROGSUFFIX = '.elf', # The suffix to use for final executable\
|
||||||
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path
|
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path\
|
||||||
LIBS = ['libl4thread', 'libl4', 'libmalloc', 'c-userspace', \
|
LIBS = ['gcc', 'libl4', 'c-userspace', 'libdev-userspace', 'gcc', 'c-userspace'], # libgcc.a - This is required for division routines.
|
||||||
'libdev-userspace', 'gcc', 'c-userspace'], # libgcc.a - This is required for division routines.
|
CPPPATH = ["#include", KERNEL_INCLUDE, LIBL4_INCLUDE, LIBDEV_INCLUDE, LIBC_INCLUDE],
|
||||||
CPPPATH = ["#include", KERNEL_INCLUDE, LIBL4_INCLUDE, LIBDEV_INCLUDE, \
|
LIBPATH = [LIBL4_LIBPATH, LIBDEV_LIBPATH, LIBC_LIBPATH],
|
||||||
LIBC_INCLUDE, LIBL4THREAD_INCLUDE],
|
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
|
||||||
LIBPATH = [LIBL4_LIBPATH, LIBDEV_LIBPATH, LIBC_LIBPATH, LIBL4THREAD_LIBPATH, \
|
|
||||||
LIBMEM_LIBPATH],
|
|
||||||
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
|
|
||||||
|
|
||||||
src = Glob('*.[cS]')
|
src = Glob('*.[cS]')
|
||||||
src += Glob('src/*.[cS]')
|
src += Glob('src/*.[cS]')
|
||||||
|
|||||||
@@ -1,115 +1,80 @@
|
|||||||
/*
|
/*
|
||||||
* Main function for this container
|
* Main function for all tests
|
||||||
|
*
|
||||||
|
* Copyright (C) 2009 B Labs Ltd.
|
||||||
*/
|
*/
|
||||||
|
#include <l4/api/errno.h>
|
||||||
|
#include <container.h>
|
||||||
|
#include <capability.h>
|
||||||
|
#include <thread.h>
|
||||||
|
#include <tests.h>
|
||||||
#include <l4lib/arch/syslib.h>
|
#include <l4lib/arch/syslib.h>
|
||||||
#include <l4lib/arch/syscalls.h>
|
#include <l4lib/arch/syscalls.h>
|
||||||
#include <l4/api/space.h>
|
#include <l4/api/space.h>
|
||||||
#include <l4thread/thread.h>
|
|
||||||
|
|
||||||
/* Symbolic constants */
|
|
||||||
#define STACK_SIZE 0x1000
|
|
||||||
#define NTHREADS 10
|
|
||||||
|
|
||||||
/* Stack and utcb region */
|
int exit_test_thread(void *arg)
|
||||||
static char stack[NTHREADS * STACK_SIZE];
|
|
||||||
DECLARE_UTCB_SPACE(utcb, NTHREADS)
|
|
||||||
|
|
||||||
/* Function definitions */
|
|
||||||
static void init_thread_lib(void)
|
|
||||||
{
|
{
|
||||||
/* Thread lib is informed about the stack region. */
|
while (1)
|
||||||
l4_set_stack_params((unsigned long)stack,
|
|
||||||
(unsigned long)(stack + sizeof(stack)),
|
|
||||||
STACK_SIZE);
|
|
||||||
|
|
||||||
/* Thread lib is informed about the utcb region. */
|
|
||||||
l4_set_utcb_params((unsigned long)utcb,
|
|
||||||
(unsigned long)(utcb + sizeof(utcb)));
|
|
||||||
|
|
||||||
/* Now, we are ready to make calls to the library. */
|
|
||||||
}
|
|
||||||
|
|
||||||
static int do_some_work1(void *arg)
|
|
||||||
{
|
|
||||||
struct task_ids ids;
|
|
||||||
int value = *(int *)arg;
|
|
||||||
int j;
|
|
||||||
|
|
||||||
l4_getid(&ids);
|
|
||||||
printf("tid = %d is called with the value of (%d).\n",
|
|
||||||
__raw_tid(ids.tid), value);
|
|
||||||
|
|
||||||
/* Wait for a while before exiting */
|
|
||||||
j = 0x400000;
|
|
||||||
while (--j)
|
|
||||||
;
|
;
|
||||||
|
//l4_thread_switch(0);
|
||||||
return ids.tid;
|
//l4_exit(5);
|
||||||
}
|
|
||||||
|
|
||||||
static int do_some_work2(void *arg)
|
|
||||||
{
|
|
||||||
struct task_ids ids;
|
|
||||||
int value = *(int *)arg;
|
|
||||||
int j;
|
|
||||||
|
|
||||||
l4_getid(&ids);
|
|
||||||
printf("tid = %d is called with the value of (%d).\n",
|
|
||||||
__raw_tid(ids.tid), value);
|
|
||||||
|
|
||||||
/* Wait for a while before exiting */
|
|
||||||
j = 0x400000;
|
|
||||||
while (--j)
|
|
||||||
;
|
|
||||||
|
|
||||||
l4_thread_exit(ids.tid);
|
|
||||||
|
|
||||||
/* Should never reach here */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int thread_demo(void)
|
int exit_test(void)
|
||||||
{
|
{
|
||||||
struct task_ids ids[NTHREADS];
|
int ret;
|
||||||
int arg[NTHREADS];
|
struct task_ids ids;
|
||||||
int j;
|
|
||||||
|
|
||||||
memset(ids, 0, sizeof(ids));
|
/* Create and run a new thread */
|
||||||
|
if ((ret = thread_create(exit_test_thread, 0,
|
||||||
|
TC_SHARE_SPACE | TC_AS_PAGER,
|
||||||
|
&ids)) < 0) {
|
||||||
|
printf("Top-level simple_pager creation failed.\n");
|
||||||
|
goto out_err;
|
||||||
|
} else
|
||||||
|
printf("Thread (%d) created successfully.\n", ids.tid);
|
||||||
|
|
||||||
/* Create threads. */
|
// l4_thread_switch(0);
|
||||||
for (int i = 0; i < NTHREADS; ++i) {
|
|
||||||
/* The argument passed to the thread in question. */
|
|
||||||
arg[i] = i;
|
|
||||||
|
|
||||||
/* Threads are created. */
|
/* Kill it */
|
||||||
if (i % 2)
|
printf("Killing Thread (%d).\n", ids.tid);
|
||||||
l4_thread_create(&ids[i], TC_SHARE_SPACE | TC_SHARE_PAGER,
|
if ((ret = l4_thread_control(THREAD_DESTROY, &ids)) < 0)
|
||||||
do_some_work1, (void *)&arg[i]);
|
printf("Error: Killing Thread (%d), err = %d\n", ids.tid, ret);
|
||||||
else
|
else
|
||||||
l4_thread_create(&ids[i], TC_SHARE_SPACE | TC_SHARE_PAGER,
|
printf("Success: Killed Thread (%d)\n", ids.tid);
|
||||||
do_some_work2, (void *)&arg[i]);
|
|
||||||
|
|
||||||
/* Wait for a while before launching another thread. */
|
|
||||||
j = 0x100000;
|
|
||||||
while (--j)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Wait for them to exit. */
|
#if 0
|
||||||
for (int i = 0; i < NTHREADS; ++i)
|
/* Wait on it */
|
||||||
printf("tid = %d exited with (%d).\n", __raw_tid(ids[i].tid),
|
printf("Waiting on Thread (%d) to exit.\n", ids.tid);
|
||||||
l4_thread_control(THREAD_WAIT, &ids[i]));
|
if ((ret = l4_thread_control(THREAD_WAIT, &ids)) >= 0)
|
||||||
|
printf("Success. Paged child returned %d\n", ret);
|
||||||
|
else
|
||||||
|
printf("Error. Wait on (%d) failed. err = %d\n",
|
||||||
|
ids.tid, ret);
|
||||||
|
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
out_err:
|
||||||
|
BUG();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* Before using the thread lib, we have to initialize it. */
|
printf("%s: Container %s started\n",
|
||||||
init_thread_lib();
|
__CONTAINER__, __CONTAINER_NAME__);
|
||||||
|
|
||||||
/* Demonstrates the usage of the thread lib. */
|
capability_test();
|
||||||
thread_demo();
|
|
||||||
|
//exit_test();
|
||||||
|
|
||||||
|
/* Now quit to demo self-paging quit */
|
||||||
|
//l4_exit(0);
|
||||||
|
|
||||||
|
/* Now quit by null pointer */
|
||||||
|
// *((int *)0) = 5;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,10 @@ sys.path.append(PROJRELROOT)
|
|||||||
|
|
||||||
from config.projpaths import *
|
from config.projpaths import *
|
||||||
from config.configuration import *
|
from config.configuration import *
|
||||||
from config.lib import *
|
|
||||||
|
|
||||||
config = configuration_retrieve()
|
config = configuration_retrieve()
|
||||||
arch = config.arch
|
|
||||||
platform = config.platform
|
platform = config.platform
|
||||||
|
arch = config.arch
|
||||||
gcc_cpu_flag = config.gcc_cpu_flag
|
gcc_cpu_flag = config.gcc_cpu_flag
|
||||||
|
|
||||||
LIBL4_RELDIR = 'conts/libl4'
|
LIBL4_RELDIR = 'conts/libl4'
|
||||||
@@ -39,19 +38,32 @@ LIBDEV_LIBPATH = join(join(BUILDDIR, LIBDEV_RELDIR), 'sys-userspace')
|
|||||||
LIBDEV_INCLUDE = [join(LIBDEV_DIR, 'uart/include')]
|
LIBDEV_INCLUDE = [join(LIBDEV_DIR, 'uart/include')]
|
||||||
LIBDEV_CCFLAGS = '-DPLATFORM_' + platform.upper()
|
LIBDEV_CCFLAGS = '-DPLATFORM_' + platform.upper()
|
||||||
|
|
||||||
|
LIBL4THREAD_RELDIR = 'conts/libl4thread'
|
||||||
|
LIBL4THREAD_DIR = join(PROJROOT, LIBL4THREAD_RELDIR)
|
||||||
|
LIBL4THREAD_LIBPATH = join(BUILDDIR, LIBL4THREAD_RELDIR)
|
||||||
|
LIBL4THREAD_INCLUDE = join(LIBL4THREAD_DIR, 'include')
|
||||||
|
|
||||||
|
LIBMEM_RELDIR = 'conts/libmem'
|
||||||
|
LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR)
|
||||||
|
LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR)
|
||||||
|
LIBMEM_INCLUDE = LIBMEM_DIR
|
||||||
|
|
||||||
env = Environment(CC = config.user_toolchain + 'gcc',
|
env = Environment(CC = config.user_toolchain + 'gcc',
|
||||||
# We don't use -nostdinc because sometimes we need standard headers,
|
# We don't use -nostdinc because sometimes we need standard headers,
|
||||||
# such as stdarg.h e.g. for variable args, as in printk().
|
# such as stdarg.h e.g. for variable args, as in printk().
|
||||||
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \
|
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \
|
||||||
'-Werror', ('-mcpu=' + gcc_cpu_flag), LIBDEV_CCFLAGS],
|
'-Werror', ('-mcpu=' + gcc_cpu_flag), LIBDEV_CCFLAGS],
|
||||||
LINKFLAGS = ['-nostdlib', '-T' + "include/linker.lds", "-u_start"],\
|
LINKFLAGS = ['-nostdlib', '-T' + "include/linker.lds", "-u_start"],
|
||||||
ASFLAGS = ['-D__ASSEMBLY__'], \
|
ASFLAGS = ['-D__ASSEMBLY__'],
|
||||||
PROGSUFFIX = '.elf', # The suffix to use for final executable\
|
PROGSUFFIX = '.elf', # The suffix to use for final executable
|
||||||
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path\
|
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path
|
||||||
LIBS = ['gcc', 'libl4', 'c-userspace', 'libdev-userspace', 'gcc', 'c-userspace'], # libgcc.a - This is required for division routines.
|
LIBS = ['libl4thread', 'libl4', 'libmalloc', 'c-userspace', \
|
||||||
CPPPATH = ["#include", KERNEL_INCLUDE, LIBL4_INCLUDE, LIBDEV_INCLUDE, LIBC_INCLUDE],
|
'libdev-userspace', 'gcc', 'c-userspace'], # libgcc.a - This is required for division routines.
|
||||||
LIBPATH = [LIBL4_LIBPATH, LIBDEV_LIBPATH, LIBC_LIBPATH],
|
CPPPATH = ["#include", KERNEL_INCLUDE, LIBL4_INCLUDE, LIBDEV_INCLUDE, \
|
||||||
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
|
LIBC_INCLUDE, LIBL4THREAD_INCLUDE],
|
||||||
|
LIBPATH = [LIBL4_LIBPATH, LIBDEV_LIBPATH, LIBC_LIBPATH, LIBL4THREAD_LIBPATH, \
|
||||||
|
LIBMEM_LIBPATH],
|
||||||
|
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
|
||||||
|
|
||||||
src = Glob('*.[cS]')
|
src = Glob('*.[cS]')
|
||||||
src += Glob('src/*.[cS]')
|
src += Glob('src/*.[cS]')
|
||||||
|
|||||||
@@ -1,80 +1,115 @@
|
|||||||
/*
|
/*
|
||||||
* Main function for all tests
|
* Main function for this container
|
||||||
*
|
|
||||||
* Copyright (C) 2009 B Labs Ltd.
|
|
||||||
*/
|
*/
|
||||||
#include <l4/api/errno.h>
|
|
||||||
#include <container.h>
|
|
||||||
#include <capability.h>
|
|
||||||
#include <thread.h>
|
|
||||||
#include <tests.h>
|
|
||||||
#include <l4lib/arch/syslib.h>
|
#include <l4lib/arch/syslib.h>
|
||||||
#include <l4lib/arch/syscalls.h>
|
#include <l4lib/arch/syscalls.h>
|
||||||
#include <l4/api/space.h>
|
#include <l4/api/space.h>
|
||||||
|
#include <l4thread/thread.h>
|
||||||
|
|
||||||
|
/* Symbolic constants */
|
||||||
|
#define STACK_SIZE 0x1000
|
||||||
|
#define NTHREADS 10
|
||||||
|
|
||||||
int exit_test_thread(void *arg)
|
/* Stack and utcb region */
|
||||||
|
static char stack[NTHREADS * STACK_SIZE];
|
||||||
|
DECLARE_UTCB_SPACE(utcb, NTHREADS)
|
||||||
|
|
||||||
|
/* Function definitions */
|
||||||
|
static void init_thread_lib(void)
|
||||||
{
|
{
|
||||||
while (1)
|
/* Thread lib is informed about the stack region. */
|
||||||
|
l4_set_stack_params((unsigned long)stack,
|
||||||
|
(unsigned long)(stack + sizeof(stack)),
|
||||||
|
STACK_SIZE);
|
||||||
|
|
||||||
|
/* Thread lib is informed about the utcb region. */
|
||||||
|
l4_set_utcb_params((unsigned long)utcb,
|
||||||
|
(unsigned long)(utcb + sizeof(utcb)));
|
||||||
|
|
||||||
|
/* Now, we are ready to make calls to the library. */
|
||||||
|
}
|
||||||
|
|
||||||
|
static int do_some_work1(void *arg)
|
||||||
|
{
|
||||||
|
struct task_ids ids;
|
||||||
|
int value = *(int *)arg;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
l4_getid(&ids);
|
||||||
|
printf("tid = %d is called with the value of (%d).\n",
|
||||||
|
__raw_tid(ids.tid), value);
|
||||||
|
|
||||||
|
/* Wait for a while before exiting */
|
||||||
|
j = 0x400000;
|
||||||
|
while (--j)
|
||||||
;
|
;
|
||||||
//l4_thread_switch(0);
|
|
||||||
//l4_exit(5);
|
return ids.tid;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int do_some_work2(void *arg)
|
||||||
|
{
|
||||||
|
struct task_ids ids;
|
||||||
|
int value = *(int *)arg;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
l4_getid(&ids);
|
||||||
|
printf("tid = %d is called with the value of (%d).\n",
|
||||||
|
__raw_tid(ids.tid), value);
|
||||||
|
|
||||||
|
/* Wait for a while before exiting */
|
||||||
|
j = 0x400000;
|
||||||
|
while (--j)
|
||||||
|
;
|
||||||
|
|
||||||
|
l4_thread_exit(ids.tid);
|
||||||
|
|
||||||
|
/* Should never reach here */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int exit_test(void)
|
static int thread_demo(void)
|
||||||
{
|
{
|
||||||
int ret;
|
struct task_ids ids[NTHREADS];
|
||||||
struct task_ids ids;
|
int arg[NTHREADS];
|
||||||
|
int j;
|
||||||
|
|
||||||
/* Create and run a new thread */
|
memset(ids, 0, sizeof(ids));
|
||||||
if ((ret = thread_create(exit_test_thread, 0,
|
|
||||||
TC_SHARE_SPACE | TC_AS_PAGER,
|
|
||||||
&ids)) < 0) {
|
|
||||||
printf("Top-level simple_pager creation failed.\n");
|
|
||||||
goto out_err;
|
|
||||||
} else
|
|
||||||
printf("Thread (%d) created successfully.\n", ids.tid);
|
|
||||||
|
|
||||||
// l4_thread_switch(0);
|
/* Create threads. */
|
||||||
|
for (int i = 0; i < NTHREADS; ++i) {
|
||||||
|
/* The argument passed to the thread in question. */
|
||||||
|
arg[i] = i;
|
||||||
|
|
||||||
/* Kill it */
|
/* Threads are created. */
|
||||||
printf("Killing Thread (%d).\n", ids.tid);
|
if (i % 2)
|
||||||
if ((ret = l4_thread_control(THREAD_DESTROY, &ids)) < 0)
|
l4_thread_create(&ids[i], TC_SHARE_SPACE | TC_SHARE_PAGER,
|
||||||
printf("Error: Killing Thread (%d), err = %d\n", ids.tid, ret);
|
do_some_work1, (void *)&arg[i]);
|
||||||
else
|
else
|
||||||
printf("Success: Killed Thread (%d)\n", ids.tid);
|
l4_thread_create(&ids[i], TC_SHARE_SPACE | TC_SHARE_PAGER,
|
||||||
|
do_some_work2, (void *)&arg[i]);
|
||||||
|
|
||||||
|
/* Wait for a while before launching another thread. */
|
||||||
|
j = 0x100000;
|
||||||
|
while (--j)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
/* Wait for them to exit. */
|
||||||
/* Wait on it */
|
for (int i = 0; i < NTHREADS; ++i)
|
||||||
printf("Waiting on Thread (%d) to exit.\n", ids.tid);
|
printf("tid = %d exited with (%d).\n", __raw_tid(ids[i].tid),
|
||||||
if ((ret = l4_thread_control(THREAD_WAIT, &ids)) >= 0)
|
l4_thread_control(THREAD_WAIT, &ids[i]));
|
||||||
printf("Success. Paged child returned %d\n", ret);
|
|
||||||
else
|
|
||||||
printf("Error. Wait on (%d) failed. err = %d\n",
|
|
||||||
ids.tid, ret);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
out_err:
|
|
||||||
BUG();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
printf("%s: Container %s started\n",
|
/* Before using the thread lib, we have to initialize it. */
|
||||||
__CONTAINER__, __CONTAINER_NAME__);
|
init_thread_lib();
|
||||||
|
|
||||||
capability_test();
|
/* Demonstrates the usage of the thread lib. */
|
||||||
|
thread_demo();
|
||||||
//exit_test();
|
|
||||||
|
|
||||||
/* Now quit to demo self-paging quit */
|
|
||||||
//l4_exit(0);
|
|
||||||
|
|
||||||
/* Now quit by null pointer */
|
|
||||||
// *((int *)0) = 5;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user