interrupt

Linux kernel ARM exception stack init

倖福魔咒の 提交于 2019-12-17 06:51:48
问题 I am using Linux kernel 3.0.35 on Freescale i.MX6 (ARM Cortex-A9). After running into a kernel OOPS I tried to understand the exception stack initialization. Here is what I have uncovered so far. In cpu_init() in arch/arm/kernel/setup.c , I see the exception stack getting initialized: struct stack { u32 irq[3]; u32 abt[3]; u32 und[3]; } ____cacheline_aligned; static struct stack stacks[NR_CPUS]; void cpu_init(void) { struct stack *stk = &stacks[cpu]; ...<snip> /* * setup stacks for re-entrant

Interrupt handling on an SMP ARM system with a GIC

 ̄綄美尐妖づ 提交于 2019-12-14 03:43:30
问题 I wanted to know how interrupt handling works from the point any device is interrupted.I know of interrupt handling in bits and pieces and would like to have clear end to end picture of interrupt handing.Let me put across what little I know about interrupt handling. Suppose an FPGA device is interrupted through electrical lines and get some data .Device driver for this FPGA device already had code (Interrupt handler) registered using request_irq function. So now FPGA device have an IRQ line

Sharing data between master thread and slave thread in interrupt driven environment in C

和自甴很熟 提交于 2019-12-13 18:23:47
问题 I have the following: f1() { while(1) { call f(2) if hardware interrupt pin goes high } } f2() { if( th() not started ) { start thread th() } else { return thread th() status } } th() { time-consuming operation } At the moment, I use the following to initiate a struct in f2(): static struct SharedData shared; if( shared == NULL) { initialize shared } Then I pass a pointer to shared to the thread. The thread then updates shared periodically. f2() will then know if th() has been started based

What is the correct definition of interrupt latency in RTOS?

こ雲淡風輕ζ 提交于 2019-12-13 18:04:15
问题 I read two different definition for 'interrupt latency' in RTOS. "In computing, interrupt latency is the time that elapses from when an interrupt is generated to when the source of the interrupt is serviced" (source: https://en.wikipedia.org/wiki/Interrupt_latency ) "The ability to guarantee a maximum latency between an external interrupt and the start of the interrupt handler." (source: What makes a kernel/OS real-time? ) Now, my question is what is the correct definition of 'interrupt

Threading in Java

▼魔方 西西 提交于 2019-12-13 15:26:35
问题 I am trying to have my main thread spawn off a new thread and, after some time, raise the interrupt flag. When it does so, the spawned thread should see that flag and terminate itself. The main thread looks something like this: final Thread t = new Thread() { @Override public void run() { f(); } }; t.start(); try { t.join(time); t.interrupt(); if(t.isAlive()) { t.join(allowance); if(t.isAlive()) throw new Exception(); } } catch(Exception e) { System.err.println("f did not terminate in the

How to disable the keyboard and mouse via assembly code

喜你入骨 提交于 2019-12-13 11:22:44
问题 I have tried to write an assembly code to hang the keyboard and mouse (I try with keyboard now) . I searched in everywhere nearly (in references and articles and the old topic here also) and almost all show the same code by fetch the address of INT 9 and create new interrupt then make it be called rather than the original interrupt(9) . That is my code i had written: .model tiny .stack 100h .data old_ISR dd ? .code main proc far mov ah,35h ; get interrupt vector mov al,09 ; for int 9 INT 21h

Make beep sound in BIOS

假如想象 提交于 2019-12-13 09:39:29
问题 When computer starts to boot, It makes a beep sound from the BIOS Speaker . How do i can do this in Assembly or C++ ? Clearly I want to make Beep Sound by BIOS Speaker. Remember i mean BIOS Speakers Does it have any interrupt for that ? I searched about that but nothing found.. I used some interrupt But the didn't do this. the following code : int main(){ cout<<"\a"; } Produced the sound from the Speaker, Not Bios How can i do this ? with any interrupt ? 回答1: Try to add this code, too.

Getting access to the input handler from the IRQ lane

喜你入骨 提交于 2019-12-13 03:51:30
问题 Whilst researching the input event system in the kernel, I came across the need to access the input handlers that have already been registered with an IRQ lane given only the irq lane (just the integer). Is there a method to access ALL event handlers associated with an IRQ? I am looking to map each list of handlers from a given input device (say mouse) to each possible event that the device could make. Not sure if it matters, but I am working with the AOSP for ARM devices. 回答1: There is an

Redundant code in hard fault handling of ARM Cortex-M processor

好久不见. 提交于 2019-12-13 02:58:01
问题 From FreeRTOS.org, regarding Debugging Hard Fault & Other Exceptions on ARM Cortex-M3 and ARM Cortex-M4 microcontrollers , according to FreeRTOS guys we can use the following code in order to debug a ARM Cortex-M Hard Fault- /* The fault handler implementation calls a function called prvGetRegistersFromStack(). */ static void HardFault_Handler(void) { __asm volatile ( " tst lr, #4 \n" " ite eq \n" " mrseq r0, msp \n" " mrsne r0, psp \n" " ldr r1, [r0, #24] <======== NOTE THIS LINE \n" " ldr

Why not to use mutex inside an interrupt

谁说胖子不能爱 提交于 2019-12-13 02:55:24
问题 i have passed through this post and i noticed that in Clifford's answer he said that we shouldn't use mutex in an interrupt, i know that in an interrupt we have to avoid too much instructions and delays ext... but am not very clear about the reasons could anyone clarify me for which reason we have to avoid this? In case that we want establish a synchronous communication between 2 interrupt driven threads what are the other mecahnism to use if using mutex is not allowed? 回答1: The original