得到如下报错信息:
HPIdriver.c: In function `hpi_init':
HPIdriver.c:364: parse error before `AT91C_BASE_PIOB'
HPIdriver.c:365: `AT91C_BASE_PIOB' undeclared (first use in this function)
HPIdriver.c:365: (Each undeclared identifier is reported only once
HPIdriver.c:365: for each function it appears in.)
这是第355line-365line的代码:
hpi_dev->hpi_vbase =
(unsigned char *) ioremap_nocache (HPI_PHYSICAL_BASEADDR, 12);
printk ("HPI: Register address:%X\n", hpi_dev->hpi_vbase);
/*Initial the PIOB of arm processor,ready for AIC setting */
AT91PS_PIO AT91C_BASE_PIOB = (AT91PS_PIO) AT91_IO_P2V (0xFFFFF600);
AT91C_BASE_PIOB->PIO_PDR = 0x20000000; AT91C_BASE_PIOB->PIO_ASR = 0x20000000;
这里边报错的几个符号可都是我在驱动里编写的函数的函数名啊(除了AT91C_BASE_PIOB和AT91_IO_P2V)。
[root@AT91RM9200DK /]$insmod HPIdriver2.o
HPIdriver2.o: unresolved symbol HPID_Read
HPIdriver2.o: unresolved symbol AT91C_BASE_PIOB
HPIdriver2.o: unresolved symbol HPID_Write
HPIdriver2.o: unresolved symbol HPIA_Read
HPIdriver2.o: unresolved symbol AT91_IO_P2V
HPIdriver2.o: unresolved symbol setdspint