<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>On Jan 3, 2017, at 10:03 PM, Pradeepa Kumar &lt;<a href="mailto:cdpradeepa@gmail.com">cdpradeepa@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra">Please see inline below</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 4, 2017 at 11:07 AM, Anish Kumar <span dir="ltr">&lt;<a href="mailto:anish198519851985@gmail.com" target="_blank">anish198519851985@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span class="gmail-"><div></div><div><br></div><div><br>On Jan 3, 2017, at 8:04 PM, Pradeepa Kumar &lt;<a href="mailto:cdpradeepa@gmail.com" target="_blank">cdpradeepa@gmail.com</a>&gt; wrote:<br><br></div></span><blockquote type="cite"><div><div dir="ltr">Hi experts<div><br></div><div><table style="margin:0px;padding:0px;border:0px;font-size:13px;border-collapse:collapse;color:rgb(36,39,41);font-family:arial,&quot;helvetica neue&quot;,helvetica,sans-serif"><tbody style="margin:0px;padding:0px;border:0px"><tr style="margin:0px;padding:0px;border:0px"><td class="gmail-m_-7449249445306101190gmail-votecell" style="padding:0px 15px 0px 0px;border:0px;vertical-align:top"><div class="gmail-m_-7449249445306101190gmail-vote" style="margin:0px;padding:0px;border:0px;text-align:center;min-width:46px"><a class="gmail-m_-7449249445306101190gmail-vote-down-off" title="This question does not show any research effort; it is unclear or not useful" style="margin:0px auto 10px;padding:0px;border:0px;font-size:1px;color:rgb(0,119,204);background-size:initial;background-repeat:no-repeat;overflow:hidden;display:block;width:40px;height:30px;background-position:0px -220px">down vote</a><a class="gmail-m_-7449249445306101190gmail-star-off" href="http://stackoverflow.com/questions/41455943/adding-32-bit-compatibility-layer-in-custom-kernel-module#" title="Click to mark as favorite question (click again to undo)" style="margin:0px auto 2px;padding:0px;border:0px;font-size:1px;color:rgb(0,119,204);text-decoration:none;background-size:initial;background-repeat:no-repeat;overflow:hidden;display:block;width:40px;height:30px;background-position:0px -120px" target="_blank">favorite</a><div class="gmail-m_-7449249445306101190gmail-favoritecount" style="margin:0px;padding:0px;border:0px"><span style="margin:0px;padding:0px;border:0px;color:rgb(106,115,124)"></span></div></div></td><td class="gmail-m_-7449249445306101190gmail-postcell" style="padding:0px;border:0px;vertical-align:top"><div style="margin:0px;padding:0px;border:0px"><div class="gmail-m_-7449249445306101190gmail-post-text" style="margin:0px 0px 5px;padding:0px;border:0px;font-size:15px;width:660px;word-wrap:break-word;line-height:1.3"><span class="gmail-"><p style="margin:0px 0px 1em;padding:0px;border:0px;clear:both">in my 64 bit kernel, I have a custom kernel module providing new protocol and providing socket system calls.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;clear:both">it works fine when 64 bit app runs.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;clear:both">i am seeing issues when 32 bit app runs (for exp recvmsg() call does not work if msg has cmsghdrs as struct size of cmsghdr is different in 32 bit and 64 bit).</p><p style="margin:0px 0px 1em;padding:0px;border:0px;clear:both">This is because my custom kernel module does not have 32 bit compatibility layer ( but linux kernel has this in compat.c etc).</p></span><ul style="margin:0px 0px 1em 30px;padding:0px;border:0px"><li style="margin:0px 0px 0.5em;padding:0px;border:0px;word-wrap:break-word"><span class="gmail-"><p style="margin:0px;padding:0px;border:0px;clear:both">is it simple to add compatibility layer to my custom kernel module</p><p style="margin:0px;padding:0px;border:0px;clear:both"><br></p></span><p style="margin:0px;padding:0px;border:0px;clear:both">All you have to do is add compat_ioctl call to your driver.</p></li></ul></div></div></td></tr></tbody></table></div></div></div></blockquote></div></blockquote><div>my kernel module provides recvmsg() but i dont see any 'compat_recvmsg' in struct proto_ops.</div></div></div></div></div></blockquote><div><br></div>Try to wrap your text in 80 characters.<div><br></div><div>Your application is crashing? Right?</div><div>Have you figured where it is crashing exactly?</div><div><br></div><div>I understood that your application is crashing as&nbsp;</div><div>It not able to function with 64 bit kernel.</div><div><br></div><div>This happens because of the data being passed</div><div>to kernel is not in the right format. You need to</div><div>look at what you are passing to the driver and</div><div>if needed write the compat_ioctl callback in your</div><div>driver fops.<br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>had there been &nbsp;'compat_recvmsg' it would have been possible for me to define recvmsg() for 32 bit apps.<br></div><div>please let me know if i am missing anything</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><blockquote type="cite"><div><div dir="ltr"><div><table style="margin:0px;padding:0px;border:0px;font-size:13px;border-collapse:collapse;color:rgb(36,39,41);font-family:arial,&quot;helvetica neue&quot;,helvetica,sans-serif"><tbody style="margin:0px;padding:0px;border:0px"><tr style="margin:0px;padding:0px;border:0px"><td class="gmail-m_-7449249445306101190gmail-postcell" style="padding:0px;border:0px;vertical-align:top"><div style="margin:0px;padding:0px;border:0px"><div class="gmail-m_-7449249445306101190gmail-post-text" style="margin:0px 0px 5px;padding:0px;border:0px;font-size:15px;width:660px;word-wrap:break-word;line-height:1.3"><ul style="margin:0px 0px 1em 30px;padding:0px;border:0px"><li style="margin:0px;padding:0px;border:0px;word-wrap:break-word"><span class="gmail-"><p style="margin:0px;padding:0px;border:0px;clear:both">how do i do this (any links ?)</p><p style="margin:0px;padding:0px;border:0px;clear:both"><br></p></span><p style="margin:0px;padding:0px;border:0px;clear:both">You can see many drivers supports compat call.</p></li></ul><p style="margin:0px 0px 1em;padding:0px;border:0px;clear:both">Thanks</p></div></div></td></tr></tbody></table></div></div>
</div></blockquote><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><br><span>Kernelnewbies mailing list</span><br><span><a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.<wbr>org</a></span><br><span><a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">https://lists.kernelnewbies.<wbr>org/mailman/listinfo/<wbr>kernelnewbies</a></span><br></div></blockquote></div></blockquote></div><br></div></div>
</div></blockquote></div></body></html>