/* Note that the resulting size also contains bytes needed for alignment padding as well as padding to ensure that data structures don't cross a 4k-boundary where required.  */
size_t itcw_calc_size(int intrg, int max_tidaws, int intrg_max_tidaws)
/* Note that the resulting size also contains bytes needed for alignment padding as well as padding to ensure that data structures don't cross a 4k-boundary where required.  */
size_t itcw_calc_size(int intrg, int max_tidaws, int intrg_max_tidaws)
{
	size_t len;
	len = sizeof(struct itcw);
	len += sizeof(struct tcw) + TCCB_MAX_SIZE + sizeof(struct tsb) + max_tidaws * sizeof(struct tidaw);
	if (intrg) {
		len += sizeof(struct tcw) + TCCB_MAX_SIZE + sizeof(struct tsb) + intrg_max_tidaws * sizeof(struct tidaw);
	}
	len += 63 + 7;
	if ((max_tidaws > 0) || (intrg_max_tidaws > 0))
		len += max(max_tidaws, intrg_max_tidaws) *
		       sizeof(struct tidaw) - 1;
	return len;
}