Code that compiles until initialization of containers and pagers.

This commit is contained in:
Bahadir Balban
2009-08-02 23:43:14 +03:00
parent 82807c2f0a
commit 7e8845abf8
29 changed files with 1012 additions and 700 deletions

View File

@@ -1,10 +1,18 @@
/*
* Description of resources on the system
*
* Copyright (C) 2009 Bahadir Balban
*/
#ifndef __RESOURCES_H__
#define __RESOURCES_H__
/* Number of containers defined at compile-time */
#define TOTAL_CONTAINERS 1
#define CONFIG_TOTAL_CONTAINERS 1
#include <l4/generic/capability.h>
#include <l4/lib/idpool.h>
#include INC_SUBARCH(mm.h)
struct boot_resources {
int nconts;
@@ -21,8 +29,30 @@ struct boot_resources {
int nkmemcaps;
};
/* List of containers */
struct container_head {
int ncont;
struct link list;
};
/*
* Everything on the platform is described and stored
* in the structure below.
*/
struct kernel_container {
l4id_t cid;
/* System id pools */
struct id_pool space_ids;
struct id_pool ktcb_ids;
struct id_pool resource_ids;
struct id_pool container_ids;
struct id_pool mutex_ids;
struct id_pool capability_ids;
/* List of all containers */
struct container_head containers;
/* Physical memory caps, used/unused */
struct cap_list physmem_used;
struct cap_list physmem_free;
@@ -38,7 +68,7 @@ struct kernel_container {
struct mem_cache *pgd_cache;
struct mem_cache *pmd_cache;
struct mem_cache *ktcb_cache;
struct mem_cache *address_space_cache;
struct mem_cache *space_cache;
struct mem_cache *mutex_cache;
struct mem_cache *cap_cache;
struct mem_cache *cont_cache;
@@ -46,6 +76,22 @@ struct kernel_container {
extern struct kernel_container kernel_container;
void free_pgd(void *addr);
void free_pmd(void *addr);
void free_space(void *addr);
void free_ktcb(void *addr);
void free_capability(void *addr);
void free_container(void *addr);
void free_user_mutex(void *addr);
pgd_table_t *alloc_pgd(void);
pmd_table_t *alloc_pmd(void);
struct address_space *alloc_space(void);
struct ktcb *alloc_ktcb(void);
struct capability *alloc_capability(void);
struct container *alloc_container(void);
struct mutex_queue *alloc_user_mutex(void);
int init_system_resources(struct kernel_container *kcont);
#endif /* __RESOURCES_H__ */