resource: add resource_type() and IORESOURCE_TYPE_BITS