Ignore:
Timestamp:
Feb 12, 2013, 6:33:31 PM (11 years ago)
Author:
meunier
Message:

Added support for memspaces and const.
Added an interrupt masking to the "giet_context_switch" syscall
Corrected two bugs in boot/boot_init.c (one minor and one regarding barriers initialization)
Reformatted the code in all files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/vm_handler.h

    r195 r228  
    66///////////////////////////////////////////////////////////////////////////////////
    77
    8 #ifndef     _VM_HANDLER_H_
    9 #define     _VM_HANDLER_H_
     8#ifndef _VM_HANDLER_H_
     9#define _VM_HANDLER_H_
    1010
    11 #include    <giet_config.h>
    12 #include    <mapping_info.h>
     11#include <giet_config.h>
     12#include <mapping_info.h>
    1313
    1414/////////////////////////////////////////////////////////////////////////////////////
     
    1616/////////////////////////////////////////////////////////////////////////////////////
    1717
    18 #define     PT1_SIZE    8192
    19 #define     PT2_SIZE    4096
     18#define PT1_SIZE    8192
     19#define PT2_SIZE    4096
    2020
    2121/////////////////////////////////////////////////////////////////////////////////////
     
    2323/////////////////////////////////////////////////////////////////////////////////////
    2424
    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
     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
    3535
    3636/////////////////////////////////////////////////////////////////////////////////////
     
    3838/////////////////////////////////////////////////////////////////////////////////////
    3939
    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
     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
    4949
    5050/////////////////////////////////////////////////////////////////////////////////////
    5151// Page table structure definition
    5252/////////////////////////////////////////////////////////////////////////////////////
    53 typedef struct PageTable
    54 {
    55         unsigned int    pt1[PT1_SIZE/4];                    // PT1 (index is ix1)
    56         unsigned int    pt2[1][PT2_SIZE/4];                 // PT2s (index is 2*ix2)
     53typedef struct PageTable {
     54    unsigned int pt1[PT1_SIZE / 4];    // PT1 (index is ix1)
     55    unsigned int pt2[1][PT2_SIZE / 4]; // PT2s (index is 2*ix2)
    5756} page_table_t;
    5857
     
    6867////////////////////////////////////////////////////////////////////////////////////
    6968
    70 void _iommu_add_pte2( unsigned int      ix1,
    71                       unsigned int      ix2,
    72                       unsigned int      ppn,
    73                       unsigned int      flags );
    74 
    75 void _iommu_inval_pte2( unsigned int    ix1,
    76                         unsigned int    ix2 );
    77 
    78 unsigned int _v2p_translate( page_table_t*      pt,
    79                              unsigned int       vpn,
    80                              unsigned int*      ppn,   
    81                              unsigned int*      flags );
     69void _iommu_add_pte2(unsigned int ix1, unsigned int ix2, unsigned int ppn, unsigned int flags);
     70void _iommu_inval_pte2(unsigned int ix1, unsigned int ix2);
     71unsigned int _v2p_translate(page_table_t * pt, unsigned int vpn, unsigned int * ppn, unsigned int * flags);
    8272
    8373#endif
     
    8979// indent-tabs-mode: nil
    9080// End:
     81// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
    9182
    92 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
Note: See TracChangeset for help on using the changeset viewer.