SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /hwcore/mm_context.h (Article 9.5) and /hwcore/mm_context.h (Article 9.5)


001 /* Copyright (C) 2005  David Decotigny            001 /* Copyright (C) 2005  David Decotigny
002                                                   002 
003    This program is free software; you can redi    003    This program is free software; you can redistribute it and/or
004    modify it under the terms of the GNU Genera    004    modify it under the terms of the GNU General Public License
005    as published by the Free Software Foundatio    005    as published by the Free Software Foundation; either version 2
006    of the License, or (at your option) any lat    006    of the License, or (at your option) any later version.
007                                                   007    
008    This program is distributed in the hope tha    008    This program is distributed in the hope that it will be useful,
009    but WITHOUT ANY WARRANTY; without even the     009    but WITHOUT ANY WARRANTY; without even the implied warranty of
010    MERCHANTABILITY or FITNESS FOR A PARTICULAR    010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
011    GNU General Public License for more details    011    GNU General Public License for more details.
012                                                   012    
013    You should have received a copy of the GNU     013    You should have received a copy of the GNU General Public License
014    along with this program; if not, write to t    014    along with this program; if not, write to the Free Software
015    Foundation, Inc., 59 Temple Place - Suite 3    015    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
016    USA.                                           016    USA. 
017 */                                                017 */
018 #ifndef _SOS_MMCTXT_H_                            018 #ifndef _SOS_MMCTXT_H_
019 #define _SOS_MMCTXT_H_                            019 #define _SOS_MMCTXT_H_
020                                                   020 
021                                                   021 
022 /**                                               022 /**
023  * @file mm_context.h                             023  * @file mm_context.h
024  *                                                024  *
025  * Low level API to manage multiple MMU transl    025  * Low level API to manage multiple MMU translation tables. The API
026  * (not its implementation) should be some kin    026  * (not its implementation) should be some kind of
027  * architecture-independent.                      027  * architecture-independent.
028  *                                                028  *
029  * The goal of this API is:                       029  * The goal of this API is:
030  *   - To provide a simple arch-independent AP    030  *   - To provide a simple arch-independent API to change the current
031  *     address space configured in the MMU        031  *     address space configured in the MMU
032  *   - To make sure that ALL the kernel space     032  *   - To make sure that ALL the kernel space mappings are always kept
033  *     IDENTICAL among all the address spaces     033  *     IDENTICAL among all the address spaces in the whole system. That
034  *     way, a virtual address in the kernel sp    034  *     way, a virtual address in the kernel space refers to EXACTLY the
035  *     same physical memory location for all t    035  *     same physical memory location for all the address spaces.
036  */                                               036  */
037                                                   037 
038 #include <sos/types.h>                            038 #include <sos/types.h>
039 #include <sos/errno.h>                            039 #include <sos/errno.h>
040                                                   040 
041                                                   041 
042 /**                                               042 /**
043  * Declaration of an MMU context. Opaque struc    043  * Declaration of an MMU context. Opaque structure defined in
044  * mm_context.c                                   044  * mm_context.c
045  */                                               045  */
046 struct sos_mm_context;                            046 struct sos_mm_context;
047                                                   047 
048                                                   048 
049 /**                                               049 /**
050  * Setup the MMU context management subsystem     050  * Setup the MMU context management subsystem
051  */                                               051  */
052 sos_ret_t sos_mm_context_subsystem_setup(void)    052 sos_ret_t sos_mm_context_subsystem_setup(void);
053                                                   053 
054                                                   054 
055 /**                                               055 /**
056  * Public function to allocate a new MMU conte    056  * Public function to allocate a new MMU context.
057  *                                                057  *
058  * Allocate a new PD, map it into kernel virtu    058  * Allocate a new PD, map it into kernel virtual address space and
059  * initialize its PDE for the Kernel space so     059  * initialize its PDE for the Kernel space so that the Kernel space is
060  * kept identical between ALL the MMU context     060  * kept identical between ALL the MMU context in the system.
061  */                                               061  */
062 struct sos_mm_context * sos_mm_context_create(    062 struct sos_mm_context * sos_mm_context_create(void);
063                                                   063 
064                                                   064 
065 /**                                               065 /**
066  * Public function to create a new MMU context    066  * Public function to create a new MMU context, copy of another one.
067  *                                                067  *
068  * Allocate a new PD, map it into kernel virtu    068  * Allocate a new PD, map it into kernel virtual address space,
069  * initialize its PDE for the Kernel space so     069  * initialize its PDE for the Kernel space so that the Kernel space is
070  * kept identical between ALL the MMU context     070  * kept identical between ALL the MMU context in the system and copy
071  * the PDE/PT of the user space to match that     071  * the PDE/PT of the user space to match that of the model mm_context.
072  */                                               072  */
073 struct sos_mm_context *                           073 struct sos_mm_context *
074 sos_mm_context_duplicate(const struct sos_mm_c    074 sos_mm_context_duplicate(const struct sos_mm_context *model);
075                                                   075 
076                                                   076 
077 /**                                               077 /**
078  * Public function to release the given MMU co    078  * Public function to release the given MMU context (based on
079  * reference counting). Only the virtual page     079  * reference counting). Only the virtual page that maps the PD of the
080  * MMU context is released. All the other user    080  * MMU context is released. All the other user-space pages are
081  * expected to be already released by the pare    081  * expected to be already released by the parent process.
082  */                                               082  */
083 sos_ret_t sos_mm_context_unref(struct sos_mm_c    083 sos_ret_t sos_mm_context_unref(struct sos_mm_context *mmctxt);
084                                                   084 
085                                                   085 
086 /**                                               086 /**
087  * Reconfigure the MMU to use a different MMU     087  * Reconfigure the MMU to use a different MMU context. mmctxt MUST
088  * NOT be NULL.                                   088  * NOT be NULL.
089  */                                               089  */
090 sos_ret_t sos_mm_context_switch_to(struct sos_    090 sos_ret_t sos_mm_context_switch_to(struct sos_mm_context *mmctxt);
091                                                   091 
092                                                   092 
093 /* *******************************************    093 /* ******************************************************
094  * Reserved functions                             094  * Reserved functions
095  */                                               095  */
096                                                   096 
097                                                   097 
098 /**                                               098 /**
099  * Reserved function to increase the reference    099  * Reserved function to increase the reference count of the given MMU
100  * context (based on reference counting).         100  * context (based on reference counting).
101  */                                               101  */
102 sos_ret_t sos_mm_context_ref(struct sos_mm_con    102 sos_ret_t sos_mm_context_ref(struct sos_mm_context *mmctxt);
103                                                   103 
104                                                   104 
105 /**                                               105 /**
106  * Restricted function reserved to paging.c to    106  * Restricted function reserved to paging.c to synchronize all the PDEs
107  * accross all the MMU contexts in the system.    107  * accross all the MMU contexts in the system. This is limited to PDEs
108  * pertaining to the kernel space.                108  * pertaining to the kernel space.
109  */                                               109  */
110 sos_ret_t sos_mm_context_synch_kernel_PDE(unsi    110 sos_ret_t sos_mm_context_synch_kernel_PDE(unsigned int index_in_pd,
111                                           sos_    111                                           sos_ui32_t pde);
112                                                   112 
113 #endif /* _SOS_MMCTXT_H_ */                       113 #endif /* _SOS_MMCTXT_H_ */
                                                      

source navigation ] diff markup ] identifier search ] general search ]