k_cpuextintr_ctl Kernel Service

Purpose

Performs CPU external interrupt control related operations.

Syntax

#include <sys/intr.h>

kerrno_t k_cpuextintr_ctl (command , cpuset , flags)
extintctl_t   command;
rsethandle_t   cpuset;
unit flags;  

Description

This kernel services provides means of enabling, disabling, and querying the external interrupt state on the CPUs described by the CPU resource set. Enabling or disabling an CPU external interrupt could affect the external interrupt delivery to the CPU. Normally, on multiple CPU system, external interrupts can be delivered to any running CPU, and the distribution among the CPUs is determined by a predefined method. Any external interrupt can only be delivered to a CPU if its interrupt priority is more favored than the current external interrupt priority of the CPU. When external interrupts are disabled via this interface, any external interrupt priority less favored than INTMAX will be blocked until interrupts are enabled again. This kernel service is applicable only on selective hardware types.

Note: Since this kernel service change the way that interrupts are delivered, system performance may be affected. This service guarantees at least one online CPU will have external interrupts enabled for all device interrupts. Any DLPAR CPU removal can fail if the operation breaks this guarantee. On an I/O bound system, one CPU may not be enough to handle all of the external interrupts received by the partition. Performance may suffer when there are not enough CPUs enabled to handle external interrupts.

Parameters

Item Description
command

Specifies the operation to the CPU specified by the CPU resource set. One of the following values defined in <sys/intr.h> can be used:

The following commands are supported:

  • EXTINTDISABLE: Disable external interrupts on the CPUs specified by the CPU resource set.
  • EXTINTENABLE: Enable external interrupts on the CPUs specified by the CPU resource set
  • QUERYEXTINTDISABLE: Return a CPU resource set containing the CPUs that have external interrupts disabled.
  • QUERYEXTINTENABLE: Return a CPU resource set containing the CPUs that have externals interrupt enabled.
cpuset

Reference to a CPU resource set. Upon successful return from this kernel service, the CPUs that have the external interrupt control operation done will be set in the CPU resource set.

The CPUs specified by this cpuset parameter are logic CPU ids.

flags

Always set to 0 or EINVAL_INTR_DIS_BAD_FLAGS will be returned.

Security

The caller must have root authority with CAP_NUMA_ATTACH capability or PV_KER_CONF privilege in the RBAC environment.

Execution Environment

The k_cpuextintr_ctl kernel service can be called from process environment only.

Return Values

Upon successful completion, the k_cpuextintr_ctl kernel service returns a 0. If unsuccessful, one of the following kerrno value is returned.

Item Description
kerrno Description
EINVAL_EXTINTR_BAD_COMMAND The command value is not valid.
EINVAL_EXTINTR_BAD_FLAGS The flags value is unknown.
EINVAL_EXTINTR_BAD_CPUSET The cpuset references NULL.
EINVAL_EXTINTR _NO_RSET The cpuset is empty.
ENOTSUP_EXTINTR_CALLER The kernel service is called from the interrupt environment.
ENOSYS_EXTINTR_PLATFORM This function is not implemented on the platform.
EPERM_EXTINTR_OPER The caller does not have enough privilege to perform the requested operation.
Note: A return value of success does not necessarily indicate that external interrupts have been enabled or disabled on all of the specified CPUs. For example, if a CPU is not online, then the enable or disable operation will not be performed on that CPU. The caller should check the returned cpuset to see which CPUs have this operation successfully done. The k_cpuextintr_ctl kernel service will not block DR CPU add/remove operation during the whole period of system call.