Syllable Internal Functions: Areas


Functions

void list_areas (MemContext_s *psCtx)
 Prints all areas in the specified memory context to the debug console.
void empty_mem_context (MemContext_s *psCtx)
 Deletes all areas in the specified memory context.
void delete_mem_context (MemContext_s *psCtx)
 Deletes the specified memory context and all of its areas.
status_t clone_page_pte (pte_t *pDst, pte_t *pSrc, bool bCow)
 Copies a page-table entry, optionally setting up copy-on-write semantics.
MemContext_s * clone_mem_context (MemContext_s *psOrig)
 Clones the specified memory context.
status_t map_area_to_file (area_id hArea, File_s *psFile, flags_t nProtection __attribute__((unused)), off_t nOffset, size_t nSize)
 Maps the specified area onto a file.
area_id clone_from_inactive_ctx (MemArea_s *psArea, uintptr_t nOffset, size_t nLength)
 clone_from_inactive_ctx() and update_inactive_ctx() are used to access an inactive address space / memory context (the associated process is not currently running, page directory is not loaded into CR3).
status_t update_inactive_ctx (MemArea_s *psOriginalArea, area_id hCloneArea, uintptr_t nOffset)
 
See also:
clone_from_inactive_ctx()

void init_kernel_mem_context ()
 Creates the memory context for the kernel.
void init_areas (void)
 Initializes the area manager.

Function Documentation

area_id clone_from_inactive_ctx ( MemArea_s *  psArea,
uintptr_t  nOffset,
size_t  nLength 
)

clone_from_inactive_ctx() and update_inactive_ctx() are used to access an inactive address space / memory context (the associated process is not currently running, page directory is not loaded into CR3).

clone_from_inactive_ctx() will create in kernel space a clone of (a part of) the specified area. If you have written to the cloned area, call update_inactive_ctx() to make sure that pages allocated by the copy-on-write mechanism are transfered to the originating memory context.

For internal use only.

Parameters:
psArea a pointer to the area to clone.
nOffset 
nLength specifies, together with nOffset, which part of the area is to be cloned. Both nOffset and nLength are expected to be page aligned.
Author:
Jan Hauffa ([email protected])

MemContext_s* clone_mem_context ( MemContext_s *  psOrig  ) 

Clones the specified memory context.

For internal use only.

Parameters:
psOrig a pointer to the memory context to clone.
Returns:
a pointer to the new memory context.
Author:
Kurt Skauen ([email protected])

status_t clone_page_pte ( pte_t *  pDst,
pte_t *  pSrc,
bool  bCow 
) [inline]

Copies a page-table entry, optionally setting up copy-on-write semantics.

For internal use only.

Parameters:
pDst a pointer to the destination page-table entry.
pSrc a pointer to the source page-table entry.
bCow true if the new virtual page should be set up for copy-on-write semantics; false to share the physical page.
Returns:
Always returns 0.
Author:
Kurt Skauen ([email protected])

void delete_mem_context ( MemContext_s *  psCtx  ) 

Deletes the specified memory context and all of its areas.

For internal use only.

Parameters:
psCtx a pointer to the MemContext_s to delete.
See also:
delete_all_areas(), free_pages()
Author:
Kurt Skauen ([email protected])

void empty_mem_context ( MemContext_s *  psCtx  ) 

Deletes all areas in the specified memory context.

For internal use only.

Parameters:
psCtx a pointer to the MemContext_s containing areas to delete.
See also:
delete_all_areas()
Author:
Kurt Skauen ([email protected])

void init_areas ( void   ) 

Initializes the area manager.

For internal use only.

Author:
Kurt Skauen ([email protected])

void init_kernel_mem_context ( void   ) 

Creates the memory context for the kernel.

This context holds all kernel areas below AREA_FIRST_USER_ADDRESS.

For internal use only.

Author:
Kurt Skauen ([email protected])

void list_areas ( MemContext_s *  psCtx  ) 

Prints all areas in the specified memory context to the debug console.

For internal use only.

Parameters:
psCtx a pointer to the MemContext_s structure to print.
Author:
Kurt Skauen ([email protected])

status_t map_area_to_file ( area_id  hArea,
File_s *  psFile,
flags_t nProtection   __attribute__((unused)),
off_t  nOffset,
size_t  nSize 
)

Maps the specified area onto a file.

For internal use only.

Parameters:
hArea a handle to the area to map to the file.
psFile a pointer to the File_s to map the area onto.
nProtection a protection bitmask containing any combination of: AREA_READ, AREA_WRITE, AREA_EXEC, AREA_KERNEL, and AREA_WRCOMB.
nOffset the offset from the start of psFile to use for the first byte of the mapped region of the file.
nSize the size of the new area in bytes.
Returns:
-EINVAL if hArea is invalid or has no associated memory context; 0 otherwise.
Author:
Kurt Skauen ([email protected])

status_t update_inactive_ctx ( MemArea_s *  psOriginalArea,
area_id  hCloneArea,
uintptr_t  nOffset 
)

See also:
clone_from_inactive_ctx()

For internal use only.

Author:
Jan Hauffa ([email protected])


Generated on Sat May 9 22:55:14 2009 for Syllable Private Functions by  doxygen 1.5.1