ucmpdi2 and cmpdi2

Rune Torgersen runet at innovsys.com
Tue Sep 26 06:36:46 EST 2006


Hi

I have a function that does a switch statement on a long long or
unsinged long long and get teh follwing compiler warnings when making a
module:

WARNING: "__ucmpdi2"
[/home/runet/source/hardware_1.1/cpu1/src/drivers/test_bug.ko]
undefined!
WARNING: "__cmpdi2"
[/home/runet/source/hardware_1.1/cpu1/src/drivers/test_bug.ko]
undefined!

And of course it fails to load.

The weird thingis that it works if I instead of using a long long, use a
[u]int64_t.
Is this a compiler error or something else?

gcc version: powerpc-604-linux-gnu-gcc (GCC) 3.4.3
target CPU: Freescale 826x.

Here is my module source:
#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif
#include <linux/config.h>
#include <linux/module.h>

#include <linux/kernel.h>   /* printk() */
#include <linux/types.h>    /* size_t */
#include <linux/ctype.h>

void TestFunc(char val)
{
    long long   t1;
    unsigned long long   t2;
    
    t1 = 0x100;
    t2 = 0x200;

    switch(t1)
    {
        case 0x01: 
            printk("c1\n");
        break;   
        default:
            printk("def1\n");
        break;
    }

    switch(t2)
    {
        case 0x02: 
            printk("c2\n");
        break;   
        default:
            printk("def2\n");
        break;
    }
}

static int __init tmp_init_module(void)
{
    return 0;
}

static void __exit tmp_cleanup_module(void)
{
}

module_init(tmp_init_module);
module_exit(tmp_cleanup_module);



More information about the Linuxppc-embedded mailing list