X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=formal-model%2Fooomem-double-update-minimal%2Fmem.spin;h=bae92d6142422a46e19cafc00a3488dad67ca0f5;hp=9fc540ae67745390c0e5f7000024f129572c9c08;hb=3db2d75b432e617014976239f694b91de2bc0d7d;hpb=4b8839f157982c717e307a2045428d3582185b11 diff --git a/formal-model/ooomem-double-update-minimal/mem.spin b/formal-model/ooomem-double-update-minimal/mem.spin index 9fc540a..bae92d6 100644 --- a/formal-model/ooomem-double-update-minimal/mem.spin +++ b/formal-model/ooomem-double-update-minimal/mem.spin @@ -40,26 +40,6 @@ #define CLEAR_TOKENS(state, bits) \ state = (state) & ~(bits) -/* - * Bit encoding, proc_one_produced : - */ - -#define P1_PROD_NONE (1 << 0) - -#define P1_READ_ONE (1 << 1) -#define P1_RMB (1 << 2) -#define P1_READ_TWO (1 << 3) - -int proc_one_produced; - -#define P2_PROD_NONE (1 << 0) - -#define P2_WRITE_ONE (1 << 1) -#define P2_WMB (1 << 2) -#define P2_WRITE_TWO (1 << 3) - -int proc_two_produced; - #define NR_PROCS 2 #define get_pid() (_pid) @@ -168,6 +148,18 @@ DECLARE_CACHED_VAR(byte, beta, 0); byte read_one = 2; byte read_two = 2; +/* + * Bit encoding, proc_one_produced : + */ + +#define P1_PROD_NONE (1 << 0) + +#define P1_READ_ONE (1 << 1) +#define P1_RMB (1 << 2) +#define P1_READ_TWO (1 << 3) + +int proc_one_produced; + active proctype test_proc_one() { assert(get_pid() < NR_PROCS); @@ -203,6 +195,19 @@ active proctype test_proc_one() assert(read_one != 1 || read_two == 1); } + +/* + * Bit encoding, proc_two_produced : + */ + +#define P2_PROD_NONE (1 << 0) + +#define P2_WRITE_ONE (1 << 1) +#define P2_WMB (1 << 2) +#define P2_WRITE_TWO (1 << 3) + +int proc_two_produced; + active proctype test_proc_two() { assert(get_pid() < NR_PROCS);