We've discontinued the single-processor and non-instrumented variants of procnto.
QNX Neutrino 7 includes a new virtual memory manager.
Note the following:
- Most mappings use on-demand paging by default.
That means that the first reference to any virtual page in a mapping results in a page fault.
Consequently, it is expected that some user code will have to be changed to avoid page faults (e.g.,
latency-sensitive code, safety-critical code, any code running within an ISR).
- The
mem_offset()
function fails on memory that hasn't been explicitly locked,
as the underlying physical address is either non-existent or non-persistent.
- We've reworked and rationalized the
shm_ctl()
API.
The behavior of the API was extended and has become clearer and easier to understand.
Most existing code should work unmodified, though some invalid combinations of flags now cause an immediate failure.
- The pageout mechanism is very different from the one in the previous memory manager (which exists only in
QNX SDP 6.6).
The move to the new memory manager means that the following flags are no longer supported:
Flag |
API |
Comments |
MAP_NOINIT |
mmap() |
This flag relaxed the requirement to initialize newly allocated memory to 0.
Its removal also means that the following are no longer supported:
- the UNMAP_INIT_REQUIRED and UNMAP_INIT_OPTIONAL flags for
munmap_flags()
- the -mi and -m~i memory-configuration options for
procnto
- the MALLOC_MMAP_NOZERO environment variable
|
MAP_BELOW16M |
mmap() |
Use typed memory instead |
MAP_NOX64K |
munmap_flags() |
Manually align the memory instead |
SHMCTL_ISADMA |
shm_ctl() |
Use typed memory instead |
SHMCTL_NOX64K |
shm_ctl() |
Manually align the memory instead |
POSIX_SPAWN_PADDR64_SAFE, SPAWN_PADDR64_SAFE |
posix_spawn(),
spawn()
|
Use typed memory for specific allocations.
The removal of these flags also means that following are no longer supported:
- the -P option for the
on
utility
- the -mP and -m~P memory configuration options for
procnto
|
Note:
In QNX Neutrino 7.0, mmap() enforces the POSIX requirement that you specify either
MAP_PRIVATE or MAP_SHARED.
If you specify neither,
mmap() returns MAP_FAILED and sets errno to EINVAL;
if you try to use the mapped-in object, you'll get a SIGSEGV.
There are new flags that govern how and if a process shares its mutexes:
- _NTO_TF_SHR_MUTEX — place no restrictions on which threads to share mutexes with.
- _NTO_TF_SHR_MUTEX_EUID — share mutexes only with threads that have the same
effective user ID as this thread.
If neither flag is set, the thread doesn't share mutexes with any threads outside its process.
This is the default for procnto's threads;
the default for threads in other processes is _NTO_TF_SHR_MUTEX.
You can use the new _NTO_TCTL_SHR_MUTEX command for
ThreadCtl()
to change this setting.
For example, if your thread doesn't intend to share any of its mutexes with threads in other processes,
you can improve security by calling:
unsigned int value = 0;
ThreadCtl( _NTO_TCTL_SHR_MUTEX, (void *)&value);