LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 02-21-2007, 10:43 PM   #1
manas_sem
LQ Newbie
 
Registered: Dec 2006
Posts: 29

Rep: Reputation: 15
calling a function within a task


this is related with Scheduler operations in Intel pentium board.. Task switching is happening with the timer interrupt. i am storing the registers of old task & restoring new tasks registers. Local Variables within the task are working properly. but when i am calling a function ( simple adding of 2 numbers) inside the task continuously, the functions return value is not proper every time.....

Can somebody help me out...is there any problem with restoring registers or some thing else ?????
 
Old 02-23-2007, 03:51 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,408

Rep: Reputation: 108Reputation: 108
There are different possibilities. First check would be to see if you really store and restore all the needed registers (and flags). It may be also that you do not switch stack or do it incorrectly. If it's possible, try to print the two arguments of your test function and the stack top adress. That should show valuable information.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question for calling function harrylee2003 Programming 3 08-06-2006 07:04 AM
calling a function from a pointer spx2 Programming 3 05-25-2006 04:52 PM
calling function in kernel vishalbutte Programming 0 02-14-2006 07:34 AM
Calling another function from a function using GTK geminigal Programming 4 07-11-2005 03:15 PM
switch statements calling a function tekmorph Programming 2 10-19-2004 05:53 PM


All times are GMT -5. The time now is 03:14 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration