Hi,
first time user of this group. Thanks in advance. Hope my
etiquette/procedure is correct.
This is a small program I'm trying to use to read a 32 bit word at an
offset of 0x20 from an address in PCI memory (0xfc020000). The number I
want to read was memory mapped to here from a PCI device (the address is
from PCI_BASE_ADDRESS_2). However it won't compile, giving the error
"undefined reference to 'readl' ", even though I've included the asm/io.h
header file.
#include<stdio.h>
#include<stdlib.h>
#include<asm/io.h>
int main(void)
{
int *base, status;
base = (int*)0xfc020000;
status=readl(*(base) + 0x20);
printf(" %x", status);
return(0);
}
Rgds. Oliver.
Dept. of Physics,
National University of Ireland, Galway,
Galway,
Ireland.
Tel: +353 (0)91 524411 ext. 2716
Fax: +353 (0)91 750584
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!