qvm_dcache_operation()

Perform data cache management

Synopsis:

#include <qvm/utils.h>
int qvm_dcache_operation(enum qvm_dcache_op op,
                         void *start,
                         size_t len)

Arguments:

op
The cache operation to perform; see qvm_dcache_op.
start
The starting address of the data to perform the operation on.
len
The number of bytes to perform the operation on.

Description:

This function performs the specified operation on the specified data cache without necessarily having to do a kernel call. It hides the architecture details and tells you whether a thread that will do architecture-specific tasks needs elevated privilege.

If you OR QDO_QUERY_PRIV with a particular cache operation, it will tell you what privilege is necessary to use that operation. You can combine this flag with only one other flag, though. You can also combine flags that refer to operations themselves rather than the required privilege level. Notably, QDO_INVAL and QDO_FLUSH can be OR'ed together.

Returns:

EOK if a cache operation was requested and it succeeded. If QDO_QUERY_PRIV was used, the function returns the needed privilege level (_NTO_IO_LEVEL_*). Otherwise, an errno value is returned.