facility_enable Kernel Service
Purpose
Enables a specified facility to be used in the kernel environment. The specified facility would otherwise be restricted for use in the kernel environment.
Syntax
#include <sys/machine.h>
int facility_enable (facility)
uint64_t facility;
Parameter
- facility
- Specifies the facility that must be enabled.
Description
The facility_enable kernel service enables the use of facilities that typically
result in a system failure if the facility is used in the kernel environment. Examples of such
facilities include the Vector Multimedia Extension (VMX) facility or the Vector Scalar Extension
(VSX) facility. Facilities that are supported by the facility_enable kernel service
are defined in the /usr/include/sys/machine.h include file.
The facility_enable kernel service saves the state of a requested facility, then
disables interrupts until the facility_disable kernel service is called.
When the facility_enable kernel service is active, the running program must
follow the interrupt environment restrictions and the following additional restrictions:
- The
facility_enablekernel service cannot be used recursively or in a nested manner. That is, each call to thefacility_enablekernel service must be followed by a call to thefacility_disablekernel service before thefacility_enablekernel service is called again. - The interrupt level cannot be modified when the
facility_enablekernel service is active. - Only a single facility can be enabled when the
facility_enablekernel service is called each time. - Sleep operations are not allowed while the
facility_enablekernel service is active and will result in a system failure. - Block operations are not allowed while the
facility_enablekernel service is active. - The
facility_disablekernel service must be used along with thefacility_enablekernel service to restore any state change since the call to thefacility_enablekernel service.
facility_enable kernel service must not be called for instruction
sequences that run for a long time. Disabling interrupts for a longer period of time can cause
performance issues in the system.Execution environment
The facility_enable kernel service can be called from either the process or
interrupt environment.
Return values
- 0
- Facility is enabled successfully and the specified facility is now active.
- ENOSYS
- Requested facility is not available or is not supported on this system.
- EINVAL
- The facility parameter is invalid.
- EBUSY
- The
facility_enablekernel service is already called and is active.