Hi,
I'm trying to use the peekpoke.h functions in a C program, but every time I try
to use them the SBC stops working and I don't know why.
I'm including the -mcpu=arm9 flag and I can run inline assembly with no
problems as long as I don't try to peek or poke.
Any help is greatly appreciated.
The following is a small part of what I'm trying to accomplish, but it freezes
every time I try to run it:
----------------------------------------------------------------------
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include "peekpoke.h"
int main(void){
unsigned long address = 0x80840004;
unsigned long val;
int dev_mem;
dev_mem = open("/dev/mem", O_RDWR|O_SYNC);
address = (unsigned long) mmap(0, getpagesize(),
PROT_READ|PROT_WRITE,
MAP_SHARED, dev_mem,
0x80840000);
val = PEEK32(address + 0x04);
printf("%X -> %X\n", (unsigned int) address, (unsigned int) val);
return 0;
}
-------------------------------------------------------------------
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|