Commit 7a6967b4 authored by Charlie Jacobsen's avatar Charlie Jacobsen

private-types: Adds default types to type system initialization.

Forgot about that.

Also adds source file to build.
parent a44513d8
......@@ -6,6 +6,15 @@
#include <libcap.h>
#include <libcap_internal.h>
#define CAP_TYPE_NUM_BUILTIN CAP_TYPE_FIRST_NON_BUILTIN
static struct cap_type_ops builtin_cap_types[CAP_TYPE_NUM_BUILTIN] = {
{"none", NULL, NULL,},
{"invalid", NULL, NULL},
{"free", NULL, NULL},
{"cnode", NULL, NULL},
};
int cap_type_system_alloc(struct cap_type_system **ts)
{
*ts = cap_zalloc(1, sizeof(**ts));
......@@ -16,6 +25,7 @@ int cap_type_system_alloc(struct cap_type_system **ts)
int cap_type_system_init(struct cap_type_system *ts)
{
int i;
/*
* Zero out types
*
......@@ -24,6 +34,11 @@ int cap_type_system_init(struct cap_type_system *ts)
* type systems.)
*/
memset(ts, 0, sizeof(*ts));
/*
* Install built-in types
*/
for (i = 0; i < CAP_TYPE_NUM_BUILTIN; i++)
ts->types[i] = builtin_cap_types[i];
/*
* Init lock
*/
......
......@@ -17,7 +17,8 @@ AM_CPPFLAGS = \
COMMON_SRCS = \
../../common/cap.c \
../../common/cptr_cache.c
../../common/cptr_cache.c \
../../common/type_system.c
export AM_CPPFLAGS COMMON_SRCS
......
......@@ -11,6 +11,7 @@ SUBDIRS = include src test
USER_SRCS = \
../../common/cap.c \
../../common/cptr_cache.c \
../../common/type_system.c \
src/cap_user.c \
src/cptr_cache_user.c
USER_INCLUDES = -I$(abs_top_srcdir)/src/platform/user/include
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment