DSP

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(38):未命名union的

2019-07-13 15:49发布

  快乐虾 http://blog.csdn.net/lights_joy/ lights@hb165.com   本文适用于 ADI bf561 DSP 优视BF561EVB开发板 uclinux-2008r1.5-rc3(smp patch) Visual DSP++ 5.0(update 5)   欢迎转载,但请保留作者信息   include/linux/shed.h中定义了一个结构体:   /*  * NOTE! "signal_struct" does not have it's own  * locking, because a shared signal_struct always  * implies a shared sighand_struct, so locking  * sighand_struct is always a proper superset of  * the locking of signal_struct.  */ struct signal_struct {      /* job control IDs */      pid_t pgrp;      struct pid *tty_old_pgrp;        union {          pid_t session __deprecated;          pid_t __session;      }; }; include/linux/init_task.h中定义了一个宏来对这个结构体进行初始化:   #define INIT_SIGNALS(sig) {                        /      .count        = ATOMIC_INIT(1),                /      .wait_chldexit     = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),/      .shared_pending    = {                         /          .list = LIST_HEAD_INIT(sig.shared_pending.list),   /          .signal =  {{0}}},                   /      .posix_timers = LIST_HEAD_INIT(sig.posix_timers),      /      .cpu_timers   = INIT_CPU_TIMERS(sig.cpu_timers),        /      .rlim         = INIT_RLIMITS,                      /      .pgrp         = 0,                        /      .tty_old_pgrp   = NULL,                        /      { .__session      = 0},                        / } 在这里      { .__session      = 0},                        / 会引发一个错误: "../../arch/blackfin/kernel/init_task.c", line 38: cc0136:  error: union           "" has no field "__session"   static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 怎么看都有__session这个成员啊,实际引发这个错误的原因是在结构体中使用了未命名的union。因此必须做如下修改: struct signal_struct {      /* job control IDs */      pid_t pgrp;      struct pid *tty_old_pgrp;        union {          pid_t session __deprecated;          pid_t __session;      }signal_struct_union; }; 其实就是随便给这个union定义一个变量。  

1       参考资料

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(32)start_kernel(2009-1-15) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(33).l1.text(2009-01-16) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(34).init.text(2009-01-16) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(35).init.data(2009-01-16) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(36).data.init_task(2009-01-16) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(37)segment(2009-01-16)