uclinux-2008R1-RC8(bf561)到VDSP5的移植(61): KBUILD_MODNAME

 

快乐虾

http://blog.csdn.net/lights_joy/

lights@hb165.com

   

 

本文适用于

ADI bf561 DSP

优视BF561EVB开发板

uclinux-2008r1-rc8 (移植到vdsp5)

Visual DSP++ 5.0

 

欢迎转载,但请保留作者信息

 

在一些以模块方式提供的驱动中,使用了module_param这个宏来定义一些参数,这个宏将引起一个语法错误:

"../../drivers/net/dm9000.c", line 124: cc0020:  error: identifier

          "KBUILD_MODNAME" is undefined

  module_param(watchdog, int, 0400);

看看module_param的定义:

#define module_param(name, type, perm)                  /

     module_param_named(name, name, type, perm)

继续找module_param_named的定义:

/* Helper functions: type is byte, short, ushort, int, uint, long,

   ulong, charp, bool or invbool, or XXX if you define param_get_XXX,

   param_set_XXX and param_check_XXX. */

#define module_param_named(name, value, type, perm)             /

     param_check_##type(name, &(value));                   /

     module_param_call(name, param_set_##type, param_get_##type, &value, perm); /

     __MODULE_PARM_TYPE(name, #type)

再展开module_param_call

/* This is the fundamental function for registering boot/module

   parameters.  perm sets the visibility in sysfs: 000 means it's

   not there, read bits mean it's readable, write bits mean it's

   writable. */

#define __module_param_call(prefix, name, set, get, arg, perm)        /

     /* Default value instead of permissions? */             /

     static int __param_perm_check_##name __attribute__((unused)) =   /

     BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2));  /

     static char __param_str_##name[] = prefix #name;        /

     static struct kernel_param const __param_##name              /

     __attribute_used__                        /

    __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) /

     = { __param_str_##name, perm, set, get, arg }

 

#define module_param_call(name, set, get, arg, perm)                   /

     __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm)

在这里使用了一个MODULE_PARAM_PREFIX的宏定义:

#define MODULE_PARAM_PREFIX KBUILD_MODNAME "."

错误提示中的KBUILD_MODNAME就出现在这里。

这个宏就是定义了模块的名称,是一个字符串,每个不同的驱动模块都有不同的名称,因此当在linux下编译时,将这个名称写在了Makefile中,因此在编译这个模块文件时,编译器会自动加上-DKBUILD_MODNAME=”xxx”这样的定义。

VDSP下编译时,也必须为此模块文件单独定义一个KBUILD_MODNAME这个的宏。其操作为:

在文件上点右键 -> File Options -> Build with -> File specific settings -> Preprocessor -> Proprocessor definitions,添加如下定义:

KBUILD_MODNAME=/"dm9000/"

注意一定要加上反斜杠。否则将出错。

 

 参考文章

uclinux-2008R1-RC8(bf561)VDSP5的移植(1):前言( 2008/4/29 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(2):代码注释( 2008/4/29 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(3):Head.s( 2008/4/29 )

 uclinux-2008R1-RC8(bf561)VDSP5的移植(4):使用head.s做为入口点( 2008/4/29 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(5):CONFIG_BANK_x( 2008/4/29 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(6):__bss_start( 2008/4/29 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(7):_sdata( 2008/4/30 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(8):_stext( 2008/4/30 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(9):bf53x_relocate_l1_mem( 2008/4/30 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(10):编译器配置( 2008/5/3 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(11):cmdline_init( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(12):init_thread_union( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(13):未命名union的问题( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(14):segment( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(15):WARN()( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(16)start_kernel( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(17).l1.text( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(18).init.text.init.data( 2008/5/4 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(19)li2040( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(20):远调用( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(21)_mc_data_initialise( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(22)spinlock_types.h( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(23)spinlock.h( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(24)CONFIG_NR_CPUS( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(25)smp.h( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(26)smp_processor_id( 2008/5/5 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(27)cpumask_t( 2008/5/6 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(28)likely( 2008/5/6 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(29)spinlock( 2008/5/6 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(30)atomic_t( 2008/5/8 )

__builtin_constant_p( 2008/5/8 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(32)cdefbf561.h( 2008/5/8 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(33)__ebss_l1( 2008/5/14 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(34).rept( 2008/5/14 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(35)ARRAY_SIZE( 2008/5/15 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(36)__per_cpu_start( 2008/5/19 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(37)_cplb_mgr( 2008/5/20 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(38):cachespinlock( 2008/5/21 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(39):链接重排( 2008/5/21 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(40):中断优先级( 2008/5/22 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(41)PLL造成的困扰( 2008/6/3 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(42)__bad_size的问题( 2008/6/20 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(43)__builtin_return_address的问题( 2008/6/23 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(44)kmallockzalloc的问题( 2008/6/23 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(45)__delay( 2008/6/24 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(46): raw_rwlock_t( 2008/6/25 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(47): d_alloc引出的问题( 2008/6/27 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(48): __cmpxchg的问题( 2008/6/30 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(49)kernel_thread_helper的问题( 2008/7/2 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(50)jiffies_64的定义问题( 2008/7/2 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(51)fork.c编译失败( 2008/7/3 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(52)cache.s的问题( 2008/7/7 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(53)reboot.c的问题( 2008/7/8 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(54): initramfs的问题( 2008/7/8 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(55): filemap.c的问题( 2008/7/9 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(56): __grab_cache_page( 2008/7/10 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(57): _NSIG_WORDS_is_unsupported_size( 2008/7/11 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(58): unable to open an initial console( 2008/7/17 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(59): Milestone:内核成功启动( 2008/7/18 )

uclinux-2008R1-RC8(bf561)VDSP5的移植(60): current_text_addr

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌云阁主

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值