Implements VirtualMemory, mapping of virtual memory pages.
VirtualMemory Linux | Implements VirtualMemory, mapping of virtual memory pages. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file of VirtualMemory. |
C-kern/ | Linux specific implementation VirtualMemory Linux. |
Macros | |
PROC_SELF_MAPS | The Linux system file containing the currently mapped memory regions and their access permissions of this process. |
Functions | |
Functions | |
sys_pagesize_vm | Uses sysconf(_SC_PAGESIZE) which conforms to POSIX.1-2001. |
vm_region_t | |
helper | |
lifetime | |
query | |
iterate | |
vmpage_t | |
helper | |
SET_PROT | Converts accessmode_e into POSIX representation. |
lifetime | |
change |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2011 Jörg Seebohn
Header file of VirtualMemory.
Linux specific implementation VirtualMemory Linux.
#define PROC_SELF_MAPS "/proc/self/maps"
The Linux system file containing the currently mapped memory regions and their access permissions of this process.
address perms offset dev inode pathname
08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm 08056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm 08058000-0805b000 rwxp 00000000 00:00 0
man 5 proc
for a more detailed description
Functions | |
sys_pagesize_vm | Uses sysconf(_SC_PAGESIZE) which conforms to POSIX.1-2001. |
helper | |
SET_PROT | Converts accessmode_e into POSIX representation. |
lifetime | |
change |
#define SET_PROT( prot, access_mode ) static_assert(0 == accessmode_NONE, "") ; static_assert(0 == PROT_NONE, "") ; if ( accessmode_READ == PROT_READ && accessmode_WRITE == PROT_WRITE && accessmode_EXEC == PROT_EXEC) { prot = access_mode & (accessmode_RDWR|accessmode_EXEC); } else { if (accessmode_READ & access_mode) { prot = PROT_READ ; } else { prot = PROT_NONE ; } if (accessmode_WRITE & access_mode) { prot |= PROT_WRITE ; } if (accessmode_EXEC & access_mode) { prot |= PROT_EXEC ; } }
Converts accessmode_e into POSIX representation. The parameter prot is set to the POSIX representation of the value access_mode which is of type accessmode_e.
The Linux system file containing the currently mapped memory regions and their access permissions of this process.
#define PROC_SELF_MAPS "/proc/self/maps"
Uses sysconf(_SC_PAGESIZE) which conforms to POSIX.1-2001.
uint32_t sys_pagesize_vm()
Converts accessmode_e into POSIX representation.
#define SET_PROT( prot, access_mode ) static_assert(0 == accessmode_NONE, "") ; static_assert(0 == PROT_NONE, "") ; if ( accessmode_READ == PROT_READ && accessmode_WRITE == PROT_WRITE && accessmode_EXEC == PROT_EXEC) { prot = access_mode & (accessmode_RDWR|accessmode_EXEC); } else { if (accessmode_READ & access_mode) { prot = PROT_READ ; } else { prot = PROT_NONE ; } if (accessmode_WRITE & access_mode) { prot |= PROT_WRITE ; } if (accessmode_EXEC & access_mode) { prot |= PROT_EXEC ; } }