lkml.org 
[lkml]   [2009]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6.30-rc8] gcc 3.3 : __udivdi3 undefined.
On Thu, Jun 04, 2009 at 09:20:18PM -0700, Andrew Morton wrote:
>On Fri, 05 Jun 2009 13:00:28 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
>
>> > Perhaps it's this:
>> >
>> > static void __init memtest(u64 pattern, u64 start_phys, u64 size)
>> > {
>> > u64 i, count;
>> > u64 *start;
>> > u64 start_bad, last_bad;
>> > u64 start_phys_aligned;
>> > size_t incr;
>> >
>> > incr = sizeof(pattern);
>> > start_phys_aligned = ALIGN(start_phys, incr);
>> > count = (size - (start_phys_aligned - start_phys))/incr;
>> Bingo!
>
>OK, thanks. We should fix this for 2.6.30.
>
>We could do the obvious:

Excellent!


>
>--- a/arch/x86/mm/memtest.c~a
>+++ a/arch/x86/mm/memtest.c
>@@ -8,6 +8,7 @@
> #include <linux/pfn.h>
>
> #include <asm/e820.h>
>+#include <asm/div64.h>
>
> static u64 patterns[] __initdata = {
> 0,
>@@ -48,7 +49,8 @@ static void __init memtest(u64 pattern,
>
> incr = sizeof(pattern);
> start_phys_aligned = ALIGN(start_phys, incr);
>- count = (size - (start_phys_aligned - start_phys))/incr;
>+ count = size - (start_phys_aligned - start_phys);
>+ do_div(count, incr);
> start = __va(start_phys_aligned);
> start_bad = 0;
> last_bad = 0;

This patch looks fine for me. :)


>_
>
>but I wonder why all those things are u64. They all hold virtual
>addresses, don't they? The code doesn't test highmem. So shouldn't
>these all be unsigned longs?
>
>

It looks like no, since many other functions also use u64 instead
of unsigned long, e.g. find_e820_area_size().

Thanks.


\
 
 \ /
  Last update: 2009-06-05 08:27    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site