hkeyset_update_userkeys Kernel Service

Purpose

Establishes accessibility to user memory.

Syntax

#include <sys/skeys.h>

kerrno_t hkeyset_update_userkeys (oldset)
hkeyset_t *oldset;

Parameters

Item Description
oldset Contains the returned previous hardware keyset. The valid parameter must be an 8-byte aligned address.

Description

The hkeyset_update_userkeys kernel service is a specialized protection gate that alters only the user-mode portion of the current hardware keyset. The user-mode storage keys for the currently running thread is placed into the current hardware keyset. This is normally done by the kernel when this kernel service accesses user memory.

The previous hardware keyset is returned in the memory specified by the oldset parameter. You can use the hkeyset_restore_userkeys kernel service to remove the user accessibility when it is no longer needed.

Important: Kernel services such as xmemin, xmemout, uiomove, copyin, and coypout are the suggested ways to access user memory from the kernel. If possible, avoid using kernel code to directly access user memory.

Execution Environment

The hkeyset_update_userkeys kernel service can be called from the process environment only.

Return Values

Item Description
0 Indicates a successful completion.
EINVAL_HKEYSET_UPDATE_USERKEYS Indicates that the parameter or execution environment is not valid.