mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Fawad Lateef" <fawadlateef@gmail.com>
To: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	kernelnewbies <kernelnewbies@nl.linux.org>
Subject: Porting setjmp/longjmp to mips64 kernel issue
Date: Wed, 8 Aug 2007 19:07:24 +0500	[thread overview]
Message-ID: <1e62d1370708080707s14573038m66ebc830daf39fd5@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]

Hello,

I am trying to implement/port the functionality of "setjmp" and
"longjmp" provided by glibc in a kernel module for mips64 based
embedded system; running debian with modified smp kernel 2.6.16 on
2-cores.

I removed all the floating-point registers save and restore
functionality from setjmp/longjmp functions as they are not
used/accessable from kernel.

Now the issue is:

Kernel hangs at instruction "j $31" in __longjmp function whenever I
try to do longjmp; the value loaded in registers (in longjmp function
especially PC in $31) are the same as I got in setjmp so it should
jump to correct location but I think its jmping to some other place
and simply stuck there.

The prints from my module before the kernel hangs is:

# insmod jmptest.ko
JMP test module loaded. Starting tests...
1:
pj_setjmp: 14 ....
calling first
calling second
pj_longjmp: 21 ....
__longjmp: 64 .... pc = [c00000000009d11c]

Can someone tell me if there is something wrong in my
porting/implementation __or__ give some hints ? I am attaching the
code in tar.gz (I am doing cross-compilation with embedded tool chain
so please adjust paths in Makefile when compiling)

Thanks in Advance.

-- 
Fawad Lateef

[-- Attachment #2: setjmp_mips64_kern.tar.gz --]
[-- Type: application/x-gzip, Size: 4135 bytes --]

                 reply	other threads:[~2007-08-08 14:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e62d1370708080707s14573038m66ebc830daf39fd5@mail.gmail.com \
    --to=fawadlateef@gmail.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®