| .. | .. |
|---|
| 12 | 12 | #ifndef __ASSEMBLY__ |
|---|
| 13 | 13 | #include <linux/compiler.h> |
|---|
| 14 | 14 | #include <linux/types.h> |
|---|
| 15 | +#include <linux/bits.h> |
|---|
| 15 | 16 | #include <linux/android_kabi.h> |
|---|
| 16 | 17 | /* |
|---|
| 17 | 18 | * Resources are tree-like, allowing |
|---|
| .. | .. |
|---|
| 62 | 63 | |
|---|
| 63 | 64 | #define IORESOURCE_EXT_TYPE_BITS 0x01000000 /* Resource extended types */ |
|---|
| 64 | 65 | #define IORESOURCE_SYSRAM 0x01000000 /* System RAM (modifier) */ |
|---|
| 66 | + |
|---|
| 67 | +/* IORESOURCE_SYSRAM specific bits. */ |
|---|
| 68 | +#define IORESOURCE_SYSRAM_DRIVER_MANAGED 0x02000000 /* Always detected via a driver. */ |
|---|
| 69 | +#define IORESOURCE_SYSRAM_MERGEABLE 0x04000000 /* Resource can be merged. */ |
|---|
| 65 | 70 | |
|---|
| 66 | 71 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ |
|---|
| 67 | 72 | |
|---|
| .. | .. |
|---|
| 138 | 143 | IORES_DESC_PERSISTENT_MEMORY = 4, |
|---|
| 139 | 144 | IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5, |
|---|
| 140 | 145 | IORES_DESC_DEVICE_PRIVATE_MEMORY = 6, |
|---|
| 141 | | - IORES_DESC_DEVICE_PUBLIC_MEMORY = 7, |
|---|
| 146 | + IORES_DESC_RESERVED = 7, |
|---|
| 147 | + IORES_DESC_SOFT_RESERVED = 8, |
|---|
| 148 | +}; |
|---|
| 149 | + |
|---|
| 150 | +/* |
|---|
| 151 | + * Flags controlling ioremap() behavior. |
|---|
| 152 | + */ |
|---|
| 153 | +enum { |
|---|
| 154 | + IORES_MAP_SYSTEM_RAM = BIT(0), |
|---|
| 155 | + IORES_MAP_ENCRYPTED = BIT(1), |
|---|
| 142 | 156 | }; |
|---|
| 143 | 157 | |
|---|
| 144 | 158 | /* helpers to define resources */ |
|---|
| .. | .. |
|---|
| 243 | 257 | extern void __release_region(struct resource *, resource_size_t, |
|---|
| 244 | 258 | resource_size_t); |
|---|
| 245 | 259 | #ifdef CONFIG_MEMORY_HOTREMOVE |
|---|
| 246 | | -extern int release_mem_region_adjustable(struct resource *, resource_size_t, |
|---|
| 247 | | - resource_size_t); |
|---|
| 260 | +extern void release_mem_region_adjustable(resource_size_t, resource_size_t); |
|---|
| 261 | +#endif |
|---|
| 262 | +#ifdef CONFIG_MEMORY_HOTPLUG |
|---|
| 263 | +extern void merge_system_ram_resource(struct resource *res); |
|---|
| 248 | 264 | #endif |
|---|
| 249 | 265 | |
|---|
| 250 | 266 | /* Wrappers for managed devices */ |
|---|
| .. | .. |
|---|
| 292 | 308 | return (r1->start <= r2->end && r1->end >= r2->start); |
|---|
| 293 | 309 | } |
|---|
| 294 | 310 | |
|---|
| 311 | +struct resource *devm_request_free_mem_region(struct device *dev, |
|---|
| 312 | + struct resource *base, unsigned long size); |
|---|
| 313 | +struct resource *request_free_mem_region(struct resource *base, |
|---|
| 314 | + unsigned long size, const char *name); |
|---|
| 315 | + |
|---|
| 316 | +#ifdef CONFIG_IO_STRICT_DEVMEM |
|---|
| 317 | +void revoke_devmem(struct resource *res); |
|---|
| 318 | +#else |
|---|
| 319 | +static inline void revoke_devmem(struct resource *res) { }; |
|---|
| 320 | +#endif |
|---|
| 295 | 321 | |
|---|
| 296 | 322 | #endif /* __ASSEMBLY__ */ |
|---|
| 297 | 323 | #endif /* _LINUX_IOPORT_H */ |
|---|