kernel: add c++ support

This commit is contained in:
2023-03-20 20:41:39 +00:00
parent a4d850cc03
commit 2bfb6bcd78
41 changed files with 333 additions and 38 deletions

View File

@@ -11,6 +11,10 @@
#define TASK_NAME_MAX 64
#define PRIO_MAX 32
#ifdef __cplusplus
extern "C" {
#endif
typedef enum task_state {
TASK_RUNNING,
TASK_STOPPED,
@@ -73,7 +77,7 @@ extern kern_status_t sched_init(void);
extern void runqueue_init(runqueue_t *rq);
extern task_t *task_alloc(void);
static inline task_t *task_ref(task_t *task) { return object_data(object_ref(object_header(task))); }
static inline task_t *task_ref(task_t *task) { return (task_t *)object_data(object_ref(object_header(task))); }
static inline void task_deref(task_t *task) { object_deref(object_header(task)); }
extern task_t *task_from_pid(unsigned int pid);
extern task_t *kernel_task(void);
@@ -90,4 +94,8 @@ static inline void task_unlock_irqrestore(task_t *task, unsigned long flags)
extern thread_t *thread_alloc(void);
#ifdef __cplusplus
}
#endif
#endif