<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 8:04 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">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-votecell" style="padding:0px 15px 0px 0px;border:0px;vertical-align:top"><div class="gmail-vote" style="margin:0px;padding:0px;border:0px;text-align:center;min-width:46px"><a class="gmail-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-image:url(&quot;&quot;);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-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-image:url(&quot;&quot;);background-size:initial;background-repeat:no-repeat;overflow:hidden;display:block;width:40px;height:30px;background-position:0px -120px">favorite</a><div class="gmail-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-postcell" style="padding:0px;border:0px;vertical-align:top"><div style="margin:0px;padding:0px;border:0px"><div class="gmail-post-text" style="margin:0px 0px 5px;padding:0px;border:0px;font-size:15px;width:660px;word-wrap:break-word;line-height:1.3"><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><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"><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><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><li style="margin:0px;padding:0px;border:0px;word-wrap:break-word"><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><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>_______________________________________________</span><br><span>Kernelnewbies mailing list</span><br><span><a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a></span><br><span><a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a></span><br></div></blockquote></body></html>