source: soft/giet_vm/boot/boot_handler.h @ 169

Last change on this file since 169 was 169, checked in by alain, 12 years ago

Introducing support for FBDMA (Frame Buffer using DMA)

File size: 3.8 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : boot_handler.h
3// Date     : 01/04/2012
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#include <giet_config.h>
9#include <mapping_info.h>
10
11#ifndef     _BOOT_HANDLER_H_
12#define     _BOOT_HANDLER_H_
13
14/////////////////////////////////////////////////////////////////////////////////////
15// Page Table sizes definition
16/////////////////////////////////////////////////////////////////////////////////////
17
18#define     PT1_SIZE    8192
19#define     PT2_SIZE    4096
20
21/////////////////////////////////////////////////////////////////////////////////////
22// PTE flags masks definition
23/////////////////////////////////////////////////////////////////////////////////////
24
25#define     PTE_V       0x80000000
26#define     PTE_T       0x40000000
27#define     PTE_L       0x20000000
28#define     PTE_R       0x10000000
29#define     PTE_C       0x08000000
30#define     PTE_W       0x04000000
31#define     PTE_X       0x02000000
32#define     PTE_U       0x01000000
33#define     PTE_G       0x00800000
34#define     PTE_D       0x00400000
35
36/////////////////////////////////////////////////////////////////////////////////////
37// MMU error codes definition
38/////////////////////////////////////////////////////////////////////////////////////
39
40#define MMU_ERR_PT1_UNMAPPED         0x001      // Page fault on Table1 (invalid PTE)
41#define MMU_ERR_PT2_UNMAPPED         0x002      // Page fault on Table 2 (invalid PTE)
42#define MMU_ERR_PRIVILEGE_VIOLATION  0x004      // Protected access in user mode
43#define MMU_ERR_WRITE_VIOLATION      0x008      // Write access to a non write page
44#define MMU_ERR_EXEC_VIOLATION       0x010      // Exec access to a non exec page
45#define MMU_ERR_UNDEFINED_XTN        0x020      // Undefined external access address
46#define MMU_ERR_PT1_ILLEGAL_ACCESS   0x040      // Bus Error in Table1 access
47#define MMU_ERR_PT2_ILLEGAL_ACCESS   0x080      // Bus Error in Table2 access
48#define MMU_ERR_CACHE_ILLEGAL_ACCESS 0x100      // Bus Error during the cache access
49
50/////////////////////////////////////////////////////////////////////////////////////
51// Page table structure definition
52/////////////////////////////////////////////////////////////////////////////////////
53typedef struct PageTable
54{
55        unsigned int    pt1[PT1_SIZE];                    // PT1 (index is ix1)
56        unsigned int    pt2[GIET_NB_PT2_MAX][PT2_SIZE];   // PT2s (index is 2*ix2)
57} page_table_t;
58
59/////////////////////////////////////////////////////////////////////////////////
60//      Definition of the scheduler structure
61/////////////////////////////////////////////////////////////////////////////////
62
63typedef struct scheduler_s
64{
65    unsigned int        context[GIET_NB_TASKS_MAX][64];   // task contexts
66    unsigned int        tasks;                                        // actual number of tasks
67    unsigned int        current;                                      // current task index
68} scheduler_t;
69
70///////////////////////////////////////////////////////////////////////////////////
71// For retrieving base addresses defined in seg.ld file.
72///////////////////////////////////////////////////////////////////////////////////
73
74typedef struct _ld_symbol_s _ld_symbol_t;
75
76extern _ld_symbol_t seg_icu_base;
77extern _ld_symbol_t seg_timer_base;
78extern _ld_symbol_t seg_tty_base;
79extern _ld_symbol_t seg_gcd_base;
80extern _ld_symbol_t seg_dma_base;
81extern _ld_symbol_t seg_fb_base;
82extern _ld_symbol_t seg_ioc_base;
83extern _ld_symbol_t seg_mapping_base;
84extern _ld_symbol_t seg_kernel_pt_base;
85
86///////////////////////////////////////////////////////////////////////////////////
87typedef void (*_isr_func_t)(void);
88
89#endif
90
91// Local Variables:
92// tab-width: 4
93// c-basic-offset: 4
94// c-file-offsets:((innamespace . 0)(inline-open . 0))
95// indent-tabs-mode: nil
96// End:
97
98// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
Note: See TracBrowser for help on using the repository browser.