小编Tan*_*ner的帖子

在Linux/x86上实现多消息MSI吗?

我正在研究一个FPGA端点的网络驱动程序,它支持PCIe总线上的多消息MSI中断(不是msix).主处理器是运行在CentOS上的x86 Intel i7 620LM,内核为4.2.

FPGA端点正确地在其MSI功能寄存器中公布多个msi向量(0x101 = 32个可能的总向量).

据我所知,内核4.2中添加了多消息功能.不幸的是,当我打电话pci_enable_msi_range(pdev, 1, 32);它只返回1.当我打电话给pci_msi_vec_count(pdev);它返回32.我能够在一个向量上请求一个irq处理程序,它可以按预期工作.

有谁知道在x86架构上的Linux中是否实际支持多消息MSI向量?

更新: 我能够使用不同的SBC和i7-4700EQ处理器启用所有32个MSI向量.这是一个4.4-rc1内核.

更新:也 适用于4.2.

更新: 在这种情况下,问题出在coreboot中.一旦电路板供应商提供更新,我就能够使多个矢量工作.

c interrupt linux-device-driver linux-kernel pci-e

7
推荐指数
2
解决办法
2210
查看次数

'struct'之前的预期表达式

我在下面的函数allocate()的第一行得到错误"'struct'之前的预期表达式".我无法弄清楚为什么.

我应该说我的任务是使这个代码与提供的结构/函数头一起工作.

任何帮助深表感谢!

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <time.h>

struct student{
    int id;
    int score;
};

struct student* allocate(){
     /*Allocate memory for ten students*/
     struct student *stud =  malloc(10 * sizeof struct *student);
     assert (stud !=0);

     return stud;
}

void generate(struct student *students){
     /*Generate random ID and scores for ten students, ID being between 1 and 10, scores between 0 and 100*/
     srand(time(NULL));

     // Generate random ID's
     int i;
     for(i=0; i<10; i++){
        students[i].id = rand()*10+1;
     } …
Run Code Online (Sandbox Code Playgroud)

c struct pointers

3
推荐指数
1
解决办法
3万
查看次数