编译设备驱动程序时出现神秘错误 [英] mysterious error while compiling device driver

查看:86
本文介绍了编译设备驱动程序时出现神秘错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

我正在使用linux环境,我使用本机编译器gcc编译设备驱动程序

程序。在我的一个宏中我有这些< br $> b $ b行

#if(1<<< HARDIRQ_BITS)< MAX_HARDIRQS_PER_CPU

#错误HARDIRQ_BITS太低了!

#endif

编译时
,它会给出这样的错误

"错误:#error HARDIRQ_BITS太低了


错误并不意味着任何特定类型的错误。

plz帮我消除这个错误...

hi all
I am working with linux environment and i compiled device driver
programs using native compiler "gcc".In one of my macro i have these
lines

#if (1 << HARDIRQ_BITS) < MAX_HARDIRQS_PER_CPU
# error HARDIRQ_BITS is too low!
#endif

while compiling,it gives error like this
"error : # error HARDIRQ_BITS is too low"

The error doesnt mean any particular type of error.
plz Help me to eliminate this error...

推荐答案

yeah写道:
yeah wrote:

hi所有

我正在使用linux环境,我编译了设备驱动程序

程序使用本机编译器gcc。在我的一个宏中我有这些



#if(1<<< HARDIRQ_BITS)< MAX_HARDIRQS_PER_CPU

#错误HARDIRQ_BITS太低了!

#endif

编译时
,它会给出这样的错误

"错误:#error HARDIRQ_BITS太低了


错误并不意味着任何特定类型的错误。

plz帮我消除这个错误...
hi all
I am working with linux environment and i compiled device driver
programs using native compiler "gcc".In one of my macro i have these
lines

#if (1 << HARDIRQ_BITS) < MAX_HARDIRQS_PER_CPU
# error HARDIRQ_BITS is too low!
#endif

while compiling,it gives error like this
"error : # error HARDIRQ_BITS is too low"

The error doesnt mean any particular type of error.
plz Help me to eliminate this error...



无论非标准宏HARDIRQ_BITS被定义为似乎是低于b
,除非你的代码对你说谎。将其定义为足够大的

值将使错误消息消失。

可能引入的其他行为是另一个问题。

Whatever the nonstandard macro HARDIRQ_BITS is defined as seems to be to
low, unless your code is lying to you. Defining it to be a large enough
value will make the error message go away. What other behavior that
might introduce is another question.


是的:

#if(1<< HARDIRQ_BITS)< MAX_HARDIRQS_PER_CPU

#error HARDIRQ_BITS太低了!

#endif
#if (1 << HARDIRQ_BITS) < MAX_HARDIRQS_PER_CPU
# error HARDIRQ_BITS is too low!
#endif



这里的逻辑似乎很奇怪。我原以为:


#if(1u<<< HARDIRQ_BITS)MAX_HARDIRQS_PER_CPU

#error HARDIRQ_BITS太高了!

#endif


The logic seems very strange here. I would have expected:

#if (1u << HARDIRQ_BITS) MAX_HARDIRQS_PER_CPU
# error HARDIRQ_BITS is too high!
#endif


编译时,它会出现这样的错误

"错误:#error HARDIRQ_BITS太低了


错误并不意味着任何特定类型的错误。

plz帮助我消除此错误...
while compiling,it gives error like this
"error : # error HARDIRQ_BITS is too low"

The error doesnt mean any particular type of error.
plz Help me to eliminate this error...



购买一个具有智能等级的全功能人脑

高于5.使用这样的设备,我想你会清楚地看到

:要么:


1:HARDIRQ_BITS太小

2:M​​AX_HARDIRQS_PER_CPU太大


(..假设你的逻辑是正确的那个。


我主张不对有符号的整数进行位移,我更喜欢

1u<< 。


Martin


Purchase a fully-functional human brain with an intelligence rating
higher than 5. With such a device, I think you''d clearly see that
either:

1: HARDIRQ_BITS is too small
2: MAX_HARDIRQS_PER_CPU is too big

(...that''s assuming your logic is right)

And I''d advocate not to do bitshifting on signed integers, I''d prefer
"1u << ".

Martin


yeah写道:
yeah wrote:

嗨所有

我正在使用linux环境,我编译了设备驱动程序

程序使用本机编译器gcc。在我的一个宏中我有这些



#if(1<<< HARDIRQ_BITS)< MAX_HARDIRQS_PER_CPU

#错误HARDIRQ_BITS太低了!

#endif

编译时
,它会给出这样的错误

"错误:#error HARDIRQ_BITS太低了


错误并不意味着任何特定类型的错误。
hi all
I am working with linux environment and i compiled device driver
programs using native compiler "gcc".In one of my macro i have these
lines

#if (1 << HARDIRQ_BITS) < MAX_HARDIRQS_PER_CPU
# error HARDIRQ_BITS is too low!
#endif

while compiling,it gives error like this
"error : # error HARDIRQ_BITS is too low"

The error doesnt mean any particular type of error.



当然,这意味着特定类型的错误。但它并不是真的一个

我们作为新闻组特别适合帮助你解决。

Of course it means a particular type of error. But it''s not really one
which we as a newsgroup are particularly well-placed to help you resolve.


plz帮帮我消除这个错误......
plz Help me to eliminate this error...



我肯定有人会因此而鞭挞我,但是为了
解释伟大的Obi-Wan Kenobi这不是你所要求的新闻组

正在寻找。


事实上,新闻组是否真的令人怀疑正确看待所有人的地方。


如何联系代码的发起人? (我假设你没有&b
写它,否则你就会知道错误意味着什么)。


另外,谷歌的简短扫描表示网上有关于这些内容的公平信息。

I''m sure someone will be along to castigate me for this, but to
paraphrase the great Obi-Wan Kenobi "this is not the newsgroup you are
looking for".

In fact it''s doubtful that a newsgroup is the right place to look at all.

How about contacting the originator of the code? (I assume you didn''t
write it as otherwise you''d know what the error implied).

Alternatively, a brief scan with Google indicates that there''s a fair
amount of information about this stuff on the web.


这篇关于编译设备驱动程序时出现神秘错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆