Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3209560B2 - Interrupt management method for microprocessor system - Google Patents
[go: Go Back, main page]

JP3209560B2 - Interrupt management method for microprocessor system - Google Patents

Interrupt management method for microprocessor system

Info

Publication number
JP3209560B2
JP3209560B2 JP02422692A JP2422692A JP3209560B2 JP 3209560 B2 JP3209560 B2 JP 3209560B2 JP 02422692 A JP02422692 A JP 02422692A JP 2422692 A JP2422692 A JP 2422692A JP 3209560 B2 JP3209560 B2 JP 3209560B2
Authority
JP
Japan
Prior art keywords
interrupt
processing
handler
interrupt handler
address
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.)
Expired - Fee Related
Application number
JP02422692A
Other languages
Japanese (ja)
Other versions
JPH05224951A (en
Inventor
康夫 中島
智洋 山脇
信夫 熱海
Original Assignee
富士通コミュニケーション・システムズ株式会社
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 富士通コミュニケーション・システムズ株式会社 filed Critical 富士通コミュニケーション・システムズ株式会社
Priority to JP02422692A priority Critical patent/JP3209560B2/en
Publication of JPH05224951A publication Critical patent/JPH05224951A/en
Application granted granted Critical
Publication of JP3209560B2 publication Critical patent/JP3209560B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Bus Control (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明はマイクロプロセッサ・シ
ステムの割込管理方法に関する。近年、多くのマイクロ
プロセッサ・システムが使用されているが、マイクロプ
ロセッサ・システムにおいてはマイクロプロセッサ(以
下、CPUと記す)がプログラムの処理を実行中に外部
デバイスまたは外部装置(以下、外部装置と総称する)
から割込要求が行われたときに実行中のプログラム処理
を中断して外部装置の割込要求を処理することが多い。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an interrupt management method for a microprocessor system. 2. Description of the Related Art In recent years, many microprocessor systems have been used. In a microprocessor system, an external device or an external device (hereinafter, collectively referred to as an external device) while a microprocessor (hereinafter, referred to as a CPU) is executing a program process. Do)
In many cases, when an interrupt request is issued from the user, the program processing being executed is interrupted to process the interrupt request from the external device.

【0002】外部要求で処理する内容は外部装置ごとに
異なるので、ユーザが外部装置ごとに割込処理ルーチン
(以下、割込ハンドラと記す)を作成しておき、割込要
求があったときにCPUが割込要求を行った外部装置を
識別し、該当する割込ハンドラを呼び出して処理させる
方法が用いられている。
[0002] Since the content processed by an external request differs for each external device, a user creates an interrupt processing routine (hereinafter, referred to as an interrupt handler) for each external device, and when an interrupt request is made, A method is used in which a CPU identifies an external device that has issued an interrupt request, calls a corresponding interrupt handler, and performs processing.

【0003】外部割込の発生によりCPUが実行中のプ
ログラム処理を中断する際には、再開するプログラムの
番地や、それまで使用していたCPUの内部レジスタの
内容を保存してから割込処理を実行し、割込処理が終了
したときにこれらのレジスタを元の状態に復してプログ
ラムを再開するが、前記割込ハンドラの中で内部レジス
タの退避処理を記述することは割込ハンドラの作成を煩
雑にするため、これらの処理はOS(オペレーティング
・システム)の割込管理機能によって行うのが普通であ
る。
When the CPU interrupts the program processing being executed due to the occurrence of an external interrupt, the address of the program to be resumed and the contents of the internal register of the CPU used so far are saved before the interrupt processing is performed. Is executed, and when the interrupt processing is completed, these registers are restored to the original state and the program is restarted. However, in the interrupt handler, saving the internal register is described in the interrupt handler. In order to complicate the creation, these processes are usually performed by an interrupt management function of an OS (operating system).

【0004】しかし、現在普及しているマイクロプロセ
ッサ・システムでは割込要求を受けたCPUがハード的
に割込ハンドラを起動するようになっているため、もし
そのまま割込ハンドラによって割込処理が開始されると
OSは割り込みの発生を知ることができず、レジスタ類
の保存を行うこともできなくなる。このため、割込ハン
ドラ側からOSを呼び出して(システムコールと呼ぶ)
OSにレジスタの保存などの処理を行ってもらい、これ
らの処理の終了後に再び割込ハンドラに処理を戻して割
込処理を行う方法が用いられている。割込処理の終了時
も同様に割込ハンドラからシステムコールを行い、OS
がレジスタ等の復帰を行ったのち、中断していたプログ
ラムを再開させる。なお、このシステムコールによって
OSは割込処理の状態を管理することが可能となってい
る。
However, in the currently popular microprocessor system, the CPU which receives the interrupt request activates the interrupt handler by hardware, so if the interrupt handler starts the interrupt processing as it is. Then, the OS cannot know the occurrence of the interrupt and cannot save the registers. Therefore, the OS is called from the interrupt handler side (called a system call).
A method is used in which the OS performs a process such as saving a register, and after these processes are completed, the process is returned to the interrupt handler again to perform the interrupt process. At the end of the interrupt processing, a system call is similarly made from the interrupt handler, and the OS
Resumes the interrupted program after restoring the registers and the like. Note that the OS can manage the state of the interrupt processing by this system call.

【0005】一方、ユーザが作成する割込ハンドラは現
在では高級言語によって書かれるのが普通であるが、高
級言語によって前記のシステムコールを含めて記述する
と、機械語に翻訳した時点で、モジュール(ハンドラ)
の先頭で必ずスタックの操作と、いくつかのCPU内レ
ジスタの書き替えが行われるようになっている。このた
め、CPUのレジスタは内容を退避する前に使用される
こととなる。割込処理の終了時にも同様な問題が発生す
る。
On the other hand, an interrupt handler created by a user is usually written in a high-level language at present. However, if the interrupt handler is described in a high-level language including the system call, a module ( handler)
The operation of the stack and the rewriting of some registers in the CPU are always performed at the head of the. Therefore, the register of the CPU is used before the contents are saved. A similar problem occurs at the end of the interrupt processing.

【0006】このような状態を避けるためにはシステム
コールに前後する部分を高級言語でなくアセンブラ言語
を用いて記述する必要がある。しかし、現在ではアセン
ブラ言語による記述は一般的でないため、正確な記述を
行うのが難しく、加えて割込ハンドラの内部で分岐など
があると終了時の処理に誤りが生じ易い。
In order to avoid such a situation, it is necessary to describe a part before and after a system call using an assembler language instead of a high-level language. However, at present, description in the assembler language is not general, so that it is difficult to accurately describe it. In addition, if there is a branch or the like inside the interrupt handler, an error is likely to occur in the process at the time of termination.

【0007】このため、割込ハンドラを高級言語のみで
記述することが可能で、処理誤りが発生し難いマイクロ
プロセッサ・システムの割込管理方法が必要となってい
る。
For this reason, there is a need for a microprocessor system interrupt management method in which an interrupt handler can be described only in a high-level language and processing errors are unlikely to occur.

【0008】[0008]

【従来の技術】図6はマイクロプロセッサ・システム構
成図、図7は従来技術のシステム構成図、図8は従来技
術のメモリ構成図、図9は従来技術の処理移行状態の説
明図、図10は従来技術のフロー図である。
2. Description of the Related Art FIG. 6 is a block diagram of a microprocessor system, FIG. 7 is a block diagram of a conventional system, FIG. 8 is a block diagram of a conventional memory, FIG. FIG. 2 is a flowchart of a conventional technique.

【0009】図6は本発明が適用されるマイクロプロセ
ッサ・システムの構成の一例を示している。図6のCP
U1は8086シリーズのマイクロプロセッサ(CP
U)を用いて構成されたマイクロプロセッサ・システム
の例を示しているが、CPU1はバス6を介してRAM
(ランダムアクセス・メモリ)4、ROM(読出専用メ
モリ)5、割込コントローラ(以下、PICと記す)2
及び8台の外部装置(I/O)3-1〜3-8と接続されて
いる。
FIG. 6 shows an example of the configuration of a microprocessor system to which the present invention is applied. CP in FIG.
U1 is an 8086 series microprocessor (CP
3 shows an example of a microprocessor system configured using U), but the CPU 1
(Random access memory) 4, ROM (read only memory) 5, interrupt controller (hereinafter referred to as PIC) 2
And eight external devices (I / O) 3 -1 to 3 -8 .

【0010】PIC2は8台の外部装置3-1〜3-8のう
ちの複数からIR0 〜IR7 線を介して同時に割込要求
があった場合に優先順位などを比較し、同時に一つの割
込要求のみがCPU1に行われるように調停する役割を
もち、割込要求はINTR線を通してCPU1に送出さ
れる。1つのPIC2には8台の外部装置が接続できる
が、PIC2をカスケードに接続することにより最大2
56台までの外部装置を接続することができる。
When two or more of the eight external devices 3 -1 to 3 -8 simultaneously receive interrupt requests via the IR 0 to IR 7 lines, the PIC 2 compares priorities and the like. It has a role of arbitrating so that only the interrupt request is made to the CPU 1, and the interrupt request is sent to the CPU 1 through the INTR line. Eight external devices can be connected to one PIC2, but up to two
Up to 56 external devices can be connected.

【0011】図7は従来技術におけるマイクロプロセッ
サ・システムの割込処理関連部分のシステム構成を図示
し、図8は図7の各部のメモリ(図7では図示省略)上
の記憶状態の例を図示しているが、以下、図7及び図8
により従来技術を説明する。なお、図7及び図8では2
台の外部装置3-1〜3-2のみを記載している。
FIG. 7 shows a system configuration of a portion related to interrupt processing of a microprocessor system in the prior art, and FIG. 8 shows an example of a storage state in a memory (not shown in FIG. 7) of each part in FIG. As shown in FIG.
The prior art will be described below. 7 and FIG.
Only the external devices 3 -1 to 3 -2 are shown.

【0012】図7の構成部分の一部は図8に示すように
RAMとROMにより構成されるメモリ上に記憶され、
CPU1がこれらを読み出しながら各機能を動作させ
る。プログラム類はRAMまたはROMのいずれにも記
憶可能なものが多いが、ここでは説明の便から、ROM
にはOS60を構成する割込ハンドラ起動処理部61、割込
ハンドラ終了処理部62及び実行管理部63のみが記憶さ
れ、割込ハンドラ81及びアプリケーション・プログラム
(以下、APと記す)82はRAMに記憶されるものとす
る。なお、以下において単にOSと記した場合にはOS
60全体またはその一部(主として実行管理部63)を指す
ものとする。
A part of the components shown in FIG. 7 is stored in a memory composed of a RAM and a ROM as shown in FIG.
The CPU 1 operates each function while reading these. Many programs can be stored in either RAM or ROM, but here, for convenience of explanation, ROM
The OS 60 stores only an interrupt handler activation processing unit 61, an interrupt handler termination processing unit 62, and an execution management unit 63, and an interrupt handler 81 and an application program (hereinafter referred to as AP) 82 are stored in a RAM. Shall be stored. In the following, when the term “OS” is simply used, the term
60 or a part thereof (mainly the execution management unit 63).

【0013】いま、CPU1がOSの実行管理部63との
共同動作によりAP82の1200番地の命令を実行中である
とすると、CPU1内のプログラムカウンタ(以下、P
Cと記す)1aは図8に示すように実行中の番地の次の12
01番地を指している。
Now, assuming that the CPU 1 is executing an instruction at the address 1200 of the AP 82 in cooperation with the execution management unit 63 of the OS, a program counter (hereinafter referred to as P
1a is the 12th address following the address being executed as shown in FIG.
It points to address 01.

【0014】この状態で外部装置3-1より割込要求があ
り、PIC2が他の割込要求と優先度などを比較してこ
の割込要求を優先することを確認すると、これをCPU
1に伝える。割込要求の内容は外部装置ごとに異なるた
め、どの外部装置からの割込要求であるかを識別する必
要があるが、以下、割込要求を行った外部装置を割込番
号で識別することとし、外部装置3-1及び3-2の割込要
求をそれぞれ割込番号1及び割込番号2とする。
[0014] There is an interrupt request from the external device 3-1 in this state, confirms that the PIC2 are compared and with priority other interrupt requests to prioritize the interrupt request, which CPU
Tell 1 Since the content of the interrupt request differs for each external device, it is necessary to identify the external device from which the interrupt request was issued.However, the external device that issued the interrupt request must be identified by the interrupt number. and then, to the external device 3 -1 and 3 -2 interrupt requests, respectively interrupt number 1 and the interrupt number 2.

【0015】図8の割込ベクタ領域71は各割込番号の割
込処理内容を規定する割込ハンドラ81が記憶されている
メモリ領域の先頭番地(ベクタと呼ばれる)を記憶して
いるメモリ領域であり、割込番号ごとに4バイト(セグ
メントとオフセット各2バイト)のアドレス情報を記憶
している。
An interrupt vector area 71 shown in FIG. 8 is a memory area storing a head address (called a vector) of a memory area in which an interrupt handler 81 for defining the interrupt processing content of each interrupt number is stored. And stores 4 bytes of address information (2 bytes for each segment and offset) for each interrupt number.

【0016】外部装置は最大256まで接続できるた
め、割込ベクタ領域71には0から255までの番号をも
つ256の領域が確保されている。この番号をタイプナ
ンバと呼び、各タイプナンバへの割り込みをタイプ0割
込〜タイプ255割込と呼んでいる。実際にはユーザが
使用できるタイプナンバの範囲は限定されているが、こ
こでは説明の便から、割込番号1をタイプ0割込、割込
番号2をタイプ1割込に対応させて説明する。
Since up to 256 external devices can be connected, 256 areas having numbers from 0 to 255 are reserved in the interrupt vector area 71. This number is called a type number, and the interruption to each type number is called a type 0 interrupt to a type 255 interrupt. Actually, the range of type numbers that can be used by the user is limited, but here, for convenience of explanation, the explanation will be made with the interruption number 1 corresponding to the type 0 interruption and the interruption number 2 corresponding to the type 1 interruption. .

【0017】ベクタ領域71の物理アドレス(バイトアド
レス)には例えば 00000〜 003FF番地(16進数)が使
用され、各タイプナンバごとに割り当てられた4バイト
の先頭番地がアドレスとして使用される。従って、割込
番号1は 00000番地、割込番号2は 00004番地を使用し
て割込ベクタ領域71にアクセスする。
For example, addresses 00000 to 003FF (hexadecimal) are used as the physical addresses (byte addresses) of the vector area 71, and the start address of 4 bytes assigned to each type number is used as the address. Therefore, the interrupt number 1 accesses the interrupt vector area 71 using the address 00000 and the interrupt number 2 uses the address 00004.

【0018】外部装置3-1の割込要求がPIC2を介し
てCPU1に伝えられると、CPU1は図6のINTA
線に割込要求を受け付けたことを知らせ、PIC2より
割込要求元を識別する情報として前記タイプ0割込のア
ドレス情報 "00000"が送られる。これによりCPU1は
00000番地にアクセスし、その内容を読み取る。
[0018] interrupt request of the external device 3-1 is transmitted to CPU1 via the PIC2, CPU1 is INTA in Figure 6
The line informs that the interrupt request has been accepted, and the PIC 2 sends the type 0 interrupt address information "00000" as information for identifying the interrupt request source. With this, CPU1
Access address 00000 and read its contents.

【0019】タイプ0割込に記憶されている割込ハンド
ラの先頭番地が 3000番地であるとすると、CPU1は
この番地、即ち、割込ハンドラ81の処理に移るが、それ
に先立ち、中断するAP82の情報を退避させる。
Assuming that the start address of the interrupt handler stored in the type 0 interrupt is 3000, the CPU 1 shifts to this address, that is, the processing of the interrupt handler 81. Back up information.

【0020】図8では退避先のメモリ領域はRAM上の
スタック領域83に確保されており、CPU1 内のスタッ
クポインタ(以下、SPと記す)1bが退避情報を記憶さ
せる番地を指している。退避する情報は割込処理が終了
したときに復帰すべき番地であり、この場合はPC1aが
指しているアドレスの"1201"となる。
In FIG. 8, the memory area of the save destination is secured in the stack area 83 on the RAM, and the stack pointer (hereinafter referred to as SP) 1b in the CPU 1 points to the address where the save information is stored. The information to be saved is an address to be restored when the interrupt processing is completed. In this case, the address is "1201" of the address pointed to by the PC 1a.

【0021】CPU1がこの"1201"をスタック領域83に
記憶させるとSP1bは次の番地に移動し、更に高位の割
り込みに備える。これを終了したのち、PC1aは割込番
号1用の割込ハンドラの先頭番地である3000番地に跳
び、処理が割込ハンドラ81に移る。ここまでの処理はO
S60が関与せずにCPU1によって行われる。
When the CPU 1 stores "1201" in the stack area 83, SP1b moves to the next address and prepares for a higher-order interrupt. After this is completed, the PC 1a jumps to address 3000, which is the start address of the interrupt handler for interrupt number 1, and the processing shifts to the interrupt handler 81. The processing up to this point is O
S60 is performed by the CPU 1 without involvement.

【0022】割込ハンドラ81は処理を開始すると、先ず
前述したシステムコールを行うのでCPU1はOS60の
一部を構成する割込ハンドラ起動処理部61によりレジス
タ類(図示省略)の退避、即ち、AP82で使用していた
レジスタの内容の退避を開始する。
When the interrupt handler 81 starts processing, it first makes the above-mentioned system call, so that the CPU 1 saves registers (not shown) by the interrupt handler activation processing unit 61 constituting a part of the OS 60, that is, the AP 82 Starts saving the contents of the register used by.

【0023】このとき、OS60は割込ハンドラ81から起
動されたが、起動した割込ハンドラがどの外部装置のも
のであるか知らされていないため、PIC2にアクセス
し、その内部レジスタ(図示省略)を読むことによって
確認する。これによってOSは、現在どの割込処理が行
われているかを管理することが可能となり、多重割込が
行われた場合などに対処することができる。しかし、こ
の割込要因の解析は、外部装置数が多く、PIC2がカ
スケード接続されているような場合には時間を要し、O
Sのオーバーヘッドが大きくなる原因となる。
At this time, the OS 60 is started from the interrupt handler 81, but since the OS 60 is not informed of which external device the started interrupt handler belongs to, the PIC 2 accesses the PIC 2 and its internal register (not shown). Confirm by reading. This enables the OS to manage which interrupt process is currently being performed, and can cope with a case where multiple interrupts are performed. However, this analysis of the interrupt factor takes a long time when the number of external devices is large and the PICs 2 are connected in cascade.
This causes the overhead of S to increase.

【0024】内部レジスタ類の保存と割込要因の解析を
終了すると、CPU1は再び処理の実行を割込ハンドラ
81に移し、割込ハンドラ81によって実質的な割込処理が
行われる。なお、割込ハンドラ81による割込処理の実行
中に高位の割込が発生すると、CPU1及びOSは前記
と同様な処理により高位の割込ハンドラを起動し、その
割込処理を実行させるたのち、前の割込ハンドラに処理
を戻す。OSはこのような多重割込などに備え、常に割
込状態を管理する。
When the saving of the internal registers and the analysis of the interrupt cause are completed, the CPU 1 re-executes the processing by the interrupt handler.
The process proceeds to 81, where substantial interrupt processing is performed by the interrupt handler 81. If a high-order interrupt occurs during execution of the interrupt process by the interrupt handler 81, the CPU 1 and the OS activate the high-order interrupt handler by the same processing as described above, and execute the interrupt process. And return to the previous interrupt handler. The OS always manages the interrupt state in preparation for such multiple interrupts.

【0025】割込処理が終了すると割込ハンドラ81は再
びシステムコールをかけ、これによりOSの割込ハンド
ラ終了処理部62がレジスタ類の復帰やPIC2の終了処
理を行い、スタック領域83に記憶されているアドレス情
報"1201"をPC1aに移すことにより中断していたAP82
の処理が再開される。
When the interrupt processing is completed, the interrupt handler 81 makes a system call again, whereby the interrupt handler termination processing unit 62 of the OS performs the restoration of the registers and the termination processing of the PIC 2, and is stored in the stack area 83. AP82 which was interrupted by transferring the address information "1201" to PC1a
Is restarted.

【0026】以上においては説明を省略したが、現在の
マイクロプロセッサ・システムが使用できるメモリ空間
は極めて大きいため、アドレスの桁数が長大になること
を避ける手段としてアドレスをセグメント(他と区別す
る場合はデータ・セグメントと呼ばれる)とオフセット
に分け、セグメントを予めタスクごとに割り当てておく
方法が使用されている。これにより、各プログラムはセ
グメントを意識することなく、オフセットのみを使用し
て作成することができる。しかし、アプリケーション・
プログラムの処理から割込処理に移る場合にはセグメン
トが変わることとなるため、割り込みの際には割込ハン
ドラ81とOS60の間でセグメントの付け替えについての
手順が取り決められる。
Although the description has been omitted above, since the memory space that can be used by the current microprocessor system is extremely large, as a means for avoiding an increase in the number of digits of the address, the segment of the address (when distinguishing it from the others) is used. Is called a data segment) and an offset, and a segment is allocated to each task in advance. As a result, each program can be created using only offsets without being aware of segments. However, the application
In the case of shifting from the program processing to the interrupt processing, the segments are changed. Therefore, in the event of an interrupt, a procedure for replacing the segments is determined between the interrupt handler 81 and the OS 60.

【0027】図9は割込処理の際の処理の移行状態を示
しているが、図示のように、APの処理実行中に割込要
求が発生すると、APの処理が中断されて割込ハンドラ
が起動される。割込ハンドラは起動されるとシステムコ
ールによってOSを呼び出し、OSによるレジスタの保
存などが終了するとOSより実行が移されて本来の割込
処理を実行する。割込処理を終了すると再びシステムコ
ールを行い、以後OSがレジスタの復帰などを行って中
断していたAPの処理を再開する。
FIG. 9 shows a transition state of processing at the time of interrupt processing. As shown in FIG. 9, when an interrupt request is generated during execution of AP processing, processing of the AP is interrupted and an interrupt handler is executed. Is started. When activated, the interrupt handler calls the OS by a system call, and when the OS finishes saving a register or the like, execution is transferred from the OS to execute the original interrupt processing. When the interrupt processing is completed, a system call is performed again, and thereafter, the OS resumes the register and resumes the interrupted AP processing.

【0028】図10は以上におけるCPUとOSの処理の
フロー図で、S11〜S14及びS21〜S23はフローの各ス
テップを示す記号である。図10の(1) は割込ハンドラ起
動時のフローを示しているが、割込処理の開始時は図示
のように、割込ベクタにより割込ハンドラを起動し(S
11) 、割込ハンドラよりのシステムコールによりOSの
割込ハンドラ起動処理部がCPU内部レジスタの保存
(S12) と割込要因の解析(S13) を行い、処理を割込
ハンドラに移して(S14) 処理を終了する。
FIG. 10 is a flow chart of the processing of the CPU and the OS described above. S11 to S14 and S21 to S23 are symbols indicating the steps of the flow. FIG. 10 (1) shows the flow when the interrupt handler is activated. At the start of the interrupt processing, the interrupt handler is activated by the interrupt vector as shown in FIG.
11) In response to a system call from the interrupt handler, the interrupt handler activation processing unit of the OS stores the CPU internal register (S12) and analyzes the cause of the interrupt (S13), and shifts the processing to the interrupt handler (S14). ) End the processing.

【0029】図10の(2) は割込ハンドラ終了時のフロー
であり、割込ハンドラよりのシステムコールにより処理
の終了を通知された割込ハンドラ終了処理部が終了処理
を行うが、多重割込が行われていた場合はスタック領域
に保存されていた中断中の割込ハンドラのアドレスを管
理領域に復帰させ(S21) 、PIC2の終了処理(S2
2) と内部レジスタの復帰(S23) を行い、中断してい
た処理を再開する。
FIG. 10 (2) shows a flow when the interrupt handler is terminated. The interrupt handler termination processing unit notified of the termination of the processing by the system call from the interrupt handler performs termination processing. If the interrupt has been performed, the address of the interrupted interrupt handler stored in the stack area is returned to the management area (S21), and the PIC2 is terminated (S2
2) and the internal register is restored (S23), and the interrupted processing is resumed.

【0030】[0030]

【発明が解決しようとする課題】以上のように、従来技
術ではOSがもつ割込要因解析機能、レジスタ保存機能
及び割込状態管理機能を用いてユーザが作成した割込ハ
ンドラに割込処理を行わせているが、次のような問題を
有している。
As described above, in the prior art, the interrupt processing is performed to the interrupt handler created by the user using the interrupt factor analysis function, the register storage function, and the interrupt state management function of the OS. It has the following problems.

【0031】(1) ユーザが作成する割込ハンドラは起
動後にシステムコールを行ってOSにレジスタの保存な
どを行わせているが、割込ハンドラを高級言語で記述す
るとシステムコールの際に先ず処理に必要な数値を転送
し、保存し終わっていないレジスタを使用する可能性が
あるため、高級言語のみで割込ハンドラを作成すること
ができない。
(1) The interrupt handler created by the user performs a system call after startup to cause the OS to save registers and the like. However, if the interrupt handler is described in a high-level language, it is processed first in the system call. It is not possible to create an interrupt handler using only high-level languages, because it may use registers that have not been saved and transfer the necessary values to

【0032】(2) 割込ハンドラの中で分岐などが行わ
れていると、終了処理が正確に行われず、終了時のシス
テムコールに誤りが発生し易いため、ユーザは割り込み
の状態を意識して割込ハンドラを作成する必要がある。
(2) If a branch or the like is performed in the interrupt handler, the termination processing is not performed accurately and an error is likely to occur in the system call at the time of termination. Need to create an interrupt handler.

【0033】(3) 割り込みの際にデータ・セグメント
を変更する必要が生ずるため、OSとの間でデータ・セ
グメントの設定についての手順が必要となり、割込ハン
ドラの作成が複雑となる。
(3) Since it is necessary to change the data segment at the time of an interrupt, a procedure for setting the data segment with the OS is required, and the creation of the interrupt handler becomes complicated.

【0034】(4) 割込要因の解析の際にOSのオーバ
ーヘッドが大きくなる。即ち、従来技術は割込ハンドラ
の作成が難しく、OSのオーバーヘッドが大きいという
欠点を有している。
(4) The OS overhead increases when analyzing the cause of the interrupt. That is, the prior art has the drawback that it is difficult to create an interrupt handler and the OS overhead is large.

【0035】本発明は、割込ハンドラの作成が容易で、
OSのオーバーヘッドが少ない割込管理方法を提供する
ことを目的とする。
The present invention makes it easy to create an interrupt handler,
An object of the present invention is to provide an interrupt management method with a small OS overhead.

【0036】[0036]

【課題を解決するための手段】図1は本発明の基本構成
図である。図中、1はマイクロプロセッサ(CPU)、
10はオペレーティング・システム(OS)、31は外部割
込における割込要因ごとの処理を規定する割込ハンド
ラ、20は外部装置(図示省略)より割込要求を受けた前
記マイクロプロセッサ1より起動されたときにソフト割
込を指定して前記割込ハンドラ31への処理移行前に前記
オペレーティングシステム10に処理を移行させる二重割
込指定手段である。
FIG. 1 is a basic configuration diagram of the present invention. In the figure, 1 is a microprocessor (CPU),
10 is an operating system (OS), 31 is an interrupt handler that defines processing for each interrupt factor in an external interrupt, and 20 is activated by the microprocessor 1 that has received an interrupt request from an external device (not shown). This is a double interrupt designating means for designating a software interrupt and transferring the processing to the operating system 10 before the processing shifts to the interrupt handler 31 when the processing is shifted to the interrupt handler 31.

【0037】11は前記オペレーティングシステム10内に
おいて、前記二重割込指定手段20を介して処理を移行さ
れたときに、割込要因の解析と前記マイクロプロセッサ
1の内部レジスタ類(図示省略)の保存を行ったのち、
前記割込ハンドラ31を起動する割込ハンドラ起動処理手
段、12は前記オペレーティングシステム10内において、
前記割込ハンドラ31より割込処理の終了を通知されたと
きに、前記内部レジスタ類の復帰と前記外部装置に対す
る割込終了処理を行ったのち、中断した前記プログラム
処理を再開させる割込ハンドラ終了処理手段である。
Reference numeral 11 denotes an analysis of an interrupt factor and a check of internal registers (not shown) of the microprocessor 1 when the processing is shifted through the double interrupt designating means 20 in the operating system 10. After saving,
Interrupt handler activation processing means for activating the interrupt handler 31, 12 in the operating system 10,
When the end of the interrupt processing is notified from the interrupt handler 31, the return of the internal registers and the end processing of the interrupt to the external device are performed, and then the interrupt handler for resuming the interrupted program processing is ended. Processing means.

【0038】[0038]

【作用】図1において、OS10を介してプログラム処理
を実行中のCPU1が外部装置より割込要求を受ける
と、実行中のプログラム処理を中断して二重割込指定手
段20にアクセスする。
In FIG. 1, when the CPU 1 executing the program processing receives an interrupt request from an external device via the OS 10, the executing program processing is interrupted and the double interrupt specifying means 20 is accessed.

【0039】二重割込指定手段20はCPU1に対して割
込ハンドラ31が記憶されている番地を直接知らせずに、
ソフト割込の実行を指定する。このため、外部装置より
の割込要求により直接割込ハンドラ31に処理が移され
ず、ソフト割込処理が開始される。
The double interrupt designating means 20 does not directly inform the CPU 1 of the address where the interrupt handler 31 is stored.
Specify execution of soft interrupt. Therefore, the processing is not directly transferred to the interrupt handler 31 by the interrupt request from the external device, and the soft interrupt processing is started.

【0040】ソフト割込処理は外部割込に優先して行わ
れるが、その際、ユーザが作成した割込ハンドラ31の代
わりにOS10内部において割込処理の役割をもつ割込ハ
ンドラ起動処理手段11が記憶されている番地を指定す
る。これにより、割込要求が行われたときに、CPU1
のハード的な動作によって割込ハンドラ31に直接処理が
移されずにOS10に処理が移される。
The software interrupt processing is performed prior to the external interrupt. At this time, instead of the interrupt handler 31 created by the user, the interrupt handler activation processing means 11 having the role of the interrupt processing inside the OS 10 Specify the address where is stored. Thereby, when the interrupt request is made, the CPU 1
The processing is transferred to the OS 10 without directly transferring the processing to the interrupt handler 31 due to the hardware operation.

【0041】処理を移されたOS10内の割込ハンドラ起
動処理手段11は割込要因の解析とCPU1の内部レジス
タ類の保存を行ったのち、前記割込ハンドラ31を起動す
る。前記割込要因の解析によって割込要求を行った外部
装置が識別され、以後、OSが割込状態を管理すること
が可能となるが、この割込要因の解析は外部装置側にア
クセスすることなく簡単な方法で行われる(詳細後
述)。
The interrupt handler activation processing means 11 in the OS 10 to which the processing has been transferred analyzes the cause of the interrupt and saves the internal registers of the CPU 1, and then activates the interrupt handler 31. The external device that has issued the interrupt request is identified by the analysis of the interrupt factor, and the OS can thereafter manage the interrupt status. However, the analysis of the interrupt factor requires access to the external device. It is done in a simple way (details later).

【0042】起動された割込ハンドラ31は割込処理を実
行し、処理を終了するとOS10内の割込ハンドラ終了処
理手段12に割込処理の終了を通知する。割込ハンドラ終
了処理手段12は前記内部レジスタ類の復帰と前記外部装
置に対する割込終了処理を行ったのち、中断した前記プ
ログラム処理を再開させる。
The activated interrupt handler 31 executes the interrupt processing, and when the processing ends, notifies the interrupt handler end processing means 12 in the OS 10 of the end of the interrupt processing. The interrupt handler termination processing means 12 resumes the interrupted program processing after performing the restoration of the internal registers and the interruption termination processing for the external device.

【0043】以上のように、図1の構成においては外部
割込が発生したときにCPU1が直接割込ハンドラ31に
処理を移さずにOS10内の割込ハンドラ起動処理手段11
に処理を移し、内部レジスタ類の保存と割込要因の解析
を行ってから割込ハンドラ31を起動する。
As described above, in the configuration of FIG. 1, when an external interrupt occurs, the CPU 1 does not directly transfer the processing to the interrupt handler 31 but the interrupt handler activation processing means 11 in the OS 10
Then, after saving the internal registers and analyzing the cause of the interrupt, the interrupt handler 31 is started.

【0044】このため、割込ハンドラ31はシステムコー
ルによってレジスタの保存などを要求する必要がなくな
り、割込処理の内容のみをすべて高級言語で作成するこ
とが可能となる。また、OSにおける割込要因の解析が
簡単となるため、OSのオーバーヘッドが小さくなる。
Therefore, the interrupt handler 31 does not need to request the saving of registers or the like by a system call, and it is possible to create only the contents of the interrupt processing in a high-level language. In addition, since the analysis of the interrupt factor in the OS is simplified, the overhead of the OS is reduced.

【0045】[0045]

【実施例】図2は本発明の実施例のシステム構成図、図
3は本発明の実施例のメモリ構成図、図4は本発明の実
施例の処理移行状態を説明する図、図5は本発明の実施
例のフロー図である。
FIG. 2 is a system configuration diagram of an embodiment of the present invention, FIG. 3 is a memory configuration diagram of an embodiment of the present invention, FIG. 4 is a diagram for explaining a process transition state of the embodiment of the present invention, and FIG. It is a flow figure of the example of the present invention.

【0046】全図を通じ、同一記号は同一対象物を示
し、1はマイクロプロセッサ(CPU)、1aはプログラ
ムカウンタ(PC)、1bはスタックポインタ(SP)、
2は割込コントローラ(PIC)、3-1,3-2は外部装
置、10はOS、11〜13はOS10を構成する各部で、11は
割込ハンドラ起動処理部、12は割込ハンドラ終了処理
部、13は実行管理部、14は割込ハンドラアドレステーブ
である。
Throughout the drawings, the same symbols indicate the same objects, 1 is a microprocessor (CPU), 1a is a program counter (PC), 1b is a stack pointer (SP),
2 interrupt controller (PIC), 3- 1, 3- 2 is an external device, 10 OS, 11 to 13 in the respective sections constituting the OS 10, 11 interrupt handler activation processing section, 12 end interrupt handler Processing unit, 13 is execution management unit , 14 is interrupt handler address table
Is Le.

【0047】21, 22は二重割込指定部20を構成する部分
で、21は割込ベクタ領域、22は二重割込指定テーブルで
ある。また、31は割込ハンドラ、32はアプリケーション
・プログラム(AP)、33はRAM上に設けらるスタッ
ク領域である。
Numerals 21 and 22 are parts constituting the double interrupt designating section 20, 21 is an interrupt vector area, and 22 is a double interrupt designating table. 31 is an interrupt handler, 32 is an application program (AP), and 33 is a stack area provided on the RAM.

【0048】図2はCPU1として8086シリーズの
マイクロプロセッサを使用した本発明の実施例のマイク
ロプロセッサ・システムの構成図を示している。説明の
便から図2及び図3には2台の外部装置3-1, 3-2のみ
を記載している。以下、図2及び図3により本発明の実
施例を説明するが、従来技術と重複する部分については
説明を省略する。
FIG. 2 is a block diagram of a microprocessor system according to an embodiment of the present invention using an 8086 series microprocessor as the CPU 1. For convenience of explanation, FIGS. 2 and 3 show only two external devices 3 -1 and 3 -2 . Hereinafter, an embodiment of the present invention will be described with reference to FIGS. 2 and 3, but the description of the same parts as those of the related art will be omitted.

【0049】いま、CPU1がOS10の管理のもとでA
P32の1200番地を実行中であり、PC1aが次の1201番地
を指している状態で外部装置3-1より割込要求があった
ものとする。PIC2がこれをCPU1に伝えると、C
PU1は従来技術におけると同様、SP1bが指している
スタック領域33にPC1aの指している番地情報"1201"を
中断するAP32の再開アドレスとして退避させる。これ
とともにSP1bはスタック領域33内の次の番地に進み、
多重割込に備える。
Now, the CPU 1 executes A under the management of the OS 10.
A running 1200 address of P32, PC1a it is assumed that there is an interrupt request from the external device 3-1 in a state in which points to the next address 1201. When PIC2 transmits this to CPU1, C
PU1 saves the address information "1201" pointed to by PC1a in the stack area 33 pointed to by SP1b as the restart address of the AP32 to be interrupted, as in the prior art. At the same time, SP1b proceeds to the next address in the stack area 33,
Prepare for multiple interrupts.

【0050】次いで、CPU1は従来技術と同様、割込
ベクタ領域21のタイプ0の番地にアクセスし、記憶され
ているアドレス情報"12340" を読み出す。これによって
PC1aは 12340番地の次の 12342番地に移るが、前記の
12340番地は従来技術と異なり、割込番号に対応する割
込ハンドラ23の先頭番地ではなく、二重割込指定テーブ
ル22の割込番号1に対応する番地である。
Next, as in the prior art, the CPU 1 accesses the type 0 address of the interrupt vector area 21 and reads out the stored address information "12340". This moves PC1a to address 12342, which is next to address 12340.
The address 12340 is different from the prior art, and is not the head address of the interrupt handler 23 corresponding to the interrupt number, but the address corresponding to the interrupt number 1 of the double interrupt designation table 22.

【0051】二重割込指定テーブル22は必要な割込番号
の数だけ用意されるが、各割込番号に対応するメモリに
は同一内容、即ち、ソフト割込の命令が記憶されてい
る。このソフト割込は外部装置よりの割り込みよりも優
先度が高いものであるが、この割り込みも外部割込と同
様、割込ベクタ領域21にアクセスして処理ルーチンが記
憶されているメモリ領域の先頭番地を得るようになって
いる。ここではソフト割込の割込ベクタ領域21へのアク
セスにタイプ255(物理アドレスは003FC)を使用する
ことが機械語によって設定されている。
The double interrupt designation table 22 is prepared by the number of necessary interrupt numbers, but the memory corresponding to each interrupt number stores the same contents, that is, the instruction of the soft interrupt. This soft interrupt has a higher priority than an interrupt from an external device. However, this interrupt also accesses the interrupt vector area 21 in the same manner as the external interrupt, and accesses the interrupt vector area 21 at the beginning of the memory area where the processing routine is stored. You get the address. Here, it is set by a machine language that the type 255 (physical address is 003FC) is used for accessing the interrupt vector area 21 of the soft interrupt.

【0052】上記ソフト割込により二重割込が行われた
ことになるため、最初の割込でPC1aが移っていたアド
レス値"12342" をSP1bが指しているスタック領域33に
記憶し、SP1bは次の番地に移る。
Since the double interruption has been performed by the software interruption, the address value "12342" to which the PC 1a has been shifted at the first interruption is stored in the stack area 33 pointed to by the SP 1b, and the SP 1b Moves to the next address.

【0053】ソフト割込が割込ベクタ領域21より得る情
報、例えば"20000" は図示のようにOS10の一部を構成
する割込ハンドラ起動処理部11の先頭番地となってい
る。割込ハンドラ起動処理部11は大別して、割込要因解
析部11a とレジスタ保存処理部11b により構成される
が、先のアドレス"20000" は割込要因解析部11a の先頭
番地となっており、ここで割込要因の解析が行われる。
The information obtained from the interrupt vector area 21 by the soft interrupt, for example, "20000" is the start address of the interrupt handler activation processing unit 11 which forms a part of the OS 10 as shown. The interrupt handler activation processing unit 11 is roughly divided into an interrupt factor analysis unit 11a and a register saving processing unit 11b, and the previous address "20000" is the first address of the interrupt factor analysis unit 11a. Here, the analysis of the interrupt factor is performed.

【0054】割込要因解析部11a には割込番号ごとの割
込ハンドラの先頭番地が2バイト間隔のアドレスに記憶
されているので、割込番号を算出すれば「 30000+
(割込番号) −2」の式により割込番号に対応する割込
ハンドラのアドレスが判るようになっている。
Since the start address of the interrupt handler for each interrupt number is stored in the interrupt factor analysis unit 11a at addresses at 2-byte intervals, if the interrupt number is calculated, "30000 + 2 ×
The address of the interrupt handler corresponding to the interrupt number can be determined by the expression (interrupt number) -2 ".

【0055】前記割込番号は、スタック領域33に記憶し
たアドレス値"12342" から割込ベクタ領域21の先頭に記
憶されているアドレス値の"12340" を引き、2で割るこ
とにより得られる。即ち、割込要因の解析は簡単な演算
を実行するのみで行われ、PIC2の内部レジスタ(図
示省略)にアクセスするが必要がないため、OSに大き
なオーバーヘッドを生ずることがない。
The interrupt number is obtained by subtracting “12340” of the address value stored at the head of the interrupt vector area 21 from the address value “12342” stored in the stack area 33 and dividing by 2. That is, the analysis of the interrupt factor is performed only by executing a simple operation, and there is no need to access an internal register (not shown) of the PIC 2, so that a large overhead does not occur in the OS.

【0056】この例では上記の演算により“1”が得ら
れ、この割り込みが割込番号1であることが識別され
る。そして 20000番地からの処理(割込要因解析部11a)
において、先に求めた割込番号1と割込ハンドラアドレ
ステーブル14から、割込ハンドラ31の処理に移ることが
できるが、それに先立ち、レジスタ保存処理部11b がC
PU1の内部レジスタの保存を行う。
In this example, "1" is obtained by the above operation, and it is identified that this interrupt is interrupt number 1. Processing from address 20,000 (interrupt factor analysis unit 11a)
In the above, the interrupt number 1 and the interrupt handler address
From the stable state 14, the processing can be shifted to the interrupt handler 31. Prior to this, the register saving processing unit 11b
The internal register of PU1 is saved.

【0057】内部レジスタ類の保存処理は従来技術にお
いて割込ハンドラよりのシステムコールによって行う内
容と同じであるが、本発明では割込ハンドラ31が関与せ
ずにすべてOS内部のみで行うことができるため、ユー
ザがレジスタ類の退避に配慮して割込ハンドラを作成す
る必要がない。なお、このとき、データ・セグメントの
付け替えなども行われる(詳細説明は省略)。
The processing for saving the internal registers is the same as that performed by the system call from the interrupt handler in the prior art, but in the present invention, all the processing can be performed only inside the OS without involving the interrupt handler 31. Therefore, there is no need for the user to create an interrupt handler in consideration of saving registers. At this time, replacement of data segments is also performed (detailed description is omitted).

【0058】レジスタ保存処理部11b はレジスタの保存
などが終わると割込ハンドラ31を呼び出すが、これは
込要因解析部11a が割込番号1と割込ハンドラアドレス
テーブル14から得たアドレス値により行うが、アドレス
値が例えば"3000"であれば、処理を3000番地に移すこと
により割込ハンドラ31による処理が開始される。
[0058] register storage processing unit 11b calls the interrupt handler 31 and such as register storage of the end, but this is split
The interrupt factor analysis unit 11a sets the interrupt number 1 and the interrupt handler address
The process is performed using the address value obtained from the table 14. If the address value is, for example, "3000", the process is moved to the address 3000, and the process by the interrupt handler 31 is started.

【0059】処理が割込ハンドラ31に移されたのちにも
し高位の割込要求があったときにはその割込処理に移
る。そのため、OS10は割込ハンドラ31による割込処理
中も割込状態即ち、現在の割込処理がどの外部装置より
の要求のものであるかを管理する必要があるが、これは
先に割込要因解析部11a により識別された割込番号をO
S内部に保存することにより可能である。
After the processing is transferred to the interrupt handler 31, if there is a higher-order interrupt request, the processing shifts to the interrupt processing. Therefore, the OS 10 needs to manage the interrupt state during the interrupt processing by the interrupt handler 31, that is, which external device requests the current interrupt processing. Enter the interrupt number identified by the factor analysis unit 11a as O
This is possible by storing it inside S.

【0060】以上のように、割込ハンドラ31はOSによ
って行われる処理がすべて終了したのちに起動されるた
め、CPU1の内部レジスタを保存したり、セグメント
の付け替えのためにアセンブラ言語を使用したり、特別
な手順を記述する必要がなく、割込処理内容のみを高級
言語だけを用いて記述することができる。その結果、こ
の割込ハンドラ31は通常のサブルーチンと同様に取り扱
うことができる。
As described above, since the interrupt handler 31 is started after all processes performed by the OS are completed, the internal handler of the CPU 1 is saved, or the assembler language is used for segment replacement. It is not necessary to describe a special procedure, and only the contents of the interrupt processing can be described using only a high-level language. As a result, the interrupt handler 31 can be handled in the same manner as a normal subroutine.

【0061】割込処理が終了する場合も割込ハンドラ31
は内部レジスタやセグメントに関する特別な記述を行う
必要がなく、サブルーチンからメインルーチンに戻す場
合に通常使用される命令、例えばRETURN命令でO
Sに処理を戻すことができ、これによりOSは割込処理
が終了したことを知ることができる。
The interrupt handler 31 also terminates the interrupt processing.
Does not need to make any special description about the internal registers and segments, and is normally used when returning from a subroutine to the main routine, for example, using a RETURN instruction.
The processing can be returned to S, whereby the OS can know that the interrupt processing has been completed.

【0062】割込ハンドラ31よりの割込終了通知により
OSの割込ハンドラ完了処理部12はレジスタの復帰など
の処理を行い、中断していたAP32の処理を再開させる
が、その処理内容は従来技術とほぼ同一であるので説明
を省略する。
In response to an interrupt completion notification from the interrupt handler 31, the interrupt handler completion processing unit 12 of the OS performs a process such as restoring a register and resumes the interrupted process of the AP 32. The description is omitted because it is almost the same as the technology.

【0063】図4は以上における処理の移行状態を図示
したものであるが、図示のように、割込ハンドラは割込
処理の際にCPUがレジスタの保存などの処理をすべて
終了したのちに呼び出されるため、割込ハンドラ23の処
理内容は非常に簡単になる。
FIG. 4 shows the transition state of the processing described above. As shown in the figure, the interrupt handler is called after the CPU completes all the processing such as register saving during the interrupt processing. Therefore, the processing contents of the interrupt handler 23 become very simple.

【0064】図5は以上における割込ハンドラ起動時の
CPUとOSの処理をフロー図に示したものであり、S
1〜S5はフローの各ステップを示す。割込が発生する
とCPUのハード処理によって二重割込指定テーブルに
無条件で分岐(S1) させたのち、二重割込指定テーブ
ルにおいてタイプ255のソフト割込を発生(S2)さ
せ、割込ハンドラ起動処理部において割込要因の解析
(S3)とCPU内部レジスタの保存(S4)を行う。
これらの処理が終わった時点で割込ハンドラを起動する
(S5)。
FIG. 5 is a flowchart showing processing of the CPU and the OS when the interrupt handler is activated as described above.
1 to S5 indicate each step of the flow. If an interrupt occurs, the CPU unconditionally branches to the double interrupt specification table (S1) by hardware processing of the CPU, and then generates a type 255 software interrupt in the double interrupt specification table (S2). The handler activation processing unit analyzes the cause of the interrupt (S3) and saves the CPU internal register (S4).
When these processes are completed, an interrupt handler is activated (S5).

【0065】割込ハンドラの処理終了時の細部の処理は
前述のように従来技術と若干異なるが、フロー図上では
差がないので説明を省略する。以上、図2乃至図5によ
り本発明の実施例を説明したが、図2乃至図5はあくま
で本発明の一実施例を示したものに過ぎず、本発明が図
示したものに限定されるものでないことは勿論である。
Although the detailed processing at the end of the processing of the interrupt handler is slightly different from that of the prior art as described above, since there is no difference in the flow chart, the description is omitted. As described above, the embodiment of the present invention has been described with reference to FIGS. 2 to 5. However, FIGS. 2 to 5 show only one embodiment of the present invention, and are not limited to those shown in the present invention. Of course not.

【0066】例えば、上記の説明は8086シリーズの
マイクロプロセッサを例として行ったが、本発明がマイ
クロプロセッサの名称如何に関わらず同様な構成をもつ
マイクロプロセッサを使用するマイクロプロセッサ・シ
ステムに適用可能であることは明らかである。
For example, while the above description has been made with reference to the 8086 series microprocessor as an example, the present invention is applicable to a microprocessor system using a microprocessor having a similar configuration regardless of the name of the microprocessor. Clearly there is.

【0067】また、図3に示したメモリ構成におけるR
AMの記憶内容の一部をROMに移しても本発明の効果
が変わらないことは明らかであり、また、アドレスや記
憶内容が図示のものに限定されないことは当然である。
更に、OSが保存または付け替え処理を行う対象はレジ
スタやデータ・セグメントのみに限定されるものではな
く、他の名称を有する同種の構成要素を含むことは勿論
であり、本発明はマイクロプロセッサ・システムの構成
の変形を排除するものではない。
Further, R in the memory configuration shown in FIG.
It is clear that the effect of the present invention does not change even if a part of the storage contents of the AM is transferred to the ROM, and it goes without saying that the addresses and the storage contents are not limited to those shown.
Further, the target for the OS to perform the save or change process is not limited to the registers and the data segments, but includes the same kind of components having other names. This does not exclude the modification of the configuration.

【0068】[0068]

【発明の効果】以上説明したように、本発明において
は、OSが内部レジスタ類の保存などの処理をすべて終
了したのちに割込ハンドラを起動するため、割込ハンド
ラにレジスタの退避やデータ・セグメント付け替えのた
めの手順を記述する必要がない。このため、ユーザは外
部割込の処理内容を規定する割込ハンドラをすべて高級
言語で記述することができ、かつ、記述の簡明化にとも
ない誤処理が発生する可能性が減少する。また、割込要
因の解析が割込コントローラ(PIC)にアクセスする
ことなく簡単な演算によって行われるため、OSのオー
バーヘッドが減少する。
As described above, according to the present invention, since the OS activates the interrupt handler after all processes such as saving the internal registers have been completed, the interrupt handler saves registers and stores data and data. There is no need to describe the procedure for segment replacement. Therefore, the user can describe all interrupt handlers that define the processing content of the external interrupt in a high-level language, and the possibility of erroneous processing due to simplification of the description decreases. Further, since the analysis of the interrupt factor is performed by a simple calculation without accessing the interrupt controller (PIC), the overhead of the OS is reduced.

【0069】即ち、本発明は、割込管理を行うマイクロ
プロセッサ・システムにおける割込ハンドラの作成効率
と割込処理の効率の向上に大きく貢献する。
That is, the present invention greatly contributes to improving the efficiency of creating an interrupt handler and the efficiency of interrupt processing in a microprocessor system that performs interrupt management.

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

【図1】 本発明の基本構成図FIG. 1 is a basic configuration diagram of the present invention.

【図2】 本発明の実施例システム構成図FIG. 2 is a system configuration diagram of an embodiment of the present invention.

【図3】 本発明の実施例メモリ構成図FIG. 3 is a diagram illustrating a memory configuration according to an embodiment of the present invention;

【図4】 本発明の実施例処理移行状態説明図FIG. 4 is an explanatory diagram of a process transition state according to an embodiment of the present invention.

【図5】 本発明の実施例フロー図FIG. 5 is a flowchart of an embodiment of the present invention.

【図6】 マイクロプロセッサ・システム構成図FIG. 6 is a block diagram of a microprocessor system.

【図7】 従来技術のシステム構成図FIG. 7 is a system configuration diagram of a conventional technology.

【図8】 従来技術のメモリ構成図FIG. 8 is a memory configuration diagram of a conventional technology.

【図9】 従来技術の処理移行状態説明図FIG. 9 is an explanatory diagram of a process transition state according to the related art.

【図10】 従来技術のフロー図FIG. 10 is a flowchart of a conventional technology.

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

1 マイクロプロセッサ(CPU) 1a プログラムカウンタ(PC) 1b スタックポインタ(SP) 2 割込コントローラ(PIC) 3-1〜3-8 外部装置(I/O) 10 オペレーティング・システム(OS) 11 割込ハンドラ起動処理手段 12 割込ハンドラ終了処理手段 13 実行管理部14 割込ハンドラアドレステーブル 20 二重割込指定手段 21 割込ベクタ領域 22 二重割込指定テーブル 31 割込ハンドラ 32 アプリケーション・プログラム(AP) 33 スタック領域DESCRIPTION OF SYMBOLS 1 Microprocessor (CPU) 1a Program counter (PC) 1b Stack pointer (SP) 2 Interrupt controller (PIC) 3-1 to 3-8 External device (I / O) 10 Operating system (OS) 11 Interrupt handler Start-up processing means 12 Interrupt handler termination processing means 13 Execution management unit 14 Interrupt handler address table 20 Double interrupt specification means 21 Interrupt vector area 22 Double interrupt specification table 31 Interrupt handler 32 Application program (AP) 33 Stack area

───────────────────────────────────────────────────── フロントページの続き (72)発明者 熱海 信夫 神奈川県横浜市港北区新横浜三丁目9番 18号 富士通コミュニケーション・シス テムズ株式会社内 (56)参考文献 特開 平2−158839(JP,A) 特開 平2−133828(JP,A) 特開 昭62−274434(JP,A) 特開 昭59−62937(JP,A) 特開 平2−299030(JP,A) 特開 昭63−296140(JP,A) 特開 昭61−196336(JP,A) 特開 昭51−27745(JP,A) インターフェース、Vol.16、N o.6,CQ出版株式会社(1990年)、 pp.131〜144(特許庁CSDB文献番 号:CSNW199800225001) C MAGAZINE、Vol.2、 No.2、株式会社日本ソフトバンク (1990年)、pp.86〜92(特許庁CS DB文献番号:CSNW199800150012) (58)調査した分野(Int.Cl.7,DB名) G06F 9/46 G06F 13/24 CSDB(日本国特許庁)──────────────────────────────────────────────────続 き Continuation of the front page (72) Inventor Nobuo Atami 3-9-1-18 Shin-Yokohama, Kohoku-ku, Yokohama-shi, Kanagawa Prefecture Inside Fujitsu Communication Systems Co., Ltd. (56) References JP-A-2-158839 (JP, A JP-A-2-133828 (JP, A) JP-A-62-274434 (JP, A) JP-A-59-62937 (JP, A) JP-A-2-299030 (JP, A) JP-A 63-274 296140 (JP, A) JP-A-61-196336 (JP, A) JP-A-51-27745 (JP, A) Interface, Vol. 16, No. 6, CQ Publishing Co., Ltd. (1990), pp. 131-144 (Patent Office CSDB literature number: CSNW199800225001) C MAGAZINE, Vol. 2, No. 2. Nippon SoftBank Corp. (1990), pp. 86-92 (Patent Office CS DB Document No .: CSNW199800150012) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 9/46 G06F 13/24 CSDB (Japan Patent Office)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 オペレーティングシステム(10)を介して
プログラム処理を実行中のマイクロプロセッサ(1) が外
部装置より割込要求を受けたときに実行中のプログラム
処理を中断して割込要因ごとの処理を規定する割込ハン
ドラ(31)に割込処理を行わさせるマイクロプロセッサ・
システムにおいて、 割込要求を受けた前記マイクロプロセッサ(1) より起動
されたときにソフト割込を指定して前記割込ハンドラ(3
1)への処理移行前に前記オペレーティングシステム(10)
に処理を移行させる二重割込指定手段(20)と、 前記オペレーティングシステム(10)内において、前記二
重割込指定手段(20)を介して処理を移行されたときに、
割込要因の解析と前記マイクロプロセッサ(1)の内部レ
ジスタ類の保存を行ったのち、前記割込ハンドラ(31)を
起動する割込ハンドラ起動処理手段(11)と、 前記オペレーティングシステム(10)内において、前記割
込ハンドラ(31)より割込処理の終了を通知されたとき
に、前記内部レジスタ類の復帰と前記外部装置に対する
割込終了処理を行ったのち、中断した前記プログラム処
理を再開させる割込ハンドラ終了処理手段(12)を備えた
ことを特徴とするマイクロプロセッサ・システムの割込
管理方法。
When a microprocessor executing a program processing via an operating system receives an interrupt request from an external device, the microprocessor interrupts the program processing being executed and interrupts the processing for each interrupt factor. A microprocessor that causes an interrupt handler (31) that regulates processing to perform interrupt processing
In the system, when activated by the microprocessor (1) having received the interrupt request, a software interrupt is designated and the interrupt handler (3) is designated.
Before the process shift to 1), the operating system (10)
A double interrupt designating means (20) that shifts the processing to, and when the processing is shifted through the double interrupt designating means (20) in the operating system (10),
An interrupt handler activation processing means (11) for activating the interrupt handler (31) after analyzing an interrupt factor and storing the internal registers of the microprocessor (1), and the operating system (10) When the completion of the interrupt processing is notified from the interrupt handler (31), the internal registers are restored and the interrupt processing for the external device is performed, and then the interrupted program processing is resumed. An interrupt management method for a microprocessor system, comprising interrupt handler termination processing means (12) for causing the interrupt handler to terminate.
JP02422692A 1992-02-12 1992-02-12 Interrupt management method for microprocessor system Expired - Fee Related JP3209560B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP02422692A JP3209560B2 (en) 1992-02-12 1992-02-12 Interrupt management method for microprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP02422692A JP3209560B2 (en) 1992-02-12 1992-02-12 Interrupt management method for microprocessor system

Publications (2)

Publication Number Publication Date
JPH05224951A JPH05224951A (en) 1993-09-03
JP3209560B2 true JP3209560B2 (en) 2001-09-17

Family

ID=12132357

Family Applications (1)

Application Number Title Priority Date Filing Date
JP02422692A Expired - Fee Related JP3209560B2 (en) 1992-02-12 1992-02-12 Interrupt management method for microprocessor system

Country Status (1)

Country Link
JP (1) JP3209560B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3600095B2 (en) 1999-12-07 2004-12-08 松下電器産業株式会社 Interrupt management device and interrupt management method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
C MAGAZINE、Vol.2、No.2、株式会社日本ソフトバンク(1990年)、pp.86〜92(特許庁CSDB文献番号:CSNW199800150012)
インターフェース、Vol.16、No.6,CQ出版株式会社(1990年)、pp.131〜144(特許庁CSDB文献番号:CSNW199800225001)

Also Published As

Publication number Publication date
JPH05224951A (en) 1993-09-03

Similar Documents

Publication Publication Date Title
JP3659062B2 (en) Computer system
US6513057B1 (en) Heterogeneous symmetric multi-processing system
US5634046A (en) General purpose use of a stack pointer register
US6711605B2 (en) Multi OS configuration method and computer system
US5594903A (en) Operating System architecture with reserved memory space resident program code identified in file system name space
US5369770A (en) Standardized protected-mode interrupt manager
JP2644780B2 (en) Parallel computer with processing request function
JPH1124943A (en) Computer restart method and computer stop method
JPH08314733A (en) Computer system and method for support of two endians
JPH11149385A (en) Multi-OS configuration method
JP2539913B2 (en) Data processing system
JPH0544054B2 (en)
JP2001290665A (en) Processor system
JP2991242B2 (en) How to use a multiprocessor computer system
JP3209560B2 (en) Interrupt management method for microprocessor system
JP2001216172A (en) Multi-OS configuration method
US6263421B1 (en) Virtual memory system that is portable between different CPU types
JPS6049352B2 (en) data processing equipment
JP3163196B2 (en) Instruction interruption information storage control method in virtual storage control
JPH09231069A (en) Information processing method and apparatus
JPH0219494B2 (en)
JPH05265846A (en) Memory management method
JP3029445B2 (en) Startup reception device and method
JPH0217822B2 (en)
JPH0677236B2 (en) Apparatus and method for simulating I/O interrupts - Patents.com

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090713

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees