XenevaOS
Loading...
Searching...
No Matches
Functions
mmap.h File Reference
#include <stdint.h>
#include <string.h>
#include <Mm/vmmngr.h>
#include <Mm/pmmngr.h>
#include <Mm/kmalloc.h>
#include <process.h>
Include dependency graph for mmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void SharedMemMapListInitialise ()
 SharedMemMapListInitialise – initialise the shared memory map list.
 
void * CreateMemMapping (void *address, size_t len, int prot, int flags, int fd, uint64_t offset)
 CreateMemMapping – Create a memory mapping of just memory, file or device.
 
void MemMapDirty (void *startingVaddr, size_t len, int flags, int prot)
 MemMapDirty – dirty update previously allocated memory map.
 
void UnmapMemMapping (void *address, size_t len)
 UnmapMemMapping – unmaps a memory mapping.
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ CreateMemMapping()

void * CreateMemMapping ( void *  address,
size_t  len,
int  prot,
int  flags,
int  fd,
uint64_t  offset 
)
extern

CreateMemMapping – Create a memory mapping of just memory, file or device.

Parameters
address– address from where mapping start, if null, kernel will find by its own
len– length of the address
prot– protection flags
flags– flags
fd– file descriptor, -1 for no file descriptor
offset– byte offset for file and device
Returns
Pointer to starting

◆ MemMapDirty()

void MemMapDirty ( void *  startingVaddr,
size_t  len,
int  flags,
int  prot 
)
extern

MemMapDirty – dirty update previously allocated memory map.

Parameters
startingVaddr– starting address
len– length in bytes
flags– memory map flags
prot– protection flags

◆ SharedMemMapListInitialise()

void SharedMemMapListInitialise ( )
extern

SharedMemMapListInitialise – initialise the shared memory map list.

◆ UnmapMemMapping()

void UnmapMemMapping ( void *  address,
size_t  len 
)
extern

UnmapMemMapping – unmaps a memory mapping.

Parameters
address– address from where mapping starts
len– length of the mapping