mruby/c VM Source Code master (2026/08/06)
Loading...
Searching...
No Matches
rrt0.h File Reference

Realtime multitask monitor for mruby/c. More...

#include "vm.h"
Include dependency graph for rrt0.h:

Go to the source code of this file.

Data Structures

struct  RTcb
 Task control block. More...
struct  RMutex
 Mutex. More...

Macros

#define MRBC_WAIT_FOREVER   UINT32_MAX
#define MRBC_TASK_NAME_LEN   15
#define MRBC_MUTEX_INITIALIZER   { 0 }

Typedefs

typedef struct RTcb mrbc_tcb
 Task control block.
typedef struct RMutex mrbc_mutex
 Mutex.

Enumerations

enum  MrbcTaskState {
  TASKSTATE_DORMANT = 0x00 , TASKSTATE_READY = 0x02 , TASKSTATE_RUNNING = 0x03 , TASKSTATE_WAITING = 0x04 ,
  TASKSTATE_SUSPENDED = 0x08
}
 Task state. More...
enum  MrbcTaskReason { TASKREASON_SLEEP = 0x01 , TASKREASON_MUTEX = 0x02 , TASKREASON_JOIN = 0x04 , TASKREASON_QUEUE = 0x08 }

Functions

static mrbc_tcbmrbc_get_tcb (const mrbc_vm *vm)

Variables

static const int MRBC_TASK_DEFAULT_PRIORITY = 128
static const int MRBC_TASK_DEFAULT_STATE = TASKSTATE_READY

Detailed Description

Realtime multitask monitor for mruby/c.

Copyright (C) 2015-      Kyushu Institute of Technology.
Copyright (C) 2015-2026  Shimane IT Open-Innovation Center.
Copyright (C) 2026-      Shimane Institute for Industrial Technology.

This file is distributed under BSD 3-Clause License.

Definition in file rrt0.h.

Macro Definition Documentation

◆ MRBC_MUTEX_INITIALIZER

#define MRBC_MUTEX_INITIALIZER   { 0 }

Definition at line 119 of file rrt0.h.

◆ MRBC_TASK_NAME_LEN

#define MRBC_TASK_NAME_LEN   15

Definition at line 69 of file rrt0.h.

◆ MRBC_WAIT_FOREVER

#define MRBC_WAIT_FOREVER   UINT32_MAX

Definition at line 66 of file rrt0.h.

Typedef Documentation

◆ mrbc_mutex

typedef struct RMutex mrbc_mutex

Mutex.

◆ mrbc_tcb

typedef struct RTcb mrbc_tcb

Task control block.

Enumeration Type Documentation

◆ MrbcTaskReason

Enumerator
TASKREASON_SLEEP 
TASKREASON_MUTEX 
TASKREASON_JOIN 
TASKREASON_QUEUE 

Definition at line 53 of file rrt0.h.

◆ MrbcTaskState

Task state.

(Bit mapped) 0 0 0 0 0 0 0 0 ^ Running ^ Ready ^ Waiting ^ Suspended

Enumerator
TASKSTATE_DORMANT 

Domant.

TASKSTATE_READY 

Ready.

TASKSTATE_RUNNING 

Running.

TASKSTATE_WAITING 

Waiting.

TASKSTATE_SUSPENDED 

Suspended.

Definition at line 45 of file rrt0.h.

Function Documentation

◆ mrbc_get_tcb()

mrbc_tcb * mrbc_get_tcb ( const mrbc_vm * vm)
inlinestatic

get TCB from VM pointer

Parameters
vmPointer to mrbc_vm
Returns
Pointer to mrbc_tcb

Definition at line 179 of file rrt0.h.

Here is the caller graph for this function:

Variable Documentation

◆ MRBC_TASK_DEFAULT_PRIORITY

const int MRBC_TASK_DEFAULT_PRIORITY = 128
static

Definition at line 60 of file rrt0.h.

◆ MRBC_TASK_DEFAULT_STATE

const int MRBC_TASK_DEFAULT_STATE = TASKSTATE_READY
static

Definition at line 61 of file rrt0.h.