LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-16-2018, 08:22 PM   #1
proy_
LQ Newbie
 
Registered: Jun 2018
Posts: 3

Rep: Reputation: Disabled
Getting call stack of interrupted task at interrupt handler


I am writing a PCI device driver in LKM. At the PCI interrupt handler, I want to access and/or print the stack frames of the interrupted task. What functions should I call to get the stack pointer and the stack frames?

Last edited by proy_; 06-17-2018 at 11:50 AM.
 
Old 06-18-2018, 06:55 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
It depends on language and processor.

I'd assume C or C++ and probably x86, but it could be ARM or other.

Have you just web searched for how to print out the current stack pointer in C or C++? There are very many opinions or discussions covering that. Personally I'd try a few of them, but also run under a debugger like GDB and then examine the stack pointer directly in the debugger to verify I'd gotten it correctly.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux doesn't call scheduler after interrupt and set task need resch flag hello13 Programming 0 05-30-2013 02:45 PM
Kernel panic: killing interrupt handler! In interrupt handler - not syncing. divyashree Programming 26 05-15-2010 01:27 PM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
can interrupt handler call user space function? pot_po Programming 0 11-07-2002 09:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration