#include <asm/cacheflush.h>
#include "jailhouse.h"
+#include <jailhouse/cell-config.h>
#include <jailhouse/header.h>
#include <jailhouse/hypercall.h>
#error 64-bit kernel required!
#endif
+#if JAILHOUSE_CELL_ID_NAMELEN != JAILHOUSE_CELL_NAME_MAXLEN
+# warning JAILHOUSE_CELL_ID_NAMELEN and JAILHOUSE_CELL_NAME_MAXLEN out of sync!
+#endif
+
/* For compatibility with older kernel versions */
#include <linux/version.h>
static int cell_management_prologue(struct jailhouse_cell_id *cell_id,
struct cell **cell_ptr)
{
- cell_id->name[JAILHOUSE_CELL_NAME_MAXLEN] = 0;
+ cell_id->name[JAILHOUSE_CELL_ID_NAMELEN] = 0;
if (mutex_lock_interruptible(&lock) != 0)
return -EINTR;
#include <linux/ioctl.h>
#include <linux/types.h>
-#include <jailhouse/cell-config.h>
+
+#define JAILHOUSE_CELL_ID_NAMELEN 31
struct jailhouse_cell_create {
__u64 config_address;
struct jailhouse_cell_id {
__s32 id;
__u32 padding;
- char name[JAILHOUSE_CELL_NAME_MAXLEN+1];
+ char name[JAILHOUSE_CELL_ID_NAMELEN + 1];
};
struct jailhouse_cell_load {
#define JAILHOUSE_CELL_ID_UNUSED (-1)
-#define JAILHOUSE_ENABLE _IOW(0, 0, struct jailhouse_system)
+#define JAILHOUSE_ENABLE _IOW(0, 0, void *)
#define JAILHOUSE_DISABLE _IO(0, 1)
#define JAILHOUSE_CELL_CREATE _IOW(0, 2, struct jailhouse_cell_create)
#define JAILHOUSE_CELL_LOAD _IOW(0, 3, struct jailhouse_cell_load)
CC = $(CROSS_COMPILE)gcc
-CFLAGS = -g -O3 -I.. -I../hypervisor/include -DLIBEXECDIR=\"$(libexecdir)\" \
+CFLAGS = -g -O3 -I.. -DLIBEXECDIR=\"$(libexecdir)\" \
-Wall -Wmissing-declarations -Wmissing-prototypes
TARGETS := jailhouse
all: $(TARGETS)
-jailhouse: jailhouse.c ../jailhouse.h ../hypervisor/include/jailhouse/cell-config.h
+jailhouse: jailhouse.c ../jailhouse.h
$(CC) $(CFLAGS) -o $@ $<
jailhouse-config-collect: jailhouse-config-create jailhouse-config-collect.tmpl