Tested with my FEX windows port by setting cpsr bits before rethrowing an exception and observing the resulting eflags in an x86 program with an exception filter. There are no additional mappings (though this could be extended using reserved bits to pass through pf/af)
From: Billy Laws blaws05@gmail.com
--- dlls/ntdll/unwind.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/ntdll/unwind.h b/dlls/ntdll/unwind.h index 5b29969eb81..faca8a259fb 100644 --- a/dlls/ntdll/unwind.h +++ b/dlls/ntdll/unwind.h @@ -57,6 +57,7 @@ static inline UINT eflags_to_cpsr( UINT eflags ) if (eflags & 0x0001) ret |= 0x20000000; /* carry */ if (eflags & 0x0040) ret |= 0x40000000; /* zero */ if (eflags & 0x0080) ret |= 0x80000000; /* negative */ + if (eflags & 0x0100) ret |= 0x00200000; /* trap */ if (eflags & 0x0800) ret |= 0x10000000; /* overflow */ return ret; } @@ -65,6 +66,7 @@ static inline UINT cpsr_to_eflags( UINT cpsr ) { UINT ret = 0x202;
+ if (cpsr & 0x00200000) ret |= 0x0100; /* trap */ if (cpsr & 0x10000000) ret |= 0x0800; /* overflow */ if (cpsr & 0x20000000) ret |= 0x0001; /* carry */ if (cpsr & 0x40000000) ret |= 0x0040; /* zero */