背景
我正在使用RTEMS并尝试设置本机NFS客户端。 虽然我已正确包含此功能,但驱动程序没有足够的动态驱动程序条目。 您可以在此处查找更多信息。
履行
为了设置额外的动态驱动程序,需要将NULL元素添加到大型免费驱动程序表中。 请参阅以下内容:
#define NULL_DRIVER_TABLE_ENTRY \ { NULL, NULL, NULL, NULL, NULL, NULL} #ifdef CONFIGURE_INIT rtems_driver_address_table Device_drivers[] = { #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS CONFIGURE_BSP_PREREQUISITE_DRIVERS, #endif #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, #endif ... #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS CONFIGURE_APPLICATION_EXTRA_DRIVERS, #endif #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER NULL_DRIVER_TABLE_ENTRY #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) NULL_DRIVER_TABLE_ENTRY #endif }; #endif问题
可能非常简单的问题是,当我构建这个时,我得到以下错误:
confdefs.h:568: error: too many initializers for 'rtems_driver_address_table'Background
I am using RTEMS and trying to set up a native NFS client. Although i have included this correctly there are not enough dynamic driver entries available for the Driver. You can seek more information here.
Implementation
In order to set up the extra dynamic drivers one needs to add NULL elements to a large table of free drivers. See the following:
#define NULL_DRIVER_TABLE_ENTRY \ { NULL, NULL, NULL, NULL, NULL, NULL} #ifdef CONFIGURE_INIT rtems_driver_address_table Device_drivers[] = { #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS CONFIGURE_BSP_PREREQUISITE_DRIVERS, #endif #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, #endif ... #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS CONFIGURE_APPLICATION_EXTRA_DRIVERS, #endif #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER NULL_DRIVER_TABLE_ENTRY #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) NULL_DRIVER_TABLE_ENTRY #endif }; #endifProblem
The problem which may be exceptionally simple is that when i build this i get the following error:
confdefs.h:568: error: too many initializers for 'rtems_driver_address_table'From looking here this appears to be a problem compiling with an unspecified number of table elements. What I don't understand is that this is currently working in that if I specify the NULL_DRIVER_TABLE_ENTRY with 7 NULLs (the number i need), it will fail, but with 6 NULLs it works perfectly fine?
As far as i can tell there is no definition as to the size of this table or its elements? Any ideas?
最满意答案
所以这是一个愚蠢的错误......
这个表的工作方式是NULL表项:
#define NULL_DRIVER_TABLE_ENTRY \ { NULL, NULL, NULL, NULL, NULL, NULL}实际上是数组中与rtems_driver_address_table对应的rtems_driver_address_table 。 这个驱动程序有6个元素,我试图有7.这个解决方案是添加一个额外的空条目,如下所示:
rtems_driver_address_table Device_drivers[] = { ... #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER NULL_DRIVER_TABLE_ENTRY, NULL_DRIVER_TABLE_ENTRY // Add extra entry here! ... };So this was a silly mistake...
The way this table works is that the NULL table entry:
#define NULL_DRIVER_TABLE_ENTRY \ { NULL, NULL, NULL, NULL, NULL, NULL}Is actually an entry in the array which corresponds to an rtems_driver_address_table. This driver has 6 elements and i was trying to have 7. The solution to this was to add an extra null entry as follows:
rtems_driver_address_table Device_drivers[] = { ... #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER NULL_DRIVER_TABLE_ENTRY, NULL_DRIVER_TABLE_ENTRY // Add extra entry here! ... };更多推荐
发布评论