From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142Ab3LTBoP (ORCPT ); Thu, 19 Dec 2013 20:44:15 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:54440 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756490Ab3LTBoN (ORCPT ); Thu, 19 Dec 2013 20:44:13 -0500 Message-ID: <52B3A0EA.9010801@gmail.com> Date: Fri, 20 Dec 2013 09:44:10 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: James Hogan CC: Chen Gang , rostedt@goodmis.org, "linux-kernel@vger.kernel.org" , linux-metag@vger.kernel.org Subject: Re: [PATCH] arch: metag: lib: add "umoddi3.S" file for __umoddi3() References: <52B2E0FA.7090805@gmail.com> <52B2E3DB.7010008@imgtec.com> <52B2F6B7.1050802@gmail.com> <52B2F8DC.8060006@imgtec.com> In-Reply-To: <52B2F8DC.8060006@imgtec.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/19/2013 09:47 PM, James Hogan wrote: > On 19/12/13 13:37, Chen Gang wrote: >> On 12/19/2013 08:17 PM, James Hogan wrote: >>> On 19/12/13 12:05, Chen Gang wrote: >>>> Use objdump to get "umoddi3.S" for __umoddi3(), the original binary >>>> file is "gcc-4.2.4-final/gcc/libgcc/umoddi3.o" which is generated by >>>> "gcc-4.2.4/gcc/libgcc2.c". >>>> >>>> The relate error with allmodconfig: >>>> >>>> MODPOST 2909 modules >>>> ERROR: "__umoddi3" [drivers/target/target_core_mod.ko] undefined! >>> >>> _umoddi3 is a 64bit division, which should be using the proper division >>> functions provided by the kernel in . >>> >>> It needs fixing wherever it comes from in drivers/target/target_core_mod.ko. >>> >> >> After disassemble target_core_mod.ko, for me, the compiler will use >> ___umoddi3 for '%' operator and use ___udivsi3 for '/' operator. > > Yeh, % is in this case remainder from a 64bit division, for which the > standard division functions in should be used instead. > >> If what I guess is correct, we need use/copy the "system library" which >> compiler provides, so just use its ".o" file is OK (just like another >> "arch/metag/lib/*.S" have done). > > No, I believe there shouldn't be any use of the C 64bit division/modulo > operations in generic kernel code in the first place, so like I said > before the code in question should be fixed to use the proper functions > in . > OK, thanks, your idea is one of fix ways. Hmm... for me, it is still not a bad idea to add "__umoddi3" to metag. - there are already several 64-bit functions in "arch/metag/lib/*.S". - some of architectures already content "__umoddi3". - it is easier for users (e.g. various drivers) to use '%' and '/'. (especially, we have already support '/'). Thanks > Cheers > James > > -- > 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/ > -- Chen Gang Open, share and attitude like air, water and life which God blessed