Questions tagged [interrupt-handling]

The concept of handling system interrupts in an application or embedded system.

The concept of handling system interrupts in an application.

This tag may also refer to an operating-system-specific way of handling interrupts, or interrupt handling in a specific type of microcontroller or processor.

Use this tag only if you have reason to believe that your issue is directly related to interrupt handling. Do not use this tag if your application is using interrupt handling, but interrupt handling does not cause the issue your are asking about.

828 questions
5
votes
3 answers

Linux: Can a signal handler excution be preempted?

I came across the following signal handler code that stores the errno variable so that it wont affect main thread's errno handling. void myhandler(int signo) { int esaved; esaved = errno; write(STDOUT_FILENO, "Got a signal\n", 13); …
Lunar Mushrooms
  • 8,358
  • 18
  • 66
  • 88
5
votes
1 answer

How to know if an interrupt is a hardware interrupt or a cpu exception

I've been researching about interrupts on the x86 and how a kernel handles the various interrupts using interrupt handlers. But one thing confuses me though.I know that interrupts could be hardware-generated, such as disk and timer interrupts, or…
Leo Aso
  • 11,898
  • 3
  • 25
  • 46
5
votes
1 answer

How to interrupt asynchronous computations in Scala?

I need to run two parallel computations and interrupt the first one when the second one finishes. Currently, I've implemented it using standard Java threads: /** * Runs sup in parallel with main. * Terminate (interrupt) it…
Petr
  • 62,528
  • 13
  • 153
  • 317
5
votes
2 answers

Future.cancel() method is not working

The code that I have creates a Callable instance and using ExecutorService a new thread is being created. I want to kill this thread after certain amount of time if the thread is not done with its execution. After going through the jdk documentation…
5
votes
1 answer

Ada interrupt handlers

When using Ada interrupt handlers, I have so far isolated some specific things that need to be in the code for them to work. Using Ada.Interrupts: protected Int_Handler is --a protected object to handle interrupts procedure Handler_1; --A…
Leon
  • 51
  • 2
4
votes
3 answers

Unable to trap Ctrl+C in a C# console app

I've got the following code that I'm trying to use to trap Ctrl+C in a console app: /// /// A driver program for testing /// /// Arguments to the program static void Main(string[]…
Alex Marshall
  • 10,162
  • 15
  • 72
  • 117
4
votes
1 answer

Where is the Linux ISR Entry Point

I'm trying to understand the system call interface and implementation in the Linux kernel. I know about entry.S and the relationship between libc headers and implementation. What I want to know is where in the kernel is the int 80h received for the…
recluze
  • 1,920
  • 4
  • 21
  • 34
4
votes
1 answer

Why is MS-DOS “not reentrant” and a DOS interrupt can't call another one?

This question is purely academic because no-one uses MS-DOS now, but I still want to know why. In some books and articles they said if you call a DOS interrupt during another one, it may cause a deadlock. That is why MS-DOS is not reentrant. For…
T.Worm
  • 382
  • 2
  • 11
4
votes
4 answers

What is the correct way to stop a thread waiting for network activity?

This question has no doubt been asked in various forms in the past, but not so much for a specific scenario. What is the most correct way to stop a Thread that is blocking while waiting to receive a network message over UDP. For example, say I have…
Nico Huysamen
  • 10,217
  • 9
  • 62
  • 88
4
votes
1 answer

Problem with IRQ handler: Flags mismatch irq

I am implementing an interrupt handling module using thread irq. I am facing this error: 1983.150961] Shut down eMMC app module init. [ 1983.151115] genirq: Flags mismatch irq 49. 00000004 (eMMC_power_shutdown_irq_ handler) vs. 00000004…
Anh Hoang
  • 117
  • 4
  • 10
4
votes
1 answer

Interrupting a Python C-extension with Ctrl-C using ctypes

I am creating a Python wrapper for a C-extension which is a driver for a sensor. I need to pass the Ctrl-C interrupt signal with Python to the driver so it ends the current acquisition phase and does not start a new one. I found these two related…
4
votes
1 answer

How can I determine interrupt source on an stm32?

I recently ended up in the Default_Handler in my stm32 project and couldn't figure out what was casing it: .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop <--- here! By default, a lot of…
Guz
  • 187
  • 1
  • 6
4
votes
6 answers

Floating point operations in interrupt handler (PowerPC, VxWorks)

I haven't found any resources that exactly answer what I am trying to understand with an issue I saw in a piece of software I am working on, so I'll ask the geniuses here! For starters, I'm running with VxWorks on a PowerPC processor. In trying to…
Anthony
  • 2,256
  • 2
  • 20
  • 36
4
votes
2 answers

What is intended/correct way to handle interrupts and use the WFI risc-v cpu instruction?

I am very new to bare metal programming and have never delt with interrupts before, but I've been learning on a RISC-V FE310-G002 SOC powered dev board. I've been reading about the RISC-V WFI (Wait for interrupt) instruction and from the manuals, it…
Echelon X-Ray
  • 138
  • 1
  • 10
4
votes
2 answers

SMP affinity routing doesn't work with GICv2 on ARM

There are 4 CPU cores and one Ethernet card on my Raspberry Pi. I need interrupts from NIC to be routed to all the 4 CPU cores. I set the /proc/irq/24/smp_affinity to 0xF (1111), but that doesn't help. In sixth column of /proc/interrupts I don't see…
NK-cell
  • 1,145
  • 6
  • 19