All pastes #821869 Raw Edit

Mine

public text v1 · immutable
·published 2007-12-18 11:31 UTC
rendered paste body

arch/ppc/platforms/iomega8241.c

/*
unsigned char __res[sizeof(bd_t)];
*/
bd_t __res;

EXPORT_SYMBOL(__res);

void __init
platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                unsigned long r6, unsigned long r7)
{
        parse_bootinfo(find_bootinfo());

...
                memcpy( (void *)&__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
...
        ppc_md.setup_arch = iomega8241_setup_arch;        
        ppc_md.calibrate_decr = todc_calibrate_decr;

}

static void __init
iomega8241_setup_arch(void)
{
        if (133333332 == __res.bi_busfreq)
                freq = 132000000;
        if (99999999 == __res.bi_busfreq)
                freq = 100000000;
        base_baud = freq / 16;
        /* so far so good */
}

Then from file syslib/todc_time.c:

void __init
todc_calibrate_decr(void)
{
        extern bd_t __res;
        ulong freq = 25000000;
        printk("AJW: calib_decr: %d.\n", __res.bi_busfreq);

        /* boom - busfreq is now 0x800000 - way wrong and looks like it has been stomped */