Linux Kernel
3.7.1
|
#include <linux/compiler.h>
#include <linux/types.h>
Go to the source code of this file.
Data Structures | |
struct | resource |
Variables | |
struct resource | ioport_resource |
struct resource | iomem_resource |
#define __request_mem_region | ( | start, | |
n, | |||
name, | |||
excl | |||
) | __request_region(&iomem_resource, (start), (n), (name), excl) |
#define check_mem_region | ( | start, | |
n | |||
) | __check_region(&iomem_resource, (start), (n)) |
#define DEFINE_RES_DMA | ( | _dma | ) | DEFINE_RES_DMA_NAMED((_dma), NULL) |
#define DEFINE_RES_DMA_NAMED | ( | _dma, | |
_name | |||
) | DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA) |
#define DEFINE_RES_IO_NAMED | ( | _start, | |
_size, | |||
_name | |||
) | DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO) |
#define DEFINE_RES_IRQ | ( | _irq | ) | DEFINE_RES_IRQ_NAMED((_irq), NULL) |
#define DEFINE_RES_IRQ_NAMED | ( | _irq, | |
_name | |||
) | DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ) |
#define DEFINE_RES_MEM_NAMED | ( | _start, | |
_size, | |||
_name | |||
) | DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM) |
#define devm_release_mem_region | ( | dev, | |
start, | |||
n | |||
) | __devm_release_region(dev, &iomem_resource, (start), (n)) |
#define devm_release_region | ( | dev, | |
start, | |||
n | |||
) | __devm_release_region(dev, &ioport_resource, (start), (n)) |
#define devm_request_mem_region | ( | dev, | |
start, | |||
n, | |||
name | |||
) | __devm_request_region(dev, &iomem_resource, (start), (n), (name)) |
#define devm_request_region | ( | dev, | |
start, | |||
n, | |||
name | |||
) | __devm_request_region(dev, &ioport_resource, (start), (n), (name)) |
#define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */ |
#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ |
#define IORESOURCE_MEM_CACHEABLE (1<<1) /* dup: IORESOURCE_CACHEABLE */ |
#define IORESOURCE_MEM_RANGELENGTH (1<<2) /* dup: IORESOURCE_RANGELENGTH */ |
#define IORESOURCE_MEM_SHADOWABLE (1<<5) /* dup: IORESOURCE_SHADOWABLE */ |
#define IORESOURCE_MEM_WRITEABLE (1<<0) /* dup: IORESOURCE_READONLY */ |
#define IORESOURCE_MUXED 0x00400000 /* Resource is software muxed */ |
#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ |
#define IORESOURCE_PREFETCH 0x00002000 /* No side effects */ |
#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */ |
#define IORESOURCE_SIZEALIGN 0x00040000 /* size indicates alignment */ |
#define IORESOURCE_STARTALIGN 0x00080000 /* start field is alignment */ |
#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */ |
#define release_mem_region | ( | start, | |
n | |||
) | __release_region(&iomem_resource, (start), (n)) |
#define release_region | ( | start, | |
n | |||
) | __release_region(&ioport_resource, (start), (n)) |
#define request_mem_region | ( | start, | |
n, | |||
name | |||
) | __request_region(&iomem_resource, (start), (n), (name), 0) |
#define request_mem_region_exclusive | ( | start, | |
n, | |||
name | |||
) | __request_region(&iomem_resource, (start), (n), (name), IORESOURCE_EXCLUSIVE) |
#define request_muxed_region | ( | start, | |
n, | |||
name | |||
) | __request_region(&ioport_resource, (start), (n), (name), IORESOURCE_MUXED) |
#define request_region | ( | start, | |
n, | |||
name | |||
) | __request_region(&ioport_resource, (start), (n), (name), 0) |
int __check_region | ( | struct resource * | parent, |
resource_size_t | start, | ||
resource_size_t | n | ||
) |
__check_region - check if a resource region is busy or free : parent resource descriptor : resource start address
: resource region size
Returns 0 if the region is free at the moment it is checked, returns %-EBUSY if the region is busy.
NOTE: This function is deprecated because its use is racy. Even if it returns 0, a subsequent call to request_region() may fail because another driver etc. just allocated the region. Do NOT use it. It will be removed from the kernel.
Definition at line 951 of file resource.c.
void __devm_release_region | ( | struct device * | dev, |
struct resource * | parent, | ||
resource_size_t | start, | ||
resource_size_t | n | ||
) |
Definition at line 1065 of file resource.c.
|
read |
Definition at line 1039 of file resource.c.
void __release_region | ( | struct resource * | parent, |
resource_size_t | start, | ||
resource_size_t | n | ||
) |
__release_region - release a previously reserved resource region : parent resource descriptor : resource start address
: resource region size
The described resource region must match a currently busy region.
Definition at line 974 of file resource.c.
|
read |
Definition at line 888 of file resource.c.
int adjust_resource | ( | struct resource * | res, |
resource_size_t | start, | ||
resource_size_t | size | ||
) |
adjust_resource - modify a resource's start and size : resource to modify : new start value : new size
Given an existing resource, change its start and size to match the arguments. Returns 0 on success, -EBUSY if it can't fit. Existing children of the resource are assumed to be immutable.
Definition at line 719 of file resource.c.
int allocate_resource | ( | struct resource * | root, |
struct resource * | new, | ||
resource_size_t | size, | ||
resource_size_t | min, | ||
resource_size_t | max, | ||
resource_size_t | align, | ||
resource_size_t(*)(void *, const struct resource *, resource_size_t, resource_size_t) | alignf, | ||
void * | alignf_data | ||
) |
allocate_resource - allocate empty slot in the resource tree given range & alignment. The resource will be reallocated with a new size if it was already allocated : root resource descriptor : resource descriptor desired by caller : requested resource region size : minimum boundary to allocate : maximum boundary to allocate : alignment requested, in bytes : alignment function, optional, called if not NULL : arbitrary data to pass to the function
Definition at line 526 of file resource.c.
Definition at line 38 of file resource.c.
insert_resource - Inserts a resource in the resource tree : parent of the new resource : new resource to insert
Returns 0 on success, -EBUSY if the resource can't be inserted.
Definition at line 667 of file resource.c.
insert_resource_conflict - Inserts resource in the resource tree : parent of the new resource : new resource to insert
Returns 0 on success, conflict resource if the resource can't be inserted.
This function is equivalent to request_resource_conflict when no conflict happens. If a conflict happens, and the conflicting resources entirely fit within the range of the new resource, then the new resource is inserted and the conflicting resources become children of the new resource.
Definition at line 650 of file resource.c.
insert_resource_expand_to_fit - Insert a resource into the resource tree : root resource descriptor : new resource to insert
Insert a resource into the resource tree, possibly expanding it in order to make it encompass any conflicting resources.
Definition at line 683 of file resource.c.
Definition at line 1166 of file resource.c.
int iomem_map_sanity_check | ( | resource_size_t | addr, |
unsigned long | size | ||
) |
Definition at line 1113 of file resource.c.
|
read |
lookup_resource - find an existing resource by a resource start address : root resource descriptor : resource start address
Returns a pointer to the resource if found, NULL otherwise
Definition at line 570 of file resource.c.
Definition at line 225 of file resource.c.
release_resource - release a previously reserved resource : resource pointer
Definition at line 270 of file resource.c.
request_resource - request and reserve an I/O or memory resource : root resource descriptor : resource descriptor desired by caller
Returns 0 for success, negative error code on error.
Definition at line 256 of file resource.c.
request_resource_conflict - request and reserve an I/O or memory resource : root resource descriptor : resource descriptor desired by caller
Returns 0 for success, conflict resource on error.
Definition at line 239 of file resource.c.
void reserve_region_with_split | ( | struct resource * | root, |
resource_size_t | start, | ||
resource_size_t | end, | ||
const char * | name | ||
) |
Definition at line 818 of file resource.c.
resource_size_t resource_alignment | ( | struct resource * | res | ) |
resource_alignment - calculate resource's alignment : resource pointer
Returns alignment on success, 0 (invalid alignment) on failure.
Definition at line 853 of file resource.c.
Definition at line 35 of file resource.c.
Definition at line 27 of file resource.c.