JPH11249908A - Interrupt handling method - Google Patents

Interrupt handling method

Info

Publication number
JPH11249908A
JPH11249908A JP4722698A JP4722698A JPH11249908A JP H11249908 A JPH11249908 A JP H11249908A JP 4722698 A JP4722698 A JP 4722698A JP 4722698 A JP4722698 A JP 4722698A JP H11249908 A JPH11249908 A JP H11249908A
Authority
JP
Japan
Prior art keywords
interrupt
interrupt request
cpu
processing
emergency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4722698A
Other languages
Japanese (ja)
Inventor
Hideki Hashimoto
英樹 橋本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Japan Radio Co Ltd
Original Assignee
Japan Radio Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Japan Radio Co Ltd filed Critical Japan Radio Co Ltd
Priority to JP4722698A priority Critical patent/JPH11249908A/en
Publication of JPH11249908A publication Critical patent/JPH11249908A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To execute emergency processing without waiting for the generation of a timer interrupt request. SOLUTION: When a CPU discriminates it during execution of interrupt handling that emergency processing is necessary (200), it sets a flag indicating this state (201) and queues the emergency processing (202) and causes the I/O to generate a self-feedback interrupt request (203) and supplies it to an interrupt signal control circuit 12. When processing the self-feedback interrupt request, the CPU processes emergency processings on a queue 301 in order. Thus, the emergency processing is processed without waiting for the generation of a timer interrupt request.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、CPUに対する割
り込み要求を処理する割込処理方法に関する。
The present invention relates to an interrupt processing method for processing an interrupt request to a CPU.

【0002】[0002]

【従来の技術及びその問題点】図3に示すように、CP
U10による各種の割込の処理順序等を制御するため
に、割込信号制御回路12が用いられる。割込信号制御
回路12はタイマ回路14にて周期的に生成され一般に
最高の優先度が付与されているタイマ割込要求を含め、
各種の割込要求を、図4に示す手順にて調整し、CPU
10にハードウエア割込処理を行わせる。
2. Description of the Related Art As shown in FIG.
An interrupt signal control circuit 12 is used to control the processing order of various interrupts by U10. The interrupt signal control circuit 12 includes a timer interrupt request which is periodically generated by the timer circuit 14 and is generally given the highest priority.
Various interrupt requests are adjusted according to the procedure shown in FIG.
10 is made to perform hardware interrupt processing.

【0003】図4に示す手順においては、割込信号制御
回路12は、まず、新たな割込要求が発生しているか否
かを判定する(100)。新たな割込要求が発生してい
るときには、割込信号制御回路12は、現在CPU10
が実行している割込処理より優先度が高い割込要求であ
るか否かを判定し(102)、優先度が高いと判定され
た場合には現在CPU10が実行中の処理を中断させそ
の優先度が高い新たな割込処理を開始させる(10
4)。また、ステップ102を実行する時点で、CPU
10が何ら割込処理を実行していないときには、割込信
号制御回路12は、直ちにステップ104を実行し、今
回要求された新たな割込処理をCPU10に実行させ
る。
In the procedure shown in FIG. 4, the interrupt signal control circuit 12 first determines whether or not a new interrupt request has occurred (100). When a new interrupt request is generated, the interrupt signal control circuit 12
It is determined whether or not the interrupt request has a higher priority than the interrupt process being executed (102). If it is determined that the interrupt request has a higher priority, the CPU 10 interrupts the process currently being executed and A new interrupt process with a high priority is started (10
4). Also, at the time when step 102 is executed, the CPU
When no interrupt processing is being executed by the interrupt processing unit 10, the interrupt signal control circuit 12 immediately executes step 104, and causes the CPU 10 to execute a new interrupt processing requested this time.

【0004】割込信号制御回路12は、実行中の割込処
理が終了したとき(106)、現在中断中又は待機中の
割込処理乃至要求が存するか否かを判断し(108)、
そのような割込処理乃至要求が存在しているときにはそ
の中で最も高い優先度を有するものを、CPU10によ
り実行開始若しくは再開させる(110)。また、ステ
ップ106にて割込処理が終了していないと判断したと
きや、ステップ108にて存しないと判断したときに
は、ステップ110の後と同様、ステップ100に戻
る。
When the interrupt processing being executed is completed (106), the interrupt signal control circuit 12 determines whether there is any interrupt processing or request that is currently interrupted or on standby (108),
When such an interrupt process or request exists, the one having the highest priority is started or restarted by the CPU 10 (110). If it is determined in step 106 that the interrupt processing has not been completed, or if it is determined in step 108 that the interrupt processing does not exist, the process returns to step 100 as in step 110.

【0005】CPU10においては、割込処理を実行す
るに際し、通常、図5に示すように、緊急処理が必要で
あるか否かを判断する(200)。緊急処理が必要であ
る場合、CPU10は、緊急処理が必要である旨を示す
フラグをセットし(201)、更に必要であるとされた
緊急処理をキューイングする(202)。すなわち、C
PU10内部やこれに付属するメモリ等に設けられてい
る実行待ちキュー300は、緊急処理を待機させるため
のキュー301及び通常処理を待機させるためのキュー
302を有しており、ステップ202においてはキュー
301へのキューイングが行われる。なお、ここでいう
通常処理とは、割込処理以外の処理において必要とされ
る処理である。CPU10は、通常の状態ではキュー3
02にキューイングされている通常処理をキューイング
された順に処理する。
When executing the interrupt processing, the CPU 10 usually determines whether or not an emergency processing is necessary as shown in FIG. 5 (200). When urgent processing is necessary, the CPU 10 sets a flag indicating that urgent processing is necessary (201), and queues urgent processing determined to be necessary (202). That is, C
The execution queue 300 provided in the PU 10 or in a memory attached to the PU 10 has a queue 301 for waiting for emergency processing and a queue 302 for waiting for normal processing. Queuing to 301 is performed. Note that the normal process here is a process required in processes other than the interrupt process. The CPU 10 operates in the queue 3 in the normal state.
02 are processed in the order in which they are queued.

【0006】また、最高の優先度が付与されているタイ
マ割込要求が発生した場合、割込信号制御回路12は、
図4の手順特にステップ102及び104に従い、CP
U10が現在実行している処理を全て中断させ、図6に
示すタイマ割込処理を実行させる。CPU10は、タイ
マ割込処理を実行するに際して、まず、緊急処理が必要
であることを示すフラグがセットされているか否かを判
断する(400)。フラグがセットされていなければ、
CPU10は、キューイングされている通常処理をキュ
ーイングされた順に処理する通常処理を再開させる。逆
に、フラグがセットされていると判断されたとき(40
0)、CPU10は、現在実行中の通常処理を中断し
(401)、キュー301上にある緊急処理のうち最も
古いものの実行を開始する(402)。CPU10は、
キュー301上に緊急処理がある限り、これを、キュー
イングされた順に処理する。キュー301上に緊急処理
がなくなった時点で(403)、CPU10の処理はス
テップ404に移行し、通常処理が再開されると共に前
述のフラグがリセットされる。
When a timer interrupt request to which the highest priority is given occurs, the interrupt signal control circuit 12
According to the procedure of FIG.
U10 interrupts all the processes currently being executed and executes the timer interrupt process shown in FIG. When executing the timer interrupt processing, the CPU 10 first determines whether or not a flag indicating that urgent processing is necessary is set (400). If the flag is not set,
The CPU 10 restarts the normal processing for processing the queued normal processing in the order of the queue. Conversely, when it is determined that the flag is set (40
0), the CPU 10 interrupts the normal process currently being executed (401), and starts execution of the oldest emergency process in the queue 301 (402). CPU 10
As long as there is an urgent process on the queue 301, it is processed in the order of queuing. When there is no more urgent process on the queue 301 (403), the process of the CPU 10 proceeds to step 404, where the normal process is resumed and the above-mentioned flag is reset.

【0007】この従来技術においては、特に、緊急処理
の実行が待たされてしまうことがあるという問題点があ
った。すなわち、ある割込処理において緊急処理がキュ
ーイングされたとしてもこの緊急処理が実行されるのは
次にタイマ割込要求が発生する時点であるから、最長
で、タイマ割込要求の発生周期分だけ緊急処理の実行が
遅れることになる。
[0007] In this prior art, there is a problem that the execution of the urgent process is particularly delayed. In other words, even if an emergency process is queued in a certain interrupt process, this emergency process is executed at the next time when a timer interrupt request is generated. Only the execution of the emergency processing will be delayed.

【0008】[0008]

【発明の概要】本発明の目的の一つは、タイマ割込要求
が発生するのを待たずに緊急処理を実行させられるよう
にすることにある。本発明の他の目的の一つは、CPU
周辺の回路やCPU等により実行される処理手順に大き
な変更を施すことなく上述の目的を達成することにあ
る。
SUMMARY OF THE INVENTION It is an object of the present invention to enable an emergency process to be executed without waiting for a timer interrupt request to occur. Another object of the present invention is to provide a CPU
An object of the present invention is to achieve the above object without making a significant change in a processing procedure executed by a peripheral circuit, a CPU, or the like.

【0009】このような目的を達成すべく、本発明は、
CPUに対する割込要求が発生しているときに、割込信
号制御回路が、現在CPUに対して発せられている割込
要求の中から最も優先度が高い割込要求を選び、CPU
が、割込信号制御回路が選んだ割込要求に係る割込処理
を実行する割込処理方法において、緊急処理の必要性を
判断し、必要であると判断したときその緊急処理をキュ
ーイングし、緊急処理をキューイングする際にこの緊急
処理を実行するための割込要求である自己帰還割込要求
を発生させるという手順を、CPUが、割込処理実行中
に実行し、CPUが、自己帰還割込要求に応じてキュー
上の緊急処理を実行することを特徴とする。このよう
に、本発明においては、緊急処理を実行させるための自
己帰還割込要求をCPU自身が発生させているため、タ
イマ割込要求が発生せずとも、この自己帰還割込要求を
実行できる時点になれば(すなわち自己帰還割込要求よ
りも高い優先度の割込要求が全て処理された時点になれ
ば)緊急処理が実行される。従って、従来に比べ、緊急
処理の実行待ち時間が短くなる。
In order to achieve such an object, the present invention provides:
When an interrupt request to the CPU is generated, the interrupt signal control circuit selects the highest priority interrupt request from among the interrupt requests currently issued to the CPU,
However, in the interrupt processing method for executing the interrupt processing related to the interrupt request selected by the interrupt signal control circuit, the necessity of the emergency processing is determined, and when it is determined that the emergency processing is necessary, the emergency processing is queued. When queuing the emergency process, the CPU executes a procedure of generating a self-feedback interrupt request, which is an interrupt request for executing the emergency process, during the execution of the interrupt process. It is characterized in that emergency processing on a queue is executed in response to a feedback interrupt request. As described above, in the present invention, since the CPU itself generates the self-feedback interrupt request for executing the emergency processing, the self-feedback interrupt request can be executed without generating the timer interrupt request. Emergency processing is executed at the time (that is, at the time when all interrupt requests having a higher priority than the self-feedback interrupt request have been processed). Therefore, the execution waiting time of the emergency processing is shorter than in the related art.

【0010】また、本発明を実施する際には、自己帰還
割込要求に最低の優先度を付与しておくのが望ましい。
そのようにすれば、自己帰還割込要求に係る割込処理に
よって他の割込要求に係る割込処理が中断又は待機させ
られることがなくなる。また、タイマ割込要求に最高の
優先度を付与しておくようにすれば、従来と同様、タイ
マ割込要求が発生した時点で確実に緊急処理を実行させ
ることができる。
In practicing the present invention, it is desirable to give the lowest priority to the self-feedback interrupt request.
By doing so, it is possible to prevent interruption processing related to another interrupt request from being interrupted or made to stand by by interruption processing related to the self-feedback interruption request. Also, if the highest priority is given to the timer interrupt request, it is possible to reliably execute the emergency processing when the timer interrupt request occurs, as in the related art.

【0011】[0011]

【発明の実施の形態】以下、本発明の好適な実施形態に
関し図面に基づき説明する。なお、図3乃至図6に示し
た従来技術と重複する部分については説明を省略すると
共に、対応する部材乃至機能には同一の符号を付し、一
部その説明を省略する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will be described below with reference to the drawings. The description of the same parts as those of the related art shown in FIGS. 3 to 6 will be omitted, and the corresponding members and functions will be denoted by the same reference numerals and the description thereof will be partially omitted.

【0012】図1に、本発明の一実施形態に係る回路の
構成を示す。この図に示す回路においては、CPU10
のI/Oが割込信号制御回路12に接続されているた
め、CPU10は最低優先度を有する自己帰還割込要求
をこのI/Oを介して割込信号制御回路12に入力でき
る。
FIG. 1 shows a circuit configuration according to an embodiment of the present invention. In the circuit shown in FIG.
Are connected to the interrupt signal control circuit 12, the CPU 10 can input a self-feedback interrupt request having the lowest priority to the interrupt signal control circuit 12 via this I / O.

【0013】図2に示すように、本実施形態において
は、CPU10は、割込処理実行中に緊急処理が必要で
あると判断したとき(200)、その旨のフラグをセッ
トし(201)緊急処理をキュー300上にキューイン
グすると共に(202)、自己帰還割込要求を発生させ
そのI/Oを介して割込信号制御回路12に与える(2
03)。割込信号制御回路12は、この自己帰還割込要
求に応じ、図4に示される手順を実行する。自己帰還割
込要求には最低の優先度が付与されているから、他の割
込要求が全て処理された時点で、割込信号制御回路12
が、CPU10にこの自己帰還割込要求に係る割込処理
を実行させる。CPU10は、自己帰還割込要求に係る
割込処理において、もしその時点で通常処理を実行中で
あればこれを中断し(図2;500)、更に現在キュー
301上にある緊急処理の内最も古いものを実行する
(501)。キュー301上に緊急処理が存在しなくな
ったとき(502)、CPU10は、ステップ500に
おいて中断した通常処理を再開すると共に、ステップ2
01にてセットされたフラグをリセットする(50
3)。
As shown in FIG. 2, in this embodiment, when the CPU 10 determines that emergency processing is necessary during execution of an interrupt processing (200), it sets a flag to that effect (201). The process is queued on the queue 300 (202), and a self-feedback interrupt request is generated and given to the interrupt signal control circuit 12 via its I / O (2).
03). The interrupt signal control circuit 12 executes the procedure shown in FIG. 4 in response to the self-feedback interrupt request. Since the lowest priority is given to the self-feedback interrupt request, when all other interrupt requests have been processed, the interrupt signal control circuit 12
Causes the CPU 10 to execute an interrupt process related to the self-feedback interrupt request. In the interrupt processing related to the self-feedback interrupt request, the CPU 10 interrupts the normal processing if it is being executed at that time (500 in FIG. 2). The old one is executed (501). When there is no more urgent process on the queue 301 (502), the CPU 10 resumes the normal process interrupted in step 500, and
Reset the flag set in 01 (50
3).

【0014】従って、本実施形態によれば、タイマ割込
要求が発生するのを待たずに緊急処理をCPU10が実
行することが可能になる。更に、そのために必要な処理
手順の改変やハードウエア的な変更はわずかなものであ
り、実施コストは低い。加えて、図5に示すタイマ割込
に係る割込処理も従来と同様実行可能であるから、仮
に、タイマ割込要求が発生するまでに自己帰還割込要求
に係る割込処理を実行する機会がなかったとしても、キ
ュー300上に存する緊急処理は確実にCPU10に実
行させることができる。
Therefore, according to the present embodiment, it becomes possible for the CPU 10 to execute the emergency processing without waiting for the generation of the timer interrupt request. Furthermore, the modification of the processing procedure and the hardware change required for that are slight, and the implementation cost is low. In addition, since the interrupt processing related to the timer interrupt shown in FIG. 5 can be executed in the same manner as in the related art, there is an opportunity to execute the interrupt processing related to the self-feedback interrupt request before the timer interrupt request occurs. Even if there is no such processing, the CPU 10 can surely cause the CPU 10 to execute the urgent process existing on the queue 300.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 本発明の一実施形態に係る回路の構成を示す
ブロック図である。
FIG. 1 is a block diagram showing a configuration of a circuit according to an embodiment of the present invention.

【図2】 この実施形態における処理手順を示す概念図
である。
FIG. 2 is a conceptual diagram showing a processing procedure in this embodiment.

【図3】 一従来技術に係る回路の構成を示すブロック
図である。
FIG. 3 is a block diagram illustrating a configuration of a circuit according to one related art.

【図4】 割込信号制御回路の動作手順を示すフローチ
ャートである。
FIG. 4 is a flowchart showing an operation procedure of the interrupt signal control circuit.

【図5】 通常の割込処理におけるCPUの動作及び実
行待ちキューの構成を示す概念図である。
FIG. 5 is a conceptual diagram showing the operation of a CPU and the configuration of an execution queue in a normal interrupt process.

【図6】 タイマ割込要求に係る割込処理を実行すると
きのCPUの動作手順及びそのときの実行待ちキューの
状態を示す概念図である。
FIG. 6 is a conceptual diagram showing an operation procedure of a CPU when executing an interrupt process related to a timer interrupt request and a state of an execution waiting queue at that time.

【符号の説明】[Explanation of symbols]

10 CPU、12 割込信号制御回路、14 タイマ
回路。
10 CPU, 12 interrupt signal control circuit, 14 timer circuit.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 CPUに対する割込要求が発生している
ときに、割込信号制御回路が、現在CPUに対して発せ
られている割込要求の中から最も優先度が高い割込要求
を選び、CPUが、割込信号制御回路が選んだ割込要求
に係る割込処理を実行する割込処理方法において、 緊急処理の必要性を判断し、必要であると判断したとき
その緊急処理をキューイングし、緊急処理をキューイン
グする際にこの緊急処理を実行するための割込要求であ
る自己帰還割込要求を発生させるという手順を、CPU
が、割込処理実行中に実行し、 CPUが、自己帰還割込要求に応じてキュー上の緊急処
理を実行することを特徴とする割込処理方法。
When an interrupt request is issued to a CPU, an interrupt signal control circuit selects an interrupt request having the highest priority from interrupt requests currently issued to the CPU. An interrupt processing method for executing an interrupt process related to an interrupt request selected by an interrupt signal control circuit, the CPU determines the necessity of the emergency process, and when it determines that it is necessary, queues the emergency process. The procedure for generating a self-feedback interrupt request, which is an interrupt request for executing this emergency process when queuing the emergency process, is performed by the CPU.
Is executed during execution of an interrupt process, and the CPU executes an emergency process on a queue in response to a self-feedback interrupt request.
【請求項2】 請求項1記載の割込処理方法において、 自己帰還割込要求には最低の優先度を付与しておくこと
を特徴とする割込処理方法。
2. The interrupt processing method according to claim 1, wherein a lowest priority is given to the self-feedback interrupt request.
【請求項3】 請求項1又は2記載の割込処理方法にお
いて、 キュー上の緊急処理を実行するための割込処理を要求す
る割込要求であるタイマ割込要求に、最高の優先度を付
与しておくことを特徴とする割込処理方法。
3. The interrupt processing method according to claim 1, wherein the highest priority is assigned to a timer interrupt request which is an interrupt request for executing an emergency process on a queue. An interrupt processing method characterized by being provided.
JP4722698A 1998-02-27 1998-02-27 Interrupt handling method Pending JPH11249908A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4722698A JPH11249908A (en) 1998-02-27 1998-02-27 Interrupt handling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4722698A JPH11249908A (en) 1998-02-27 1998-02-27 Interrupt handling method

Publications (1)

Publication Number Publication Date
JPH11249908A true JPH11249908A (en) 1999-09-17

Family

ID=12769298

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4722698A Pending JPH11249908A (en) 1998-02-27 1998-02-27 Interrupt handling method

Country Status (1)

Country Link
JP (1) JPH11249908A (en)

Similar Documents

Publication Publication Date Title
JP4580845B2 (en) Task execution device
US6820155B1 (en) Interruption managing device and interruption managing method
WO2009147802A1 (en) Priority controller and priority control method
JPH04278612A (en) Method for controlling clock signal for processor and information processing system
JP2004362100A (en) Information processor, method for controlling process, and computer program
JP2009163658A (en) Input/output controller and its firmware update method
US20090292846A1 (en) Method of interrupt scheduling
JP2001160041A (en) System for reducing cpu load of on-line system
JP2007164421A (en) Parallel processors, parallel processing method and parallel processing program
JP2006146758A (en) Computer system
JP2001117786A (en) Process scheduling device and process scheduling method
JP2004078683A (en) Computer system and shared memory controlling method
JP2636722B2 (en) Multitask execution management method
JPH11249908A (en) Interrupt handling method
JP2597283B2 (en) Scheduling method for interrupt
JP2010277422A (en) Interrupt handler
JP2004070582A (en) Event notification task control processing system and method and its program
JP2005190238A (en) Real time control system
JP2006172229A (en) Operation control method for task, operation control system for task and program
US6735713B1 (en) System for suspending current bus cycle of microprocessor upon receiving external bus retry signal for executing other process and re-staring the suspended bus cycle thereafter
JP2000312244A (en) Network interface switching method, its system and its recording medium
JPH09265446A (en) Bus controller
CN114443257A (en) Task scheduling method, device and system based on thread pool
JPH07262022A (en) Interruption processing system
JPH0778091A (en) Multitask managing method