ioremap() and readl() not compiling
I am trying to write some code to read from a network controller,
when i compile the code I get:
in.c: In function `main':
in.c:14: warning: initialization makes pointer from integer without a cast
/home/tpriest/tmp/ccgYSZJ9.o(.text+0x1b): In function `main':
: undefined reference to `ioremap'
/home/tpriest/tmp/ccgYSZJ9.o(.text+0x58): In function `main':
: undefined reference to `readl'
collect2: ld returned 1 exit status
sorce code:
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>
int main (void)
{
int x;
unsigned int y;
char *baseptr = ioremap(0Xdb000000, 1024*1024);
iopl(3);
while (1)
{
printf("enter port: ");
scanf("%4X",&y);
x = readl(baseptr+y);
printf("0X%8.8X\n",x);
}
return 0;
}
System info
mandrake 9.2
p3 700
256 mb ram
|