[Suzaku:00228] Re: Trouble adding OPB slave

Eike Suthau email@hidden
2005年 1月 14日 (金) 12:52:13 JST


Hello,

This is the program source that does not crash (unused address):
================ hello.c (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+512,0);
 }
 return 0;
}
=====================================================

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;
}
=====================================================

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
#

Please tell me which versions of the different components are recommended!

Regards,
eike



suzaku メーリングリストの案内