[ILUG] asm/io.h + readl/writel

Oliver Ryan oryan at physics.nuigalway.ie
Wed Jul 4 18:02:42 IST 2001


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




More information about the ILUG mailing list