首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

有人普及一下驱动里面的resource么?该如何处理

2012-03-30 
有人普及一下驱动里面的resource么?struct resource {resource_size_t startresource_size_t endconst c

有人普及一下驱动里面的resource么?
struct resource {
resource_size_t start;
resource_size_t end;
const char *name;
unsigned long flags;
struct resource *parent, *sibling, *child;
};

这里start ,end 是什么的地址? 是怎么定义值呢?

flags:
  /*
 * IO resources have these defined flags.
 */
#define IORESOURCE_BITS0x000000ff/* Bus-specific bits */

#define IORESOURCE_TYPE_BITS0x00001f00/* Resource type */
#define IORESOURCE_IO0x00000100
#define IORESOURCE_MEM0x00000200
#define IORESOURCE_IRQ0x00000400
#define IORESOURCE_DMA0x00000800
#define IORESOURCE_BUS0x00001000

#define IORESOURCE_PREFETCH0x00002000/* No side effects */
#define IORESOURCE_READONLY0x00004000
#define IORESOURCE_CACHEABLE0x00008000
#define IORESOURCE_RANGELENGTH0x00010000
#define IORESOURCE_SHADOWABLE0x00020000

#define IORESOURCE_SIZEALIGN0x00040000/* size indicates alignment */
#define IORESOURCE_STARTALIGN0x00080000/* start field is alignment */

#define IORESOURCE_MEM_640x00100000
#define IORESOURCE_WINDOW0x00200000/* forwarded by bridge */
#define IORESOURCE_MUXED0x00400000/* Resource is software muxed */

#define IORESOURCE_EXCLUSIVE0x08000000/* Userland may not map this resource */
#define IORESOURCE_DISABLED0x10000000
#define IORESOURCE_UNSET0x20000000
#define IORESOURCE_AUTO0x40000000
#define IORESOURCE_BUSY0x80000000/* Driver has marked this resource busy */



这里flags有这么多,但是常用的好像不多, 怎么选取flag呢?
3ks

[解决办法]
这些东西应该一看就懂啊。
[解决办法]
这个resource里的start和end是你具体设备 也就是硬件对应的物理地址,网上这样的内容很多。可以看看
[解决办法]
设备IO寄存器,IO内存等物理地址.

热点排行