+
+/* Sets the wildcard mask for register 'idx' in 'wc' to 'mask'.
+ * (A 0-bit indicates a wildcard bit.) */
+void
+flow_wildcards_set_reg_mask(struct flow_wildcards *wc, int idx, uint32_t mask)
+{
+ if (mask != wc->reg_masks[idx]) {
+ wc->reg_masks[idx] = mask;
+ if (mask != UINT32_MAX) {
+ wc->wildcards |= FWW_REGS;
+ } else {
+ int i;
+
+ for (i = 0; i < FLOW_N_REGS; i++) {
+ if (wc->reg_masks[i] != UINT32_MAX) {
+ wc->wildcards |= FWW_REGS;
+ return;
+ }
+ }
+ wc->wildcards &= ~FWW_REGS;
+ }
+ }
+}