Arm interrupt Analysis 3: wince driver interrupt Analysis

Source: Internet
Author: User

Currently, many high-end ARM chips, such as Apple, Samsung, and Huawei, use ARM chips as smartphone chips.

This article introduces the interrupt Analysis of the ARM-based wince operating system driver. There are two types of Wince drivers. Here we introduce stream drivers, which are relatively simple.

The following figure shows the status of the streaming driver:

We can see the figure above from the right to the left, and the rightmost is the application. The program should use the createfile, writefile, readfile, ioctrl, closefile functions to access the driver, which is the same as other operating systems, such as Windows XP and Linux.

A stream driver is a library (DLL) that implements a number of functions, including xxx_init and xxx_deinit. The above diagram is listed.

Before using the driver, you need to load the driver (activate the driver), that is, make the driver ready for application access. The ActivateDeviceEx function is used for activation. ActivateDeviceEx receives a registry path as a parameter. Therefore, we need to write the driver information to the registry according to the format. The following is an example of the gpio registry:

[HKEY_LOCAL_MACHINE \ drivers \ builtin \ gpio]

"DLL" = "maid"

"Prefix" = "gio"

"Order" = DWORD: 63

"Index" = DWORD: 1

"Friendlyname" = "gpio driver"

 

If the driver is interrupted, perform the following steps:

1. When the driver is initialized, the physical interrupt number obtains the virtual interrupt number and calls the kerneliocontrol (ioctl_hal_request_sysintr…) function ...)

2. During driver initialization, the event handle is bound to the virtual interrupt number, and the function interruptinitialize is used to create an ist thread and waiting the event.

3. interrupt handling: If a hardware interrupt occurs, the wait event in the IST thread will return. Next, handle the interrupt and call the interruptdone function. This means that the interrupt processing is complete.

4. Call interruptdisable before exiting the driver to disable the current interrupt, which is opposite to interruptinitialize.

5. Release the virtual interrupt Number Resource kerneliocontrol (ioctl_hal_release_sysintr...) before exiting the driver ...)

 

If you develop an Ethernet driver, how do you know the hardware interrupt Number of the Ethernet chip? The answer is: Ask the BSP developer or hardware developer. Unlike windows drivers, the interrupt Number of the Windows Driver is sent to the driver by messages.

 

Driver interrupt number for a Windows XP operating system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.