not to perform redundant work. There is no direct way to flush the
cache; rather, the kernel evicts unwanted bits from the cache by
executing a block of instructions, which is expensive.
With this diff, make build time decreases about 0.4%.
Diff from miod@
-/* $OpenBSD: cache_tfp.c,v 1.6 2016/01/05 05:27:54 visa Exp $ */
+/* $OpenBSD: cache_tfp.c,v 1.7 2017/06/22 14:40:20 visa Exp $ */
/*
* Copyright (c) 2012 Miodrag Vallat.
vsize_t sz;
void (*inval_subr)(vsize_t);
+ if (ci->ci_cachepending_l1i != 0)
+ return;
+
if (_sz >= ci->ci_l1inst.size) {
- tfp_inval_icache(ci->ci_l1inst.size);
- ci->ci_cachepending_l1i = 0;
+ ci->ci_cachepending_l1i = 1;
} else {
/* extend the range to multiple of 32 bytes */
va = _va & ~(32UL - 1);