Skip to content

Commit d2552a5

Browse files
committed
Link tasks to address spaces
Extends TCB with an address 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 98d5b9d commit d2552a5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/sys/task.h

Lines changed: 6 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 as;
64+
6265
/* Task Control Block (TCB)
6366
*
6467
* Contains all essential information about a single task, including saved
@@ -71,6 +74,9 @@ 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 as *as_ptr; /* Address space for memory isolation */
79+
7480
/* Scheduling Parameters */
7581
uint16_t prio; /* Encoded priority (base and time slice counter) */
7682
uint8_t prio_level; /* Priority level (0-7, 0 = highest) */

0 commit comments

Comments
 (0)