Skip to content

Commit

Permalink
Pate.AArch32: add fread stub and fix fwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Sep 27, 2023
1 parent ebc82c8 commit 8d5e5fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/Pate/AArch32.hs
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,14 @@ stubOverrides = PA.ArchStubOverrides (PA.mkDefaultStubOverride "__pate_stub" r0
, ("realloc", PA.mkMallocOverride r0 r0)
, ("clock", PA.mkClockOverride r0)
, ("write", PA.mkWriteOverride "write" r0 r1 r2 r0)
-- FIXME: fixup arguments for fwrite
, ("fwrite", PA.mkWriteOverride "fwrite" r0 r1 r2 r0)
-- FIXME: fixup arguments for fwrite (len = size * nmemb)
, ("fwrite", PA.mkWriteOverride "fwrite" r3 r0 r1 r0)
, ("printf", PA.mkObservableOverride "printf" r0 r1)
, ("puts", PA.mkObservableOverride "puts" r0 r0)
-- fixme: double check this
, ("ceilf", PA.mkDefaultStubOverrideArg "ceilf" [Some v0] r0)
-- FIXME: check abi for args
, ("fread", PA.mkDefaultStubOverrideArg "fread" [Some r0, Some r1, Some r2, Some r4] r0)
-- FIXME: default stubs below here
] ++
(map mkDefault $
Expand Down Expand Up @@ -296,6 +298,8 @@ stubOverrides = PA.ArchStubOverrides (PA.mkDefaultStubOverride "__pate_stub" r0
r0 = ARMReg.ARMGlobalBV (ASL.knownGlobalRef @"_R0")
r1 = ARMReg.ARMGlobalBV (ASL.knownGlobalRef @"_R1")
r2 = ARMReg.ARMGlobalBV (ASL.knownGlobalRef @"_R2")
r3 = ARMReg.ARMGlobalBV (ASL.knownGlobalRef @"_R3")
r4 = ARMReg.ARMGlobalBV (ASL.knownGlobalRef @"_R4")

v0 = ARMReg.ARMGlobalBV (ASL.knownGlobalRef @"_V0")
v1 = ARMReg.ARMGlobalBV (ASL.knownGlobalRef @"_V1")
Expand Down

0 comments on commit 8d5e5fa

Please sign in to comment.