[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hx4700-port
Subject:    RE: [Hx4700-port] processor question
From:       avinash <avinash.sridhar () thomson ! net>
Date:       2005-10-21 17:46:31
Message-ID: 1129916791.4571.20.camel () prindtavinash ! prin ! am ! thmulti
[Download RAW message or body]

hi,

In previous mails I had mentioned that I was trying to run
as assembly inline program which had just had the command

asm("tmcr wCGR0,r0");

and the resulting excecution would produce an
"Illegal Instruction"

>From ARM assembly literature this is a co-processor
instruction and please correct me if I am wrong, but for
this to work the co-processor must be accesible. So 
the illegal instruction is an execption thrown by the 
kernel to signal co-processor inaccessibilty.

after looking closely at the PXA270 architecture there 
are steps needed to make this co-processor accessible.
But this has to be run in priviliged mode. 
To try this I wrote a small kernel module with the 
following contents:

#include <linux/init.h>
#include <linux/module.h>

MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
    int reg;
    printk(KERN_ALERT "Inset co-pro module");
    asm("mrc p15, 0, r0, c15, c1, 0");
    asm("orr r0,r0,#0x03");
    asm("mcr p15, 0, r0, c15, c1, 0");
    printk(KERN_ALERT "Done mrc");
    return 0;

}

static void hello_exit(void)
{
    printk(KERN_ALERT "Goodbye cruel World");
}

module_init(hello_init);
module_exit(hello_exit);


Now once i do an insmod of hello.ko that i have compiled,
i can load the module and I can see the debug messages in
'dmesg' on the IPAQ.

Now if i run my original c program which had the inline 
assembly line

asm("tmcr wCGR0,r0")

the program runs and exits cleanly and I dont get any
Illegal Instruction messages.

I am still running the stock kerenel from handhelds.org.
So this tells me that the kernel / toolchain supports
iwmmxt instructions.

however i have noticed that once i insert my module to 
enable access to the co-processors, i seem to have memory
allocation errors and I cant copy any file to my home 
directory, any command with "cp" returns with
"memory exhausted". 

Does anyone have any inputs with the steps that i have
executed ?

Thanks in advance.

_______________________________________________
Hx4700-port mailing list
Hx4700-port@handhelds.org
https://www.handhelds.org/mailman/listinfo/hx4700-port
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic