Summary of the invention
The technical problem underlying that the present invention will solve is, a kind of interrupt response device and method is provided, can be quick, and response terminal flexibly.
For solving the problems of the technologies described above, the technological means that the present invention adopts is following:
A kind of interrupt response device; Comprise central processing unit and interrupt enable module; Also comprise the programmable Interrupt processing module; Store multiple interrupt handling routine in the said central processing unit, said central processing unit is used for disposing corresponding interrupt handling routine for said programmable Interrupt processing module in advance through the application configuration signal; Said interruption enable module is used to enable look-at-me, and through effective passage said look-at-me is sent to said programmable Interrupt processing module or central processing unit; Said programmable Interrupt processing module is used for after receiving the look-at-me that said interruption enable module is sent, and the interrupt handling routine according to said central processing unit configuration carries out Interrupt Process.
Further, said device also comprises interruption selection module; Said central processing unit produces the interrupt switch control signal; Also be used for controlling said interruption through said interrupt switch control signal and select the passage between module gating itself and the said central processing unit effective, perhaps the passage between itself and the said programmable Interrupt processing module is effective.
Further, the said interruption of acquiescence gating selects the passage between module and the said programmable Interrupt processing module effective.
Further, said central processing unit also is used for before producing the interrupt switch control signal, judging whether the middle-end processor program has surpassed the degree able to programme of said programmable Interrupt processing module; And be used for when the complexity of judging the middle-end processor program has surpassed the degree able to programme of said programmable Interrupt processing module, control said interruption through said interrupt switch control signal and select the passage between module gating itself and the said central processing unit effective.
A kind of interrupt response method comprises:
Central processing unit is programmable Interrupt processing module configure interrupt handling procedure in advance;
Interrupt enable module and enable look-at-me, and look-at-me is sent to programmable Interrupt processing module or central processing unit through effective passage;
Said programmable Interrupt processing module receives said look-at-me, and carries out Interrupt Process according to the interrupt handling routine that is disposed.
Further, interrupting enable module enables also to comprise before the step of look-at-me:
Central processing unit produces the control of interrupt switch control signal and interrupts selecting said programmable Interrupt processing module of module gating and said interruption to select the passage between the module, and perhaps said central processing unit and said interruption select the passage between the module effective.
Further, it is effective that the passage between the module is selected in acquiescence said programmable Interrupt processing module of gating and said interruption.
Further, central processing unit produces before the step of interrupt switch control signal, also comprises:
Said central processing unit judges whether the complexity of interrupt handling routine has surpassed the degree able to programme of said programmable Interrupt processing module, if then control is interrupted selecting module gating central processing unit and interrupted selecting the passage between the module effective.
The invention has the beneficial effects as follows: interrupt response device and method of the present invention; Through being programmable Interrupt processing module configure interrupt handling procedure in advance by CPU; Thereby make and enable look-at-me when interrupting enable module; And when look-at-me being sent to this programmable Interrupt processing module through effective passage; This programmable Interrupt processing module can be carried out corresponding Interrupt Process according to the interrupt handling routine of CPU configuration, when perhaps through effective passage look-at-me being sent to central processing unit, carries out corresponding Interrupt Process by this central processing unit.Promptly when the interruption enable module enables look-at-me; Both can through effective passage look-at-me be sent to the programmable Interrupt processing module as required; Carry out Interrupt Process by this programmable Interrupt processing module according to the interrupt handling routine that disposes; Also can as required look-at-me be sent to CPU, carry out Interrupt Process, thereby make that apparatus and method dirigibility of the present invention is higher by CPU; Simultaneously because the interrupt handling routine of this programmable Interrupt processing module is configurable; When facing different interruptions; All can be in advance through CPU for the programmable Interrupt processing module disposes corresponding interrupt handling routine, avoided interruption processing module to be merely able to come the problem of handling interrupt according to specific program, thus the dirigibility that has further improved Interrupt Process; And; Because the speed of this programmable Interrupt processing module handling interrupt is fast, and do not take CPU during its handling interrupt, and then make interrupt response device of the present invention when handling interrupt, possess fast and the high advantage of dirigibility.
The interrupt response device and method of this embodiment; Through coming gating CPU and interruption to select the passage between the module effective by interrupting the selection module, perhaps programmable Interrupt processing module and interruption select the passage between the module effective, and the passage that generally is defaulted as between gating programmable Interrupt processing module and the interruption selection module is effective; Thereby make when the terminal enable module enables look-at-me; The programmable Interrupt processing module can respond interruption apace, yet, when some in particular cases; When for example the complexity of interrupt handling routine has surpassed the degree able to programme of programmable Interrupt processing module; Perhaps the user initiatively gating CPU is when interrupting selecting the passage between the module, the passage that interrupts between selection module gating itself and central processing unit is effective, thereby through this effective passage look-at-me is sent to CPU; Come handling interrupt by CPU again, and then further improved dirigibility and speed that response is interrupted.
Embodiment
Combine accompanying drawing that the present invention is done further explain through embodiment below.
Embodiment one:
Please refer to Fig. 3, be the high-level schematic functional block diagram of an embodiment of the interrupt response device of this embodiment.The interrupt response device of present embodiment comprises CPU301, interrupts enable module 302 and programmable Interrupt processing module 303; Wherein, Store by multiple interrupt handling routine among the CPU301, and this CPU301 is used for being the corresponding interrupt handling routines of programmable Interrupt processing module 303 configurations in advance through the application configuration signal; Interrupt enable module 302 and be used to enable look-at-me, and look-at-me is sent to this programmable Interrupt processing module 303 or CPU301 through effective passage; Programmable Interrupt processing module 303 is used for after receiving the look-at-me that the interruption enable module is sent, and the interrupt handling routine according to the CPU configuration carries out corresponding Interrupt Process, perhaps when this CPU301 receives look-at-me, carries out corresponding Interrupt Process.
Through come to come the configure interrupt handling procedure by CPU, avoided independent, thereby practiced thrift cost in the present embodiment for the programmable Interrupt processing module is provided with an independent interrupt handling routine configuration module for the programmable Interrupt processing module.
The interrupt response device of present embodiment is programmable Interrupt processing module 303 configure interrupt handling procedures through CPU301 in advance; Thereby make when interruption enable module 302 enables look-at-me; In the time of can as required this look-at-me being sent to this programmable Interrupt processing module 303 through effective passage; Can carry out corresponding Interrupt Process according to the interrupt handling routine of CPU301 configuration by this programmable Interrupt processing module 303 again; Perhaps as required look-at-me is sent to CPU301 through effective passage, carry out corresponding Interrupt Process, thereby make that the dirigibility of this device is higher by CPU; Simultaneously because the interrupt handling routine of this programmable Interrupt processing module 303 is configurable; When facing different interruptions; Can be the corresponding interrupt handling routines of programmable Interrupt processing module 303 configurations through CPU in advance all; Avoided interruption processing module to be merely able to come the problem of handling interrupt according to specific program, thus the dirigibility that has further improved Interrupt Process; And because the speed of these programmable Interrupt processing module 303 handling interrupt is fast, and do not take CPU during its handling interrupt, and then make the interrupt response device of present embodiment when handling interrupt, possess fast and the high advantage of dirigibility.
Embodiment two:
Please refer to Fig. 4, be the high-level schematic functional block diagram of the another embodiment of the interrupt response device of this embodiment.The interrupt response device of present embodiment comprises CPU401, interrupts enable module 402; With programmable Interrupt processing module 403; Also comprise and interrupt selecting module 404; Wherein, Store multiple interrupt handling routine among the CPU401, and be the corresponding interrupt handling routines of programmable Interrupt processing module 403 configuration in advance, and produce the interrupt switch control signal and control and interrupt selecting the passage between this interruption selection module 404 of module 404 gatings and CPU401 effective through the application configuration signal; Perhaps gating programmable Interrupt processing module 403 and interruption select the passage between the module 404 effective; Generally be defaulted as gating programmable Interrupt processing module 403 and interrupt selecting the passage between the module 404 effective, interrupt enable module 402 and enable look-at-me, and select effective passage of module 404 gatings that look-at-me is sent to programmable Interrupt processing module 403 through this interruption; Programmable Interrupt processing module 403 is carried out corresponding Interrupt Process according to the interrupt handling routine that CPU401 disposed after receiving look-at-me.
Through come to come the configure interrupt handling procedure by CPU, avoided independent, thereby practiced thrift cost in the present embodiment for the programmable Interrupt processing module is provided with an independent interrupt handling routine configuration module for the programmable Interrupt processing module.
CPU401 in the present embodiment also can be as required; Control interrupts selecting the passage between module 404 gating CPU401 and the interruption enable module 402 effective; For example, CPU401 judges whether the complexity of interrupt handling routine surpasses the degree able to programme of programmable Interrupt processing module 403, if then interrupt selecting module 404 gating CPU401 and interrupt selecting the passage between the module 402 effective through the control of interrupt switch control signal; Then interrupt enable module 402 and enable look-at-me; And, look-at-me is sent to CPU401, and then carry out Interrupt Process by CPU401 through this effective passage that interrupts selecting module 404 gatings.
The interrupt response device of present embodiment; Interrupt selecting module 404 gating CPU401 and interruption selection module 404 or programmable Interrupt processing module 403 and interrupt selecting the passage between the module 404 effective through controlling through the interrupt switch control signal by CPU401; Be defaulted as gating programmable Interrupt processing module 403 and interrupt selecting the passage between the module 404 effective; Thereby make when interruption enable module 402 enables look-at-me; Programmable Interrupt processing module 403 can respond interruption apace; And when some in particular cases, when for example the complexity of interrupt handling routine had surpassed the degree able to programme of programmable Interrupt processing module 403, perhaps the user was when initiatively gating CPU401 is with the passage that interrupts between the selection module 404; Just come handling interrupt, and then further improved dirigibility and speed that response is interrupted by CPU401.
Based on above-mentioned interrupt response device, this embodiment also provides a kind of interrupt response method, will combine specific embodiment and accompanying drawing that the interrupt response method of this embodiment is carried out detailed explanation below.
Embodiment three:
Based on the interrupt response device of the foregoing description one, this embodiment provides a kind of interrupt response method.Please refer to Fig. 5, be the process flow diagram of an embodiment of the interrupt response method of this embodiment.The interrupt response method of present embodiment comprises step:
S501, CPU are programmable Interrupt processing module configure interrupt handling procedure in advance.
Through come to come the configure interrupt handling procedure by CPU, avoided independent, thereby practiced thrift cost in the present embodiment for the programmable Interrupt processing module is provided with an independent interrupt handling routine configuration module for the programmable Interrupt processing module.
In the present embodiment through by CPU in advance for the programmable Interrupt processing module disposes corresponding interrupt handling routine, if each the interruption all handled according to same program, then only need to be provided with once, need not all to be provided with before each the interruption.When the interruption enable module enables look-at-me; And look-at-me sent to this programmable Interrupt processing module; The programmable Interrupt processing module is carried out Interrupt Process according to the predefined program of CPU after receiving this look-at-me, and does not take CPU when carrying out Interrupt Process.Because the interrupt handling routine in this programmable Interrupt processing module is pre-configured by CPU; Thereby avoided and to have carried out Interrupt Process according to specific program; And can by the pre-configured different interrupt handling routine of CPU, and then improve dirigibility as required; This programmable terminal processing module processing speed is fast simultaneously, and does not take CPU.
S503 interrupts enable module and enables look-at-me, and sends look-at-me and give the programmable Interrupt processing module.
S505, the programmable Interrupt processing module is carried out Interrupt Process according to the interrupt handling routine that is disposed after receiving look-at-me.
Embodiment four:
Based on the interrupt response device of the above embodiments two, this embodiment provides a kind of interrupt response method.Please refer to Fig. 6, be the process flow diagram of the another embodiment of the interrupt response method of this embodiment.The interrupt response method of present embodiment comprises step:
S601, CPU are programmable Interrupt processing module configure interrupt handling procedure in advance.
Through come to come the configure interrupt handling procedure by CPU, avoided independent, thereby practiced thrift cost in the present embodiment for the programmable Interrupt processing module is provided with an independent interrupt handling routine configuration module for the programmable Interrupt processing module.
S603, CPU produces the interrupt switch control signal, and interrupts selecting module gating programmable Interrupt processing module and interrupt selecting the passage between the module effective through this interrupt switch control signal control.
Under the normal condition in this embodiment, be defaulted as this interruption of CPU control and select module gating programmable Interrupt processing module and interrupt selecting the passage between the module effective.Certainly some are in particular cases; CPU in this embodiment also interrupts selecting the passage between module gating CPU and the interruption enable module effective through the control of interrupt switch control signal; Send look-at-me through this effective passage to CPU thereby interrupt enable module, and carry out Interrupt Process by this CPU.
S605 interrupts enable module and enables look-at-me, and sends look-at-me through effective passage of step S603 gating to the programmable Interrupt processing module.
S607 after the programmable Interrupt processing module receives look-at-me, carries out Interrupt Process according to the interrupt handling routine that is disposed.
Embodiment five:
Based on the interrupt response device of the above embodiments two, this embodiment also provides a kind of interrupt response method.Please refer to Fig. 7, be the process flow diagram of an embodiment again of the interrupt response method of this embodiment.The interrupt response method of present embodiment comprises step:
S701, CPU are programmable Interrupt processing module configure interrupt handling procedure in advance.
Through come to come the configure interrupt handling procedure by CPU, avoided independent, thereby practiced thrift cost in the present embodiment for the programmable Interrupt processing module is provided with an independent interrupt handling routine configuration module for the programmable Interrupt processing module.
S703, CPU judge whether the complexity of this interrupt handling routine has surpassed the degree able to programme of programmable Interrupt processing module, if, execution in step S705a then, otherwise execution in step S705b.
S705a, CPU produces the interrupt switch control signal, and interrupts selecting module gating CPU and interrupt selecting the passage between the module, execution in step S707 through its control.
S705b, CPU interrupts selecting module gating programmable Interrupt processing module and interrupts selecting the passage between the module effective through the control of interrupt switch control signal, execution in step S711.
S707 interrupts enable module and enables look-at-me, and sends look-at-me through effective passage of gating among the step S705a to CPU.
After S709, CPU receive this look-at-me, carry out Interrupt Process, end operation.
S711 interrupts enable module and enables look-at-me, and sends look-at-me through effective passage of gating among the step S705b to the programmable Interrupt processing module.
S713 after the programmable Interrupt processing module is received this look-at-me, carries out Interrupt Process, end operation according to CPU configure interrupt handling procedure.
Interrupting the selection module by CPU through the control of interrupt switch control signal in the interrupt response method of present embodiment comes gating CPU and interruption selection module or programmable Interrupt processing module and interrupts selecting the passage between the module effective; Be defaulted as gating programmable Interrupt processing module and interrupt selecting the passage between the module effective; Thereby make when the interruption enable module enables look-at-me; The programmable Interrupt processing module can respond interruption apace; And this programmable Interrupt processing module can be by the pre-configured corresponding interrupt handling routine of CPU; Avoided interruption processing module to be merely able to come the problem of handling interrupt, the dirigibility that has further improved Interrupt Process according to specific program; Yet work as some in particular cases; When for example the complexity of interrupt handling routine has surpassed the degree able to programme of programmable Interrupt processing module; When perhaps the passage between user active gating CPU and the interruption selection module is effective; Just look-at-me is sent to CPU, come handling interrupt, and then further improved dirigibility and speed that response is interrupted by CPU.
Above content is to combine concrete embodiment to the further explain that the present invention did, and can not assert that practical implementation of the present invention is confined to these explanations.For the those of ordinary skill of technical field under the present invention, under the prerequisite that does not break away from the present invention's design, can also make some simple deduction or replace, all should be regarded as belonging to protection scope of the present invention.