Nicolas Besson - Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

Здесь есть возможность читать онлайн «Nicolas Besson - Microsoft Windows Embedded CE 6.0 Exam Preparation Kit» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: Redmond, Год выпуска: 2008, Издательство: Microsoft, Жанр: Руководства, ОС и Сети, Программы, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Microsoft Windows Embedded CE 6.0 Exam Preparation Kit: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Microsoft Windows Embedded CE 6.0 Exam Preparation Kit — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Interrupt Identifiers (IRQ and SYSINTR)<\/p> <\/div>

Each hardware interrupt line corresponds to an IRQ value in the interrupt controller registers. Each IRQ value can be associated with only one ISR, but an ISR can map to multiple IRQs. The kernel does not need to maintain the IRQs. It just determines and signals events associated with the SYSINTR values returned from the ISR in response to the IRQ. The ability to return varying SYSINTR values from an ISR provides the basis to support multiple devices that use the same shared interrupt.<\/p>

NOTE<\/div>
OEMInterruptHandler and HookInterrupt<\/div>

Target devices that only support a single IRQ, such as ARM-based systems, use the OEMInterruptHandler function as the ISR to identify the embedded peripheral that triggered the interrupt. Original equipment manufacturers (OEMs) must implement this function as part of the OAL. On platforms that support multiple IRQs, such as Intel x86-based systems, you can associate the IRQs with individual ISRs by calling HookInterrupt.<\/p> <\/cite>

Static Interrupt Mappings<\/p> <\/div>

For the ISR to determine a correct SYSINTR return value there must be a mapping between the IRQ and the SYSINTR, which can be hardcoded into the OAL. The Bsp_cfg.h file for the Device Emulator BSP demonstrates how to define a SYSINTR value in the OAL for a target device relative to the SYSINTR_FIRMWARE value. If you want to define additional identifiers in your OAL for a custom target device, keep in mind that the kernel reserves all values below SYSINTR_FIRMWARE for future use and the maximum value should be less than SYSINTR_MAXIMUM.<\/p>

To add a mapping of static SYSINTR values to IRQs on a target device, you can call the OALIntrStaticTranslate function during system initialization. For example, the Device Emulator BSP calls OALIntrStaticTranslate in the BSPIntrInit function to register a custom SYSINTR value for the built-in Open Host Controller Interface (OHCI) in the kernel's interrupt mapping arrays (g_oalSysIntr2Irq and g_oalIrq2SysIntr). However, static SYSINTR values and mappings are not a common way to associate IRQs with SYSINTRs because it is difficult and requires OAL code changes to implement custom interrupt handling. Static SYSINTR values are typically used for core hardware components of a target device where there is no explicit device driver and the ISR resides in the OAL.<\/p>

Dynamic Interrupt Mappings<\/p> <\/div>

The good news is that you do not need to hardcode SYSINTR values into the OAL if you call KernelIoControl in your device drivers with an IO control code of IOCTL_HAL_REQUEST_SYSINTR to register IRQ/SYSINTR mappings. The call eventually ends in the OALIntrRequestSysIntr function, which dynamically allocates a new SYSINTR for the given IRQ, and then registers the IRQ and SYSINTR mappings in the kernel's interrupt mapping arrays. Locating a free SYSINTR value up to SYSINTR_MAXUMUM is more flexible than static SYSINTR assignments because this mechanism does not require any modifications to the OAL when you add new drivers to the BSP.<\/p>

When calling KernelIoControl with IOCTL_HAL_REQUEST_SYSINTR, you establish a 1:1 relationship between IRQ and SYSINTR. If the IRQ-SYSINTR mapping table already has an entry for the specified IRQ, OALIntrRequestSysIntr will not create a second entry. To remove an entry from the interrupt mapping tables, such as when unloading a driver, call KernelIoControl with an IO control code of IOCTL_HAL_REQUEST_SYSINTR. IOCTL_HAL_RELEASE_SYSINTR dissociates the IRQ from the SYSINTR value.<\/p>

The following code sample illustrates the use of IOCTL_HAL_REQUEST_SYSINTR and IOCTL_HAL_RELEASE_SYSINTR. It takes a custom value (dwLogintr) and passes this value to the OAL to be translated into a SYSINTR value, and then associates this SYSINTR with an IST event.<\/p>

DWORD dwLogintr = IRQ_VALUE;<\/code> <\/p>

DWORD dwSysintr = 0;<\/code> <\/p>

HANDLE hEvent = NULL;<\/code> <\/p>

BOOL bResult = TRUE;<\/code> <\/p>

// Create event to associate with the interrupt<\/code> <\/p>

m_hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);<\/code> <\/p>

if (m_hDetectionEvent == NULL) {<\/code> <\/p>

return ERROR_VALUE;<\/code> <\/p>

}<\/code> <\/p>

// Ask the kernel (OAL) to associate an SYSINTR value to an IRQ<\/code> <\/p>

bResult = KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR,<\/code> <\/p>

&dwLogintr, sizeof(dwLogintr),<\/code> <\/p>

&dwSysintr, sizeof(dwSysintr), 0);<\/code> <\/p>

if (bResult == FALSE) {<\/code> <\/p>

return ERROR_VALUE;<\/code> <\/p>

}<\/code> <\/p>

// Initialize interrupt and associate the SYSINTR value with the event.<\/code> <\/p>

bResult = InterruptInitialize(dwSysintr, hEvent,0,0);<\/code> <\/p>

if (bResult == FALSE) {<\/code> <\/p>

return ERROR_VALUE;<\/code> <\/p>

}<\/code> <\/p>

// Interrupt management loop<\/code> <\/p>

while(!m_bTerminateDetectionThread) {<\/code> <\/p>

// Wait for the event associated to the interrupt<\/code> <\/p>

WaitForSingleObject(hEvent,INFINITE);<\/code> <\/p>

// Add actual IST processing here<\/code> <\/p>

// Acknowledge the interrupt<\/code> <\/p>

InterruptDone(m_dwSysintr);<\/code> <\/p>

}<\/code> <\/p>

// Deinitialize interrupts will mask the interrupt<\/code> <\/p>

bResult = InterruptDisable(dwSysintr);<\/code> <\/p>

// Unregister SYSINTR<\/code> <\/p>

bResult = KernelIoControl(IOCTL_HAL_RELEASE_SYSINTR,<\/code> <\/p>

&dwSysintr, sizeof(dwSysintr), NULL, 0, 0);<\/code> <\/p>

// Close the event object<\/code> <\/p>

CloseHandle(hEvent);<\/code> <\/p>

Shared Interrupt Mappings<\/p> <\/div>

The 1:1 relationship between IRQ and SYSINTR implies that you cannot register multiple ISRs for an IRQ directly to implement interrupt sharing, but you can map multiple ISRs indirectly. The interrupt mapping tables only map an IRQ to one static ISR, yet within this ISR, you can call the NKCallIntChain function to iterate through the chain of ISRs, registered dynamically through LoadIntChainHandler. NKCallIntChain goes through the ISRs registered for the shared interrupt and returns the first SYSINTR value that is not equal to SYSINTR_CHAIN. Having determined the appropriate SYSINTR for the current interrupt source, the static ISR can pass this logical interrupt identifier to the kernel to signal the corresponding IST event. The LoadIntChainHandler function and installable ISRs are covered in more detail later in this lesson.<\/p>

Communication between an ISR and an IST<\/p> <\/div>

Because ISR and IST run at different times and in different contexts, you must take extra care of physical and virtual memory mappings if an ISR must pass data to an IST. For example, an ISR might copy individual bytes from a peripheral device into an input buffer, returning SYSINTR_NOP until the buffer is full. The ISR returns the actual SYSINTR value only when the input buffer is ready for the IST. The kernel signals the corresponding IST event and the IST runs to copy the data into a process buffer.<\/p>

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit»

Представляем Вашему вниманию похожие книги на «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit»

Обсуждение, отзывы о книге «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x