Hi Luis,

On 05/16/2012 07:12 PM, Luis Alves wrote:
I've solved the missing libraries problem but the toolchain you
provided isn't generating proper code for the 68000.

I've disassembled the kernel and checked the 'proc_net_ns_init'
function, where the kernel is hanging more precisely at the 'memcpy'
intruction.

So, the memcpy gets compiled into a movel instruction with an odd
displacement (causing a bus error).

memcpy(netd->name, "net", 4);

compiled into:

[...]
   2175b8:      217c 6e65 7400  movel #1852142592,%a0@(77)
   2175be:      004d
[...]


The previous toolchain is generating 4 moveb intructions in this case.
I also see some other differences related to move opcodes.

For instance, the previous toolchain loads an address content to the
stack by doing this:

   207104:      2f39 001f 54c8  movel 1f54c8<malloc_sizes+0x1c>,%sp@-
   20710a:      4eb9 0004 2bbc  jsr 42bbc<kmem_cache_alloc>


The new toolchain is doing this:

   21755a:      307c 001c       moveaw #28,%a0
   21755e:      d1fc 0020 6d2c  addal #2125100,%a0
   217564:      2f10            movel %a0@,%sp@-
   217566:      4eb9 0004 640e  jsr 4640e<kmem_cache_alloc>


To me this looks Coldfire 'limited' adressing modes.

Any suggestion? :|

What are the compiler options supplied to gcc?
(If you make the kernel with V=1 then you get the full command
line trace)


When ever i have the time I'll try to build a toolchain (maybe using
gcc 4.7) and check the generated code.
Maybe I also could try the code sourcery one, but there is no
reference for the 'legacy 68k' family on their download page (only
coldfire).

Any m68k targeted compiler should be able to generate code for any
family member with the right command line options. With the bundled
toolchains you may not have the libs generated for your specific
CPU member though.

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     g...@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to