Skip to content

Commit 319ba96

Browse files
committed
Link tasks to memory spaces
Extends TCB with a memory space pointer to enable per-task memory isolation. Each task can now reference its own memory protection domain through the flex page mechanism.
1 parent f7ae03b commit 319ba96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/sys/task.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ enum task_states {
5959
#define TASK_TIMESLICE_LOW 10 /* Low priority: longer slice */
6060
#define TASK_TIMESLICE_IDLE 15 /* Idle tasks: longest slice */
6161

62+
/* Forward declaration */
63+
struct memspace;
64+
6265
/* Task Control Block (TCB)
6366
*
6467
* Contains all essential information about a single task, including saved
@@ -71,6 +74,8 @@ typedef struct tcb {
7174
size_t stack_sz; /* Total size of the stack in bytes */
7275
void (*entry)(void); /* Task's entry point function */
7376

77+
/* Memory Protection */
78+
struct memspace *mspace; /* Memory space for task isolation */
7479
/* Scheduling Parameters */
7580
uint16_t prio; /* Encoded priority (base and time slice counter) */
7681
uint8_t prio_level; /* Priority level (0-7, 0 = highest) */

0 commit comments

Comments
 (0)