Ignore:
Timestamp:
Jan 2, 2016, 4:57:40 PM (8 years ago)
Author:
alain
Message:

Introduce the _v2p_add_pte1(), _v2p_add_pte2(), _v2p_del_pte1(), _v2p_del_pte2() functions
to support dynamic mapping / unmapping associated to the giet_fat_mmap() and giet_fat_munmap() system calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_common/vmem.h

    r534 r751  
    8585                                   unsigned int* flags );
    8686
     87//////////////////////////////////////////////////////////////////////////////
     88// This function registers a new PTE1 in the page table defined
     89// by the <vspace_id> argument, and the <x,y> coordinates.
     90// It updates only the first level PT1.
     91// This function checks that the PT1 entry is not already mapped,
     92// to enforce the rule: only one vseg in a given BPP.
     93// The 4 vsegs used by the boot code being packed in one single BPP,
     94// this verif is not done for all identity mapping vsegs.
     95//////////////////////////////////////////////////////////////////////////////
     96void _v2p_add_pte1( unsigned int vspace_id,   // vspace index
     97                    unsigned int x,           // cluster X coordinate
     98                    unsigned int y,           // cluster Y coordinate
     99                    unsigned int vpn,         // 20 bits right-justified
     100                    unsigned int flags,       // 10 bits left-justified
     101                    unsigned int ppn,         // 28 bits right-justified
     102                    unsigned int ident );     // identity mapping if non zero
     103
     104//////////////////////////////////////////////////////////////////////////////
     105// This function registers a new PTE2 in the page table defined
     106// by the <vspace_id> argument, and the (x,y) coordinates.
     107// It updates both the first level PT1 and the second level PT2.
     108// As the set of PT2s is implemented as a fixed size array (no dynamic
     109// allocation), this function checks a possible overflow of the PT2 array.
     110// As a given entry in PT1 can be shared by several vsegs, mapped by
     111// different processors, we need to take the lock protecting PTAB[v][x][y].
     112//////////////////////////////////////////////////////////////////////////////
     113void _v2p_add_pte2( unsigned int vspace_id,   // vspace index
     114                    unsigned int x,           // cluster X coordinate
     115                    unsigned int y,           // cluster Y coordinate
     116                    unsigned int vpn,         // 20 bits right-justified
     117                    unsigned int flags,       // 10 bits left-justified
     118                    unsigned int ppn,         // 28 bits right-justified
     119                    unsigned int ident );     // identity mapping if non zero
     120
     121//////////////////////////////////////////////////////////////////////////////
     122// This function invalidate a PTE1 entry in the page table identified by the
     123// <vspace_id> argument and the <x,y> coordinates. The PTE1 entry is
     124// defined by the <vpn> virtual page number.
     125//////////////////////////////////////////////////////////////////////////////
     126void _v2p_del_pte1( unsigned int vspace_id,   // vspace index
     127                    unsigned int x,           // cluster X coordinate
     128                    unsigned int y,           // cluster Y coordinate
     129                    unsigned int vpn );       // 20 bits right-justified
     130
     131//////////////////////////////////////////////////////////////////////////////
     132// This function invalidate a PTE2 entry in the page table identified by the
     133// <vspace_id> argument and the <x,y> coordinates. The PTE2 entry is
     134// defined by the <vpn> virtual page number. The PT1 used to access the PTE2
     135// juis not modified.
     136//////////////////////////////////////////////////////////////////////////////
     137void _v2p_del_pte2( unsigned int vspace_id,   // vspace index
     138                    unsigned int x,           // cluster X coordinate
     139                    unsigned int y,           // cluster Y coordinate
     140                    unsigned int vpn );       // 20 bits right-justified
     141
     142
    87143#endif
    88144
Note: See TracChangeset for help on using the changeset viewer.