00001 /****************************************************************************** 00002 * \file loader/server/src/kquota.h 00003 * \brief kernel memory quotas 00004 * 00005 * \date 08-2007 00006 * \author Bjoern Doebel <doebel@os.inf.tu-dresden.de> 00007 * 00008 * (c) 2007 Technische Universitaet Dresden 00009 * This file is part of DROPS, which is distributed under the terms of the 00010 * GNU General Public License 2. Please see the COPYING file for details. 00011 *****************************************************************************/ 00012 00013 #ifndef __LOADER_SERVER_SRC_KQUOTA_H__ 00014 #define __LOADER_SERVER_SRC_KQUOTA_H__ 00015 00016 #include <l4/sys/types.h> 00017 00018 #define KQUOTA_NAME_LENGTH 20 00019 00021 typedef struct kquota_user 00022 { 00023 l4_threadid_t tid; 00024 struct kquota_user *next; 00025 } kquota_user_t; 00026 00028 typedef struct cfg_kquota_t 00029 { 00030 char name[KQUOTA_NAME_LENGTH]; 00031 unsigned size; 00033 kquota_user_t *users; 00034 struct cfg_kquota_t *next; 00035 } cfg_kquota_t; 00036 00038 extern cfg_kquota_t *kquota_list; 00039 00048 int add_kquota(char *name, unsigned size); 00049 00056 cfg_kquota_t *get_kquota(const char *name); 00057 00063 int kquota_add_user(cfg_kquota_t *kq, l4_threadid_t user); 00064 00068 void kquota_del_user(cfg_kquota_t *kq, l4_threadid_t user); 00069 00070 #endif /* ! __LOADER_SERVER_SRC_KQUOTA_H__ */