Ignore:
Timestamp:
Nov 3, 2014, 11:03:55 AM (10 years ago)
Author:
alain
Message:

Introducing dynamic allocation of peripheral channels (NIC, TTY, CMA, TIM)
Intoducing a kernel function for all system calls: No more direct call
to the peripheral drivers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/ctx_handler.c

    r428 r440  
    66//////////////////////////////////////////////////////////////////////////////////
    77
     8#include <ctx_handler.h>
    89#include <giet_config.h>
    9 #include <tim_driver.h>
     10#include <utils.h>
     11#include <kernel_utils.h>
    1012#include <xcu_driver.h>
    11 #include <tty_driver.h>
    12 #include <utils.h>
    13 #include <ctx_handler.h>
    14 #include <mapping_info.h>
    15 #include <sys_handler.h>
    1613
     14////////// defined in giet_kernel/switch.s file /////////
    1715extern void _task_switch(unsigned int *, unsigned int *);
    1816
    19 /////////////////////////////////////////////////////////////////////////////////
    20 // This function performs a context switch between the running task
    21 // and  another task, using a round-robin sheduling policy between all
    22 // tasks allocated to a given processor (static allocation).
    23 // It selects the next runable task to resume execution.
    24 // If the only runable task is the current task, return without context switch.
    25 // If there is no runable task, the scheduler switch to the default "idle" task.
    26 /////////////////////////////////////////////////////////////////////////////////
    27 // Implementation note
    28 // The return address contained in $31 is saved in the current task context
    29 // (in the ctx[31] slot), and the function actually returns to the address
    30 // contained in the ctx[31] slot of the next task context.
    31 /////////////////////////////////////////////////////////////////////////////////
     17//////////////////
    3218void _ctx_switch()
    3319{
     
    9884} //end _ctx_switch()
    9985
    100 /////////////////////////////////////////////////////////////////////////////////////
    101 // This function is executed as the"idle" task when no other task can be executed
    102 /////////////////////////////////////////////////////////////////////////////////////
     86/////////////////
    10387void _idle_task()
    10488{
     
    10791    unsigned int x          = cluster_xy >> Y_WIDTH;
    10892    unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
    109     unsigned int lpid       = gpid & ((1<<P_WIDTH)-1);
     93    unsigned int p          = gpid & ((1<<P_WIDTH)-1);
    11094
    11195    while(1)
     
    126110
    127111        // warning message
    128         _printf("\n[GIET WARNING] Processor[%d,%d,%d] still idle at cycle %d\n",
    129                 x, y, lpid, _get_proctime() );
     112        _puts("\n[GIET WARNING] Processor[");
     113        _putd( x );
     114        _puts(",");
     115        _putd( y );
     116        _puts(",");
     117        _putd( p );
     118        _puts("] still idle at cycle ");
     119        _putd( _get_proctime() );
     120        _puts("\n");
    130121    }
    131122} // end ctx_idle()
    132123
    133124
    134 /////////////////////////////////////////////////////////////////////////////////
    135 // The address of this function is used to initialise the return address
    136 // in the "idle" task context.
    137 /////////////////////////////////////////////////////////////////////////////////
     125////////////////
    138126void _ctx_eret()
    139127{
Note: See TracChangeset for help on using the changeset viewer.