From 15b54482241083d52b6e9857a66fecbf915d467d Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 8 Jun 2023 20:05:18 +0200 Subject: cooker: Full support for flags and masks, assorted fixes Signed-off-by: Stefano Brivio --- cooker/example.hjson | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'cooker/example.hjson') diff --git a/cooker/example.hjson b/cooker/example.hjson index 9e08163..458961c 100644 --- a/cooker/example.hjson +++ b/cooker/example.hjson @@ -44,30 +44,36 @@ ] /* - * INTFLAGS, LONGFLAGS, U32FLAGS + * FLAGS * - * "field": { "in": [ "ipc", "mount", "uts" ] } + * "field": { "some": [ "ipc", "mount", "uts" ] } * flags & set * !!(flags & (ipc | mount | ns)) + * OP_BITWISE field AND set + * OP_CMP result EQ 0 -> next match * * "field": { "all": [ "ipc", "mount", "uts" ] } * flags & set == set * flags & (ipc | mount | ns) == (ipc | mount | ns) + * OP_BITWISE field AND set + * OP_CMP result NE set -> next match * - * "field": { "not": [ "ipc", "mount", "uts" ] } + * "field": { "none": [ "ipc", "mount", "uts" ] } * !(flags & set) + * OP_BITWISE field AND set + * OP_CMP result NE 0 -> next match * - * "field": { "ipc": false, "mount": true, "uts": false } - * flags & set == set - * !(flags & ipc) && (flags & mount) && !(flags & utc) + * "field": { [ "ipc", "mount", "uts" ] } + * flags == set + * flags == (ipc | mount | ns) * - * "field": { "ipc" } + * "field": "ipc" * flags == ipc * - * INTMASK + * MASK * value = (target value & known values) * - * INT, LONG, U32 + * NUMBERS * "arg": { "in": [ 0, 1 ] } * arg == 0 || arg == 1 */ -- cgit v1.2.3