Eric Biederman | 5899fd8 | 2003-04-24 06:25:08 +0000 | [diff] [blame^] | 1 | #ifndef RESOURCE_H |
| 2 | #define RESOURCE_H |
| 3 | |
| 4 | |
| 5 | #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ |
| 6 | |
| 7 | #define IORESOURCE_IO 0x00000100 /* Resource type */ |
| 8 | #define IORESOURCE_MEM 0x00000200 |
| 9 | #define IORESOURCE_IRQ 0x00000400 |
| 10 | #define IORESOURCE_DMA 0x00000800 |
| 11 | |
| 12 | #define IORESOURCE_PREFETCH 0x00001000 /* No side effects */ |
| 13 | #define IORESOURCE_READONLY 0x00002000 |
| 14 | #define IORESOURCE_CACHEABLE 0x00004000 |
| 15 | #define IORESOURCE_RANGELENGTH 0x00008000 |
| 16 | #define IORESOURCE_SHADOWABLE 0x00010000 |
| 17 | #define IORESOURCE_BUS_HAS_VGA 0x00020000 |
| 18 | |
| 19 | #define IORESOURCE_SET 0x80000000 |
| 20 | |
| 21 | /* PCI specific resource bits */ |
| 22 | #define IORESOURCE_PCI64 (1<<0) /* 64bit long pci resource */ |
| 23 | #define IORESOURCE_PCI_BRIDGE (1<<1) /* A bridge pci resource */ |
| 24 | |
| 25 | /* ISA PnP IRQ specific bits (IORESOURCE_BITS) */ |
| 26 | #define IORESOURCE_IRQ_HIGHEDGE (1<<0) |
| 27 | #define IORESOURCE_IRQ_LOWEDGE (1<<1) |
| 28 | #define IORESOURCE_IRQ_HIGHLEVEL (1<<2) |
| 29 | #define IORESOURCE_IRQ_LOWLEVEL (1<<3) |
| 30 | |
| 31 | /* ISA PnP DMA specific bits (IORESOURCE_BITS) */ |
| 32 | #define IORESOURCE_DMA_TYPE_MASK (3<<0) |
| 33 | #define IORESOURCE_DMA_8BIT (0<<0) |
| 34 | #define IORESOURCE_DMA_8AND16BIT (1<<0) |
| 35 | #define IORESOURCE_DMA_16BIT (2<<0) |
| 36 | |
| 37 | #define IORESOURCE_DMA_MASTER (1<<2) |
| 38 | #define IORESOURCE_DMA_BYTE (1<<3) |
| 39 | #define IORESOURCE_DMA_WORD (1<<4) |
| 40 | |
| 41 | #define IORESOURCE_DMA_SPEED_MASK (3<<6) |
| 42 | #define IORESOURCE_DMA_COMPATIBLE (0<<6) |
| 43 | #define IORESOURCE_DMA_TYPEA (1<<6) |
| 44 | #define IORESOURCE_DMA_TYPEB (2<<6) |
| 45 | #define IORESOURCE_DMA_TYPEF (3<<6) |
| 46 | |
| 47 | |
| 48 | /* ISA PnP memory I/O specific bits (IORESOURCE_BITS) */ |
| 49 | #define IORESOURCE_MEM_WRITEABLE (1<<0) /* dup: IORESOURCE_READONLY */ |
| 50 | #define IORESOURCE_MEM_CACHEABLE (1<<1) /* dup: IORESOURCE_CACHEABLE */ |
| 51 | #define IORESOURCE_MEM_RANGELENGTH (1<<2) /* dup: IORESOURCE_RANGELENGTH */ |
| 52 | #define IORESOURCE_MEM_TYPE_MASK (3<<3) |
| 53 | #define IORESOURCE_MEM_8BIT (0<<3) |
| 54 | #define IORESOURCE_MEM_16BIT (1<<3) |
| 55 | #define IORESOURCE_MEM_8AND16BIT (2<<3) |
| 56 | #define IORESOURCE_MEM_SHADOWABLE (1<<5) /* dup: IORESOURCE_SHADOWABLE */ |
| 57 | #define IORESOURCE_MEM_EXPANSIONROM (1<<6) |
| 58 | |
| 59 | struct resource { |
| 60 | unsigned long base; /* Base address of the resource */ |
| 61 | unsigned long size; /* Size of the resource */ |
| 62 | unsigned long limit; /* Largest valid value base + size -1 */ |
| 63 | unsigned long flags; /* Descriptions of the kind of resource */ |
| 64 | unsigned long index; /* Bus specific per device resource id */ |
| 65 | unsigned char align; /* Required alignment (base 2) of the resource */ |
| 66 | unsigned char gran; /* Granularity (base 2) of the resource */ |
| 67 | /* Alignment must be >= the granularity of the resource */ |
| 68 | }; |
| 69 | |
| 70 | #endif /* RESOURCE_H */ |