[Suzaku:00229] Re: Trouble adding OPB slave
Yasushi SHOJI
email@hidden
2005年 1月 14日 (金) 13:28:04 JST
Hi Eike,
At Fri, 14 Jan 2005 12:52:13 +0900,
Eike Suthau wrote:
>
> This program crashes (IP address):
> ================ hello.c ( not working ) ======================
> #include <stdio.h>
> #include "measif.h"
>
> #define BASE 0xffffb000
>
> //port in/out macro
> #define OUT(addr, data) *(volatile int *)(addr)=(unsigned long)data
> #define IN(addr) (unsigned long) *(volatile int*)(address)
> int main(int argc, char *argv[])
> {
> unsigned long i,j;
> while (1) {
> OUT(BASE,0);
> }
> return 0;
> }
I've compiled this code with out your core. It seems to be the
produced program is running forever. no crash at all.
using the toolchan from our site and on the default suzaku. so, seems
like the code is fine.
here is disassembled code for main:
00000048 <main>:
48: 3060b000 addik r3, r0, -20480
4c: d8001800 sw r0, r0, r3
50: b800fffc bri -4 // 4c
could you tell me the optimization level you are using? I'm using -O2
for now. except for the address, it seems to be exactly the same.
> =====================================================
>
> When I run the second program I get:
> # /tmp/hello
> debug trap
> r0:00000000 r1:80FC7F24 r2:80FC1114 r3:FFFFB008
> r4:80FC01A4 r5:00000001 r6:80FC7F80 r7:80FC7F88
> r8:00000000 r9:00005401 r10:00000001 r11:00000020
> r12:8003B588 r13:80FC1114 r14:80009FA0 r15:80FC017C
> r16:00000009 r17:80FC04D0 r18:FFFFFF82 r19:00000001
> r20:00000000 r21:00000000 r22:00000000 r23:8037FFAC
> r24:00000000 r25:80374EBC r26:8037FFBE r27:8034F82C
> r28:00000000 r29:8036EFE0 r30:8036B960 r31:00000FFF
> pc:80FC04D0 psw:00000020
> Trace/BPT trap
> #
when you get debug trap, you'll see this out put. but not sure why
you get the debug trap.
Best regards,
--
yashi
suzaku メーリングリストの案内