lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
/*
 * Returns 1 if the provided granule size is supported, 0 otherwise.
 */
Returns 1 if the provided granule size is supported, 0 otherwise.
Returns 1 if the provided granule size is supported 0 otherwise .
int xlat_arch_is_granule_size_supported(size_t size)
{
	u_register_t id_aa64mmfr0_el1 = read_id_aa64mmfr0_el1();
	if (size == PAGE_SIZE_4KB) {
		return (((id_aa64mmfr0_el1 >> ID_AA64MMFR0_EL1_TGRAN4_SHIFT) &
			 ID_AA64MMFR0_EL1_TGRAN4_MASK) ==
			 ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED) ? 1 : 0;
	} else if (size == PAGE_SIZE_16KB) {
		return (((id_aa64mmfr0_el1 >> ID_AA64MMFR0_EL1_TGRAN16_SHIFT) &
			 ID_AA64MMFR0_EL1_TGRAN16_MASK) ==
			 ID_AA64MMFR0_EL1_TGRAN16_SUPPORTED) ? 1 : 0;
	} else if (size == PAGE_SIZE_64KB) {
		return (((id_aa64mmfr0_el1 >> ID_AA64MMFR0_EL1_TGRAN64_SHIFT) &
			 ID_AA64MMFR0_EL1_TGRAN64_MASK) ==
			 ID_AA64MMFR0_EL1_TGRAN64_SUPPORTED) ? 1 : 0;
	} else {
		return 0;
	}
}
int xlat_arch_is_granule_size_supported ( size_t size ) { u_register_t id_aa64mmfr0_el1 = read_id_aa64mmfr0_el1 ( ) ; if ( size == PAGE_SIZE_4KB ) { return ( ( ( id_aa64mmfr0_el1 >> ID_AA64MMFR0_EL1_TGRAN4_SHIFT ) & ID_AA64MMFR0_EL1_TGRAN4_MASK ) == ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED ) ? 1 : 0 ; } else if ( size == PAGE_SIZE_16KB ) { return ( ( ( id_aa64mmfr0_el1 >> ID_AA64MMFR0_EL1_TGRAN16_SHIFT ) & ID_AA64MMFR0_EL1_TGRAN16_MASK ) == ID_AA64MMFR0_EL1_TGRAN16_SUPPORTED ) ? 1 : 0 ; } else if ( size == PAGE_SIZE_64KB ) { return ( ( ( id_aa64mmfr0_el1 >> ID_AA64MMFR0_EL1_TGRAN64_SHIFT ) & ID_AA64MMFR0_EL1_TGRAN64_MASK ) == ID_AA64MMFR0_EL1_TGRAN64_SUPPORTED ) ? 1 : 0 ; } else { return 0 ; } }
Returns 1 if the provided granule size is supported, 0 otherwise.
Returns 1 if the provided granule size is supported 0 otherwise .