This module implements function relative to task migration. This module is used by slave kernel.
More...
#include "task_migration.h"
#include "../../include/kernel_pkg.h"
#include "../include/services.h"
#include "../include/plasma.h"
#include "task_location.h"
#include "local_scheduler.h"
#include "communication.h"
#include "utils.h"
|
void | send_task_migrated (int migrated_task, int old_proc, unsigned int master_address) |
|
void | migrate_dynamic_memory (TCB *tcb_aux) |
|
void | migrate_CODE (TCB *tcb_migration) |
|
void | handle_migration_code (volatile ServiceHeader *p, TCB *migrate_tcb) |
|
void | handle_migration_TCB (volatile ServiceHeader *p, TCB *migrate_tcb) |
|
void | handle_migration_task_location (volatile ServiceHeader *p, TCB *migrate_tcb) |
|
void | handle_migration_request_msg (volatile ServiceHeader *p, TCB *migrate_tcb) |
|
void | handle_migration_stack (volatile ServiceHeader *p, TCB *migrate_tcb) |
|
void | handle_migration_DATA_BSS (volatile ServiceHeader *p, TCB *migrate_tcb, unsigned int master_address) |
|
int | handle_task_migration (volatile ServiceHeader *p, TCB *tcb_ptr) |
|
int | handle_migration (volatile ServiceHeader *p, unsigned int master_address) |
|
This module implements function relative to task migration. This module is used by slave kernel.
HEMPS VERSION - 8.0 - support for RT applications
Distribution: June 2016
Created by: Marcelo Ruaro - contact: marce.nosp@m.lo.r.nosp@m.uaro@.nosp@m.acad.nosp@m..pucr.nosp@m.s.br
Research group: GAPH-PUCRS - contact: ferna.nosp@m.ndo..nosp@m.morae.nosp@m.s@pu.nosp@m.crs.b.nosp@m.r
int handle_migration |
( |
volatile ServiceHeader * |
p, |
|
|
unsigned int |
master_address |
|
) |
| |
Handles all task migration packets, calling the appropriated sub-function.
- Parameters
-
p | ServiceHeader pointer of the packet a generic task migration packet |
master_address | Address of the kernel master of the slave processor |
- Returns
- The necessity of call the scheduler, 1 - need scheduler, 0 not need scheduler
Handle the migration code, coping the code to a free page. It is called by the target processor (the new processor)
- Parameters
-
p | ServiceHeader pointer of the packet with the task code |
migrate_tcb | The TCB pointer of the task to be migrated |
void handle_migration_DATA_BSS |
( |
volatile ServiceHeader * |
p, |
|
|
TCB * |
migrate_tcb, |
|
|
unsigned int |
master_address |
|
) |
| |
Handles the migration of the task DATA and BSS data sections It is called by the target processor (the new processor)
- Parameters
-
p | ServiceHeader pointer of the packet with the task DATA and BSS data sections |
migrate_tcb | The TCB pointer of the task to be migrated |
void handle_migration_request_msg |
( |
volatile ServiceHeader * |
p, |
|
|
TCB * |
migrate_tcb |
|
) |
| |
Handles the migration of the task message request data It is called by the target processor (the new processor)
- Parameters
-
p | ServiceHeader pointer of the packet with the message request data |
migrate_tcb | The TCB pointer of the task to be migrated |
Handles the migration of the task stack data It is called by the target processor (the new processor)
- Parameters
-
p | ServiceHeader pointer of the packet with the task stack data |
migrate_tcb | The TCB pointer of the task to be migrated |
void handle_migration_task_location |
( |
volatile ServiceHeader * |
p, |
|
|
TCB * |
migrate_tcb |
|
) |
| |
Handles the migration of the task task location data It is called by the target processor (the new processor)
- Parameters
-
p | ServiceHeader pointer of the packet with the task location data |
migrate_tcb | The TCB pointer of the task to be migrated |
Handles the migration of the task TCB information It is called by the target processor (the new processor)
- Parameters
-
p | ServiceHeader pointer of the packet with the TCB data |
migrate_tcb | The TCB pointer of the task to be migrated |
Handles a task migration order from the kernel master This function is called by the source processor (the old processor)
- Parameters
-
p | ServiceHeader pointer of the packet with task migration order |
tcb_ptr | TCB pointer of the task to be migrated |
void migrate_CODE |
( |
TCB * |
tcb_migration | ) |
|
Migrate the code data to the new processor. It is called by the source processor (the older processor) The code is static because corresponds the the task instructions loaded when the task is allocated in a given processor
- Parameters
-
tcb_migration | The TCB pointer of the task to be migrated |
void migrate_dynamic_memory |
( |
TCB * |
tcb_aux | ) |
|
This function os the core of task migration. It is called by the source processor (the older processor) Its job is to migrate to the new processor the dynamic data section that can change during task execution.
- Parameters
-
tcb_aux | The TCB pointer of the task to be migrated |
void send_task_migrated |
( |
int |
migrated_task, |
|
|
int |
old_proc, |
|
|
unsigned int |
master_address |
|
) |
| |
Assembles and sends a TASK_MIGRATED packet to the master kernel
- Parameters
-
migrated_task | Migrated task ID |
old_proc | Old processor address of task |
master_address | Master address of the task |