]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/ioport.h
include/linux/syscalls.h: add sys_renameat2() prototype
[karo-tx-linux.git] / include / linux / ioport.h
index 89b7c24a36e9fd7a8af6fea77bf7986507e86c65..5e3a906cc089a721eaacdf390e3e30927fd37434 100644 (file)
@@ -51,7 +51,7 @@ struct resource {
 
 #define IORESOURCE_EXCLUSIVE   0x08000000      /* Userland may not map this resource */
 #define IORESOURCE_DISABLED    0x10000000
-#define IORESOURCE_UNSET       0x20000000
+#define IORESOURCE_UNSET       0x20000000      /* No address assigned yet */
 #define IORESOURCE_AUTO                0x40000000
 #define IORESOURCE_BUSY                0x80000000      /* Driver has marked this resource busy */
 
@@ -169,6 +169,16 @@ static inline unsigned long resource_type(const struct resource *res)
 {
        return res->flags & IORESOURCE_TYPE_BITS;
 }
+/* True iff r1 completely contains r2 */
+static inline bool resource_contains(struct resource *r1, struct resource *r2)
+{
+       if (resource_type(r1) != resource_type(r2))
+               return false;
+       if (r1->flags & IORESOURCE_UNSET || r2->flags & IORESOURCE_UNSET)
+               return false;
+       return r1->start <= r2->start && r1->end >= r2->end;
+}
+
 
 /* Convenience shorthand with allocation */
 #define request_region(start,n,name)           __request_region(&ioport_resource, (start), (n), (name), 0)