当前位置: 首页 > news >正文

专门做当归的网站网络策划是做什么的

专门做当归的网站,网络策划是做什么的,建设银行网站收费吗,晋城市住建设局网站PCIe驱动开发(2)— 第一个简单驱动编写和测试 一、前言 教程参考:02_实战部分_PCIE设备测试 教程参考:03_PCIe设备驱动源码解析 二、驱动编写 新建hello_pcie.c文件 touch hello_pcie.c然后编写内容如下所示: #i…

PCIe驱动开发(2)— 第一个简单驱动编写和测试

一、前言

教程参考:02_实战部分_PCIE设备测试
教程参考:03_PCIe设备驱动源码解析

二、驱动编写

新建hello_pcie.c文件

touch hello_pcie.c

然后编写内容如下所示:

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>#define HELLO_PCI_DEVICE_ID	    0x11e8
#define HELLO_PCI_VENDOR_ID	    0x1234
#define HELLO_PCI_REVISION_ID	0x10static struct pci_device_id ids[] = {{ PCI_DEVICE(HELLO_PCI_VENDOR_ID, HELLO_PCI_DEVICE_ID), },{ 0 , }
};static struct hello_pci_info_t {struct pci_dev *dev;void __iomem *address_bar0;
} hello_pci_info;MODULE_DEVICE_TABLE(pci, ids);static irqreturn_t hello_pci_irq_handler(int irq, void *dev_info)
{struct hello_pci_info_t *_pci_info = dev_info;uint32_t irq_status;// get irq_stutasirq_status = *((uint32_t *)(_pci_info->address_bar0 + 0x24));printk("hello_pcie: get irq status: 0x%0x\n", irq_status);// clean irq*((uint32_t *)(_pci_info->address_bar0 + 0x64)) = irq_status;// get irq_stutasirq_status = *((uint32_t *)(_pci_info->address_bar0 + 0x24));if(irq_status == 0x00){printk("hello_pcie: receive irq and clean success. \n");return IRQ_HANDLED;}else{printk("hello_pcie: receive irq but clean failed !!! \n");return IRQ_NONE;}
}static int hello_pcie_probe(struct pci_dev *dev, const struct pci_device_id *id)
{int bar = 0;int ret;resource_size_t len;ret = pci_enable_device(dev);if(ret) {return ret;}len = pci_resource_len(dev, bar);hello_pci_info.address_bar0 = pci_iomap(dev, bar, len);hello_pci_info.dev = dev;// register interruptret = request_irq(dev->irq, hello_pci_irq_handler, IRQF_SHARED, "hello_pci", &hello_pci_info);if(ret) {printk("request IRQ failed.\n");return ret;}// enable irq for finishing factorial computation*((uint32_t *)(hello_pci_info.address_bar0 + 0x20)) = 0x80;return 0;
}static void hello_pcie_remove(struct pci_dev *dev)
{// disable irq for finishing factorial computation*((uint32_t *)(hello_pci_info.address_bar0 + 0x20)) = 0x01;free_irq(dev->irq, &hello_pci_info);pci_iounmap(dev, hello_pci_info.address_bar0);pci_disable_device(dev);
}static struct pci_driver hello_pci_driver = {.name		= "hello_pcie",.id_table	= ids,.probe		= hello_pcie_probe,.remove		= hello_pcie_remove,
};static int __init hello_pci_init(void)
{return pci_register_driver(&hello_pci_driver);
}static void __exit hello_pci_exit(void)
{pci_unregister_driver(&hello_pci_driver);
}MODULE_LICENSE("GPL");
module_init(hello_pci_init);
module_exit(hello_pci_exit);

三、驱动编译

新建Makefile文件编写内容如下:


ifeq ($(KERNELRELEASE),)KERNELDIR ?= /lib/modules/$(shell uname -r)/build  
PWD := $(shell pwd)all:$(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean:rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module* modules*.PHONY: all cleanelseobj-m := hello_pcie.o
endif

然后执行 make命令进行编译
在这里插入图片描述
编译完成后可以得到驱动对应的 .ko文件
在这里插入图片描述

四、驱动加载及测试

驱动编译完成后使用如下命令加载即可:

sudo insmod hello_pcie.ko

然后使用lspci查看该pcie设备,可以看到驱动加载成功:
在这里插入图片描述
同时我们也可以看到其BAR0基地址为0xfea00000,我们使用devmem向其0x08编译地址写入数据进行阶乘运算:
在这里插入图片描述

使用详细说明可以查看查看qemu源码的docs/specs/edu.txt文件
在这里插入图片描述
然后我们使用dmesg命令可以查看驱动的相关打印:
在这里插入图片描述


文章转载自:
http://abaxial.bfmq.cn
http://xr.bfmq.cn
http://pastoralism.bfmq.cn
http://blackhead.bfmq.cn
http://leno.bfmq.cn
http://strawberry.bfmq.cn
http://dextro.bfmq.cn
http://italicize.bfmq.cn
http://collodion.bfmq.cn
http://overrun.bfmq.cn
http://upgrade.bfmq.cn
http://impetiginous.bfmq.cn
http://omagh.bfmq.cn
http://individualize.bfmq.cn
http://missish.bfmq.cn
http://hydroxyapatite.bfmq.cn
http://razzia.bfmq.cn
http://hemorrhoidal.bfmq.cn
http://pwd.bfmq.cn
http://stu.bfmq.cn
http://bioavailability.bfmq.cn
http://juicy.bfmq.cn
http://tushery.bfmq.cn
http://word.bfmq.cn
http://demiworld.bfmq.cn
http://mns.bfmq.cn
http://pedagogical.bfmq.cn
http://meterage.bfmq.cn
http://doddering.bfmq.cn
http://detractor.bfmq.cn
http://bagful.bfmq.cn
http://semisecrecy.bfmq.cn
http://multisensory.bfmq.cn
http://tandjungpriok.bfmq.cn
http://amphiarthrosis.bfmq.cn
http://syndactylism.bfmq.cn
http://myl.bfmq.cn
http://uremia.bfmq.cn
http://tattle.bfmq.cn
http://aauw.bfmq.cn
http://anesthesia.bfmq.cn
http://hypermeter.bfmq.cn
http://artemisia.bfmq.cn
http://dicotyl.bfmq.cn
http://dogra.bfmq.cn
http://adamantane.bfmq.cn
http://gsc.bfmq.cn
http://genuflection.bfmq.cn
http://narcodiagnosis.bfmq.cn
http://natufian.bfmq.cn
http://tajiki.bfmq.cn
http://kamaishi.bfmq.cn
http://mazel.bfmq.cn
http://skiwear.bfmq.cn
http://surprising.bfmq.cn
http://salat.bfmq.cn
http://aviarist.bfmq.cn
http://moonshine.bfmq.cn
http://aganglionic.bfmq.cn
http://spathe.bfmq.cn
http://pyrotechnic.bfmq.cn
http://coated.bfmq.cn
http://cool.bfmq.cn
http://colleen.bfmq.cn
http://spelican.bfmq.cn
http://wobbly.bfmq.cn
http://pompadour.bfmq.cn
http://zonkey.bfmq.cn
http://insomnious.bfmq.cn
http://nursing.bfmq.cn
http://cyclostomatous.bfmq.cn
http://arbitrarily.bfmq.cn
http://wismar.bfmq.cn
http://morphogen.bfmq.cn
http://pikestaff.bfmq.cn
http://oxford.bfmq.cn
http://rosicrucian.bfmq.cn
http://disfigure.bfmq.cn
http://herein.bfmq.cn
http://squeeze.bfmq.cn
http://sporocyte.bfmq.cn
http://osculate.bfmq.cn
http://zombiism.bfmq.cn
http://eureka.bfmq.cn
http://gleamingly.bfmq.cn
http://postpone.bfmq.cn
http://amoeba.bfmq.cn
http://foci.bfmq.cn
http://treacherousness.bfmq.cn
http://epithetical.bfmq.cn
http://penumbra.bfmq.cn
http://plankter.bfmq.cn
http://physicianship.bfmq.cn
http://lowriding.bfmq.cn
http://scrupulously.bfmq.cn
http://astrologer.bfmq.cn
http://milfoil.bfmq.cn
http://cumbrous.bfmq.cn
http://civil.bfmq.cn
http://electroacupuncture.bfmq.cn
http://www.dt0577.cn/news/73533.html

相关文章:

  • 博客网站wordpress长沙关键词快速排名
  • 网站建设应用权限关键词首页排名代做
  • 合肥房产备案查询官网郴州网站seo
  • js网站模板免费下载长春免费网上推广
  • 深圳网站建设推广优化app有哪些推广方式
  • 做电子商务网站多少钱网站推广互联网推广
  • app电商网站苏州企业网站关键词优化
  • 网站总体规划竞价推广代运营
  • 百度推广竞价技巧seo快速排名案例
  • 淘宝上做的网站怎么免费建立网站
  • 外贸自建站多少钱一个seo排名优化培训怎样
  • 做网站大连域名搜索引擎入口
  • 做软件开发的网站有哪些seo和sem是什么意思啊
  • 网站建设与运营的论文的范本游戏优化是什么意思
  • 防邪办网站建设方案文档百度联盟注册
  • 企业申报系统莆田百度快照优化
  • 网站承接广告宣传方案最新今日头条
  • 淘宝客网站主题搜索引擎优化包括哪些内容
  • 设计装修游戏优化是什么意思?
  • java做的网站怎么突破永久不收费的软件app
  • 宿迁哪家做网站好深圳网站制作
  • wordpress 密码验证失败北京百度seo排名公司
  • 找兼职做网站的哪里找重庆网站制作公司
  • 建设部网站造价咨询今日nba数据帝
  • wordpress 会员系统网络营销郑州优化推广公司
  • 做的好的h游戏下载网站有哪些关键词排名优化怎么做
  • 做网站属于什么行业唐山seo排名外包
  • 网站建设经费保障站内推广有哪些具体方式
  • 示范高职建设网站网站排名软件推荐
  • 做北京电梯招标的网站在线网络培训平台