[Git][ghc/ghc][wip/dcoutts/io-manager-io-primop-exceptions] 2 commits: FIXUP: try to fix wasm symbol type for ghc_hs_iface
Duncan Coutts pushed to branch wip/dcoutts/io-manager-io-primop-exceptions at Glasgow Haskell Compiler / GHC Commits: 6fbe14e1 by Duncan Coutts at 2026-09-01T15:30:54+01:00 FIXUP: try to fix wasm symbol type for ghc_hs_iface - - - - - 7f15ba30 by Duncan Coutts at 2026-09-01T15:31:22+01:00 EXPERIMENT: try forward declaring shared helper and switch style to handle the result of I/O manager ccalls, so that we can reuse it more with other I/O primops. - - - - - 2 changed files: - rts/HeapStackCheck.cmm - rts/PrimOps.cmm Changes: ===================================== rts/HeapStackCheck.cmm ===================================== @@ -20,6 +20,7 @@ import ReleaseSRWLockExclusives; #if !defined(UnregisterisedCompiler) import CLOSURE g0; import CLOSURE large_alloc_lim; +import CLOSURE ghc_hs_iface; import CLOSURE stg_MSG_THROWTO_info; import CLOSURE stg_MVAR_DIRTY_info; import CLOSURE stg_WHITEHOLE_info; ===================================== rts/PrimOps.cmm ===================================== @@ -2297,7 +2297,31 @@ stg_whereFromzh (P_ clos, W_ buf) Thread I/O blocking primitives -------------------------------------------------------------------------- */ -stg_waitReadyFd ( W_ fd, CInt rw ) +import stg_handleIOSubmitResult; // Forward decl + +stg_waitReadzh ( W_ fd ) +{ + CInt result; + + (result) = ccall syncIOWaitReady(Capability_iomgr(MyCapability()) "ptr", + CurrentTSO "ptr", + /* IORead */ 0::CInt, fd); + + jump stg_handleIOSubmitResult(result); +} + +stg_waitWritezh ( W_ fd ) +{ + CInt result; + + (result) = ccall syncIOWaitReady(Capability_iomgr(MyCapability()) "ptr", + CurrentTSO "ptr", + /* IOWrite */ 1::CInt, fd); + + jump stg_handleIOSubmitResult(result); +} + +stg_handleIOSubmitResult ( W_ fd, CInt rw ) { CInt result; @@ -2313,7 +2337,7 @@ stg_waitReadyFd ( W_ fd, CInt rw ) } /* case IOSubmitResultSyncSuccess*/ - if (result == 1::CInt) { + if (result == 1::CInt) (likely: True) { /* Success, don't even go via scheduler. */ return (); } @@ -2336,16 +2360,6 @@ stg_waitReadyFd ( W_ fd, CInt rw ) ccall sbarf("syncIOWaitReady result encoding error") never returns; } -stg_waitReadzh ( W_ fd ) -{ - jump stg_waitReadyFd(fd, /* IORead */ 0::CInt); -} - -stg_waitWritezh ( W_ fd ) -{ - jump stg_waitReadyFd(fd, /* IOWrite */ 1::CInt); -} - stg_delayzh ( W_ us_delay ) { CBool ok; /* Ok, or heap alloc failure. */ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c10ec9432fd7d06aece3be9e7cd0b69... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c10ec9432fd7d06aece3be9e7cd0b69... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Duncan Coutts (@dcoutts)