Oberon || Library || Module Index || Search Engine || Definition || Module
(* prot parameter of Map and Protect *) CONST read = { 31 }; (* page can be read *) CONST write = { 30 }; (* page can be written *) CONST exec = { 29 }; (* page can be executed *) CONST none = {}; (* page cannot be accessed *) (* flags parameter of Map *) CONST shared = { 31 }; (* share changes *) CONST private = { 30 }; (* changes are private *) CONST typeMask = { 28..31 }; (* allows comparisons against shared or private *) CONST fixed = { 27 }; (* interpret address exactly *) (* flags parameter of Sync *) CONST async = { 31 }; (* return immediately *) CONST invalidate = { 30 }; (* invalidate mappings *) (* advise parameter of Advise *) CONST normal = 0; (* no further special treatment *) CONST random = 1; (* expect random page references *) CONST sequential = 2; (* expect sequential page references *) CONST willneed = 3; (* will need these pages *) CONST dontneed = 4; (* don't need these pages *) (* mode of LockAll *) CONST current = 1; (* lock all current mappings *) CONST future = 2; (* lock all future mappings *)
PROCEDURE GetPageSize() : SysTypes.Size; PROCEDURE Map(address: SysTypes.Address; len: SysTypes.Size; prot: SET; flags: SET; fd: SysTypes.File; off: SysTypes.Offset; VAR mapaddress: SysTypes.Address; VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Unmap(address: SysTypes.Address; len: SysTypes.Size; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Protect(addr: SysTypes.Address; len: SysTypes.Size; prot: SET; VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Sync(addr: SysTypes.Address; len: SysTypes.Size; flags: SET; VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Advise(addr: SysTypes.Address; len: SysTypes.Size; advise: INTEGER; VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Lock(addr: SysTypes.Address; len: SysTypes.Size; VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Unlock(addr: SysTypes.Address; len: SysTypes.Size; VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Lockall(mode: INTEGER; VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE UnlockAll(VAR errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE InCore(addr: SysTypes.Address; len: SysTypes.Size; VAR vector: SysTypes.Address; VAR errors: RelatedEvents.Object) : BOOLEAN;
GetPageSize returns the page size of the system. All addresses and sizes given to one of the other procedures should be multiples of the page size. The page size may differ on different kernel architectures: while it is safe to regard a page size constant during the lifetime of a process it is unsafe to assume a constant page size for multiple runs.
Map maps the range [off, off+len) of the file referenced by fd into the address space at [address, address+len). Unless fixed has been given in flags, the system is free to choose another address instead of address which is returned in mapaddress. prot specifies the protection mode of the affected memory region. read, write and exec may be given in any combination. Following flags may be given to flags:
Unmap removes the mappings for pages in the given memory range. Protect changes the protections of the mappings specified by the given range. Sync writes dirty pages of the given memory range to their permanent storage locations. Following options may be specified in flags:
Advise allows to tell the kernel the indicated access pattern of a given memory range. This allows the kernel to parameterize its paging algorithm to achieve better performance. Following access patterns are supported:
Lock requests the given memory range to be locked into physical memory. Because the possible impact on system resources, this system call is restricted to the super-user. Alternatively, Advise may be used. Unlock undoes the effect of lock for the given memory range. Lockall requests all pages (or optionally all pages which are added to the address pages or replaced by new mappings) to be locked up into physical memory. The operational mode is determined by mode:
InCore tells which pages of the given memory range are currently cached into physical memory. The status is returned as a byte-per-page array which is stored into area pointed to by vector. Bytes set to 1 indicate that the corresponding page is in physical memory.
Oberon || Library || Module Index || Search Engine || Definition || Module