Skip to content

Commit e7d6cef

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 flexpage mechanism.
1 parent 641cd39 commit e7d6cef

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
@@ -72,6 +75,8 @@ typedef struct tcb {
7275
size_t stack_sz; /* Total size of the stack in bytes */
7376
void (*entry)(void); /* Task's entry point function */
7477

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

0 commit comments

Comments
 (0)