JP2012098985A - Direct memory access control device, direct memory access control system, program, image processing device and compound machine - Google Patents

Direct memory access control device, direct memory access control system, program, image processing device and compound machine Download PDF

Info

Publication number
JP2012098985A
JP2012098985A JP2010247187A JP2010247187A JP2012098985A JP 2012098985 A JP2012098985 A JP 2012098985A JP 2010247187 A JP2010247187 A JP 2010247187A JP 2010247187 A JP2010247187 A JP 2010247187A JP 2012098985 A JP2012098985 A JP 2012098985A
Authority
JP
Japan
Prior art keywords
memory access
dma
address
direct memory
access control
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
JP2010247187A
Other languages
Japanese (ja)
Inventor
Mikio Nao
幹夫 尚
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Data Corp
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 Oki Data Corp filed Critical Oki Data Corp
Priority to JP2010247187A priority Critical patent/JP2012098985A/en
Publication of JP2012098985A publication Critical patent/JP2012098985A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To prevent malfunction continuation by memory access to a transfer source and a transfer area while DMA is running.SOLUTION: A DMA controller performing transfer control of DMA and memory access using the same system bus comprises: registers 22-25 in which address range of a transfer source in DMA and address range of a transfer destination in DMA are stored; and an unauthorized access detection circuit 1 which outputs an unauthorized access alarm signal showing that data in memory access is an unauthorized access, if a designated address is in the address range of the transfer source of DMA or in the address range of the transfer destination of DMA when the address for data transfer in the memory access is designated on the system bus.

Description

本発明は、ダイレクトメモリアクセスに用いられるダイレクトメモリアクセス制御装置、ダイレクトメモリアクセス制御システム、プログラム、画像処理装置および複合機の技術に関するものである。   The present invention relates to a technology of a direct memory access control device, a direct memory access control system, a program, an image processing device, and a multifunction peripheral used for direct memory access.

従来、ダイレクトメモリアクセス(Direct Memory Access:以下、DMAと称する)の動作において、DMA実行中では、システムバスが、DMAコントローラにバス権を与えている。そのため、プロセッサを含むその他の周辺回路はシステムバスから切り離され、アクセスすることができない。
しかし、近年、システム性能向上のため、周辺I/O(Input/Output)デバイスに対するDMA動作など、低速のDMA動作に関しては、DMA終了アドレスに到達するまでの期間であっても、より優先度の高いデバイスからのバスアクセス要求に対しては、バス権をDMAコントローラから他のデバイスに渡すことが一般的になってきた。
したがって、DMA起動中であっても、プロセッサや他のDMAコントローラによるシステムバスへのアクセスが発生する場合がある。
Conventionally, in the operation of direct memory access (hereinafter referred to as DMA), the system bus gives the bus right to the DMA controller during DMA execution. Therefore, other peripheral circuits including the processor are disconnected from the system bus and cannot be accessed.
However, in recent years, in order to improve system performance, low-speed DMA operations, such as DMA operations for peripheral I / O (Input / Output) devices, have a higher priority even during the period until the DMA end address is reached. In response to a bus access request from a high device, it has become common to pass the bus right from the DMA controller to another device.
Therefore, even during DMA activation, access to the system bus by a processor or another DMA controller may occur.

特許文献1には、以下の方法で、DMAライト(Write)による主記憶装置への書き込みが、CPU(プロセッサ)からの読み出しに追い越されて、不正データが読み出されたり、データが失われるのを防ぐアクセス制御装置が開示されている。すなわち、特許文献1に記載のアクセス制御装置は、DMAによる画像処理において、DMA制御装置(DMAコントローラ)が最後のデータの書き込みを終了し、この書込データをメモリ制御装置内のバッファに滞留させる。そして、アクセス制御装置は、メモリへのデータの書き込みが完全に終了する前に、該メモリ領域へのCPUによるアクセスが発生した場合、DMA制御装置によりメモリ書き込み要求の発生しているメモリアドレスと、CPUによるアクセス要求が出されたメモリアドレスとを比較する。比較の結果、メモリアドレスが一致していた場合、アクセス制御装置は、メモリ制御装置内バッファに滞留しているデータ書き込みが終了するまでCPUによるアクセスを制限する。   In Patent Document 1, writing to the main storage device by DMA write (Write) is overtaken by reading from the CPU (processor) by the following method, and illegal data is read or data is lost. An access control apparatus for preventing the above is disclosed. That is, in the access control device described in Patent Document 1, in the image processing by DMA, the DMA control device (DMA controller) finishes writing the last data, and this write data is retained in the buffer in the memory control device. . Then, if the access to the memory area occurs before the data writing to the memory is completely completed, the access control device, the memory address at which the memory write request is generated by the DMA control device, The memory address to which the access request by the CPU is issued is compared. If the memory addresses match as a result of the comparison, the access control device restricts the access by the CPU until the data writing staying in the buffer in the memory control device is completed.

特開平6−231032号公報JP-A-6-231032

しかしながら、特許文献1に記載のアクセス制御では、CPU(プロセッサ)からのアクセス要求アドレスと、アクセス制御装置内のバッファに溜まっているデータ書き込み要求アドレスとの比較のみを行っているため、DMAが停止する前のDMA転送先領域への不正アクセスや、DMA転送元領域への不正アクセスに対しては効果がないという問題がある。   However, in the access control described in Patent Document 1, DMA is stopped because only the access request address from the CPU (processor) is compared with the data write request address stored in the buffer in the access control device. There is a problem that there is no effect on unauthorized access to the DMA transfer destination area before the data transfer or unauthorized access to the DMA transfer source area.

本発明は、このような問題を解決するためになされたものであり、DMA実行中の転送元および転送領域へのメモリアクセスによる誤動作継続防止を可能とすることを目的とする。   The present invention has been made to solve such a problem, and an object of the present invention is to make it possible to prevent malfunctions due to memory access to a transfer source and a transfer area during DMA execution.

前記した課題を解決するため、本発明は、同一のシステムバスを用いて、DMAおよびメモリアクセスの転送制御を行うDMA制御装置であって、前記DMAにおける転送元のアドレス範囲、および前記DMAにおける転送先のアドレス範囲が格納される記憶手段と、前記メモリアクセスにおけるデータ転送を行うためのアドレスが、前記システムバス上に指定されると、前記指定されたアドレスが、前記DMAの転送元のアドレス範囲内、もしくは前記DMAの転送先のアドレス範囲内のアドレスである場合、前記メモリアクセスにおけるデータは、不正アクセスである旨の不正アクセス警告信号を出力する不正アクセス検出手段と、を有することを特徴とする。   In order to solve the above-described problems, the present invention provides a DMA control device that performs transfer control of DMA and memory access using the same system bus, and includes a transfer source address range in the DMA and transfer in the DMA When the storage means for storing the previous address range and the address for performing data transfer in the memory access are designated on the system bus, the designated address is the address range of the DMA transfer source. Or unauthorized access detection means for outputting an unauthorized access warning signal indicating that the data in the memory access is unauthorized access when the address is within the address range of the DMA transfer destination. To do.

本発明によれば、DMA実行中の転送元および転送領域へのメモリアクセスによる誤動作継続防止が可能となる。   According to the present invention, it is possible to prevent continuation of malfunction due to memory access to a transfer source and transfer area during DMA execution.

第1実施形態に係る不正アクセス検出回路の構成例を示す図である。It is a figure which shows the structural example of the unauthorized access detection circuit which concerns on 1st Embodiment. 第1実施形態に係る画像処理装置の構成例を示す図である。It is a figure which shows the structural example of the image processing apparatus which concerns on 1st Embodiment. 第1実施形態に係るDMAコントローラの構成例を示す図である。It is a figure which shows the structural example of the DMA controller which concerns on 1st Embodiment. DMAコントローラにおける処理の流れを示すフローチャートである(その1)。It is a flowchart which shows the flow of a process in a DMA controller (the 1). DMAコントローラにおける処理の流れを示すフローチャートである(その2)。It is a flowchart which shows the flow of a process in a DMA controller (the 2). 第1実施形態に係る不正アクセス検出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the unauthorized access detection process which concerns on 1st Embodiment. 第2実施形態に係るDMA制御システムの構成例を示す図である。It is a figure which shows the structural example of the DMA control system which concerns on 2nd Embodiment. 第2実施形態に係るDMA制御システムにおける処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the DMA control system which concerns on 2nd Embodiment. 第2実施形態に係る割込処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the interruption process which concerns on 2nd Embodiment. 第1実施形態および第2実施形態に係る画像処理装置およびDMA制御システムを搭載した複合機の斜視概略図である。FIG. 3 is a schematic perspective view of a multi-function peripheral equipped with an image processing apparatus and a DMA control system according to the first and second embodiments.

以下に、図面を参照して本発明によるDMA制御装置、DMA制御システムの実施形態について説明する。なお、一方のDMAコントローラ(ダイレクトメモリアクセス)によるDMAと、他方のDMAコントローラ(メモリアクセス)によるDMAとは速度が異なり、双方のDMAが同時期に実行されることも前提としている。なお、他方のDMAコントローラによるDMAは、DMAに限らず一般的なメモリアクセスでもよい。   Embodiments of a DMA control device and a DMA control system according to the present invention will be described below with reference to the drawings. Note that it is assumed that the DMA by one DMA controller (direct memory access) and the DMA by the other DMA controller (memory access) are different in speed, and both DMAs are executed at the same time. The DMA by the other DMA controller is not limited to DMA, but may be general memory access.

《第1実施形態》
まず、図1〜図6を参照して、本発明に係る第1実施形態を説明する。なお、本実施形態におけるDMAは、スキャナから送られてくる画像データや、ホストインタフェースから送られてくる画像データ、PC(Personal Computer)から送られてくる画像データなどを対象とすることを想定している。
<< First Embodiment >>
First, a first embodiment according to the present invention will be described with reference to FIGS. It is assumed that the DMA in this embodiment is intended for image data sent from a scanner, image data sent from a host interface, image data sent from a PC (Personal Computer), and the like. ing.

(不正アクセス検出回路の構成)
図1は、第1実施形態に係る不正アクセス検出回路の構成例を示す図である。
不正アクセス検出回路(不正アクセス検出手段)1は、図2および図3に示すDMAコントローラ2に含まれるものである。
不正アクセス検出回路1は、4つのアドレス比較器11(11a〜11d)、転送元用ANDゲート12、転送先用ANDゲート13およびORゲート14を有する。
アドレス比較器11aは、DMAコントローラ2に含まれるDMA転送元開始アドレスレジスタ22の転送元開始アドレスと、アドレスバス81(図3)から送られたバスアドレスとを比較する機能を有する。
アドレス比較器11bは、DMAコントローラ2に含まれるDMA転送元終了アドレスレジスタ23の転送元終了アドレスと、アドレスバス81(図3)から送られたバスアドレスとを比較する機能を有する。
アドレス比較器11cは、DMAコントローラ2に含まれるDMA転送先開始アドレスレジスタ24の転送先開始アドレスと、アドレスバス81(図3)から送られたバスアドレスとを比較する機能を有する。
アドレス比較器11dは、DMAコントローラ2に含まれるDMA転送先終了アドレスレジスタ25の転送先終了アドレスと、アドレスバス81(図3)から送られたバスアドレスとを比較する機能を有する。
DMA起動中信号53は、自身のDMAコントローラ2がDMA起動中である場合に「P」すなわち「1」となる信号である。DMA読出アクセス信号51は、自身のDMAコントローラ2による読み出しが発生したとき「N」すなわち「0」となる信号である。DMA書込アクセス信号52は、自身のDMAコントローラ2による書き込みが発生したとき「N」すなわち「0」となる信号である。
(Configuration of unauthorized access detection circuit)
FIG. 1 is a diagram illustrating a configuration example of an unauthorized access detection circuit according to the first embodiment.
The unauthorized access detection circuit (unauthorized access detection means) 1 is included in the DMA controller 2 shown in FIGS.
The unauthorized access detection circuit 1 includes four address comparators 11 (11a to 11d), a transfer source AND gate 12, a transfer destination AND gate 13, and an OR gate 14.
The address comparator 11a has a function of comparing the transfer source start address of the DMA transfer source start address register 22 included in the DMA controller 2 with the bus address sent from the address bus 81 (FIG. 3).
The address comparator 11b has a function of comparing the transfer source end address of the DMA transfer source end address register 23 included in the DMA controller 2 with the bus address sent from the address bus 81 (FIG. 3).
The address comparator 11c has a function of comparing the transfer destination start address of the DMA transfer destination start address register 24 included in the DMA controller 2 with the bus address sent from the address bus 81 (FIG. 3).
The address comparator 11d has a function of comparing the transfer destination end address of the DMA transfer destination end address register 25 included in the DMA controller 2 with the bus address sent from the address bus 81 (FIG. 3).
The DMA activation signal 53 is a signal that becomes “P”, that is, “1” when the own DMA controller 2 is DMA activation. The DMA read access signal 51 is a signal that becomes “N”, that is, “0” when reading by the own DMA controller 2 occurs. The DMA write access signal 52 is a signal that becomes “N”, that is, “0” when writing by its own DMA controller 2 occurs.

転送元用ANDゲート12は、図3で後記するDMA転送元アドレスレジスタ26から入力されるDMA読出アクセス信号51と、図3で後記するDMA転送先アドレスレジスタ27から入力されるDMA書込アクセス信号52と、図3で後記するDMAコントローラ制御レジスタ21から入力されるDMA起動中信号53と、アドレス比較器11aからの比較結果信号と、アドレス比較器11bからの比較結果信号との5つの信号の論理積を出力する機能を有する。
また、転送先用ANDゲート13は、図3で後記するDMA転送元アドレスレジスタ26から入力されるDMA読出アクセス信号51と、図3で後記するDMA転送先アドレスレジスタ27から入力されるDMA書込アクセス信号52と、図3で後記するDMAコントローラ制御レジスタ21から入力されるDMA起動中信号53と、アドレス比較器11cからの比較結果信号と、アドレス比較器11dからの比較結果信号との5つの信号の論理積を出力する機能を有する。
The transfer source AND gate 12 receives a DMA read access signal 51 input from a DMA transfer source address register 26 described later in FIG. 3 and a DMA write access signal input from a DMA transfer destination address register 27 described later in FIG. 52, a DMA activation signal 53 input from the DMA controller control register 21 described later in FIG. 3, a comparison result signal from the address comparator 11a, and a comparison result signal from the address comparator 11b. It has a function of outputting a logical product.
The transfer destination AND gate 13 also receives a DMA read access signal 51 input from a DMA transfer source address register 26 described later in FIG. 3 and a DMA write input from a DMA transfer destination address register 27 described later in FIG. The access signal 52, the DMA activation signal 53 input from the DMA controller control register 21 described later in FIG. 3, the comparison result signal from the address comparator 11c, and the comparison result signal from the address comparator 11d It has a function of outputting a logical product of signals.

ORゲート14は、転送元用ANDゲート12からの出力と、転送先用ANDゲート13からの出力との論理和を不正アクセス警告信号として出力する機能を有する。
なお、不正アクセス検出回路1の動作の詳細は、図6を参照して後記する。
The OR gate 14 has a function of outputting a logical sum of an output from the transfer source AND gate 12 and an output from the transfer destination AND gate 13 as an unauthorized access warning signal.
Details of the operation of the unauthorized access detection circuit 1 will be described later with reference to FIG.

(画像処理装置の構成)
図2は、第1実施形態に係る画像処理装置の構成例を示す図である。
画像処理装置100は、DMAコントローラ2(DMAコントローラA2a,DMAコントローラB2b)と、プロセッサ3(プロセッサA3a,プロセッサB3b)と、I/O装置4(I/O装置A4a,I/O装置B4b)と、主記憶装置6を制御する主記憶装置コントローラ5と、ディスプレイなどの表示装置(表示手段)7とを有してなる。
各DMAコントローラ2と、プロセッサ3と、I/O装置4、主記憶装置コントローラ5と、表示装置7とは、システムバス8を介して互いに接続されている。
DMAコントローラ2は、DMA読出・書込アクセス信号や、不正アクセス警告信号などをシステムバス8へ出力する。
なお、図2において、DMAコントローラ2、I/O装置4が、2台ずつ記載されているが、これに限らず、3台以上でもよい。また、プロセッサ3は1台でもよい。
なお、DMAコントローラA2aが行うDMAがダイレクトメモリアクセス、DMAコントローラB2bが行うDMAがメモリアクセスである。
(Configuration of image processing apparatus)
FIG. 2 is a diagram illustrating a configuration example of the image processing apparatus according to the first embodiment.
The image processing apparatus 100 includes a DMA controller 2 (DMA controller A2a, DMA controller B2b), a processor 3 (processor A3a, processor B3b), and an I / O device 4 (I / O device A4a, I / O device B4b). The main storage device controller 5 controls the main storage device 6 and a display device (display means) 7 such as a display.
Each DMA controller 2, processor 3, I / O device 4, main storage device controller 5, and display device 7 are connected to each other via a system bus 8.
The DMA controller 2 outputs a DMA read / write access signal, an unauthorized access warning signal, and the like to the system bus 8.
In FIG. 2, two DMA controllers 2 and two I / O devices 4 are shown. However, the present invention is not limited to this, and there may be three or more. One processor 3 may be provided.
Note that DMA performed by the DMA controller A2a is direct memory access, and DMA performed by the DMA controller B2b is memory access.

(DMAコントローラの構成)
図3は、第1実施形態に係るDMAコントローラの構成例を示す図である。
DMAコントローラ(DMA制御装置)2は、不正アクセス検出回路1、DMAコントローラ制御レジスタ21、DMA転送元開始アドレスレジスタ(記憶手段)22、DMA転送元終了アドレスレジスタ(記憶手段)23、DMA転送先開始アドレスレジスタ(記憶手段)24、DMA転送先終了アドレスレジスタ(記憶手段)25、DMA転送元アドレスレジスタ26、DMA転送先アドレスレジスタ27およびDMAデータバッファ28を有してなる。
(Configuration of DMA controller)
FIG. 3 is a diagram illustrating a configuration example of the DMA controller according to the first embodiment.
The DMA controller (DMA controller) 2 includes an unauthorized access detection circuit 1, a DMA controller control register 21, a DMA transfer source start address register (storage means) 22, a DMA transfer source end address register (storage means) 23, and a DMA transfer destination start. It has an address register (storage means) 24, a DMA transfer destination end address register (storage means) 25, a DMA transfer source address register 26, a DMA transfer destination address register 27, and a DMA data buffer 28.

また、システムバス8は、データを転送するためのデータバス82と、データの転送元あるいは転送先のアドレスを転送するためのアドレスバス81とから構成されており、不正アクセス検出回路1には、アドレスバス81からバスアドレス(データの書込・読込場所を示すアドレス)が入力され、さらに不正アクセス検出回路1から不正アクセス警告信号がデータバス82へ出力される。   The system bus 8 includes a data bus 82 for transferring data and an address bus 81 for transferring the address of the data transfer source or transfer destination. A bus address (address indicating a data write / read location) is input from the address bus 81, and an unauthorized access warning signal is output from the unauthorized access detection circuit 1 to the data bus 82.

不正アクセス検出回路1については図1で説明したため、説明を省略する。
DMAコントローラ制御レジスタ21には、DMAコントローラ2を全体制御する制御パラメータが格納されている。制御パラメータは、特にアイドル状態からの起動・停止を制御しており、DMAコントローラ2の起動中、DMAコントローラ2はDMA起動中信号53(実際は「1」の信号)を不正アクセス検出回路1へ出力し、停止中(アイドル状態)では「0」を出力する。
The unauthorized access detection circuit 1 has been described with reference to FIG.
The DMA controller control register 21 stores control parameters for overall control of the DMA controller 2. The control parameter particularly controls the start / stop from the idle state. During the start of the DMA controller 2, the DMA controller 2 outputs the DMA start signal 53 (actually “1” signal) to the unauthorized access detection circuit 1. During stop (idle state), “0” is output.

DMA転送元開始アドレスレジスタ22は、DMAにおけるデータの転送元(例えば、I/O装置4)のアドレス範囲のうち、開始(先頭)アドレスであるDMA転送元開始アドレスを格納しており、このDMA転送元開始アドレスを不正アクセス検出回路1が取り込むように構成されている。
DMA転送元終了アドレスレジスタ23は、DMAにおけるデータの転送元のアドレス範囲のうち、終了(最後尾)アドレスであるDMA転送元終了アドレスを格納しており、このDMA転送元終了アドレスを不正アクセス検出回路1が取り込むように構成されている。
The DMA transfer source start address register 22 stores a DMA transfer source start address which is a start (start) address in the address range of a data transfer source (for example, the I / O device 4) in the DMA. The unauthorized access detection circuit 1 is configured to capture the transfer source start address.
The DMA transfer source end address register 23 stores the DMA transfer source end address which is the end (last) address in the address range of the data transfer source in the DMA, and this DMA transfer source end address is detected as unauthorized access. The circuit 1 is configured to capture.

DMA転送先開始アドレスレジスタ24は、DMAにおけるデータの転送先(例えば、主記憶装置6)のアドレス範囲のうち、開始(先頭)アドレスであるDMA転送先開始アドレスを格納しており、このDMA転送先開始アドレスを不正アクセス検出回路1が取り込むように構成されている。
DMA転送先終了アドレスレジスタ25は、DMAにおけるデータの転送先のアドレス範囲のうち、終了(最後尾)アドレスであるDMA転送先終了アドレスを格納しており、このDMA転送先終了アドレスを不正アクセス検出回路1が取り込むように構成されている。
The DMA transfer destination start address register 24 stores a DMA transfer destination start address which is a start (start) address in the address range of a data transfer destination (for example, the main storage device 6) in the DMA. The unauthorized access detection circuit 1 is configured to capture the destination start address.
The DMA transfer destination end address register 25 stores a DMA transfer destination end address which is an end (last) address in the address range of the data transfer destination in the DMA, and this DMA transfer destination end address is detected as unauthorized access. The circuit 1 is configured to capture.

DMA転送元アドレスレジスタ26には、DMAにおけるデータの転送元(例えば、I/O装置4)のアドレスであるDMA転送元アドレスが格納されている。DMAコントローラ2は、このDMA転送元アドレスを、DMA転送元開始アドレスからDMA転送元終了アドレスまで変化させつつ、アドレスバス81へ送るとともに、不正アクセス検出回路1へDMA読出アクセス信号51を送る機能を有する。
DMA転送先アドレスレジスタ27には、DMAにおけるデータの転送先(例えば、主記憶装置6)のアドレスであるDMA転送先アドレスが格納されている。DMAコントローラ2は、このDMA転送先アドレスを、DMA転送先開始アドレスからDMA転送先終了アドレスまで変化させつつ、アドレスバス81へ送るとともに、不正アクセス検出回路1へDMA書込アクセス信号52を送る機能を有する。
The DMA transfer source address register 26 stores a DMA transfer source address that is an address of a data transfer source (for example, the I / O device 4) in the DMA. The DMA controller 2 has a function of sending this DMA transfer source address to the address bus 81 while changing the DMA transfer source address from the DMA transfer source start address to the DMA transfer source end address, and sending a DMA read access signal 51 to the unauthorized access detection circuit 1. Have.
The DMA transfer destination address register 27 stores a DMA transfer destination address which is an address of a data transfer destination (for example, the main storage device 6) in the DMA. The DMA controller 2 sends the DMA transfer destination address to the address bus 81 while changing the DMA transfer destination address from the DMA transfer destination start address to the DMA transfer destination end address, and sends a DMA write access signal 52 to the unauthorized access detection circuit 1 Have

DMAデータバッファ28は、データバス82から送られたDMAの転送データと、アドレスバス81から送られた、DMAのデータが有効であることを示すDMA受付信号を格納する機能を有する。   The DMA data buffer 28 has a function of storing DMA transfer data sent from the data bus 82 and a DMA acceptance signal indicating that the DMA data sent from the address bus 81 is valid.

(DMAコントローラの処理)
次に、図1〜図3を参照しつつ、図4〜図6に沿ってDMAコントローラ2および不正アクセス検出回路1における処理を説明する。
図4および図5は、DMAコントローラにおける処理の流れを示すフローチャートである。なお、図4および図5の処理のうち、ステップS101とステップS102はプロセッサによる処理であり、ステップS103以降はDMAコントローラ2による処理である。また、ステップS105およびステップS109の処理は、制御対象となっているデバイス(I/O装置4および主記憶装置コントローラ5)による処理である。
DMAを開始する場合、まずプロセッサ3は、予め設定されているDMAコントローラ2(DMAコントローラ2a側)に対して、DMAの転送データ(DMAデータ)を読み出すための転送元アドレス範囲およびDMAデータを書き込むための転送先アドレス範囲を読み込む(図4のS101)。
そして、プロセッサ3は、DMAコントローラ2のDMA転送元開始アドレスレジスタ22に開始アドレスを書き込み、DMAコントローラ2のDMA転送元終了アドレスレジスタ23に終了アドレスを書き込むことで、転送元アドレス範囲を設定する。
同様に、プロセッサ3は、DMAコントローラ2のDMA転送先開始アドレスレジスタ24に開始アドレスを書き込み、DMAコントローラ2のDMA転送先終了アドレスレジスタ25に終了アドレスを書き込むことで、転送先アドレス範囲を設定する。
次に、I/O装置4の起動タイミングに応じてプロセッサ2が制御レジスタ21を通してアイドル状態となっていたDMAコントローラ2(DMAコントローラ2a側)を起動する(S102)。
(DMA controller processing)
Next, processing in the DMA controller 2 and the unauthorized access detection circuit 1 will be described along FIGS. 4 to 6 with reference to FIGS.
4 and 5 are flowcharts showing the flow of processing in the DMA controller. 4 and 5, step S101 and step S102 are processing by the processor, and steps after step S103 are processing by the DMA controller 2. Further, the processing in step S105 and step S109 is processing performed by the devices (I / O device 4 and main storage device controller 5) that are controlled.
When starting DMA, the processor 3 first writes the transfer source address range and DMA data for reading DMA transfer data (DMA data) to the preset DMA controller 2 (DMA controller 2a side). A transfer destination address range is read (S101 in FIG. 4).
Then, the processor 3 sets the transfer source address range by writing the start address in the DMA transfer source start address register 22 of the DMA controller 2 and writing the end address in the DMA transfer source end address register 23 of the DMA controller 2.
Similarly, the processor 3 sets a transfer destination address range by writing a start address in the DMA transfer destination start address register 24 of the DMA controller 2 and writing an end address in the DMA transfer destination end address register 25 of the DMA controller 2. .
Next, in accordance with the activation timing of the I / O device 4, the processor 2 activates the DMA controller 2 (on the DMA controller 2a side) that has been in the idle state through the control register 21 (S102).

起動されたDMAコントローラ2は、DMAコントローラ制御レジスタ21から不正アクセス検出回路1に入力されるDMA起動中信号53を「1」とし(S103)、DMAを開始する。
なお、本実施形態では、前記したようにDMA起動中信号53の「1」がDMAコントローラ2が起動中であることを示し、「0」がアイドル中であることを示すものとする。
The activated DMA controller 2 sets the DMA activation signal 53 input from the DMA controller control register 21 to the unauthorized access detection circuit 1 to “1” (S103), and starts DMA.
In this embodiment, as described above, “1” of the DMA activation signal 53 indicates that the DMA controller 2 is being activated, and “0” indicates that it is idle.

DMAコントローラ2(DMAコントローラ2a側)は、起動直後であれば、DMA転送元開始アドレスレジスタ22の内容を、DMA転送元アドレスレジスタ26にコピーし、システムバス8(アドレスバス81)に対してDMA転送元アドレスを出力し、読出先のデバイス(例えば、I/O装置4など)に読出アクセスを要求する(S104)。このとき、不正アクセス検出回路1にDMA読出アクセス信号51が入力される。   If the DMA controller 2 (DMA controller 2a side) is immediately after startup, the contents of the DMA transfer source start address register 22 are copied to the DMA transfer source address register 26, and the DMA is transferred to the system bus 8 (address bus 81). The transfer source address is output, and a read access is requested to a read destination device (for example, the I / O device 4) (S104). At this time, the DMA read access signal 51 is input to the unauthorized access detection circuit 1.

読出アクセスの要求を受けたI/O装置4は、読出アクセス信号に含まれるDMA転送元アドレスに該当するデータを読み出し、読み出したデータをシステムバス8(データバス82)へ出力する(S105)。
データバス82に出力されたデータは、DMAコントローラ2(DMAコントローラ2a側)のデータバッファ28に一時的に保存される。
The I / O device 4 that has received the read access request reads the data corresponding to the DMA transfer source address included in the read access signal, and outputs the read data to the system bus 8 (data bus 82) (S105).
The data output to the data bus 82 is temporarily stored in the data buffer 28 of the DMA controller 2 (DMA controller 2a side).

次に、DMAコントローラ2(DMAコントローラ2a側)は、I/O装置4からの読出状態信号に基づいてDMAの読出対象となっているDMAデータの読み出しが完了したか否かを判定する(S106)。
ステップS106の結果、読み出しが完了していない場合(S106→No)、読出対象のデバイスのコントローラはステップS105を繰り返す。
ステップS106の結果、読み出しが完了している場合(S106→Yes)、DMAコントローラ2は、DMA転送元アドレスレジスタ26のDMA転送元アドレスを1増加させ(S107)、さらに、読出アクセスを解除して、次の読出アクセスの要求に備える。
Next, the DMA controller 2 (DMA controller 2a side) determines whether or not the reading of the DMA data to be read by the DMA is completed based on the read state signal from the I / O device 4 (S106). ).
As a result of step S106, when the reading is not completed (S106 → No), the controller of the device to be read repeats step S105.
As a result of step S106, when the reading is completed (S106 → Yes), the DMA controller 2 increments the DMA transfer source address in the DMA transfer source address register 26 by 1 (S107), and further cancels the read access. Prepare for the next read access request.

次に、DMAコントローラ2(DMAコントローラ2a側)は、起動直後であれば、DMA転送先開始アドレスレジスタ24の内容を、DMA転送先アドレスレジスタ26にコピーし、システムバス8(アドレスバス81)に対してDMA転送先アドレスを出力し、書込先のデバイス(例えば、主記憶装置コントローラ5など)に書込アクセスを要求する(図5のS108)。このとき、不正アクセス検出回路1にDMA書込アクセス信号52が入力される。   Next, the DMA controller 2 (the DMA controller 2a side) copies the contents of the DMA transfer destination start address register 24 to the DMA transfer destination address register 26 immediately after startup, and puts it in the system bus 8 (address bus 81). In response to this, the DMA transfer destination address is output, and a write access is requested to the write destination device (for example, the main storage controller 5) (S108 in FIG. 5). At this time, the DMA write access signal 52 is input to the unauthorized access detection circuit 1.

書込アクセスの要求を受けた主記憶装置コントローラ5は、書込アクセス信号に含まれるDMA転送先アドレスに該当するデータを書き込む(S109)。   Receiving the write access request, the main storage controller 5 writes the data corresponding to the DMA transfer destination address included in the write access signal (S109).

次に、DMAコントローラ2は、I/O装置4からの信号に基づいてDMAの書込対象となっているDMAデータの書き込みが完了したか否かを判定する(S110)。
ステップS110の結果、書き込みが完了していない場合(S110→No)、主記憶装置コントローラ5はステップS109を繰り返す。
ステップS110の結果、書き込みが完了している場合(S110→Yes)、DMAコントローラ2は、DMA転送先アドレスレジスタ27のDMA転送先アドレスを1増加させ(S111)、さらに書込アクセスを解除して、主記憶装置コントローラ5に書込アクセスを解除させ、次の書込アクセスの要求に備える。
Next, the DMA controller 2 determines whether or not the writing of the DMA data to be written into the DMA is completed based on the signal from the I / O device 4 (S110).
If the result of step S110 is that writing has not been completed (S110 → No), the main memory controller 5 repeats step S109.
As a result of step S110, when the writing is completed (S110 → Yes), the DMA controller 2 increments the DMA transfer destination address in the DMA transfer destination address register 27 by 1 (S111), and further cancels the write access. Then, the main storage controller 5 is released from the write access to prepare for the next write access request.

そして、DMAコントローラは、DMA転送元アドレスがDMA転送元終了アドレスの値であるか、またはDMA転送先アドレスがDMA転送先終了アドレスの値であるか否かを判定する(S112)。
DMA転送元アドレスがDMA転送元終了アドレスの値でなく、かつDMA転送先アドレスがDMA転送先終了アドレスの値でない場合(S112→No)、DMAコントローラ2は図4のステップS104へ処理を戻す。
DMA転送元アドレスがDMA転送元終了アドレスの値であるか、またはDMA転送先アドレスがDMA転送先終了アドレスの値である場合(S112→Yes)、プロセッサ3はDMAコントローラ2をアイドル状態にし、処理を終了させる。DMAコントローラ2がアイドル状態となるとともに、DMA起動中信号53は「0」となる。
Then, the DMA controller determines whether the DMA transfer source address is the value of the DMA transfer source end address or whether the DMA transfer destination address is the value of the DMA transfer destination end address (S112).
When the DMA transfer source address is not the value of the DMA transfer source end address and the DMA transfer destination address is not the value of the DMA transfer destination end address (S112 → No), the DMA controller 2 returns the process to step S104 in FIG.
When the DMA transfer source address is the value of the DMA transfer source end address or the DMA transfer destination address is the value of the DMA transfer destination end address (S112 → Yes), the processor 3 sets the DMA controller 2 in the idle state and performs processing. End. The DMA controller 2 becomes idle, and the DMA activation signal 53 becomes “0”.

(不正アクセス検出回路における処理)
図6は、第1実施形態に係る不正アクセス検出処理の流れを示すフローチャートである。なお、また、図6の処理は図4および図5の処理とパラレルに行われる処理である。
不正アクセス検出回路1は、自デバイスのDMAが起動中であるか否かを判定する(S301)。自デバイスとは、この場合、例えば不正アクセス検出回路1自身が搭載されているDMAコントローラ2である。
ステップS301の結果、自デバイスのDMAが起動中でない場合(S301→No)、不正アクセス検出回路1は「0」を出力する(S309)。
ステップS301の結果、自デバイスが起動中である場合(S301→Yes)、不正アクセス検出回路1は自デバイスのDMA読出アクセス信号51であるか否かを判定する(S302)。
(Processing in unauthorized access detection circuit)
FIG. 6 is a flowchart showing the flow of unauthorized access detection processing according to the first embodiment. In addition, the process of FIG. 6 is a process performed in parallel with the process of FIG. 4 and FIG.
The unauthorized access detection circuit 1 determines whether or not the DMA of its own device is being activated (S301). In this case, the own device is, for example, the DMA controller 2 on which the unauthorized access detection circuit 1 itself is mounted.
As a result of step S301, if the DMA of the device itself is not activated (S301 → No), the unauthorized access detection circuit 1 outputs “0” (S309).
If the result of step S301 is that the own device is being activated (S301 → Yes), the unauthorized access detection circuit 1 determines whether it is the DMA read access signal 51 of the own device (S302).

ステップS302の結果、自デバイスのDMA読出アクセス信号51である場合(S302→Yes)、不正アクセス検出回路1は「0」を出力する(S309)。
ステップS302の結果、自デバイスのDMA読出アクセス信号51でない場合(S302→No)、不正アクセス検出回路1は自デバイスのDMA書込アクセス信号52であるか否かを判定する(S303)。
ステップS303の結果、自デバイスのDMA書込アクセス信号52である場合(S303→Yes)、不正アクセス検出回路1は「0」を出力する(S309)。
If the result of step S302 is the DMA read access signal 51 of the device itself (S302 → Yes), the unauthorized access detection circuit 1 outputs “0” (S309).
If the result of step S302 is not the DMA read access signal 51 of the own device (S302 → No), the unauthorized access detection circuit 1 determines whether it is the DMA write access signal 52 of the own device (S303).
If the result of step S303 is the DMA write access signal 52 of the own device (S303 → Yes), the unauthorized access detection circuit 1 outputs “0” (S309).

ステップS303の結果、自デバイスのDMA書込アクセス信号52でない場合(S303→No)、アドレス比較器11aが、アドレスバス81を介して入力された、他方のDMAコントローラ2などから送られたバスアドレスと、DMA転送元開始アドレスレジスタ22のDMA転送元開始アドレスとを比較し、バスアドレスがDMA転送元開始アドレス以上であるか否かを判定する(S304)。なお、自デバイスがDMAコントローラA2aだとすると、他デバイスはDMAコントローラB2bや、プロセッサA3aや、プロセッサB3bなどが該当する。   If it is not the DMA write access signal 52 of the own device as a result of step S303 (S303 → No), the bus address sent from the other DMA controller 2 or the like, which is input via the address bus 81 by the address comparator 11a. Is compared with the DMA transfer source start address in the DMA transfer source start address register 22 to determine whether or not the bus address is equal to or higher than the DMA transfer source start address (S304). If the own device is the DMA controller A2a, the other device corresponds to the DMA controller B2b, the processor A3a, the processor B3b, and the like.

ステップS304の結果、バスアドレスがDMA転送元開始アドレス未満であれば(S304→No)、不正アクセス検出回路1はステップS306へ処理を進める。
ステップS304の結果、バスアドレスがDMA転送元開始アドレス以上であれば(S304→Yes)、アドレス比較器11bが、アドレスバス81から入力されたバスアドレスと、DMA転送元終了アドレスレジスタ23のDMA転送元終了アドレスとを比較し、バスアドレスがDMA転送元終了アドレス以下であるか否かを判定する(S305)。
If the result of step S304 is that the bus address is less than the DMA transfer source start address (S304 → No), the unauthorized access detection circuit 1 advances the processing to step S306.
If the result of step S304 is that the bus address is greater than or equal to the DMA transfer source start address (S304 → Yes), the address comparator 11b performs the DMA transfer of the bus address input from the address bus 81 and the DMA transfer source end address register 23. The original end address is compared, and it is determined whether or not the bus address is equal to or less than the DMA transfer source end address (S305).

ステップS305の結果、バスアドレスがDMA転送元終了アドレス以下であれば(S305→Yes)、アドレス比較器11bは「1」を転送元用ANDゲート12へ出力し(S308)、バスアドレスがDMA転送元終了アドレスより大きければ(S305→No)、アドレス比較器11cは、アドレスバス81から入力されたバスアドレスと、DMA転送先開始アドレスレジスタ24のDMA転送先開始アドレスとを比較し、バスアドレスがDMA転送先開始アドレス以上であるか否かを判定する(S306)。
ステップS306の結果、バスアドレスがDMA転送先開始アドレス未満であれば(S306→No)、アドレス比較器11cは「0」を転送先用ANDゲート13へ出力する(S309)。
If the result of step S305 is that the bus address is equal to or less than the DMA transfer source end address (S305 → Yes), the address comparator 11b outputs “1” to the transfer source AND gate 12 (S308), and the bus address is DMA transfer. If it is larger than the original end address (S305 → No), the address comparator 11c compares the bus address input from the address bus 81 with the DMA transfer destination start address of the DMA transfer destination start address register 24, and the bus address is It is determined whether it is equal to or greater than the DMA transfer destination start address (S306).
As a result of step S306, if the bus address is less than the DMA transfer destination start address (S306 → No), the address comparator 11c outputs “0” to the transfer destination AND gate 13 (S309).

ステップS306の結果、バスアドレスがDMA転送先開始アドレス以上であれば(S306→Yes)、アドレス比較器11dが、アドレスバス81から入力されたバスアドレスと、DMA転送先終了アドレスレジスタ25のDMA転送先終了アドレスとを比較し、バスアドレスがDMA転送先終了アドレス以下であるか否かを判定する(S307)。
ステップS307の結果、バスアドレスがDMA転送先終了アドレス以下であれば(S307→Yes)、アドレス比較器11dは「1」を転送先用ANDゲート13へ出力し(S308)、バスアドレスがDMA転送先終了アドレスより大きければ(S307→No)、アドレス比較器11dは「0」を転送先用ANDゲート13へ出力する(S309)。
If the result of step S306 is that the bus address is greater than or equal to the DMA transfer destination start address (S306 → Yes), the address comparator 11d performs the DMA transfer of the bus address input from the address bus 81 and the DMA transfer destination end address register 25. It is compared with the destination end address to determine whether or not the bus address is equal to or lower than the DMA transfer destination end address (S307).
As a result of step S307, if the bus address is equal to or less than the DMA transfer destination end address (S307 → Yes), the address comparator 11d outputs “1” to the transfer destination AND gate 13 (S308), and the bus address is DMA transfer. If it is larger than the destination end address (S307 → No), the address comparator 11d outputs “0” to the transfer destination AND gate 13 (S309).

そして、転送元用ANDゲート12は、入力された転送元関連信号の論理積を算出し、算出結果をORゲート14へ出力する。ここで、転送元関連信号とは、アドレス比較器11a,11bから出力された比較結果と、DMA起動中信号53と、DMA読出アクセス信号51と、DMA書込アクセス信号52とである。
ここで、DMA読出アクセス信号51とDMA書込アクセス信号52は負論理であり、DMAコントローラ2自身のアクセスを除外するために入力されている。
Then, the transfer source AND gate 12 calculates the logical product of the input transfer source related signals and outputs the calculation result to the OR gate 14. Here, the transfer source related signals are the comparison results output from the address comparators 11a and 11b, the DMA activation signal 53, the DMA read access signal 51, and the DMA write access signal 52.
Here, the DMA read access signal 51 and the DMA write access signal 52 are negative logic, and are input to exclude access of the DMA controller 2 itself.

以上の動作により、バスアドレスがDMA転送元開始アドレスからDMA転送元終了アドレスまでの範囲内にあり、かつDMAコントローラ2が起動中であり、さらにバスアドレスがDMAコントローラ2自身のアクセスではない場合、転送元用ANDゲート12は「1」を出力する。一方、バスアドレスがDMA転送元開始アドレスからDMA転送元終了アドレスまでの範囲外であったり、DMAコントローラ2が停止中、またはDMAコントローラ2自身のアクセスが発生している場合、転送元用ANDゲート12は「0」を出力する。   With the above operation, when the bus address is within the range from the DMA transfer source start address to the DMA transfer source end address, the DMA controller 2 is being activated, and the bus address is not an access of the DMA controller 2 itself, The transfer source AND gate 12 outputs “1”. On the other hand, if the bus address is outside the range from the DMA transfer source start address to the DMA transfer source end address, the DMA controller 2 is stopped, or the DMA controller 2 itself is accessing, the transfer source AND gate 12 outputs “0”.

そして、転送先用ANDゲート13は、入力された転送先関連信号の論理積を算出し、算出結果をORゲート14へ出力する。ここで、転送先関連信号とは、アドレス比較器11c,11dから出力された比較結果と、DMA起動中信号53と、DMA読出アクセス信号51と、DMA書込アクセス信号52とである。
ここで、DMA読出アクセス信号51とDMA書込アクセス信号52は負論理であり、DMAコントローラ2自身のアクセスを除外するために入力されている。
Then, the transfer destination AND gate 13 calculates a logical product of the input transfer destination related signals and outputs the calculation result to the OR gate 14. Here, the transfer destination related signals are the comparison results output from the address comparators 11c and 11d, the DMA activation signal 53, the DMA read access signal 51, and the DMA write access signal 52.
Here, the DMA read access signal 51 and the DMA write access signal 52 are negative logic, and are input to exclude access of the DMA controller 2 itself.

以上の動作により、バスアドレスがDMA転送先開始アドレスからDMA転送先終了アドレスまでの範囲内にあり、かつDMAコントローラ2が起動中であり、さらに、バスアドレスがDMAコントローラ2自身のアクセスではない場合、転送先用ANDゲート13は「1」を出力する。一方、バスアドレスがDMA転送先開始アドレスからDMA転送先終了アドレスまでの範囲外であったり、DMAコントローラ2が停止中、またはDMAコントローラ2自身のアクセスが発生している場合、転送先用ANDゲート13は「0」を出力する(S309)。   With the above operation, the bus address is within the range from the DMA transfer destination start address to the DMA transfer destination end address, the DMA controller 2 is being activated, and the bus address is not an access of the DMA controller 2 itself The transfer destination AND gate 13 outputs “1”. On the other hand, if the bus address is outside the range from the DMA transfer destination start address to the DMA transfer destination end address, the DMA controller 2 is stopped, or the DMA controller 2 itself is accessing, the transfer destination AND gate 13 outputs “0” (S309).

そして、ORゲート14は、転送元用ANDゲート12の出力と、転送先用ANDゲート13の出力の論理和を算出し、この論理和を不正アクセス警告信号としてデータバス82に出力し、主記憶装置6上にフラグを立てる。
すなわち、不正アクセス警告信号は、自デバイスのDMAが起動中で、バスアドレスが自デバイスのDMA読出または書込ではなく、他のデバイスが持つ他方のDMAコントローラなどにより送られた他デバイスバスアドレスと判断され、さらにバスアドレスの範囲が自デバイスのDMA転送元開始から終了の範囲またはバスアドレスの範囲が自身のDMA転送先開始から終了の範囲にあてはまる場合に「1」を出力する(S308)。一方、自デバイスのDMAが未使用またはバスアドレスが自デバイスのDMA読出または書込によるもの、またはバスアドレスの範囲が自身のDMA転送元開始から終了の範囲外、またはバスアドレスの範囲が自身のDMA転送先開始から終了の範囲外の場合に「0」を出力する(S309)。
そして、コントローラ3は、定期的に主記憶装置6に書き込まれた不正アクセス警告信号、またはフラグを監視し、不正アクセスを示す「1」の情報である場合は、表示装置7にアラート表示を行わせ、DMAコントローラA2aおよびDMAコントローラB2bにDMA処理を中断させ、処理を終了する。
The OR gate 14 calculates the logical sum of the output of the transfer source AND gate 12 and the output of the transfer destination AND gate 13 and outputs the logical sum to the data bus 82 as an unauthorized access warning signal. A flag is set on the device 6.
In other words, the unauthorized access warning signal is sent to the other device bus address sent by the other DMA controller or the like of the other device, not the DMA read or write of the own device when the DMA of the own device is active. Further, if the bus address range falls within the range from the start to the end of the DMA transfer source of the own device or the range of the bus address falls within the range from the start to the end of the own DMA transfer destination, “1” is output (S308). On the other hand, the DMA of the own device is not used or the bus address is based on the DMA read or write of the own device, or the bus address range is outside the range from the start to the end of the own DMA transfer source, or the bus address range is If it is outside the range from the start to the end of the DMA transfer destination, “0” is output (S309).
The controller 3 periodically monitors the unauthorized access warning signal or flag written in the main storage device 6, and if the information is “1” indicating unauthorized access, displays an alert on the display device 7. Then, the DMA processing is interrupted by the DMA controller A2a and the DMA controller B2b, and the processing ends.

第1実施形態によれば、DMA転送元アドレス範囲、DMA転送先アドレス範囲に対する不正アクセスを検出できる。すなわち、DMAが停止する前のDMA転送先領域への不正アクセスや、DMA転送元領域への不正アクセスを検出することができる。   According to the first embodiment, unauthorized access to the DMA transfer source address range and the DMA transfer destination address range can be detected. That is, it is possible to detect unauthorized access to the DMA transfer destination area before DMA stops and unauthorized access to the DMA transfer source area.

《第2実施形態》
これまでの技術では、複数のDMA制御装置が動作しているときにおいて、DMA転送領域が重なってしまう場合についても誤動作を防ぐことはできないという問題がある。
次に、図7〜図9を参照して、このような問題を解決するための本発明に係る第2実施形態を説明する。
<< Second Embodiment >>
The conventional techniques have a problem that malfunctions cannot be prevented even when DMA transfer areas overlap when a plurality of DMA control devices are operating.
Next, a second embodiment according to the present invention for solving such a problem will be described with reference to FIGS.

(DMA制御システムの構成)
図7は、第2実施形態に係るDMA制御システムの構成例を示す図である。
さらに、システムバス8には不正アクセス検出用ORゲート92からの出力によって、割り込みの発生を検知する割込コントローラ93が接続されている。
(Configuration of DMA control system)
FIG. 7 is a diagram illustrating a configuration example of a DMA control system according to the second embodiment.
Further, the system bus 8 is connected to an interrupt controller 93 that detects the occurrence of an interrupt based on an output from the unauthorized access detection OR gate 92.

不正アクセス検出用ORゲート92は、複数のDMAコントローラ2から出力される不正アクセス警告信号の論理和を算出し、論理和の結果をバスアクセス状態出力回路91へ出力すると共に、システムバス8を介して割込コントローラ93へ割込信号を出力する機能を有する。
バスアクセス状態出力回路91には、各DMAコントローラ2から入力された、DMAの対象となっているデバイスに対するDMA読出アクセス信号51およびDMA書込アクセス信号52(まとめて、バスアクセス要求信号と称する)が常時入力されており、不正アクセス検出用ORゲート92から出力された信号が「1」であるとき、バスアクセス要求信号の入力状態を主記憶装置6などの記憶媒体に保存し、プロセッサ3からバスアクセス要求信号の状態出力の指示を受けると、システムバス8へ保存しているバスアクセス要求信号の入力状態を出力する機能を有する。
The unauthorized access detection OR gate 92 calculates the logical sum of the unauthorized access warning signals output from the plurality of DMA controllers 2, outputs the logical sum to the bus access state output circuit 91, and passes through the system bus 8. And has a function of outputting an interrupt signal to the interrupt controller 93.
The bus access status output circuit 91 receives a DMA read access signal 51 and a DMA write access signal 52 (collectively referred to as a bus access request signal) input from each DMA controller 2 to the device to be DMA-targeted. Is always input and the signal output from the unauthorized access detection OR gate 92 is “1”, the input state of the bus access request signal is stored in a storage medium such as the main storage device 6, and the processor 3 When receiving an instruction to output the status of the bus access request signal, it has a function of outputting the input status of the bus access request signal stored in the system bus 8.

(DMA制御システムの処理)
次に、図7を参照しつつ、図8に沿ってDMA制御システムの処理を説明する。
図8は、第2実施形態に係るDMA制御システムにおける処理の流れを示すフローチャートである。
不正アクセス検出用ORゲート92には、複数のDMAコントローラ2から不正アクセス警告信号が入力されており、不正アクセス検出用ORゲート92は、これらの各不正アクセス警告信号の論理和を算出し(S401)、算出結果をバスアクセス状態出力回路91へ出力する。
バスアクセス状態出力回路91は、不正アクセス検出用用ORゲート14から送られた論理和が「1」であるか否かを判定する(S402)。つまり、バスアクセス状態出力回路91は、少なくとも1台のDMAコントロ一ラがDMA不正アクセスを検知し、不正アクセス警告信号「1」を出力したか否かを判定する。
ステップS402の結果、論理和が「0」である場合(S402→No)、DMA制御システム9はステップS401へ処理を戻す。
ステップS402の結果、論理和が「1」である場合(S402→Yes)、バスアクセス状態出力回路91は、バスアクセス要求信号の状態を主記憶装置6などの記憶媒体に保存し(S403)、システムバス8を介して割込信号を割込コントローラ93へ送信し(S404)、DMA制御システム9はステップS401へ処理を戻す。
(Processing of DMA control system)
Next, the processing of the DMA control system will be described along FIG. 8 with reference to FIG.
FIG. 8 is a flowchart showing the flow of processing in the DMA control system according to the second embodiment.
The unauthorized access detection OR gate 92 receives unauthorized access warning signals from the plurality of DMA controllers 2, and the unauthorized access detection OR gate 92 calculates the logical sum of these unauthorized access warning signals (S401). The calculation result is output to the bus access state output circuit 91.
The bus access status output circuit 91 determines whether the logical sum sent from the unauthorized access detection OR gate 14 is “1” (S402). In other words, the bus access status output circuit 91 determines whether or not at least one DMA controller detects a DMA unauthorized access and outputs an unauthorized access warning signal “1”.
If the logical sum is “0” as a result of step S402 (S402 → No), the DMA control system 9 returns the process to step S401.
If the logical sum is “1” as a result of step S402 (S402 → Yes), the bus access state output circuit 91 stores the state of the bus access request signal in a storage medium such as the main storage device 6 (S403), An interrupt signal is transmitted to the interrupt controller 93 via the system bus 8 (S404), and the DMA control system 9 returns the process to step S401.

図9は、第2実施形態に係る割込処理の流れを示すフローチャートである。
割込コントローラ93が割込信号を受信することによって、割込発生を検知すると、その旨をプロセッサ3へ通知し、プロセッサ3は、バスアクセス状態出力回路91にバスアクセス要求信号状態の出力を指示する。すると、バスアクセス状態出力回路91は、保存しているバスアクセス要求信号の状態をシステムバス8へ出力する(S501)。
そして、表示装置7(図2)が、システムバス8を介して取得したバスアクセス要求信号の状態を表示する(S502)。
FIG. 9 is a flowchart showing a flow of interrupt processing according to the second embodiment.
When the interrupt controller 93 receives the interrupt signal and detects the occurrence of the interrupt, the interrupt controller 93 notifies the processor 3 to that effect, and the processor 3 instructs the bus access state output circuit 91 to output the bus access request signal state. To do. Then, the bus access state output circuit 91 outputs the state of the stored bus access request signal to the system bus 8 (S501).
Then, the display device 7 (FIG. 2) displays the state of the bus access request signal acquired via the system bus 8 (S502).

以上のように第2実施形態によれば、第1実施形態におけるDMA不正アクセスの検出・表示(アラート表示)に加え、複数のDMA制御装置が動作しているときにおいて、DMA転送領域が重なってしまう場合についても誤動作を防ぐことに加え、その発生要因も表示することができ、画像処理装置100のプログラムのデバッグに有益な情報を得ることができる。   As described above, according to the second embodiment, in addition to the detection and display (alert display) of DMA unauthorized access in the first embodiment, when a plurality of DMA control devices are operating, the DMA transfer areas overlap. In addition to preventing malfunction, the cause of the occurrence can be displayed, and useful information for debugging the program of the image processing apparatus 100 can be obtained.

また、本実施形態では、不正アクセス検出回路1や、DMAコントローラ2をCPUを内蔵したハードウェアで構成してあるが、ソフトウェアで実現してもよい。例えば、PCにおけるROM(Read Only Memory)や、HD(Hard Disk)に格納されたプログラムが、RAM(Random Access Memory)に展開され、CPUによって実行されることによって、不正アクセス検出回路1や、DMAコントローラ2を具現化してもよい。このようなプログラムをPCで実行することにより、PCを不正アクセス検出回路1や、DMAコントローラ2のシミュレータとして使用することができる。   In the present embodiment, the unauthorized access detection circuit 1 and the DMA controller 2 are configured by hardware incorporating a CPU, but may be realized by software. For example, a program stored in a ROM (Read Only Memory) or an HD (Hard Disk) in a PC is expanded in a RAM (Random Access Memory) and executed by the CPU, whereby the unauthorized access detection circuit 1 or DMA The controller 2 may be embodied. By executing such a program on the PC, the PC can be used as a simulator for the unauthorized access detection circuit 1 or the DMA controller 2.

《複合機》
図10は、第1実施形態および第2実施形態に係る画像処理装置およびDMA制御システムを搭載した複合機の斜視概略図である。
複合機200は、大別して、読取ユニット201、表示ユニット202、制御ユニット203、印刷ユニット204、操作パネルユニット205、通信ユニット206を有している。
読取ユニット201は、LED(Light Emitting Diode)(線状光源)やCCD(Charge Coupled Device)などの読取センサを有するスキャナ装置であり、原稿を読み取って電気信号に変換し、さらにイメージデータに変換する機能を有する。なお、読取ユニット201は、図2のI/O装置4に相当するものである。
制御ユニット203には、複合機200を制御するための処理装置が内蔵されており、例えば図2のDMAコントローラ2、プロセッサ3、主記憶装置コントローラ5、主記憶装置6、図7のDMA制御システム9などが内蔵されている。
<Machine>
FIG. 10 is a schematic perspective view of a multifunction machine equipped with the image processing apparatus and the DMA control system according to the first and second embodiments.
The multi-function device 200 roughly includes a reading unit 201, a display unit 202, a control unit 203, a printing unit 204, an operation panel unit 205, and a communication unit 206.
The reading unit 201 is a scanner device having a reading sensor such as an LED (Light Emitting Diode) (linear light source) or a CCD (Charge Coupled Device). The reading unit 201 reads an original, converts it into an electrical signal, and further converts it into image data. It has a function. The reading unit 201 corresponds to the I / O device 4 in FIG.
The control unit 203 incorporates a processing device for controlling the multifunction device 200. For example, the DMA controller 2, the processor 3, the main storage device controller 5, the main storage device 6, and the DMA control system shown in FIG. 9 etc. are built in.

印刷ユニット204は、電子写真方式を利用したのプリンタ装置であり、読取ユニット201で読み取られた画像データや、通信ユニット206が受信した通信回線や外部インタフェースからのデータを印刷する機能を有する。なお、印刷ユニット204は、図2のI/O装置4に相当するものである。
操作パネルユニット205は、画像処理条件の各種設定や装置の状態等を表示する表示ユニット202と、装置への命令を入力するための操作ユニットとを備えている。なお、表示ユニット202は、図2の表示装置7に相当する構成であり、操作ユニットは、図2のI/O装置4に相当するものである。
また、通信ユニット206は、PCなど、他の機器が接続される箇所であり、図2のI/O装置4に相当するものである。なお、通信ユニット206は複合機200の背面に配置されているため、図10では隠れている。
The printing unit 204 is a printer device using an electrophotographic method, and has a function of printing image data read by the reading unit 201 and data from a communication line or an external interface received by the communication unit 206. The printing unit 204 corresponds to the I / O device 4 in FIG.
The operation panel unit 205 includes a display unit 202 that displays various settings of image processing conditions, the state of the apparatus, and the like, and an operation unit for inputting commands to the apparatus. The display unit 202 has a configuration corresponding to the display device 7 in FIG. 2, and the operation unit corresponds to the I / O device 4 in FIG.
The communication unit 206 is a part to which other devices such as a PC are connected, and corresponds to the I / O device 4 in FIG. Note that the communication unit 206 is hidden in FIG.

なお、第1実施形態において、不正アクセス検出回路1をDMAコントローラ2内部に持たせたが、主記憶装置コントローラ5や図示しないバスコントローラに搭載してもよい。
また、本実施形態における画像処理装置100は、プリンタ(インパクトプリンタ、インクジェットプリンタ)、ファクシミリ、スキャナ、またはそれらの複合装置、PCなど、DMA機能を有する電子機器一般においても適応可能である。
Although the unauthorized access detection circuit 1 is provided in the DMA controller 2 in the first embodiment, it may be mounted on the main memory controller 5 or a bus controller (not shown).
In addition, the image processing apparatus 100 according to the present embodiment can be applied to general electronic devices having a DMA function such as a printer (impact printer, inkjet printer), a facsimile, a scanner, or a composite device thereof, or a PC.

1 不正アクセス検出回路(不正アクセス検出手段)
2 DMAコントローラ(DMA制御装置)
3 プロセッサ
4 I/O装置
5 主記憶装置コントローラ
6 主記憶装置
7 表示装置(表示手段)
8 システムバス
9 DMA制御システム
11(11a〜11d) アドレス比較器
12 転送元用ANDゲート
13 転送先用ANDゲート
14 ORゲート
21 DMAコントローラ制御レジスタ
22 DMA転送元開始アドレスレジスタ(記憶手段)
23 DMA転送元終了アドレスレジスタ(記憶手段)
24 DMA転送先開始アドレスレジスタ(記憶手段)
25 DMA転送先終了アドレスレジスタ(記憶手段)
26 DMA転送元アドレスレジスタ
27 DMA転送先アドレスレジスタ
28 DMAデータバッファ
51 DMA読出アクセス信号
52 DMA書込アクセス信号
53 DMA起動中信号
81 アドレスバス
82 データバス
91 バスアクセス状態出力回路(DMA不正アクセス要因出力手段)
92 不正アクセス検出用ORゲート
93 割込コントローラ
100 画像処理装置
200 複合機
201 読取ユニット
202 表示ユニット
203 制御ユニット
204 印刷ユニット
205 操作パネルユニット
206 通信ユニット
1 Unauthorized access detection circuit (unauthorized access detection means)
2 DMA controller (DMA controller)
3 processor 4 I / O device 5 main memory controller 6 main memory 7 display device (display means)
8 System bus 9 DMA control system 11 (11a to 11d) Address comparator 12 AND gate for transfer source 13 AND gate for transfer destination 14 OR gate 21 DMA controller control register 22 DMA transfer source start address register (storage means)
23 DMA transfer source end address register (storage means)
24 DMA transfer destination start address register (storage means)
25 DMA transfer destination end address register (storage means)
26 DMA transfer source address register 27 DMA transfer destination address register 28 DMA data buffer 51 DMA read access signal 52 DMA write access signal 53 DMA start signal 81 Address bus 82 Data bus 91 Bus access status output circuit (DMA illegal access factor output circuit) means)
92 Unauthorized access detection OR gate 93 Interrupt controller 100 Image processing device 200 Multifunction machine 201 Reading unit 202 Display unit 203 Control unit 204 Printing unit 205 Operation panel unit 206 Communication unit

Claims (12)

同一のシステムバスを用いて、ダイレクトメモリアクセスおよびメモリアクセスの転送制御を行うダイレクトメモリアクセス制御装置であって、
前記ダイレクトメモリアクセスにおける転送元のアドレス範囲、および前記ダイレクトメモリアクセスにおける転送先のアドレス範囲が格納される記憶手段と、
前記メモリアクセスにおけるデータ転送を行うためのアドレスが、前記システムバス上に指定されると、
前記指定されたアドレスが、前記ダイレクトメモリアクセスの転送元のアドレス範囲内、もしくは前記ダイレクトメモリアクセスの転送先のアドレス範囲内のアドレスである場合、前記メモリアクセスにおけるデータは、不正アクセスである旨の不正アクセス警告信号を出力する不正アクセス検出手段と、
を有することを特徴とするダイレクトメモリアクセス制御装置。
A direct memory access control device for performing direct memory access and memory access transfer control using the same system bus,
Storage means for storing a transfer source address range in the direct memory access and a transfer destination address range in the direct memory access;
When an address for performing data transfer in the memory access is designated on the system bus,
If the specified address is within the address range of the direct memory access transfer source or the address range of the direct memory access transfer destination, the data in the memory access is an unauthorized access. Unauthorized access detection means for outputting an unauthorized access warning signal;
A direct memory access control device comprising:
前記記憶手段は、前記ダイレクトメモリアクセスの転送元のアドレスにおける開始アドレスおよび終了アドレスが記憶され、
前記不正アクセス検出手段は、
前記システムバス上に指定されたアドレスが、前記開始アドレス以上の値であり、かつ前記外部装置からのアドレスが、前記終了アドレス以下の値である場合に、前記不正アクセス警告信号を出力する
ことを特徴とする請求項1に記載のダイレクトメモリアクセス制御装置。
The storage means stores a start address and an end address in a transfer source address of the direct memory access,
The unauthorized access detection means includes
Outputting the unauthorized access warning signal when an address designated on the system bus is a value equal to or greater than the start address and an address from the external device is equal to or less than the end address. 2. The direct memory access control apparatus according to claim 1, wherein
前記記憶手段は、前記ダイレクトメモリアクセスの転送先のアドレスにおける開始アドレスおよび終了アドレスが記憶され、
前記不正アクセス検出手段は、
前記システムバス上に指定されたアドレスが、前記開始アドレス以上の値であり、かつ前記外部装置からのアドレスが、前記終了アドレス以下の値である場合に、前記不正アクセス警告信号を出力する
ことを特徴とする請求項1に記載のダイレクトメモリアクセス制御装置。
The storage means stores a start address and an end address in a transfer destination address of the direct memory access,
The unauthorized access detection means includes
Outputting the unauthorized access warning signal when an address designated on the system bus is a value equal to or greater than the start address and an address from the external device is equal to or less than the end address. 2. The direct memory access control apparatus according to claim 1, wherein
前記不正アクセス検出手段は、
前記ダイレクトメモリアクセスの転送元のアドレス範囲内、もしくは前記ダイレクトメモリアクセスの転送先のアドレス範囲内のアドレスである場合に加え、前記ダイレクトメモリアクセス制御装置自分自身に対する書込要求および読込要求がない場合に、前記不正アクセス警告信号を出力する
ことを特徴とする請求項1に記載のダイレクトメモリアクセス制御装置。
The unauthorized access detection means includes
When there is no write request or read request for the direct memory access control device itself in addition to the address within the address range of the direct memory access transfer source or the address range of the transfer destination of the direct memory access The direct memory access control apparatus according to claim 1, wherein the unauthorized access warning signal is output.
前記メモリアクセスは、他のダイレクトメモリアクセスであり、該他のダイレクトメモリアクセスを備える他のデバイスは、他の不正アクセス検出手段を備える
ことを特徴とする請求項1から請求項4のいずれか一項に記載のダイレクトメモリアクセス制御装置。
The memory access is another direct memory access, and another device including the other direct memory access includes other unauthorized access detection means. The direct memory access control device according to item.
請求項1から請求項5のいずれか一項に記載のダイレクトメモリアクセス制御装置を、少なくとも1つ有するダイレクトメモリアクセス制御システムであって、
前記ダイレクトメモリアクセス制御装置のうち、少なくとも1つから前記不正アクセス警告信号を受信したとき、ダイレクトメモリアクセスの対象となっているデバイスに対するバスアクセス要求信号の状態を表示手段へ出力するダイレクトメモリアクセス不正アクセス要因出力手段を有する
ことを特徴とするダイレクトメモリアクセス制御システム。
A direct memory access control system having at least one direct memory access control device according to any one of claims 1 to 5,
Improper direct memory access that outputs the status of the bus access request signal for the device subject to direct memory access to the display means when the unauthorized access warning signal is received from at least one of the direct memory access control devices A direct memory access control system comprising access factor output means.
請求項1から請求項5のいずれか一項に記載のダイレクトメモリアクセス制御装置の不正アクセス検出手段に係る処理をコンピュータに実行させるためのプログラム。   The program for making a computer perform the process which concerns on the unauthorized access detection means of the direct memory access control apparatus as described in any one of Claims 1-5. 請求項6に記載のダイレクトメモリアクセス制御システムのダイレクトメモリアクセス不正アクセス要因出力手段の処理をコンピュータに実行させるためのプログラム。   The program for making a computer perform the process of the direct memory access unauthorized access factor output means of the direct memory access control system of Claim 6. 請求項1から請求項5のいずれか一項に記載のダイレクトメモリアクセス制御装置を有する
ことを特徴とする画像処理装置。
An image processing apparatus comprising the direct memory access control device according to claim 1.
請求項6に記載のダイレクトメモリアクセス制御システムを有する
ことを特徴とする画像処理装置。
An image processing apparatus comprising the direct memory access control system according to claim 6.
読取ユニット、通信ユニット、主記憶装置および印刷ユニットを備える複合機であって、
前記読取ユニットまたは前記通信ユニットから前記主記憶装置まで前記ダイレクトメモリアクセスにより転送し、前記主記憶装置から前記印刷ユニットまで前記メモリアクセスにより転送する請求項1から請求項5のいずれか一項に記載のダイレクトメモリアクセス制御装置を備えることを特徴とする複合機。
A multi-function machine comprising a reading unit, a communication unit, a main storage device and a printing unit,
6. The data is transferred from the reading unit or the communication unit to the main storage device by the direct memory access, and is transferred from the main storage device to the printing unit by the memory access. 6. A multi-function machine comprising the direct memory access control device.
読取ユニット、通信ユニット、主記憶装置および印刷ユニットを備える複合機であって、
前記読取ユニットまたは前記通信ユニットから前記主記憶装置まで前記ダイレクトメモリアクセスにより転送し、前記主記憶装置から前記印刷ユニットまで前記メモリアクセスにより転送する請求項6に記載のダイレクトメモリアクセス制御システムを備えることを特徴とする複合機。
A multi-function machine comprising a reading unit, a communication unit, a main storage device and a printing unit,
The direct memory access control system according to claim 6, wherein the direct memory access is transferred from the reading unit or the communication unit to the main storage device by the direct memory access, and is transferred from the main storage device to the printing unit by the memory access. A multi-function machine characterized by
JP2010247187A 2010-11-04 2010-11-04 Direct memory access control device, direct memory access control system, program, image processing device and compound machine Pending JP2012098985A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010247187A JP2012098985A (en) 2010-11-04 2010-11-04 Direct memory access control device, direct memory access control system, program, image processing device and compound machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010247187A JP2012098985A (en) 2010-11-04 2010-11-04 Direct memory access control device, direct memory access control system, program, image processing device and compound machine

Publications (1)

Publication Number Publication Date
JP2012098985A true JP2012098985A (en) 2012-05-24

Family

ID=46390807

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010247187A Pending JP2012098985A (en) 2010-11-04 2010-11-04 Direct memory access control device, direct memory access control system, program, image processing device and compound machine

Country Status (1)

Country Link
JP (1) JP2012098985A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019023896A (en) * 2015-06-08 2019-02-14 新唐科技股▲ふん▼有限公司 Method for secure access to peripheral device via bus
KR20200063017A (en) * 2018-11-27 2020-06-04 한국전자통신연구원 Apparatus for image processing and image processing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019023896A (en) * 2015-06-08 2019-02-14 新唐科技股▲ふん▼有限公司 Method for secure access to peripheral device via bus
KR20200063017A (en) * 2018-11-27 2020-06-04 한국전자통신연구원 Apparatus for image processing and image processing method
KR102591663B1 (en) 2018-11-27 2023-10-20 한국전자통신연구원 Apparatus for image processing and image processing method

Similar Documents

Publication Publication Date Title
JP4792113B2 (en) Interprocessor interrupt
US8843663B2 (en) Data transmission device and method for merging multiple commands
KR102320386B1 (en) Image forming apparatus and power control method for image forming apparatus
JP2002354217A (en) Method and device for forming image
JP2010211351A (en) Semiconductor integrated circuit, power saving control method, power saving control program, and recording medium
US11144109B2 (en) Apparatus, method, and storage medium for controlling a power saving state in a SATA storage system
JP2014026373A (en) Information processing device, control method for information processing device, and program
JP2015044307A (en) Image forming apparatus
JP2012098985A (en) Direct memory access control device, direct memory access control system, program, image processing device and compound machine
JP6336328B2 (en) COMMUNICATION DEVICE, ITS CONTROL METHOD, AND PROGRAM
JP5636653B2 (en) Semiconductor integrated circuit and power saving control method
JP7374622B2 (en) information processing equipment
JP6949572B2 (en) Image forming device that realizes power saving and its control method
JP5783348B2 (en) Control device, control program, and image forming apparatus
JP2015215684A (en) Information processing apparatus and information processing program
US20200250125A1 (en) Electronic apparatus including device configured to be shifted to power saving state and connected to pci device, and control method thereof
JP2007310735A (en) Direct memory access controller
US5913225A (en) Cache flush mechanism for a secondary cache memory
JP4862395B2 (en) Information processing apparatus and information processing apparatus control method
JP2006040063A (en) Image processing device and smi processing method thereof
JP6090057B2 (en) Status information recording apparatus and program
JP2021074974A (en) Image formation device and control method for image formation device
JP2000020401A (en) Cpu device, information processor and control method therefor
JP2023021707A (en) Information processing device, control method of information processing device, and program
JP2004181769A (en) Printing device