Changeset 606 for trunk/kernel/mm/ppm.h


Ignore:
Timestamp:
Dec 3, 2018, 12:20:18 PM (6 years ago)
Author:
alain
Message:

Improve the FAT32 file system to support cat, rm, cp commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/ppm.h

    r567 r606  
    2929#include <list.h>
    3030#include <busylock.h>
    31 #include <queuelock.h>
     31#include <remote_queuelock.h>
    3232#include <boot_info.h>
    3333#include <page.h>
     
    3939 * contains an integer number of pages, defined by the <pages_nr> field in the
    4040 * boot_info structure. It is split in three parts:
     41 *
    4142 * - the "kernel_code" section contains the kernel code, loaded by the boot-loader.
    4243 *   It starts at PPN = 0 and the size is defined by the <pages_offset> field in the
     
    6061 * Another service is to register the dirty pages in a specific dirty_list, that is
    6162 * also rooted in the PPM, in order to be able to save all dirty pages on disk.
    62  * This dirty list is protected by a specific local queuelock.
     63 * This dirty list is protected by a specific remote_queuelock, because it can be
     64 * modified by a remote thread, but it is implemented as a local list, because it
     65 * contains only local pages.
    6366 ****************************************************************************************/
    6467
    6568typedef struct ppm_s
    6669{
    67         busylock_t     free_lock;               /*! lock protecting free_pages[] lists      */
    68         list_entry_t   free_pages_root[CONFIG_PPM_MAX_ORDER];  /*! roots of free lists      */
    69         uint32_t       free_pages_nr[CONFIG_PPM_MAX_ORDER];    /*! numbers of free pages    */
    70         page_t       * pages_tbl;               /*! pointer on page descriptors array       */
    71         uint32_t       pages_nr;                /*! total number of small physical page     */
    72     queuelock_t    dirty_lock;              /*! lock protecting dirty pages list        */
    73     list_entry_t   dirty_root;              /*! root of dirty pages list                */
    74     void         * vaddr_base;              /*! pointer on local physical memory base   */
     70        busylock_t          free_lock;          /*! lock protecting free_pages[] lists      */
     71        list_entry_t        free_pages_root[CONFIG_PPM_MAX_ORDER];  /*! roots of free lists */
     72        uint32_t            free_pages_nr[CONFIG_PPM_MAX_ORDER];    /*! free pages number   */
     73        page_t            * pages_tbl;          /*! pointer on page descriptors array       */
     74        uint32_t            pages_nr;           /*! total number of small physical page     */
     75    remote_queuelock_t  dirty_lock;         /*! lock protecting dirty pages list        */
     76    list_entry_t        dirty_root;         /*! root of dirty pages list                */
     77    void              * vaddr_base;         /*! pointer on local physical memory base   */
    7578}
    7679ppm_t;
     
    135138inline xptr_t ppm_base2page( xptr_t base_xp );
    136139
    137 
    138 
    139140/*****************************************************************************************
    140141 * Get extended pointer on page base from global PPN.
     
    153154inline ppn_t ppm_base2ppn( xptr_t base_xp );
    154155
    155 
    156 
    157156/*****************************************************************************************
    158157 * Get global PPN from extended pointer on page descriptor.
     
    172171
    173172
     173/*********** debug  functions  **********************************************************/
    174174
    175175/*****************************************************************************************
     
    190190
    191191/*****************************************************************************************
    192  * This function registers a physical page as dirty.
     192 * This function registers a page identified by the <page_xp> argument as dirty.
     193 * It can be called by a thread running in any cluster.
    193194 * - it takes the queuelock protecting the PPM dirty_list.
    194195 * - it test the PG_DIRTY flag in the page descriptor.
     
    197198 * - it releases the queuelock protecting the PPM dirty_list.
    198199 *****************************************************************************************
    199  * @ page     : pointer on page descriptor.
     200 * @ page_xp  : extended pointer on page descriptor.
    200201 * @ returns true if page was not dirty / returns false if page was dirty
    201202 ****************************************************************************************/
    202 bool_t ppm_page_do_dirty( page_t * page );
    203 
    204 /*****************************************************************************************
    205  * This function unregisters a physical page as dirty.
     203bool_t ppm_page_do_dirty( xptr_t page_xp );
     204
     205/*****************************************************************************************
     206 * This function unregisters a page identified by the <page_xp> argument as dirty.
     207 * It can be called by a thread running in any cluster.
    206208 * - it takes the queuelock protecting the PPM dirty_list.
    207209 * - it test the PG_DIRTY flag in the page descriptor.
     
    210212 * - it releases the queuelock protecting the PPM dirty_list.
    211213 *****************************************************************************************
    212  * @ page     : pointer on page descriptor.
     214 * @ page_xp  : extended pointer on page descriptor.
    213215 * @ returns true if page was dirty / returns false if page was not dirty
    214216 ****************************************************************************************/
    215 bool_t ppm_page_undo_dirty( page_t * page );
    216 
    217 /*****************************************************************************************
    218  * This function synchronizes (i.e. update the disk) all dirty pages in a cluster.
     217bool_t ppm_page_undo_dirty( xptr_t page_xp );
     218
     219/*****************************************************************************************
     220 * This function synchronizes (i.e. update the IOC device) all dirty pages in a cluster.
    219221 * - it takes the queuelock protecting the PPM dirty_list.
    220222 * - it scans the PPM dirty list, and for each page:
     
    226228 $ The PPM dirty_list is empty when the sync operation completes.
    227229 ****************************************************************************************/
    228 void ppm_sync_all_pages( void );
     230void ppm_sync_dirty_pages( void );
    229231
    230232#endif  /* _PPM_H_ */
Note: See TracChangeset for help on using the changeset viewer.