Chinaunix首页 | 论坛 | 博客
  • 博客访问: 396603
  • 博文数量: 380
  • 博客积分: 75
  • 博客等级: 民兵
  • 技术积分: 1925
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-05 15:35
文章分类

全部博文(380)

文章存档

2014年(1)

2013年(2)

2012年(19)

2011年(358)

我的朋友

分类:

2011-09-05 18:35:09

LPC3250 BSP Header Files' Position


需求

    用户驱动一般都会有这样类似的文件包含:
#include    
    这就要求平台相关的头文件必须放在include/asm/arch/目录下,而LPC3250的平台相关头文件却放在arch/arm/mach-lpc32xx/include/mach/目录下,如下所示:
[chenxibing@localhost linux-2.6.27.8]$ ls arch/arm/mach-lpc32xx/include/mach/
board.h        i2c.h             lpc32xx_gpio.h    lpc32xx_rtc.h      lpc32xx_uart.h  uncompress.h
clock.h        io.h              lpc32xx_hsuart.h  lpc32xx_sdcard.h   lpc32xx_usbd.h  vmalloc.h
debug-macro.S  irqs.h            lpc32xx_i2c.h     lpc32xx_slcnand.h  memory.h
dma.h          lpc32xx_clcdc.h   lpc32xx_i2s.h     lpc32xx_ssp.h      platform.h
entry-macro.S  lpc32xx_clkpwr.h  lpc32xx_kscan.h   lpc32xx_timer.h    system.h
hardware.h     lpc32xx_dmac.h    lpc32xx_mac.h     lpc32xx_tsc.h      timex.h

    为了不修改驱动程序代码,以保证代码的最大兼容性,我们可以做一个连接,将arch/arm/mach-lpc32xx/include/mach/连接到include/asm/arch/目录:
[chenxibing@localhost asm-arm]$ pwd
/home/chenxibing/lpc3250/linux-2.6.27.8/include/asm-arm
[chenxibing@localhost asm-arm]$ ln -s ../../arch/arm/mach-lpc32xx/include/mach/ arch
 
   最后得到的结果就是:
[chenxibing@localhost linux-2.6.27.8]$ ls include/asm-arm/arch/
board.h        i2c.h             lpc32xx_gpio.h    lpc32xx_rtc.h      lpc32xx_uart.h  uncompress.h
clock.h        io.h              lpc32xx_hsuart.h  lpc32xx_sdcard.h   lpc32xx_usbd.h  vmalloc.h
debug-macro.S  irqs.h            lpc32xx_i2c.h     lpc32xx_slcnand.h  memory.h
dma.h          lpc32xx_clcdc.h   lpc32xx_i2s.h     lpc32xx_ssp.h      platform.h
entry-macro.S  lpc32xx_clkpwr.h  lpc32xx_kscan.h   lpc32xx_timer.h    system.h
hardware.h     lpc32xx_dmac.h    lpc32xx_mac.h     lpc32xx_tsc.h      timex.h

    这样,使用了#include  的文件编译也不会出错了。
阅读(276) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~