Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760234AbXHHOHs (ORCPT ); Wed, 8 Aug 2007 10:07:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764044AbXHHOH0 (ORCPT ); Wed, 8 Aug 2007 10:07:26 -0400 Received: from wa-out-1112.google.com ([209.85.146.178]:36336 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761961AbXHHOHZ (ORCPT ); Wed, 8 Aug 2007 10:07:25 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=r2lV+K9JodZ0tS2ADPCgI6nPQmm9fwdpSWbXxVdSYhUv8xTCoh3iDBlOg857Ppsl4fhwxx2eYW8NKWGmGPQwKZENHmGCC5NpUhc6yDs/YkeOje6zKxELT4LNQM2pJcC4sq087FnPh8AWGC3AIUAihxTbKxfl6q533KDutnFx5eg= Message-ID: <1e62d1370708080707s14573038m66ebc830daf39fd5@mail.gmail.com> Date: Wed, 8 Aug 2007 19:07:24 +0500 From: "Fawad Lateef" To: "Linux Kernel Mailing List" , kernelnewbies Subject: Porting setjmp/longjmp to mips64 kernel issue MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_155645_30641059.1186582044134" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7462 Lines: 130 ------=_Part_155645_30641059.1186582044134 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_155645_30641059.1186582044134 Content-Type: application/x-gzip; name=setjmp_mips64_kern.tar.gz Content-Transfer-Encoding: base64 X-Attachment-Id: f_f53vyg8r Content-Disposition: attachment; filename="setjmp_mips64_kern.tar.gz" H4sICFXOuUYAA2ZyLjI4NzI2LjAuc2V0am1wX21pcHM2NF9rZXJuLnRhcgDtO2tX20iy+Sr9iloP OTEZI/zCDjCZXcYDGe4Q4AA52Tkzc5RGatkCvVYtQ9g92d9+q/ohycYY9iY3s3vWPRMjtbqrq6ur 69kteHEVZ24cZmLQd695nmwKVcWmH3W14z37rNLGMhj05d/h3F8s/e5w+KzTHmz1e/32sD981u52 O1vdZ9D+vGGfVqaiYDnAs4DdMt+NWMF5sKjdY9//Q8vmSxil2V0ejicFNEfr0NneHrTod9iCbrvd k799OMg5h/M0KG5ZzuEgnSY+K8I0acFh4jk2AFxMQgFBGHHAvxnLC0gDKCYc3hy/gxEchZc5y+9k 01GaFHl4OS24D5d38EPOEVoCP/NJyqF5qV7/8neeOGk+XndsBX4OEg0TEFZCY7ULd+kUPASUcz8U egQIC2CJv5nmBCVO/TC4ozqcAM8lfgXPY1FH9ogLgd/e8ITnLILT6WUUetT7KPR4IjgwnCBVioma AHV8iEC7wEP8Lke/4bnAKug6HTOeBtmCNIcmK2gKOaQZ9VxHvO+AOC43PZeQopqxD2EiYU/SDGc3 Qag439swiuCSw1TwYBq1CA42hveHFz+dvLuAveNf4P3e2dne8cUvu9i4mKT4ld9wBSqMsyhEyDi5 nCXFHaJPEN7un41+wi57PxweHV78QpM4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HkopSz8G5ZtPSm1JLbUdHS21FLbkRFS29ELbkFFS29BbXk5lO09ObTkttO 0dLbTktuOEVLbzgtudUULb3VNH+TySz4m1PnobUdZw8BG2f34JyOHmaShy8g1i4dnnGUITlfcm3z AFElXXGnRKSKyuWqGx2mYDIF6KtdItAvibhkdDrf4HktUD4Y+SuospRKEvKIAp0SuLMt2pdKt2lx G8vTCurIGKL88AS7krV+S34rGpTCVJMmrunIugUTF9l6a64qqBEVRb8RKx2S2OOQFBeDttSrt+oE BxJiTIRAH1cK9WSDDtYaByyAJu301zqrO4e1H4WINhpIMgGrs7ZzbaSjuFZnxbwhga7XkvVzCYDM g9fw6/Mo+vj7smRAawEPzI1+RXxTyqc96Vh9KL+XJzTIJ9dnX16QNk/oBq+mAQnY5u6uTDH80Wbq qqzKqqzKqqzKqqzKqqzKqqzKqnxm+V9ARRHYAFAAAA== ------=_Part_155645_30641059.1186582044134-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/