Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ predicate void ByteV (pointer virt, u8 the_value)
return;
}

// predicate (u8) NewByteV (pointer virt)
// {
// take B = Owned<char>(virt);
// // assert (B == the_value);
// return B;
// }

predicate void Page (pointer vbase, boolean guard, u8 order)
{
if (!guard) {
Expand All @@ -308,7 +315,7 @@ predicate void Page (pointer vbase, boolean guard, u8 order)
let vbaseI = (u64) vbase;
// FULM_OPT
take Bytes = each (u64 i; (vbaseI <= i) && (i < (vbaseI + length)))
{Byte(array_shift<char>(NULL, i))};
{Block(array_shift<char>(NULL, i))};
return;
}
}
Expand All @@ -323,7 +330,9 @@ predicate void ZeroPage (pointer vbase, boolean guard, u8 order)
let vbaseI = ((u64) vbase);
// FULM_OPT
take Bytes = each (u64 i; (vbaseI <= i) && (i < (vbaseI + length)))
{ByteV(array_shift<char>(NULL, i), 0u8)};
{RW(array_shift<char>(NULL, i))};
assert (each (u64 i; (vbaseI <= i) && (i < (vbaseI + length)))
{Bytes[i] == 0u8});
return;
}
}
Expand All @@ -335,7 +344,9 @@ predicate void AllocatorPageZeroPart (pointer zero_start, u8 order)
let length = region_length - sizeof<struct list_head>;
// FULM_OPT
take Bytes = each (u64 i; (start <= i) && (i < (start + length)))
{ByteV(array_shift<char>(NULL, i), 0u8)};
{RW(array_shift<char>(NULL, i))};
assert (each (u64 i; (start <= i) && (i < (start + length)))
{Bytes[i] == 0u8});
return;
}

Expand Down
5 changes: 4 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ $CC -g -c -O0 -std=gnu11 -I$OPAM_SWITCH_PREFIX/lib/cn/runtime/include build/driv
echo "Linking..."
$CC driver.pp.exec.o $OPAM_SWITCH_PREFIX/lib/cn/runtime/libcn_exec.a -L $OPAM_SWITCH_PREFIX/lib/cn/runtime -lcn_exec -o driver.exe
echo "Running..."
./driver.exe
for i in $(seq 1 10);
do
gtime -f ~%e~%M ./driver.exe
done
echo "Done!"