irq

RISC-V Interrupt Handling Flow

浪尽此生 提交于 2021-02-16 09:24:17
问题 I am looking for how a RISC-V processor processes interrupt requests. I looked at the Instruction Set Manuals and information on the internet. The focus is on explaining exactly what the title sets: the instruction set. In my view, how interrupts are handled is a question of what is called the "programmer's model" of the processor. It does not clearly fit into a document about an instruction set, because parts of interrupt processing are not expressed in instructions. Clearly, jumping into an

request_threaded_irq() is used in the driver why not request_irq()? What are the differences between two?

為{幸葍}努か 提交于 2020-01-12 08:44:08
问题 I posted this is the thread which discussed about request_threaded_irq but I did not get any reply. So I am posting it freshly. I am working on a touchscreen driver for capacitive touchscree. It used request_threaded_irq() call instead of request_irq(). I could not understand the basic difference betweeen two. It says :- Name request_threaded_irq — allocate an interrupt line Synopsis int request_threaded_irq (unsigned int irq, irq_handler_t handler,irq_handler_t thread_fn, unsigned long

When we use irq_set_chained_handler the irq line will be disabled or not?

半腔热情 提交于 2019-12-28 18:51:13
问题 When we use irq_set_chained_handler the irq line will not be disabled or not, when we are servicing the associated handler, as in case of request_irq. 回答1: It doesn't matter how the interrupt was setup. When any interrupt occurred, all interrupts (for this CPU) will be disabled during the interrupt handler. For example, on ARM architecture first place in C code where interrupt handling is found is asm_do_IRQ() function (defined in arch/arm/kernel/irq.c ). It's being called from assembler code

Accessing IRQ description array within a module and displaying action names

家住魔仙堡 提交于 2019-12-24 03:21:57
问题 I am programming a kernel module in C which is struggling to access IRQ description array elements and to display all action names of these elements. At the beginning, I thought that this irq_desc array is sonething like a macro but after compiling i understood it is not. Then I used for_each_irq_desc(irq, desc) function. but this time it returned a warning: WARNING: "irq_to_desc" [/home/samet/Masaüstü/Assignment3/Ass-1.ko] undefined! and after this warning, i tried to insmod the module into

Retrieving return address of an exception on ARM Cortex M0

老子叫甜甜 提交于 2019-12-21 18:58:34
问题 I am trying to retrieve the return address of an IRQ handler in my code. My aim is to save the value of the PC just before the watchdog timer expires and before the reset for debug purposes, using WDT_IRQHandler(). I am also testing this approach with other IRQs to check if I grasped the idea. But it seems I haven't. I have read the documentation available. I understood that when an exception happens, 8 registers are pushed to the stack: R0, R1, R2, R3, R12, LR, PC and XPSR. I have also read

Setting up IRQ mapping

亡梦爱人 提交于 2019-12-21 04:07:41
问题 I'm following several tutorials and references trying to get my kernel set up. I've come across some unfamiliar code in a tutorial that isn't explaining it at all. It's code that I'm told maps the 16 IRQs (0-15) to ISR locations 32-47 : void irq_remap(void) { outportb(0x20, 0x11); outportb(0xA0, 0x11); outportb(0x21, 0x20); outportb(0xA1, 0x28); outportb(0x21, 0x04); outportb(0xA1, 0x02); outportb(0x21, 0x01); outportb(0xA1, 0x01); outportb(0x21, 0x0); outportb(0xA1, 0x0); } The code for

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

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

IRQ 6 floppy disk controller interrupt not triggered

拜拜、爱过 提交于 2019-12-11 07:00:03
问题 For some reason, IRQ 6 never hits in my Qemu, Bochs, VMWare, or VirtualBox emulators. Do I need some type of virtual Floppy Drive or something? Here is my IRq6 handler: void i86_flpy_irq (struct regs *r) { //! irq fired _FloppyDiskIRQ = 1; printf("IRQ 6 HIT"); } It never says "IRQ 6 HIT", and not only that, in my install function for my irq6 where I call in kernel: void flpydsk_install (int irq) { //! install irq handler install_handler_irq (irq, i86_flpy_irq); //! initialize the DMA for FDC

How does linux kernel wake idle processor up when new task created?

久未见 提交于 2019-12-08 22:27:40
问题 I'm newbie on Linux Kernel. Currently, I looked into idle codes and had a quesition. When processor doesn't have any taks in their own runqueue then it may go into idle mode, specific WFI(wating for interrupt). (All I mentioned is about ARM architecture not X86. So something is wrong for X86.) After staying in WFI state, maybe other processor(not idle) want to spread their task to this, idle processor(by load balance). At that time a busy processor makes task imigrated. In my point of view,