From c8cec856c6988a864b5747338c5874abfee33cd1 Mon Sep 17 00:00:00 2001 From: Jakub Jermar Date: Wed, 16 Aug 2017 22:32:16 +0200 Subject: [PATCH] Introduce kernel objects --- kernel/generic/include/kobject/kobject.h | 56 ++++++++++++++++++++++++++++++++ kernel/generic/include/proc/task.h | 4 +++ 2 files changed, 60 insertions(+) create mode 100644 kernel/generic/include/kobject/kobject.h diff --git a/kernel/generic/include/kobject/kobject.h b/kernel/generic/include/kobject/kobject.h new file mode 100644 index 000000000..99a7c85b0 --- /dev/null +++ b/kernel/generic/include/kobject/kobject.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017 Jakub Jermar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** @addtogroup generic + * @{ + */ +/** @file + */ + +#ifndef KERN_KOBJECT_H_ +#define KERN_KOBJECT_H_ + +#include + +#define MAX_KERNEL_OBJECTS 64 + +typedef enum { + KOBJECT_TYPE_INVALID +} kobject_type_t; + +typedef struct { + kobject_type_t type; + union { + }; +} kobject_t; + + +#endif + +/** @} + */ diff --git a/kernel/generic/include/proc/task.h b/kernel/generic/include/proc/task.h index 9413e95a4..9507f0154 100644 --- a/kernel/generic/include/proc/task.h +++ b/kernel/generic/include/proc/task.h @@ -36,6 +36,7 @@ #define KERN_TASK_H_ #include +#include #include #include #include @@ -94,6 +95,9 @@ typedef struct task { /** Task permissions. */ perm_t perms; + + /** Sending communication endpoints */ + kobject_t kobject[MAX_KERNEL_OBJECTS]; /* IPC stuff */ -- 2.11.4.GIT