Commit e6b6572e authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/init: dovetail: add placeholders for core init/cleanup

Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 5604dc66
/*
* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2020 Philippe Gerum <rpm@xenomai.org>
*/
#ifndef _COBALT_KERNEL_DOVETAIL_MACHINE_H
#define _COBALT_KERNEL_DOVETAIL_MACHINE_H
#include <linux/percpu.h>
#ifdef CONFIG_FTRACE
#define boot_lat_trace_notice "[LTRACE]"
#else
#define boot_lat_trace_notice ""
#endif
struct vm_area_struct;
struct cobalt_machine {
const char *name;
int (*init)(void);
int (*late_init)(void);
void (*cleanup)(void);
void (*prefault)(struct vm_area_struct *vma);
const char *const *fault_labels;
};
extern struct cobalt_machine cobalt_machine;
struct cobalt_machine_cpudata {
unsigned int faults[32];
};
DECLARE_PER_CPU(struct cobalt_machine_cpudata, cobalt_machine_cpudata);
struct cobalt_pipeline {
#ifdef CONFIG_SMP
cpumask_t supported_cpus;
#endif
};
int pipeline_init(void);
int pipeline_late_init(void);
void pipeline_cleanup(void);
extern struct cobalt_pipeline cobalt_pipeline;
#endif /* !_COBALT_KERNEL_IPIPE_MACHINE_H */
ccflags-y += -Ikernel
obj-y += pipeline.o
pipeline-y := init.o
/*
* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2020 Philippe Gerum <rpm@xenomai.org>
*/
#include <linux/init.h>
#include <pipeline/machine.h>
#include <cobalt/kernel/clock.h>
#include <cobalt/kernel/assert.h>
int __init pipeline_init(void)
{
int ret;
if (cobalt_machine.init) {
ret = cobalt_machine.init();
if (ret)
return ret;
}
/* Enable the Xenomai out-of-band stage */
TODO();
ret = xnclock_init();
if (ret)
goto fail_clock;
return 0;
fail_clock:
if (cobalt_machine.cleanup)
cobalt_machine.cleanup();
return ret;
}
int __init pipeline_late_init(void)
{
if (cobalt_machine.late_init)
return cobalt_machine.late_init();
return 0;
}
__init void pipeline_cleanup(void)
{
/* Disable the Xenomai stage */
TODO();
xnclock_cleanup();
}
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