Source/Packages

Runtime.NativeDescriptor

packages/execution/src/Runtime/NativeDescriptor.alpha

80 lines3 declarations3.4 KiBSHA-256 ac2abacc0cb3

def · lines 13–54

nativeDescriptorStatusAssembly

Full file
Admit a Linux descriptor-returning syscall result: [0, INT_MAX] succeeds; negative kernel errors survive unchanged, oversized positive words fail. This does not test whether an arbitrary integer names an open descriptor.
13def nativeDescriptorStatusAssembly =
14  (nativePhysicalNativeEmit
15    (nativePhysicalNativeMove
16      (constructor X86NativeRegister64 X86NativeRDI)
17      (constructor X86NativeRegister64 X86NativeRAX))
18    (nativePhysicalNativeEmit
19      (nativePhysicalNativeTest
20        (constructor X86NativeRegister64 X86NativeRAX)
21        (constructor X86NativeRegister64 X86NativeRAX))
22      (nativePhysicalNativeJumpCondition
23        (constructor X86NativeCondition X86NativeConditionSign)
24        b"descriptor-return"
25        (nativePhysicalNativeEmit
26          (nativePhysicalNativeCompareImmediate
27            (constructor X86NativeRegister64 X86NativeRAX)
28            (x86NativeImmediate32FromNatural 2147483647))
29          (nativePhysicalNativeJumpCondition
30            (constructor X86NativeCondition X86NativeConditionAbove)
31            b"descriptor-invalid"
32            (nativePhysicalNativeEmit
33              (constructor
34                X86NativeInstruction
35                X86NativeClear32
36                (constructor X86NativeRegister64 X86NativeRAX))
37              (nativePhysicalNativeJump
38                b"descriptor-return"
39                (nativePhysicalNativeLabel
40                  b"descriptor-invalid"
41                  (nativePhysicalNativeEmit
42                    (constructor
43                      X86NativeInstruction
44                      X86NativeClear32
45                      (constructor X86NativeRegister64 X86NativeRAX))
46                    (nativePhysicalNativeEmit
47                      (nativePhysicalNativeAddImmediate
48                        (constructor X86NativeRegister64 X86NativeRAX)
49                        (x86NativeImmediate32FromNatural (naturalSaturatingSubtract 4294967296 22)))
50                      (nativePhysicalNativeLabel
51                        b"descriptor-return"
52                        (nativePhysicalNativeEmit
53                          nativePhysicalNativeReturnInstruction
54                          (constructor X86NativeAssembly X86NativeAssemblyEnd)))))))))))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.