CN109189598A - A kind of method, processor and terminal device interrupting positioning - Google Patents
A kind of method, processor and terminal device interrupting positioning Download PDFInfo
- Publication number
- CN109189598A CN109189598A CN201810862658.1A CN201810862658A CN109189598A CN 109189598 A CN109189598 A CN 109189598A CN 201810862658 A CN201810862658 A CN 201810862658A CN 109189598 A CN109189598 A CN 109189598A
- Authority
- CN
- China
- Prior art keywords
- interrupt
- irq
- interrupting
- output function
- processor
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0766—Error or fault reporting or storing
- G06F11/0772—Means for error signaling, e.g. using interrupts, exception flags, dedicated error registers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/0736—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention provides a kind of method, processor and terminal devices for interrupting positioning, wherein method includes: when executing IRQ interrupt service routine every time, call periodic sampling output function, to periodically sample and export IRQ interrupting information, then according to the IRQ interrupting information, abnormal interrupt event is determined.The present invention can be quick and efficiently locates the interruption being abnormal.
Description
Technical field
The invention belongs to embedded system technology field more particularly to a kind of method, processor and terminals for interrupting positioning
Equipment.
Background technique
ARM is the abbreviation of Advanced RISC Machine, refers to ARM company and its CPU product.ARM platform refers to
Embedded system using the CPU (processor) of ARM system as host CPU.IRQ is the abbreviation of INTERRUPT REQUEST, is
The general name of the corresponding interruption of all peripheral modules of ARM system CPU.On ARM system CPU, the interruption of all peripheral modules is total
With the main entrance of the same IRQ interrupt service routine.
In the exploitation debugging or operation of embedded system bottom software, in fact it could happen that interruption triggers and draw with not rested
The crash problem risen.Because IRQ interruption do not trigger with not rested caused by system in case of system halt problem be can in built-in system software
The failure that can occur, only carries out verifying confirmation to this failure and orients the interrupt number being triggered and corresponding interruption thing
Part could thoroughly solve the problems, such as this.
The common method for positioning such problem is using external emulator, for example, JTAG emulator (Joint
Test Action Group, joint test working group), carry out operation problem software, and by the methods of manual inspection come a step one
The verifying of step ground and orientation problem.This localization method the problem is that: need that existing equipment is transformed, JTAG drawn from CPU
All mouth lines of interface regulation, the operation are more troublesome;If also, CPU used in system does not have jtag interface, this side
Method is infeasible;Though not drawing JTAG mouth line on jtag interface but circuit board if CPU used in system has in advance and causing JTAG
Interface can not connect, then the method is still infeasible.In short, having centainly by conventional JTAG emulation mode to position described problem
Limitation.
To sum up, centering exists in the prior art to break location difficulty, complicated for operation and the problem of take a long time.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of method, processor and terminal device for interrupting positioning, to solve
Centering exists in the prior art to break location difficulty, complicated for operation and the problem of take a long time.
The first aspect of the embodiment of the present invention provides a kind of method for interrupting positioning, comprising:
When executing IRQ interrupt service routine every time, periodic sampling output function is called, wherein the periodic sampling is defeated
Function is for periodically sampling and exporting IRQ interrupting information out.
By calling the periodic sampling output function, the IRQ interrupting information of processor is obtained.
According to the IRQ interrupting information, abnormal interrupt event is determined.
The second aspect of the embodiment of the present invention provides a kind of processor, comprising:
Function call module, for calling periodic sampling output function when executing IRQ interrupt service routine every time,
In, the periodic sampling output function is for periodically sampling while exporting IRQ interrupting information.
Function execution module, for by calling the periodic sampling output function, the IRQ for obtaining processor to interrupt letter
Breath.
Locating module is interrupted, for determining abnormal interrupt event according to the IRQ interrupting information.
The third aspect of the embodiment of the present invention provides a kind of terminal device, including memory, processor and is stored in
In the memory and the computer program that can run on the processor, when the processor executes the computer program
The step of realizing the method for interrupting positioning as described above.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage
Media storage has computer program, and the method for interrupting positioning as described above is realized when the computer program is executed by processor
Step.
Existing beneficial effect is the embodiment of the present invention compared with prior art: by executing IRQ interruption service every time
When program, periodic sampling output function is called, to periodically sample and export IRQ interrupting information, then according to the IRQ
Interrupting information determines abnormal interrupt event.Can be quick and efficiently locate the interruption being abnormal.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is the flow diagram of the method for the interruption positioning that one embodiment of the present of invention provides;
Fig. 2 is the implementation process schematic diagram of step S103 in Fig. 1 of one embodiment of the present of invention offer;
Fig. 3 is the structural schematic diagram for the processor that one embodiment of the present of invention provides;
Fig. 4 is the structural schematic diagram that locating module is interrupted in Fig. 3 of one embodiment of the present of invention offer;
Fig. 5 is the schematic diagram for the terminal device that one embodiment of the present of invention provides.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific
The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " instruction is described special
Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step,
Operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment
And be not intended to limit the application.As present specification and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is
Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or
" if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true
It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment 1:
Fig. 1 shows a kind of implementation process of the method for interruption positioning of one embodiment of the present of invention offer, this implementation
The process executing subject of example can be processor, and details are as follows for process:
Step S101 calls periodic sampling output function, wherein the week when executing IRQ interrupt service routine every time
Phase, sampling output function was for periodically sampling and exporting IRQ interrupting information.
Step S102 obtains the IRQ interrupting information of processor by calling the periodic sampling output function.
Step S103 determines abnormal interrupt event according to the IRQ interrupting information.
In the processor, IRQ interrupt service routine is executed every time, can all generate IRQ interrupting information, still, the present embodiment
In be not IRQ interrupting information is all acquired when interrupting each time, but be spaced preset duration or default interruption times, thus
Periodically acquire IRQ interrupting information.Optionally, the time interval of front and back double sampling is set as preset duration, for example, the 1st
Second sampling is primary, sampling in the 2nd second is primary, it is primary to sample within the 3rd second ... and so on.
In one embodiment, the abnormal interrupt event is notified into user.
In the present embodiment, abnormal interrupt event can be due to interrupt do not trigger with not rested caused by crash therefore
Barrier can also be the improper interrupt event not occurred according to default association sequence.
In the present embodiment, realized by being inserted into operation a cycle sampling output function in IRQ interrupt service routine
Positioning to abnormal interruption is suitable for ARM platform, the interruption being abnormal can be positioned effective and rapidly, especially for interruption
Crash phenomenon caused by triggering with not rested is, it can be achieved that feedback problem is to user rapidly, in order to which user safeguards.
In one embodiment of the invention, before step S101, the method for interrupting positioning further include: in IRQ
The calling interface to the periodic sampling output function is inserted into the inlet of interrupt service routine.
Optionally, after the pop down code on the head of IRQ interrupt service routine, insertion exports letter to the periodic sampling
Several calling codes.
It should be noted that the interruption of all peripheral modules shares the same IRQ and interrupts service in the CPU of ARM system
The entrance of program, the entrance of IRQ interrupt service routine are used to carry out the press process of breakpoint address and general register.In IRQ
Disconnected service routine generallys use assembler language to realize.
In the present embodiment, in the inlet of IRQ interrupt service routine, increase the calling to periodic sampling output function.?
It is inserted into IRQ interrupt service routine and runs a cycle sampling output function.
In the processor, the interruption that every generation is once triggered by peripheral module will execute an IRQ and interrupt service journey
Sequence, a periodic sampling output function will be called by executing an IRQ interrupt service routine.Although interrupting can all call week every time
Phase samples output function, and still, periodic sampling output function is not to call all be sampled each time, but be spaced default
Duration or default interruption times can just sample once.
In the present embodiment, in the inlet of IRQ interrupt service routine, it is inserted into the calling to periodic sampling output function.It adopts
Exported with periodic samples rather than call the mode exported every time, and is subtracted as much as possible to simplify output information
Influence of the minor mode output code to program normal flow.
In one embodiment of the invention, IRQ interrupting information include the corresponding interrupt number of current interrupt service and/or in
Disconnected event, wherein interrupt number is the data in interrupt number register, and interrupt event is the data in interrupt event register.
It should be noted that including interrupt number register in the CPU of ARM system, interrupt number register is with interruption
The register for indicating function is used to indicate interrupt number corresponding to the current positive peripheral module for receiving interruption service.
In one embodiment of the invention, the periodic sampling output function is used for:
The corresponding interrupt number of current interrupt service and/or interrupt event are read, as the IRQ interrupting information.
By the way of poll, by the peripheral module with external transfer function, the IRQ interrupting information is exported.
In one embodiment, periodic sampling output function periodically Sampling interrupt number first, passes through the interruption of output
Number the interrupt number being abnormal can be determined, so that it is determined that triggering the peripheral module of this abnormal interrupt.If triggered in this exception
Disconnected peripheral module has more complex interrupt source, then needs to increase more detailed output information, then defeated in periodic sampling
Increase the code of output interrupt event in function, out so as to further determine that the interrupt event being specifically abnormal.
In one embodiment, periodic sampling output function exports IRQ by the peripheral module with external transfer function
Interrupting information, can be for manual analysis and confirmation.Wherein, the peripheral module with external transfer function can be communication port, show
Show that equipment or printer etc. are one such or several.
In addition, due to periodic sampling output function output be interrupting information, so output should not be come in a manner of interruption
It realizes, in order to avoid upsetting current interrupt service, causes interrupting information that cannot successfully export.Based on this reason, this programme uses poll
Mode exported.
In one embodiment, it is inserted into the basic output function of bottom, in periodic sampling output function for realizing difference
The output function of the peripheral module externally transmitted.
By taking a concrete application scene as an example, when periodic sampling output function exports interrupting information by serial ports, the period
It samples and the basic output function of serial ports is written in output function.
The basic output function of serial ports the realization process includes:
1) the entrance variable element in the basic output function of serial ports is converted into target output string.
2) the target output string is sent with polling mode, comprising: lasting waiting, until serial ports sends buffering queue
Become discontented state, then word for word saves land and send the target output string to serial ports transmission buffering queue.
Periodic sampling output function sets collected IRQ interrupting information as institute before calling the basic output function of serial ports
Entrance variable element is stated, is then called.
In the present embodiment, periodic sampling output function is for periodically sampling while exporting IRQ interrupting information, this function
It is just output it after periodically sampling IRQ interrupting information.
In one embodiment of the invention, the periodic sampling output function by variable count, clock walk when or
Mode when timer travel realizes periodic samples and exports the IRQ interrupting information.
In one embodiment, the periodic sampling output function realizes periodic samples simultaneously in such a way that variable counts
Export the IRQ interrupting information, comprising:
1) static variable is defined, and its value is initialized as 0.
2) when calling the periodic sampling output function every time, the value of the static variable is added 1.
If 3) the value mould of the static variable samples except the value after preset sampling period number is 0 and exports the IRQ
Interrupting information.
4) otherwise, the IRQ interrupting information is not sampled, directly jumps out the periodic sampling output function.
In the present embodiment, preset sampling period number can be set according to the frequency speed of processor, such as 1000,
10000 etc..
Wherein, it is a kind of binary operation for not having exchangeability that mould, which removes,.For example, working as a=bq+r, q is integer, and is reached
Maximum, we say that a mould is equal to r except b at this time.
In one embodiment, the periodic sampling output function realizes periodic samples simultaneously by way of when clock is walked
Export the IRQ interrupting information, comprising:
1) when calling the periodic sampling output function every time, current time is read from system clock.
If 2) the value mould of the current time samples except the value after preset time cycle number is 0 and exports the IRQ
Interrupting information.
3) otherwise, the IRQ interrupting information is not sampled, directly jumps out the periodic sampling output function.
In the present embodiment, preset time cycle number can be 3,5 or 10 etc., respectively correspond 3 seconds, 5 seconds, sampling in 10 seconds
Period.
In one embodiment, periodic samples are realized by way of the periodic sampling output function is when timer travel
And export the IRQ interrupting information, comprising:
1) when calling the periodic sampling output function for the first time, starting timer carries out timing, and timing time is initial
Turn to 0.
2) when calling the periodic sampling output function every time later, when checking whether the timing time reaches default
It is long.
If 3) timing time reaches preset duration, sample and export the IRQ interrupting information, and restart it is described fixed
When device so that timing time is reset to 0.
If 4) timing time does not reach the default time limit, the IRQ interrupting information is not sampled, continue to count
When, and directly jump out the periodic sampling output function.
In the present embodiment, preset duration can be 3 seconds, 5 seconds, 10 seconds etc..
As shown in Fig. 2, in one embodiment of the invention, the step S103 in embodiment corresponding to Fig. 1 includes:
Step S201 determines the interrupt number being abnormal by the IRQ interrupting information.
Optionally, by reading the data acquisition interrupt number in interrupt number register.
Step S202 determines peripheral module according to the interrupt number being abnormal, wherein the peripheral module is touching
Send out the external equipment of the interrupt number.
Optionally, processor-based technical manual can obtain the specific corresponding relationship of interrupt number and peripheral module, benefit
Step S202 may be implemented with the corresponding relationship.
Step S203 determines the interrupt event that triggering is interrupted according to the interrupt source of the peripheral module, and by the interruption thing
Part is as the abnormal interrupt event.
In one embodiment of the invention, step S201 includes:
1) interrupt number in the IRQ interrupting information is obtained.
If 2) interrupt number meets default exceptional condition, as the interrupt number being abnormal.
Wherein, it includes: interrupt number repeated multiple times appearance, Huo Zhe in preset duration that interrupt number, which meets default exceptional condition,
Other improper interrupt numbers are interrupted or are inserted into interrupt number with default association sequence.
In a particular application, the repeated multiple times appearance in preset duration is interrupted, can be shown as, some interruption is not stopped
Triggering with having a rest causes to crash.
In a particular application, it is not being beaten by taking a scene as an example according to the improper interruption that default association sequence occurs
During print, normal sequence is printed after first serial communication, and the sequence of interruption is answered are as follows: first there is the corresponding interruption of serial port module, after
The interruption of face immediately print module may be exactly if occurring the interruption of other peripheral modules triggering in the two are interrupted
Abnormal interruption.
In one embodiment of the invention, step S203 includes:
If 1) peripheral module has an interrupt source, an interrupt event is determined according to the interrupt source, as institute
State abnormal interrupt event.
If 2) peripheral module has at least two interrupt sources, by described in periodic sampling output function reading
Data in the corresponding interrupt event register of peripheral module, and determined according to the data in the interrupt event register read
The abnormal interrupt event.
In one embodiment, interrupt event includes interrupt status and interruption source.
It should be noted that the specific corresponding relationship of interrupt number and peripheral module, different processors is different, can join
See the technical manual of alignment processing device.
Peripheral module better simply for interrupt source, such as: timer, universal input and output module, it is specific to interrupt original
Because being exactly that the interrupt condition set reaches, system is additionally provided dedicated register no longer generally to indicate these peripheral modules
Interrupt status or specific interruption source.
The peripheral module more complex for interrupt source, such as: ethernet module, serial ports, USB module are specific to interrupt original
Because more, system generally provides dedicated register to indicate the specific interruption source of these peripheral modules.
Therefore, for the peripheral module at least two interrupt sources, the present embodiment exports letter by the periodic sampling
Number reads the data in the corresponding interrupt event register of the peripheral module.
The interrupt event register of peripheral module corresponding to different interrupt numbers is different, and the present embodiment is different only for occurring
The peripheral module of normal interrupt number.General location time-consuming can more be saved, improve location efficiency.
By taking a concrete application scene as an example, it is assumed that orienting abnormal peripheral module in step S202 is Ethernet mould
The interrupt source of block, ethernet module may include: the change of link state, receiver spilling, transmitter underload, in receiving frame
It is disconnected, send frame and interrupt etc., these interrupt sources by the corresponding interrupt event register of ethernet module that system provides not
It is indicated respectively with position.So, in step S203, the data in the corresponding interrupt event register of ethernet module are read,
So that it is determined that abnormal interrupt event.
The embodiment of the present invention has following technical effect that
1, periodic sampling output function uses the strategy of periodic samples output, has simplified output information, and as much as possible
Influence of the debugging output code to program normal flow is reduced, in case problem can not reappear.
2, the basic output function of bottom is realized using polling mode, and avoiding sampling output information possibly can not be successfully defeated
Out the problem of.
3, this programme is implemented simpler, high to the location efficiency of disruption.
4, this programme can be suitably used for the positioning of the abnormal interruption problem on all ARM platforms.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Embodiment 2:
As shown in figure 3, the processor 100 that one embodiment of the present of invention provides, for executing embodiment corresponding to Fig. 1
In method and step comprising:
Function call module 110, for calling periodic sampling output function when executing IRQ interrupt service routine every time,
Wherein, the periodic sampling output function is for periodically sampling while exporting IRQ interrupting information.
Function execution module 120, for by calling the periodic sampling output function, the IRQ for obtaining processor to be interrupted
Information.
Locating module 130 is interrupted, for determining abnormal interrupt event according to the IRQ interrupting information.
In one embodiment of the invention, processor 100 further include:
Interface calling module, for being inserted into the periodic sampling output function in the inlet of IRQ interrupt service routine
Calling interface.
As shown in figure 4, in one embodiment of the invention, the interruption locating module 130 in embodiment corresponding to Fig. 3
It further include the structure for executing the method and step in embodiment corresponding to Fig. 2 comprising:
Interrupt number determination unit 131, for determining the interrupt number being abnormal by the IRQ interrupting information.
Peripheral hardware determination unit 132, the interrupt number for being abnormal according to, determines peripheral module, wherein described outer
If module is to trigger the external equipment of the interrupt number.
Interrupt event determination unit 133 determines the interruption thing that triggering is interrupted for the interrupt source according to the peripheral module
Part, and using the interrupt event as the abnormal interrupt event.
In one embodiment of the invention, interrupt number determination unit 131 includes:
Interrupt number obtains subelement, for obtaining the interrupt number in the IRQ interrupting information.
Abnormal judgment sub-unit, it is different as the generation if meeting default exceptional condition for the interrupt number
Normal interrupt number.
In one embodiment of the invention, interrupt event determination unit 133 includes:
First interrupts judgment sub-unit, true according to the interrupt source if having an interrupt source for the peripheral module
A fixed interrupt event, as the abnormal interrupt event.
Second interrupts judgment sub-unit, if having at least two interrupt sources for the peripheral module, passes through the week
Phase sampling output function reads the data in the corresponding interrupt event register of the peripheral module, and according to the interruption read
Data in event registers determine the abnormal interrupt event.
In one embodiment, processor 100 further includes other function module/unit, for realizing each reality in embodiment 1
Apply the method and step in example.
It is apparent to those skilled in the art that for convenience and simplicity of description, only with above-mentioned each function
The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds
Block is completed, i.e. the internal structure of processor 100 is divided into different functional modules, described above all or part of to complete
Function.Each functional module in embodiment can integrate in one processing unit, is also possible to the independent physics of each unit and deposits
It can also be integrated in one unit with two or more units, above-mentioned integrated module can both use the shape of hardware
Formula is realized, can also be realized in the form of software functional units.In addition, the specific name of each functional module is also intended merely to just
It is distinguished in mutual, the protection scope being not intended to limit this application.The specific work process of module in above-mentioned processor 100, can
With the corresponding process in reference implementation example 1, details are not described herein.
Embodiment 3:
Fig. 5 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in figure 5, the terminal of the embodiment is set
It is standby to include: processor 100, memory 200 and be stored in the memory 200 and be run on the processor 100
Computer program 300.The processor 100 realizes each reality as described in example 1 above when executing the computer program 300
Apply the step in example, such as step S101 to S103 shown in FIG. 1.Alternatively, the processor 100 executes the computer program
The function of each module/unit in each system embodiment as described in example 2 above, such as module shown in Fig. 3 are realized when 300
110 to 130 function.
The terminal device refers to the terminal with data-handling capacity, including but not limited to computer, work station, service
Device, the smart phone more even haveing excellent performance, palm PC, tablet computer, personal digital assistant (PDA), smart television
(Smart TV) etc..The specific example of terminal device is enumerated in detail above, it will be appreciated by those of skill in the art that intelligence is eventually
End is not limited to above-mentioned enumerate example.
The terminal device may include, but be not limited only to, processor 100, memory 200.Those skilled in the art can be with
Understand, Fig. 5 is only the example of terminal device, does not constitute the restriction to terminal device, may include more or more than illustrating
Few component perhaps combines certain components or different components, such as the terminal device can also be set including input and output
Standby, network access equipment, bus etc..
Alleged processor 100 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng.
The memory 200 can be the internal storage unit of the terminal device, such as the hard disk or interior of terminal device
It deposits.What the memory 200 was also possible to be equipped on the External memory equipment of the terminal device, such as the terminal device inserts
Connect formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory
Block (Flash Card) etc..Further, the memory 200 can also both include the internal storage unit of the terminal device
It also include External memory equipment.The memory 200 is for storing needed for the computer program and the terminal device
Other programs and data.The memory 200 can be also used for temporarily storing the data that has exported or will export.
Embodiment 4:
The embodiment of the invention also provides a kind of computer readable storage medium, computer-readable recording medium storage has meter
Calculation machine program is realized the step in each embodiment as described in example 1 above, such as is schemed when computer program is executed by processor
Step S101 shown in 1 to step S103.Alternatively, realizing when the computer program is executed by processor such as institute in embodiment 2
The function of each module/unit in each system embodiment stated, such as the function of module 110 to 130 shown in Fig. 3.
The computer program can be stored in a computer readable storage medium, and the computer program is by processor
When execution, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code,
The computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..Institute
State computer-readable medium may include: can carry the computer program code any entity or device, recording medium,
USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), arbitrary access
Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs
It is bright, the content that the computer-readable medium includes can according in jurisdiction make laws and patent practice requirement into
Row increase and decrease appropriate, such as do not include electric load according to legislation and patent practice, computer-readable medium in certain jurisdictions
Wave signal and telecommunication signal.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, embodiment 1 to 4 can in any combination, group
The new embodiment formed after conjunction is also within the scope of protection of this application.There is no the portion for being described in detail or recording in some embodiment
Point, it may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed terminal device and method can pass through it
Its mode is realized.For example, system described above/terminal device embodiment is only schematical, for example, the module
Or the division of unit, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple lists
Member or component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point,
Shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device or unit
INDIRECT COUPLING or communication connection, can be electrical property, mechanical or other forms.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.
Claims (10)
1. a kind of method for interrupting positioning characterized by comprising
When executing IRQ interrupt service routine every time, periodic sampling output function is called, wherein the periodic sampling exports letter
Number is for periodically sampling and exporting IRQ interrupting information;
By calling the periodic sampling output function, the IRQ interrupting information of processor is obtained;
According to the IRQ interrupting information, abnormal interrupt event is determined.
2. the method as described in claim 1 for interrupting positioning, which is characterized in that described to interrupt service journey in execution IRQ every time
When sequence, before calling periodic sampling output function, further includes: in the inlet of IRQ interrupt service routine, be inserted into the period
Sample the calling interface of output function.
3. the method as described in claim 1 for interrupting positioning, which is characterized in that the periodic sampling output function is used for:
The corresponding interrupt number of current interrupt service and/or interrupt event are read, as the IRQ interrupting information;
By the way of poll, by the peripheral module with external transfer function, the IRQ interrupting information is exported.
4. the method as described in claim 1 for interrupting positioning, which is characterized in that the periodic sampling output function passes through variable
When counting, clock are walked or mode when timer travel realizes periodic samples and exports the IRQ interrupting information.
5. the method as described in claim 1 for interrupting positioning, which is characterized in that it is described according to the IRQ interrupting information, it determines
Abnormal interrupt event, comprising:
By the IRQ interrupting information, the interrupt number being abnormal is determined;
According to the interrupt number being abnormal, peripheral module is determined, wherein the peripheral module is trigger the interrupt number outer
Portion's equipment;
According to the interrupt source of the peripheral module, the interrupt event that triggering is interrupted is determined, and using the interrupt event as described different
Normal interrupt event.
6. the method as claimed in claim 5 for interrupting positioning, which is characterized in that it is described by the IRQ interrupting information, it determines
The interrupt number being abnormal, comprising:
Obtain the interrupt number in the IRQ interrupting information;
If the interrupt number meets default exceptional condition, as the interrupt number being abnormal.
7. the method as claimed in claim 5 for interrupting positioning, which is characterized in that the interruption according to the peripheral module
Source determines the interrupt event that triggering is interrupted, and using the interrupt event as the abnormal interrupt event, comprising:
If the peripheral module has an interrupt source, an interrupt event is determined according to the interrupt source, as the exception
Interrupt event;
If the peripheral module has at least two interrupt sources, the peripheral hardware mould is read by the periodic sampling output function
Data in the corresponding interrupt event register of block, and determined according to the data in the interrupt event register read described different
Normal interrupt event.
8. a kind of processor characterized by comprising
Function call module, for calling periodic sampling output function, wherein institute when executing IRQ interrupt service routine every time
Periodic sampling output function is stated for periodically sampling while exporting IRQ interrupting information;
Function execution module, for obtaining the IRQ interrupting information of processor by calling the periodic sampling output function;
Locating module is interrupted, for determining abnormal interrupt event according to the IRQ interrupting information.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor
The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 7 when executing the computer program
The step of method of any one interruption positioning.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In the step of the method for positioning is interrupted in realization as described in any one of claim 1 to 7 when the computer program is executed by processor
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810862658.1A CN109189598B (en) | 2018-08-01 | 2018-08-01 | Interrupt positioning method, processor and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810862658.1A CN109189598B (en) | 2018-08-01 | 2018-08-01 | Interrupt positioning method, processor and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109189598A true CN109189598A (en) | 2019-01-11 |
CN109189598B CN109189598B (en) | 2022-01-25 |
Family
ID=64937695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810862658.1A Active CN109189598B (en) | 2018-08-01 | 2018-08-01 | Interrupt positioning method, processor and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109189598B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110164392A (en) * | 2019-04-28 | 2019-08-23 | 珠海黑石电气自动化科技有限公司 | A kind of antistatic LCD drive method, circuit, device and storage medium |
CN111478751A (en) * | 2020-03-30 | 2020-07-31 | 百富计算机技术(深圳)有限公司 | Data breakpoint continuous transmission method and device and terminal equipment |
CN117056062A (en) * | 2023-10-13 | 2023-11-14 | 武汉天喻信息产业股份有限公司 | Method and device for forcedly exiting interrupt service routine |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105468497A (en) * | 2015-12-15 | 2016-04-06 | 迈普通信技术股份有限公司 | Interruption exception monitoring method and apparatus |
CN106201892A (en) * | 2016-07-20 | 2016-12-07 | 中国航空工业集团公司航空动力控制系统研究所 | Aborted source location detection method for embedded software |
CN106569888A (en) * | 2016-11-04 | 2017-04-19 | 郑州云海信息技术有限公司 | ARM interrupt processing method and system |
CN107451045A (en) * | 2016-05-31 | 2017-12-08 | 北京信威通信技术股份有限公司 | A kind of method and device of abnormal information positioning |
US20180203722A1 (en) * | 2017-01-19 | 2018-07-19 | Samsung Electronics Co., Ltd. | Method for reducing interrupt latency in embedded systems |
-
2018
- 2018-08-01 CN CN201810862658.1A patent/CN109189598B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105468497A (en) * | 2015-12-15 | 2016-04-06 | 迈普通信技术股份有限公司 | Interruption exception monitoring method and apparatus |
CN107451045A (en) * | 2016-05-31 | 2017-12-08 | 北京信威通信技术股份有限公司 | A kind of method and device of abnormal information positioning |
CN106201892A (en) * | 2016-07-20 | 2016-12-07 | 中国航空工业集团公司航空动力控制系统研究所 | Aborted source location detection method for embedded software |
CN106569888A (en) * | 2016-11-04 | 2017-04-19 | 郑州云海信息技术有限公司 | ARM interrupt processing method and system |
US20180203722A1 (en) * | 2017-01-19 | 2018-07-19 | Samsung Electronics Co., Ltd. | Method for reducing interrupt latency in embedded systems |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110164392A (en) * | 2019-04-28 | 2019-08-23 | 珠海黑石电气自动化科技有限公司 | A kind of antistatic LCD drive method, circuit, device and storage medium |
CN111478751A (en) * | 2020-03-30 | 2020-07-31 | 百富计算机技术(深圳)有限公司 | Data breakpoint continuous transmission method and device and terminal equipment |
CN117056062A (en) * | 2023-10-13 | 2023-11-14 | 武汉天喻信息产业股份有限公司 | Method and device for forcedly exiting interrupt service routine |
CN117056062B (en) * | 2023-10-13 | 2024-04-02 | 武汉天喻信息产业股份有限公司 | Method and device for forcedly exiting interrupt service routine |
Also Published As
Publication number | Publication date |
---|---|
CN109189598B (en) | 2022-01-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109189598A (en) | A kind of method, processor and terminal device interrupting positioning | |
CA1263759A (en) | Arrangement for on-line diagnostic testing of an off- line standby processor in a duplicated processor configuration | |
CN102546843B (en) | A kind of method by the multiple UART communication interfaces of software simulated implementation | |
CN111163018B (en) | Network equipment and method for reducing transmission delay thereof | |
US11048845B1 (en) | FPGA chip-based handler simulation test system and a test method | |
JPS644216B2 (en) | ||
CN105610915A (en) | Data reporting method and system | |
CN109032828A (en) | Using abnormality eliminating method and terminal | |
CN101297256A (en) | Data processing arrangement comprising a reset facility | |
CN110865868B (en) | Low-delay control method, device and equipment thereof | |
CN109739712B (en) | FPGA accelerator card transmission performance test method, device, equipment and medium | |
CN110069827A (en) | Placement-and-routing's method and apparatus of the online logic analyser of FPGA | |
CN101699419A (en) | Data transmission method and universal serial bus host controller using same | |
CN109240947A (en) | Intelligent card data method of reseptance and device | |
CN103197971B (en) | The implementation method of the low CPU usage intervalometer of high accuracy under Windows operating system Pentium IV framework | |
CN114153783B (en) | Method, system, computer device and storage medium for implementing multi-core communication mechanism | |
CN110399255A (en) | A kind of debugging system of FPGA system and FPGA system | |
CN110765045B (en) | FPGA-based interrupt delay counting system and method | |
CN112286653A (en) | Method and device for improving processing efficiency of acquired data and storage medium | |
CN104049997B (en) | Satellite receiver on-line loading method based on multiplexing technology | |
CN115470048B (en) | Reset method, system-on-chip, electronic device and storage medium | |
CN110876852A (en) | Network game data processing method and system of micro-service | |
CN117873853B (en) | Data recording method, device, electronic equipment and medium | |
CN106980536B (en) | Data acquire the program scheduler method of monitor | |
CN117076061A (en) | Fault processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |