diff options
Diffstat (limited to 'include/linux/ioport.h')
-rw-r--r-- | include/linux/ioport.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index cd6bd001ba4e..87a9fc039b47 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -9,13 +9,15 @@ | |||
9 | #define _LINUX_IOPORT_H | 9 | #define _LINUX_IOPORT_H |
10 | 10 | ||
11 | #include <linux/compiler.h> | 11 | #include <linux/compiler.h> |
12 | #include <linux/types.h> | ||
12 | /* | 13 | /* |
13 | * Resources are tree-like, allowing | 14 | * Resources are tree-like, allowing |
14 | * nesting etc.. | 15 | * nesting etc.. |
15 | */ | 16 | */ |
16 | struct resource { | 17 | struct resource { |
18 | resource_size_t start; | ||
19 | resource_size_t end; | ||
17 | const char *name; | 20 | const char *name; |
18 | unsigned long start, end; | ||
19 | unsigned long flags; | 21 | unsigned long flags; |
20 | struct resource *parent, *sibling, *child; | 22 | struct resource *parent, *sibling, *child; |
21 | }; | 23 | }; |
@@ -96,31 +98,37 @@ extern struct resource * ____request_resource(struct resource *root, struct reso | |||
96 | extern int release_resource(struct resource *new); | 98 | extern int release_resource(struct resource *new); |
97 | extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); | 99 | extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); |
98 | extern int allocate_resource(struct resource *root, struct resource *new, | 100 | extern int allocate_resource(struct resource *root, struct resource *new, |
99 | unsigned long size, | 101 | resource_size_t size, resource_size_t min, |
100 | unsigned long min, unsigned long max, | 102 | resource_size_t max, resource_size_t align, |
101 | unsigned long align, | ||
102 | void (*alignf)(void *, struct resource *, | 103 | void (*alignf)(void *, struct resource *, |
103 | unsigned long, unsigned long), | 104 | resource_size_t, resource_size_t), |
104 | void *alignf_data); | 105 | void *alignf_data); |
105 | int adjust_resource(struct resource *res, unsigned long start, | 106 | int adjust_resource(struct resource *res, resource_size_t start, |
106 | unsigned long size); | 107 | resource_size_t size); |
108 | |||
109 | /* get registered SYSTEM_RAM resources in specified area */ | ||
110 | extern int find_next_system_ram(struct resource *res); | ||
107 | 111 | ||
108 | /* Convenience shorthand with allocation */ | 112 | /* Convenience shorthand with allocation */ |
109 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 113 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) |
110 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) | 114 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) |
111 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) | 115 | #define rename_region(region, newname) do { (region)->name = (newname); } while (0) |
112 | 116 | ||
113 | extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name); | 117 | extern struct resource * __request_region(struct resource *, |
118 | resource_size_t start, | ||
119 | resource_size_t n, const char *name); | ||
114 | 120 | ||
115 | /* Compatibility cruft */ | 121 | /* Compatibility cruft */ |
116 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) | 122 | #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) |
117 | #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) | 123 | #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) |
118 | #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) | 124 | #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) |
119 | 125 | ||
120 | extern int __check_region(struct resource *, unsigned long, unsigned long); | 126 | extern int __check_region(struct resource *, resource_size_t, resource_size_t); |
121 | extern void __release_region(struct resource *, unsigned long, unsigned long); | 127 | extern void __release_region(struct resource *, resource_size_t, |
128 | resource_size_t); | ||
122 | 129 | ||
123 | static inline int __deprecated check_region(unsigned long s, unsigned long n) | 130 | static inline int __deprecated check_region(resource_size_t s, |
131 | resource_size_t n) | ||
124 | { | 132 | { |
125 | return __check_region(&ioport_resource, s, n); | 133 | return __check_region(&ioport_resource, s, n); |
126 | } | 134 | } |