1# 2# Copyright (c) 2021-2025, Arm Limited. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7# RME_GPT_BITLOCK_BLOCK is the number of 512MB blocks 8# per bit and the value must be power of 2. 9BITLOCK_BLOCK_POWER_2=$(shell echo $$(( ${RME_GPT_BITLOCK_BLOCK} & (${RME_GPT_BITLOCK_BLOCK} - 1) ))) 10 11# Process RME_GPT_BITLOCK_BLOCK value 12ifneq (${BITLOCK_BLOCK_POWER_2}, 0) 13 $(error "RME_GPT_BITLOCK_BLOCK must be power of 2. Invalid value ${RME_GPT_BITLOCK_BLOCK}.") 14endif 15 16ifeq (${RME_GPT_BITLOCK_BLOCK},0) 17 $(info "GPT library uses global spinlock") 18endif 19 20# Process the maximum size of supported contiguous blocks 21# RME_GPT_MAX_BLOCK 22ifeq ($(filter 0 2 32 512, ${RME_GPT_MAX_BLOCK}),) 23 $(error "Invalid value for RME_GPT_MAX_BLOCK: ${RME_GPT_MAX_BLOCK}") 24endif 25 26GPT_LIB_SRCS := $(addprefix lib/gpt_rme/, \ 27 gpt_rme.c) 28