ControlMem():
Err ControlMem( void *p, int32 size, int32 cmd, Item task )
ControlMem()
change the control status for entire pages. The p
argument, a pointer to a memory location, and the size
argument, the amount of the contiguous memory, in bytes, beginning at the memory location specified by the p
argument, specify which memory control status to change. If p and size arguments specify any part of a page, changes are made to the entire page. The task
argument specifies which task to change the control status for. You can make multiple calls to ControlMem()
to change the control status for more than one task. The cmd
argument is a constant that specifies the change to be made to the control status. The possible values are given below:
task
argument. Currently, a task argument value of 0 is not supported for this operation.
MEMC_GIVE
, is described in the next section.)
For a task to change the control status of memory pages with ControlMem()
, it must own that memory, with one exception: a task that has write access to memory it doesn't own can relinquish its write access using MEMC_NOWRITE
as the value of the cmd
argument.
A task can use ControlMem()
to prevent itself from writing to memory that it owns, which is useful during debugging.