d***x 发帖数: 4 | 1 下载了个pci驱动,编译出错
/src/master.c:62: error: section attribute not allowed for specific_pci_
probe
/src/master.c:62: warning: __cold__ attribute ignored
下面是出错的代码, __devinit 是 include/kernel/init.h里定义的
/* Static function prototypes */
static int m_pci_probe_valid (struct pci_dev *dev,
int __devinit (*specific_pci_probe)(struct pci_dev *dev)) __devinit;
去掉__devinit再编译就没问题,只是对linux不是很熟,不知这样去掉对不对? |
m*****e 发帖数: 4193 | 2 Probably mismatched kernel and driver version.
Check what __devinit does. I *think* it just marks the code in init section
so it can be discarded to save memory, but maybe there is sth else.
【在 d***x 的大作中提到】 : 下载了个pci驱动,编译出错 : /src/master.c:62: error: section attribute not allowed for specific_pci_ : probe : /src/master.c:62: warning: __cold__ attribute ignored : 下面是出错的代码, __devinit 是 include/kernel/init.h里定义的 : /* Static function prototypes */ : static int m_pci_probe_valid (struct pci_dev *dev, : int __devinit (*specific_pci_probe)(struct pci_dev *dev)) __devinit; : 去掉__devinit再编译就没问题,只是对linux不是很熟,不知这样去掉对不对?
|
d***x 发帖数: 4 | 3
section
是的,__devinit 只标识了section
这么说driver里去掉__devinit没问题了?
另外kernel和driver版本冲突会不会在编译后insmod时才会体现出来呢?谢谢
include/linux/init.h
/* Used for HOTPLUG */
#define __devinit __section(.devinit.text) __cold
【在 m*****e 的大作中提到】 : Probably mismatched kernel and driver version. : Check what __devinit does. I *think* it just marks the code in init section : so it can be discarded to save memory, but maybe there is sth else.
|
m*****e 发帖数: 4193 | 4 I think it's the "__cold" attribute that causes your problem. Maybe it's
something to do with your gcc/binutils version.
【在 d***x 的大作中提到】 : : section : 是的,__devinit 只标识了section : 这么说driver里去掉__devinit没问题了? : 另外kernel和driver版本冲突会不会在编译后insmod时才会体现出来呢?谢谢 : include/linux/init.h : /* Used for HOTPLUG */ : #define __devinit __section(.devinit.text) __cold
|