# US 2021/0279097 A1 · Interrupt handling method, computer system, and non-transitory storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0279097 A1
- Document ID: US20210279097A1
- Status: Published application
- Kind: A1
- Application number: 17/260,580
- Filed: 2019-02-18
- Published: 2021-09-09
- Earliest claimed: 2018-07-24
- Assignees: Mitsubishi Electric Corporation
- Applicants: Mitsubishi Electric Corporation
- Inventors: Nikam Tanajirao VIJAY; Patwardhan KUNAL
- Web page: https://patentgrep.com/patent/US20210279097A1

## CPC

- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/3009: {Thread control instructions}
- G06F 9/321: {Program or instruction counter, e.g. incrementing}
- G06F 9/4818: {Priority circuits therefor}
- G06F 9/4812: {by interrupt, e.g. masked}
- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06F 9/545: {where tasks reside in different layers, e.g. user- and kernel-space}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present invention provides an interrupt handling system for handling interrupts in a computer system is provided. The interrupt handling system captures and processes the interrupts in a user space of the computer system. The present invention also provides for an interrupt registration method that facilitates interrupt handling in the user space during porting of user applications from one platform to another.

## Claims

### Claim 1

An interrupt handling method for a computer system to execute an interrupt handling program on a second platform, the interrupt handling program being created on a first platform, the method comprising:
storing an interrupt number and corresponding interrupt service routine in a memory of the computer system, wherein the interrupt number corresponds to an input/output device coupled with the computer system;
determining a user space input/output device number on a basis of the interrupt number, wherein the user space input/output device number corresponds to the input/output device;
determining a memory location of the input/output device on the basis of the determined user space input/output device number;
initiating the input/output device for reading, on the basis of the determined memory location;
creating a thread corresponding to the input/output device; and
placing the thread in a wait state for receiving an interrupt signal from the input/output device, wherein the interrupt signal corresponds to an interrupt generated by the input/output device;
receiving the interrupt signal from the input/output device;
executing the interrupt service routine in a kernel space within the memory in response to receiving the interrupt signal;
resuming the thread from wait state on the basis of the interrupt service routine; and
executing a user-defined function corresponding to the interrupt signal, in a user space within the memory.

### Claim 2 (depends on 1)

The interrupt handling method as claimed in claim 1, further comprising placing the thread in the wait state for receiving another interrupt signal from the input/output device subsequent to executing the user-defined function corresponding to the interrupt signal.

### Claim 3 (depends on 1)

The interrupt handling method as claimed in claim 1, further comprising:
incrementing an interrupt event counter subsequent to receiving the interrupt signal from the input/output device; and
resetting the interrupt event counter subsequent to executing the user-defined function corresponding to the interrupt signal.

### Claim 4 (depends on 1)

The interrupt handling method as claimed in claim 1, further comprising creating a separate thread for every interrupt.

### Claim 5 (depends on 1)

The interrupt handling method as claimed in claim 1, wherein the step of receiving the interrupt signal from the input/output device includes receiving the interrupt signal corresponding to the input/output device through an interrupt controller.

### Claim 6 (depends on 1)

The interrupt handling method as claimed in claim 1, wherein the thread is assigned highest priority, thereby reducing latency.

### Claim 7

A computer system including a memory having a user space and a kernel space, and a computing device coupled with the memory, the computing device is configured to:
store an interrupt number and corresponding interrupt service routine in the memory, wherein the interrupt number corresponds to an input/output device coupled with the computer system;
determine a user space input/output device number on a basis of the interrupt number, wherein the user space input/output device number corresponds to the input/output device;
determine a memory location of the input/output device on the basis of the determined user space input/output device number;
initiate the I/O device for reading, on the basis of the determined memory location;
create a thread corresponding to the input/output device;
place the thread in a wait state to receive an interrupt signal from the input/output device, wherein the interrupt signal corresponds to an interrupt generated by the input/output device;
receive the interrupt signal from the input/output device;
execute the interrupt service routine in the kernel space in response to receiving the interrupt signal;
resume the thread from wait state on the basis of interrupt service routine; and
execute a user-defined function corresponding to the interrupt signal, in the user space.

### Claim 8 (depends on 7)

The computer system as claimed in claim 7, wherein the computing device is further configured to place the thread in the wait state for receiving another interrupt signal from the input/output device subsequent to executing the user-defined function corresponding to the interrupt signal.

### Claim 9 (depends on 7)

The computer system as claimed in claim 7, wherein the computing device is further configured to:
increment an interrupt event counter subsequent to receiving the interrupt signal from the input/output device, and
reset the interrupt event counter subsequent to executing the user-defined function corresponding to the interrupt signal.

### Claim 10 (depends on 7)

The computer system as claimed in claim 7, wherein the computing device is further configured to create a separate thread for every interrupt.

### Claim 11 (depends on 7)

The computer system as claimed in claim 7, wherein the interrupt signal is received from the input/output device by way of an interrupt controller.

### Claim 12 (depends on 7)

The computer system as claimed in claim 7, wherein the thread is assigned highest priority, thereby reducing latency.

### Claim 13

A non-transitory storage medium storing a program product for causing a computer system including a computing device to execute an interrupt handling program on a second platform, the interrupt handling program being created on a first platform, wherein the program causes the computing device to perform the operations of:
storing an interrupt number and corresponding interrupt service routine in a memory coupled with the computing device, wherein the interrupt number corresponds to an input/output device coupled with the computer system;
determining a user space input/output device number on a basis of the interrupt number, wherein the user space input/output device number corresponds to the input/output device;
determining a memory location of the input/output device on the basis of the determined user space input/output device number;
initiating the input/output device for reading, on the basis of the determined memory location;
creating a thread corresponding to the input/output device;
placing the thread in a wait state for receiving an interrupt signal from the input/output device, wherein the interrupt signal corresponds to an interrupt generated by the input/output device;
receiving the interrupt signal from the input/output device;
executing the interrupt service routine in a kernel space within the memory in response to receiving the interrupt signal;
resuming the thread from wait state on the basis of the interrupt service routine; and
executing a user-defined function corresponding to the interrupt signal, in a user space within the memory.

### Claim 14 (depends on 13)

The storage medium as claimed in claim 13, wherein the program causes the computing device to further perform an operation of placing the thread in the wait state for receiving another interrupt signal from the input/output device subsequent to executing the user-defined function corresponding to the interrupt signal.

### Claim 15 (depends on 13)

The storage medium as claimed in claim 13, wherein the program causes the computing device to further perform an operation of creating a separate thread for every interrupt.

### Claim 16 (depends on 13)

The storage medium as claimed in claim 13, wherein the program causes the computing device to further perform operations of:
incrementing an interrupt event counter subsequent to receiving the interrupt signal from the input/output device; and
resetting the interrupt event counter subsequent to executing the user-defined function corresponding to the interrupt signal.

### Claim 17 (depends on 13)

The storage medium as claimed in claim 13, wherein the operation of receiving the interrupt signal from the input/output device includes receiving the interrupt signal corresponding to the input/output device through an interrupt controller.

### Claim 18 (depends on 13)

The storage medium as claimed in claim 13, wherein the thread is assigned highest priority, thereby reducing latency.
