CN113986480A - Method for calling interrupt service function and related device - Google Patents

Method for calling interrupt service function and related device Download PDF

Info

Publication number
CN113986480A
CN113986480A CN202111168593.9A CN202111168593A CN113986480A CN 113986480 A CN113986480 A CN 113986480A CN 202111168593 A CN202111168593 A CN 202111168593A CN 113986480 A CN113986480 A CN 113986480A
Authority
CN
China
Prior art keywords
target
service function
program module
interrupt
interrupt service
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
CN202111168593.9A
Other languages
Chinese (zh)
Inventor
白颂荣
张海越
陈楠
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.)
Shenzhen Xihua Technology Co Ltd
Original Assignee
Shenzhen Xihua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Xihua Technology Co Ltd filed Critical Shenzhen Xihua Technology Co Ltd
Priority to CN202111168593.9A priority Critical patent/CN113986480A/en
Publication of CN113986480A publication Critical patent/CN113986480A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Abstract

The embodiment of the application discloses a calling method and a related device of an interrupt service function, which are applied to a microprocessor, wherein the microprocessor comprises a bootrom program module and a user program module; the method comprises the following steps: when a user program module of the microprocessor detects a target interrupt event in the running process, the bootrom program module can be run to obtain a reference initial address of a target interrupt service function corresponding to the target interrupt event, jump to the reference initial address to read the target initial address of the target interrupt service function, and jump to the target initial address to execute the target interrupt service function. The method and the device are beneficial to improving the flexibility of calling the interrupt service function by the microprocessor and expanding the functionality of the interrupt service function.

Description

Method for calling interrupt service function and related device
Technical Field
The present application relates to the technical field of program operation of chips, and in particular, to a method and a related apparatus for calling an interrupt service function.
Background
A microprocessor based on a Cortex-M0 core is a 32-bit processor introduced by ARM and widely applied to the market. The process of interrupt response by the microprocessor requires the microprocessor to save the context of the current environment in the stack, find the corresponding interrupt service function (also called interrupt service routine ISR) in the interrupt vector table by the interrupt vector number, and then run the ISR. Since the microprocessor uses the microprocessor internal registers in the interrupt service routine, the microprocessor internal registers need to be saved to a specified RAM address, i.e., the stack, before the ISR is called. After the interruption, the data in the RAM address (stack) is restored to the internal register of the microprocessor, so that the program running field before and after the interruption has no change.
Disclosure of Invention
The application provides a calling method and a related device of an interrupt service function, so as to improve the flexibility of a microprocessor for executing interrupt response.
In a first aspect, the present application provides a method for calling an interrupt service function, which is applied to a microprocessor, where the microprocessor includes a bootrom program module and a user program module; the method comprises the following steps:
detecting a target interrupt event in the running process of the user program module;
responding to the target interrupt event, operating the bootrom program module to acquire a reference initial address of a target interrupt service function corresponding to the target interrupt event, wherein a memory area of the reference initial address and a memory area of the bootrom program module are different types of memory areas;
jumping to the reference start address to read a target start address of the target interrupt service function;
jumping to the target start address to execute the target interrupt service function.
It can be seen that, in the embodiment of the present application, when a user program module of a microprocessor detects a target interrupt event during a running process, the bootrom program module can run to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event, jump to the reference start address to read the target start address of the target interrupt service function, and jump to the target start address to execute the target interrupt service function. The memory area of the reference initial address and the memory area of the bootrom program module are memory areas with different types, and the reference initial address is not restricted by the memory area of the bootrom program module, so that the target initial address of the target interrupt service function can be more flexibly set, the restriction of the memory space of the interrupt service function is reduced, and the flexibility of calling the interrupt service function by the microprocessor and the functionality of expanding the interrupt service function are improved.
In a second aspect, the present application provides a device for calling an interrupt service function, which is applied to a microprocessor, where the microprocessor includes a bootrom program module and a user program module; the device comprises:
the detection unit is used for detecting a target interrupt event in the running process of the user program module;
a response unit, configured to respond to the target interrupt event, run the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event, where a storage area of the reference start address and a storage area of the bootrom program module are different types of storage areas;
a first jumping unit for jumping to the reference start address to read a target start address of the target interrupt service function;
and the second jumping unit is used for jumping to the target starting address to execute the target interrupt service function.
In a third aspect, the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes an apparatus to perform the steps of the method according to any one of the first aspect.
In a fourth aspect, the present application provides a microprocessor for running a program, wherein the program is run to perform the steps of the method according to any one of the first aspect.
In a fifth aspect, the present application provides an electronic device comprising a microprocessor as described in the fourth aspect.
Drawings
FIG. 1 is a block diagram of a microprocessor according to an embodiment of the present disclosure;
fig. 2a is a schematic flowchart of a method for calling an interrupt service function according to an embodiment of the present application;
FIG. 2b is a schematic diagram of an alternative microprocessor according to an embodiment of the present application;
FIG. 3 is a block diagram illustrating functional units of an apparatus for invoking an interrupt service function according to an embodiment of the present disclosure;
fig. 4 is a block diagram illustrating functional units of another apparatus for calling an interrupt service function according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In the present application, "at least one" means one or more, and a plurality means two or more. In this application and/or, an association relationship of an associated object is described, which means that there may be three relationships, for example, a and/or B, which may mean: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein each of a, b, c may itself be an element or a set comprising one or more elements.
It should be noted that, in the embodiments of the present application, the term "equal to" may be used in conjunction with more than, and is applicable to the technical solution adopted when more than, and may also be used in conjunction with less than, and is applicable to the technical solution adopted when less than, and it should be noted that when equal to or more than, it is not used in conjunction with less than; when the ratio is equal to or less than the combined ratio, the ratio is not greater than the combined ratio. In the embodiments of the present application, "of", "corresponding" and "corresponding" may be sometimes used in combination, and it should be noted that the intended meaning is consistent when the difference is not emphasized.
First, partial terms referred to in the embodiments of the present application are explained so as to be easily understood by those skilled in the art.
1. A Cortex-M0 microprocessor is a 32-bit processor from ARM. The kernel of the microprocessor adopts an architecture that the instruction and the data share the same bus.
2. An interrupt mechanism, one of the basic mechanisms in modern computer systems, functions as a communication network in the system to coordinate the response and processing of the system to various external events, an interrupt is a necessary condition for implementing multiprogramming, and an interrupt is a reaction of a processor to an event occurring in the system.
The event that causes the interrupt is referred to as the interrupt source.
Requests that an interrupt source makes processing to a processor are referred to as interrupt requests. For example, an IRQ, an "emergency" must request (send an electrical pulse signal) an interrupt to the processor.
The point of pause at which an interrupted program is interrupted when an interruption occurs is called a breakpoint.
The process by which the processor suspends the active program and transitions to responding to the interrupt request is referred to as an interrupt response.
The program that handles the interrupt source is called an interrupt handler.
The interrupt handler associated with processor execution is called interrupt handling.
And the process of returning a breakpoint is referred to as interrupt return.
The interrupt is realized by the combination of software and hardware, the hardware part is called a hardware device, and the software part is called a software processing program.
3. The interrupt vector is a variable of the address of the interrupt.
4. The interrupt vector table is a jump instruction of the interrupt service function, because each interrupt vector only has a storage space of one byte in the vector table and can only store one instruction, the jump instruction is usually stored, so that the program jumps to other places of the memory and then executes interrupt processing.
5. The interrupt service routine is an interrupt code executed when an interrupt is transmitted.
Currently, using the CORTEX-M0 kernel, and a bootrom program (diskless boot ROM interface program) is stored in ROM, i.e. the interrupt vector table is also stored in the ROM address, the interrupt service function entry address in the interrupt vector table will not be changed (since in ROM, the entry address cannot be changed). In this way, the interrupt service function of the application code (i.e. the user program) in the RAM address is fixed with the entry address (start address) in advance, and the size of the interrupt service function is restricted, which affects the extension of the software function.
Based on the above problem, the present application provides a method and a related apparatus for invoking an interrupt service function, which are described in detail below.
Referring to FIG. 1, FIG. 1 is a block diagram illustrating a microprocessor 100 according to an embodiment of the present disclosure. The microprocessor 100 includes a core 120, a ROM140, and an IRAM160, where the core 120 is communicatively connected to the ROM140 and the IRAM160, respectively, and the core 120 may be, for example, a CPU.
The schematic structure of the microprocessor 100 is only an example, and the specific components may be more or less, and are not limited herein.
In addition, the microprocessor 100 may be applied to various electronic devices such as a mobile terminal (e.g., a smart phone), an IoT device in the internet of things, and a vehicle-mounted terminal device.
Referring to fig. 2a, fig. 2a is a schematic flowchart illustrating a method for calling an interrupt service function according to an embodiment of the present application, where the method is applied to a microprocessor, where the microprocessor includes a bootrom program module and a user program module; as shown in the figure, the calling method of the interrupt service function comprises the following steps.
Step 201, a target interrupt event is detected in the running process of the user program module.
For example, the user program module may be any application program executed by the microprocessor, such as a third party application program or a system application program installed on a device to which the microprocessor belongs, and the like, which is not limited herein.
In one possible example, the interrupt response time requirement of the target interrupt event is less than a preset time duration.
For example, the preset time period may be, for example, 500ms, and the like, and is not limited herein.
Step 202, in response to the target interrupt event, running the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event, where a storage area of the reference start address and a storage area of the bootrom program module are storage areas with different types.
For example, a BootRom (also called BootRom) in a diskless boot ROM interface program (also called BootRom program) is a small memory area integrated inside a microprocessor, and a boot code is generally solidified inside the memory area. As for the address space occupied by BootRom, the definition of each chip may be different. The different types refer to different physical characteristics of the storage intervals.
In one possible example, as shown in FIG. 2b, the bootrom program module is stored in ROM and the user program module is stored in IRAM.
For example, the size of the ROM may be 8KB, and the address range of the bootrom program module in the ROM may be 0x0-0x1 FFF. The size of the IRAM may be 64KB, and the address range of the user program module may be 0x10000 to 0x 20000.
In one possible example, the running the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event includes: running the bootrom program module to obtain a reference initial address of a target interrupt service function corresponding to the target interrupt event in a preset interrupt vector table;
the interrupt vector table is arranged in a read only memory ROM of the microprocessor, and the reference starting address is in a static random access memory IRAM of the microprocessor.
In a specific implementation, the microprocessor may query an interrupt vector corresponding to the target interrupt event from an interrupt vector table according to an interrupt vector number in the target interrupt event, and read a reference start address of the target interrupt service function from the interrupt vector.
It can be seen that, in this example, the microprocessor can run the bootrom program module, search the interrupt vector table, and obtain the reference start address of the target interrupt service function, and since the reference start address is in the IRAM of the microprocessor, although the reference start address in the interrupt vector table in the ROM cannot be modified, the reference start address is not the real start address of the interrupt service function, the interrupt service function does not receive the constraint, and the target start address indicated by the reference start address can be flexibly adapted and set specifically according to the size, functionality, and the like of the interrupt service function.
In one possible example, the running the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event in a preset interrupt vector table includes: running the bootrom program module to perform the following operations: detecting the value of a preset flag bit as a preset value, wherein the preset value is used for indicating the target interrupt event to represent the interrupt processing of a user program to be executed; and inquiring the interrupt vector table according to the value of the preset zone bit to obtain a reference initial address of a target interrupt service function corresponding to the target interrupt event.
In one possible example, after the target interrupt event is detected during the running of the user program, the method further includes: and setting the value of the preset zone bit as the preset value.
For example, the preset value may be 1 or 0.
In one possible example, the preset flag bit is set in the sram IRAM.
As can be seen, in this example, the preset flag bit of the fixed address is set in the IRAM, and the value of the flag bit is determined in the bootrom program module to distinguish whether to execute the interrupt processing of the bootrom program module or the interrupt processing of the user program module, so that the bootrom program module and the user program module share the interrupt processing function.
In one possible example, before the target interrupt event is detected during the running of the user program, the method further includes: writing a reference start address of the target interrupt service function into the interrupt vector table of the bootrom program module.
In a specific implementation, if the use of the IRQ by the bootrom program module is not considered, all addresses of the interrupt vector table of the bootrom program module can be rewritten into the reference start address of the interrupt service function of the application program module.
It can be seen that, in this example, by referring to the mapping mechanism between the start address and the target start address, the interrupt service function is no longer constrained by the unchangeable characteristic of the entry address, i.e. the reference start address, in the interrupt vector table, and the flexibility is improved.
Step 203, jump to the reference start address to read the target start address of the target interrupt service function.
Illustratively, the target start address is in a static random access memory IRAM of the microprocessor and is different from the reference start address.
In a specific implementation, the location of the target start address may be set according to the size, functional characteristics, and the like of the target interrupt service function. For example, the larger the target interrupt service function, the closer the target start address is located to the low storage location of the IRAM, so as to reserve enough storage space to store the entire target interrupt service function. And the like.
And 204, jumping to the target starting address to execute the target interrupt service function.
The target interrupt service function is a function capable of interrupting a user program and providing service.
It can be seen that, in the embodiment of the present application, when a user program module of a microprocessor detects a target interrupt event during a running process, the bootrom program module can run to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event, jump to the reference start address to read the target start address of the target interrupt service function, and jump to the target start address to execute the target interrupt service function. The memory area of the reference initial address and the memory area of the bootrom program module are memory areas with different types, and the reference initial address is not restricted by the memory area of the bootrom program module, so that the target initial address of the target interrupt service function can be more flexibly set, the restriction of the memory space of the interrupt service function is reduced, and the flexibility of calling the interrupt service function by the microprocessor and the functionality of expanding the interrupt service function are improved.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It will be appreciated that the microprocessor, in order to carry out the above-described functions, may comprise corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and algorithm steps described in connection with the embodiments provided herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the functional units of the microprocessor may be divided according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
The embodiment of the application provides a calling device of an interrupt service function, and the calling device of the interrupt service function can be a microprocessor. Specifically, the calling device of the interrupt service function is used for executing the steps executed by the microprocessor in the calling method of the interrupt service function. The device for calling the interrupt service function provided by the embodiment of the application can comprise modules corresponding to the corresponding steps.
In the embodiment of the present application, the function module of the call device of the interrupt service function may be divided according to the above method example, for example, each function module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The division of the modules in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 3 shows a schematic diagram of a possible structure of the call device of the interrupt service function in the above embodiment, in the case of dividing each functional module according to each function. As shown in fig. 3, the calling means 3 of the interrupt service function is applied to a microprocessor including a bootrom program module and a user program module; the device comprises:
a detection unit 30, configured to detect a target interrupt event during the running process of the user program module;
a response unit 31, configured to respond to the target interrupt event, run the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event, where a storage area of the reference start address and a storage area of the bootrom program module are different types of storage areas;
a first jumping unit 32 for jumping to the reference start address to read a target start address of the target interrupt service function;
a second jumping unit 33 for jumping to the target start address to execute the target interrupt service function.
In a possible example, in terms of the running of the bootrom program module to obtain the reference start address of the target interrupt service function corresponding to the target interrupt event, the response unit 31 is specifically configured to: and operating the bootrom program module to acquire a reference starting address of a target interrupt service function corresponding to the target interrupt event in a preset interrupt vector table, wherein the interrupt vector table is arranged in a Read Only Memory (ROM) of the microprocessor, and the reference starting address is in a static random access memory (IRAM) of the microprocessor.
In a possible example, in terms of the running of the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event in a preset interrupt vector table, the response unit 31 is specifically configured to: running the bootrom program module to perform the following operations: detecting the value of a preset flag bit as a preset value, wherein the preset value is used for indicating the target interrupt event to represent the interrupt processing of a user program to be executed; and inquiring the interrupt vector table according to the value of the preset zone bit to obtain a reference initial address of a target interrupt service function corresponding to the target interrupt event.
In one possible example, the apparatus further comprises a setting unit configured to: and setting the value of the preset zone bit as the preset value.
In one possible example, the preset flag bit is set in the sram IRAM.
In one possible example, the apparatus further comprises a write unit to: writing a reference start address of the target interrupt service function into the interrupt vector table of the bootrom program module.
In one possible example, the bootrom program module is stored in ROM and the user program module is stored in IRAM.
In one possible example, the interrupt response time requirement of the target interrupt event is less than a preset time duration.
In the case of using an integrated unit, a schematic structural diagram of another interrupt service function calling device 4 provided in the embodiment of the present application is shown in fig. 4. In fig. 4, the calling means 4 of the interrupt service function includes: a processing module 40 and a communication module 41. The processing module 40 is used for controlling and managing actions of calling means of the interrupt service function, such as steps performed by the detection unit 30, the response unit 31, the first jumping unit 32, the second jumping unit 33, and/or other processes for performing the techniques described herein. The communication module 41 is used to support the interaction between the calling device of the interrupt service function and other devices. As shown in fig. 4, the calling device of the interrupt service function may further include a storage module 42, and the storage module 42 is used for storing program codes and data of the calling device of the interrupt service function.
The Processing module 40 may be a Processor or a controller, and may be, for example, a Central Processing Unit (CPU), a general-purpose Processor, a Digital Signal Processor (DSP), an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others. The communication module 41 may be a transceiver, an RF circuit or a communication interface, etc. The storage module 42 may be a memory.
All relevant contents of each scene related to the method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again. The calling device 3 of the interrupt service function and the calling device 4 of the interrupt service function can both execute the steps executed by the microprocessor in the method for calling the interrupt service function shown in fig. 2 a.
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer instructions or the computer program are loaded or executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire or wirelessly. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more collections of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium may be a solid state disk.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus and system may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative; for example, the division of the unit is only a logic function division, and there may be another division manner in actual implementation; for example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications can be easily made by those skilled in the art without departing from the spirit and scope of the present invention, and it is within the scope of the present invention to include different functions, combination of implementation steps, software and hardware implementations.

Claims (12)

1. The calling method of the interrupt service function is characterized by being applied to a microprocessor, wherein the microprocessor comprises a bootrom program module and a user program module; the method comprises the following steps:
detecting a target interrupt event in the running process of the user program module;
responding to the target interrupt event, operating the bootrom program module to acquire a reference initial address of a target interrupt service function corresponding to the target interrupt event, wherein a memory area of the reference initial address and a memory area of the bootrom program module are different types of memory areas;
jumping to the reference start address to read a target start address of the target interrupt service function;
jumping to the target start address to execute the target interrupt service function.
2. The method of claim 1, wherein said executing the bootrom program module to obtain a reference starting address of a target interrupt service function corresponding to the target interrupt event comprises:
running the bootrom program module to obtain a reference initial address of a target interrupt service function corresponding to the target interrupt event in a preset interrupt vector table;
the interrupt vector table is arranged in a read only memory ROM of the microprocessor, and the reference starting address is in a static random access memory IRAM of the microprocessor.
3. The method according to claim 2, wherein the running the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event in a preset interrupt vector table comprises:
running the bootrom program module to perform the following operations:
detecting the value of a preset flag bit as a preset value, wherein the preset value is used for indicating the target interrupt event to represent the interrupt processing of a user program to be executed; and the number of the first and second groups,
and inquiring the interrupt vector table according to the value of the preset zone bit to obtain a reference initial address of a target interrupt service function corresponding to the target interrupt event.
4. The method of claim 3, wherein after detecting a target interrupt event during the running of the user program, the method further comprises:
and setting the value of the preset zone bit as the preset value.
5. The method according to claim 4, wherein the preset flag bit is set in the SRAM IRAM.
6. The method according to any of claims 1-5, wherein before detecting a target interrupt event during the running of the user program, the method further comprises:
writing a reference start address of the target interrupt service function into the interrupt vector table of the bootrom program module.
7. The method of claim 6, wherein the bootrom program module is stored in ROM and the user program module is stored in IRAM.
8. The method of claim 7, wherein the interrupt response time requirement of the target interrupt event is less than a preset time duration.
9. The calling device of the interrupt service function is applied to a microprocessor, and the microprocessor comprises a bootrom program module and a user program module; the device comprises:
the detection unit is used for detecting a target interrupt event in the running process of the user program module;
a response unit, configured to respond to the target interrupt event, run the bootrom program module to obtain a reference start address of a target interrupt service function corresponding to the target interrupt event, where a storage area of the reference start address and a storage area of the bootrom program module are different types of storage areas;
a first jumping unit for jumping to the reference start address to read a target start address of the target interrupt service function;
and the second jumping unit is used for jumping to the target starting address to execute the target interrupt service function.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes an apparatus to perform the steps of the method according to any one of claims 1-8.
11. A microprocessor, characterized in that the microprocessor is adapted to run a program, wherein the program is adapted to perform the steps of the method according to any of the claims 1-8 when running.
12. An electronic device comprising the microprocessor of claim 11.
CN202111168593.9A 2021-09-30 2021-09-30 Method for calling interrupt service function and related device Pending CN113986480A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111168593.9A CN113986480A (en) 2021-09-30 2021-09-30 Method for calling interrupt service function and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111168593.9A CN113986480A (en) 2021-09-30 2021-09-30 Method for calling interrupt service function and related device

Publications (1)

Publication Number Publication Date
CN113986480A true CN113986480A (en) 2022-01-28

Family

ID=79737679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111168593.9A Pending CN113986480A (en) 2021-09-30 2021-09-30 Method for calling interrupt service function and related device

Country Status (1)

Country Link
CN (1) CN113986480A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012208567A (en) * 2011-03-29 2012-10-25 Keihin Corp Electronic apparatus
US20130290587A1 (en) * 2012-04-27 2013-10-31 Denso Corporation Microcomputer
CN112198820A (en) * 2020-09-27 2021-01-08 中国第一汽车股份有限公司 Interrupt service implementation method, device, equipment and storage medium
CN112346739A (en) * 2019-08-06 2021-02-09 珠海格力电器股份有限公司 Remapping method and device of interrupt vector table, microprocessor and electronic device
CN112395065A (en) * 2020-11-26 2021-02-23 湖北开特汽车电子电器系统股份有限公司 Interrupt service method and device for starting and loading embedded system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012208567A (en) * 2011-03-29 2012-10-25 Keihin Corp Electronic apparatus
US20130290587A1 (en) * 2012-04-27 2013-10-31 Denso Corporation Microcomputer
CN112346739A (en) * 2019-08-06 2021-02-09 珠海格力电器股份有限公司 Remapping method and device of interrupt vector table, microprocessor and electronic device
CN112198820A (en) * 2020-09-27 2021-01-08 中国第一汽车股份有限公司 Interrupt service implementation method, device, equipment and storage medium
CN112395065A (en) * 2020-11-26 2021-02-23 湖北开特汽车电子电器系统股份有限公司 Interrupt service method and device for starting and loading embedded system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
石晶;王宜怀;苏勇;沈忱;: "基于ARM Cortex-M4的MQX中断机制分析与中断程序框架设计" *

Similar Documents

Publication Publication Date Title
US9727343B2 (en) Apparatus and method for handling exception events
EP0538817A2 (en) High-speed processor capable of handling multiple interrupts
CN110865888A (en) Resource loading method and device, server and storage medium
JP2018523201A (en) Firmware related event notification
US20150081942A9 (en) Multi-core processor system, computer product, and control method
EP2839369B1 (en) Information processing device and method for protecting data in a call stack
US6694401B2 (en) Method and apparatus for executing real-mode interrupts from within extended SMRAM handler
US9582339B2 (en) Operation of software modules in parallel
US9372773B2 (en) User-level hardware branch records
CN114281431A (en) Function calling method, device, medium, embedded equipment and operating system
US8726101B2 (en) Apparatus and method for tracing memory access information
CN114064236A (en) Task execution method, device, equipment and storage medium
CN116126581B (en) Memory fault processing method, device, system, equipment and storage medium
CN102929770A (en) Monitoring and positioning method of task monopolizing of user state of embedded Linux system
CN115905040B (en) Counter processing method, graphics processor, device and storage medium
CN113986480A (en) Method for calling interrupt service function and related device
US6349388B1 (en) Timer processing engine for supporting multiple virtual minimum time timers
CN115576734A (en) Multi-core heterogeneous log storage method and system
CN115269199A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN113986481A (en) Interrupt service instance calling method and related device
CN114153560A (en) Virtual interrupt processing method, device, equipment and medium
US20030018842A1 (en) Interrupt controller
CN113961366A (en) Kernel function calling method of operating system and computer equipment
CN113238842A (en) Task execution method and device and storage medium
CN113535341A (en) Method and device for realizing inter-CPU (central processing unit) core interrupt communication under Linux

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