From 2b0ea24e94869c0a4885c5c10b643da37ba8e22f Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Sat, 25 Jul 2009 17:52:06 +0300 Subject: [PATCH] Added 2 more files. --- include/l4/generic/container.h | 67 ++++++++++++++++++++++++++++++++++ src/generic/container.c | 11 ++++++ 2 files changed, 78 insertions(+) create mode 100644 include/l4/generic/container.h create mode 100644 src/generic/container.c diff --git a/include/l4/generic/container.h b/include/l4/generic/container.h new file mode 100644 index 0000000..d5ff56f --- /dev/null +++ b/include/l4/generic/container.h @@ -0,0 +1,67 @@ +/* + * Definitions for Codezero Containers + * + * Copyright (C) 2009 Bahadir Balban + */ +#ifndef __CONTAINER_H__ +#define __CONTAINER_H__ + +#include +#include +#include +#include +#include + +/* Container macro. No locks needed! */ +#define container (current->container) + +struct container { + /* Unique container id */ + l4id_t cid; + + /* List of address spaces */ + struct address_space_list space_list; + + /* List of threads */ + struct ktcb_list ktcb_list; + + /* ID pools for threads and spaces */ + struct id_pool *thread_id_pool; + struct id_pool *space_id_pool; + + /* Scheduling structs */ + struct scheduler scheduler; + + /* Mutex list for all userspace mutexes */ + struct mutex_queue_head mutex_queue_head; + + /* + * Capabilities that apply to this container + * + * Threads, address spaces, mutex queues, cpu share ... + * Pagers possess these capabilities. + */ + struct capability caps[5] /* threadpool, spacepool, mutexpool, cpupool, mempool */ +}; + +/* The array of containers present on the system */ +extern struct container container[]; + + +struct memdesc { + unsigned long start; + unsigned long end; + unsigned int flags; +}; + +struct cinfo { + char cname[32]; + unsigned long pager_lma; + unsigned long pager_vma; + unsigned long pager_size; + + unsigned long total_memdesc; + struct memdesc memdesc[]; +}; + +#endif /* __CONTAINER_H__ */ diff --git a/src/generic/container.c b/src/generic/container.c new file mode 100644 index 0000000..38f4f83 --- /dev/null +++ b/src/generic/container.c @@ -0,0 +1,11 @@ +/* + * Containers defined for current build. + * + * Copyright (C) 2009 B Labs Ltd. + */ + +struct container container[] = { + .[0] = { 0 }, + }, +}; +