Linux Kernel
3.7.1
|
#include <linux/export.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/sched.h>
#include <linux/seq_file.h>
#include <linux/device.h>
#include <linux/pfn.h>
#include <asm/io.h>
Go to the source code of this file.
Data Structures | |
struct | resource_constraint |
struct | region_devres |
Macros | |
#define | pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
Variables | |
struct resource | ioport_resource |
struct resource | iomem_resource |
#define MAXRESERVE 4 |
Definition at line 1079 of file resource.c.
Definition at line 10 of file resource.c.
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.
__setup | ( | ) |
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 370 of file resource.c.
EXPORT_SYMBOL | ( | ioport_resource | ) |
EXPORT_SYMBOL | ( | iomem_resource | ) |
EXPORT_SYMBOL | ( | request_resource | ) |
EXPORT_SYMBOL | ( | release_resource | ) |
EXPORT_SYMBOL | ( | allocate_resource | ) |
EXPORT_SYMBOL | ( | adjust_resource | ) |
EXPORT_SYMBOL | ( | __request_region | ) |
EXPORT_SYMBOL | ( | __check_region | ) |
EXPORT_SYMBOL | ( | __release_region | ) |
EXPORT_SYMBOL | ( | __devm_request_region | ) |
EXPORT_SYMBOL | ( | __devm_release_region | ) |
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 365 of file resource.c.
int reallocate_resource | ( | struct resource * | root, |
struct resource * | old, | ||
resource_size_t | newsize, | ||
struct resource_constraint * | constraint | ||
) |
reallocate_resource - allocate a slot in the resource tree given range & alignment. The resource will be relocated if the new size cannot be reallocated in the current location.
: root resource descriptor : resource descriptor desired by caller : new size of the resource descriptor : the size and alignment constraints to be met.
Definition at line 475 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 __init 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.
int walk_system_ram_range | ( | unsigned long | start_pfn, |
unsigned long | nr_pages, | ||
void * | arg, | ||
int(*)(unsigned long, unsigned long, void *) | func | ||
) |
Definition at line 329 of file resource.c.
Definition at line 35 of file resource.c.
Definition at line 27 of file resource.c.