source: soft/giet_vm/sys/ctx_handler.h @ 231

Last change on this file since 231 was 231, checked in by joannou, 11 years ago
  • Bugfix in Interruption mechanism :
    • _it_mask() and _it_restore() functions now share a global array indexed by the proc_id (used a simple global variable before => problem with multiproc)
    • added 2 new fuctions _it_enable() and _it_disable() that only affect the IE bit of the status register in COP0
    • replaced interrupt masking/restoring arround _ctx_switch() in sys_handler by a simple interrupt disabling before the call to _ctx_switch (restoring after a _ctx_switch wouldn't restore the correct task's status register)
    • replaced the use of _ctx_switch in _exit() by a call to _context_switch() (this function actually does the interrupt disabling)
  • Added some comments in the ctx_handler.h
  • Added the delay reset in the idle task (ctx_handler.c)
  • Added a new irq type (PTI)
    • Modifications in xml_parser.c to accept PTI irq type (now used in xml mappings)
    • Added the test on the irq type in the _irq_demux() function. This leads to a different argument passed to the ISR (i.e. either channel_id or irq_id (aka icuid) )
File size: 2.0 KB
Line 
1#ifndef _CTX_HANDLER_H
2#define _CTX_HANDLER_H
3
4#include <giet_config.h>
5
6/////////////////////////////////////////////////////////////////////////////////
7//      Definition of the scheduler structure
8/////////////////////////////////////////////////////////////////////////////////
9
10typedef struct static_scheduler_s
11{
12    unsigned int        context[15][64];                // at most 15 task contexts
13    unsigned int        tasks;                                  // actual number of tasks
14    unsigned int        current;                                // current task index
15    unsigned int        interrupt_vector[32];   // interrupt vector
16} static_scheduler_t;
17
18
19/////////////////////////////////////////////////////////////////////////////////
20//  "idle" task index definition
21/////////////////////////////////////////////////////////////////////////////////
22
23#define IDLE_TASK_INDEX         14
24
25/////////////////////////////////////////////////////////////////////////////////
26//      Definition of the task context slots indexes
27/////////////////////////////////////////////////////////////////////////////////
28
29#define CTX_SP_ID               29
30#define CTX_RA_ID               31
31
32#define CTX_EPC_ID              32
33#define CTX_CR_ID               33
34#define CTX_SR_ID               34
35#define CTX_BVAR_ID             35
36
37#define CTX_PTPR_ID             39
38
39#define CTX_TTY_ID              40  // Integer : global TTY terminal index
40#define CTX_DMA_ID          41  // Integer : global DMA channel index
41#define CTX_NIC_ID          42  // Integer : global NIC channel index
42#define CTX_TIMER_ID    43  // Integer : user level timer index / UNUSED
43#define CTX_PTAB_ID             44  // Pointer : page table virtual base adress
44#define CTX_LTID_ID             45  // Integer : local task index (in scheduler) / UNUSED
45#define CTX_VSID_ID             46  // Integer : vspace index
46#define CTX_RUN_ID              47  // Boolean : task runable
47
48//////////////////////////////////////////////////////////////////////////////////
49//      Prototype of the context switch function
50//////////////////////////////////////////////////////////////////////////////////
51
52extern void _ctx_switch();
53extern void _ctx_eret();
54extern void _ctx_idle();
55
56extern static_scheduler_t _scheduler[];
57
58#endif
Note: See TracBrowser for help on using the repository browser.