├── .gitignore ├── .gitmodules ├── Applications ├── AcpiDump │ ├── AcpiDump.c │ ├── AcpiDump.inf │ └── README.md ├── AcpiLoader │ ├── AcpiLoader.c │ ├── AcpiLoader.inf │ ├── AcpiSupport.c │ ├── AcpiSupport.h │ └── README.md ├── FdtDump │ ├── FdtDump.c │ ├── FdtDump.inf │ └── README.md ├── GdbSyms │ ├── GdbSyms.c │ └── GdbSyms.inf ├── GopTool │ ├── GopTool.c │ ├── GopTool.inf │ └── README.md ├── MemResv │ ├── MemResv.c │ ├── MemResv.inf │ └── README.md ├── PciRom │ ├── PciRom.c │ ├── PciRom.inf │ └── README.md ├── RangeIsMapped │ ├── README.md │ ├── RangeIsMapped.c │ └── RangeIsMapped.inf ├── SetCon │ ├── README.md │ ├── SetCon.c │ └── SetCon.inf ├── ShellErrVars │ ├── README.md │ ├── ShellErrVars.c │ └── ShellErrVars.inf ├── ShellMapVar │ ├── README.md │ ├── ShellMapVar.c │ └── ShellMapVar.inf ├── ShellPlatVars │ ├── README.md │ ├── ShellPlatVars.c │ └── ShellPlatVars.inf ├── cat │ ├── README.md │ ├── cat.c │ └── cat.inf ├── dd │ ├── README.md │ ├── args.c │ ├── conv.c │ ├── conv_tab.c │ ├── dd.c │ ├── dd.h │ ├── dd.inf │ ├── extern.h │ ├── misc.c │ └── position.c ├── grep │ ├── README.md │ ├── fastgrep.c │ ├── file.c │ ├── grep.c │ ├── grep.h │ ├── grep.inf │ ├── queue.c │ ├── queue.h │ └── util.c ├── ls │ ├── README.md │ ├── cmp.c │ ├── extern.h │ ├── ls.c │ ├── ls.h │ ├── ls.inf │ └── print.c └── stat │ ├── README.md │ ├── stat.c │ └── stat.inf ├── Drivers └── QemuVideoDxe │ ├── ComponentName.c │ ├── Driver.c │ ├── DriverSupportedEfiVersion.c │ ├── Gop.c │ ├── Initialize.c │ ├── Qemu.h │ ├── QemuVideoDxe.inf │ ├── README.md │ ├── UnalignedIoGcc.c │ ├── UnalignedIoIcc.c │ ├── UnalignedIoInternal.h │ ├── UnalignedIoMsc.c │ ├── UnalignedIoUnsupported.c │ ├── VbeShim.asm │ ├── VbeShim.c │ ├── VbeShim.h │ └── VbeShim.sh ├── Include └── Library │ ├── FTSLib.h │ ├── RegexLib.h │ ├── SoftFloatLib.h │ ├── StdExtLib.h │ └── UtilsLib.h ├── Library ├── FTSLib │ ├── FTSLib.inf │ ├── README.md │ └── fts.c ├── RegexLib │ ├── COPYRIGHT │ ├── README.md │ ├── RegexLib.inf │ ├── cclass.h │ ├── cname.h │ ├── engine.c │ ├── regcomp.c │ ├── regerror.c │ ├── regex2.h │ ├── regexec.c │ ├── regfree.c │ ├── regsub.c │ └── utils.h ├── SoftFloatLib │ ├── AArch64 │ │ └── bindings.c │ ├── README.md │ ├── SoftFloat-3d │ │ ├── COPYING.txt │ │ ├── README.html │ │ ├── README.txt │ │ ├── build │ │ │ ├── Linux-386-GCC │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ │ ├── Linux-386-SSE2-GCC │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ │ ├── Linux-x86_64-GCC │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ │ ├── Win32-MinGW │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ │ ├── Win32-SSE2-MinGW │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ │ ├── Win64-MinGW-w64 │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ │ ├── template-FAST_INT64 │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ │ └── template-not-FAST_INT64 │ │ │ │ ├── Makefile │ │ │ │ └── platform.h │ │ ├── doc │ │ │ ├── SoftFloat-history.html │ │ │ ├── SoftFloat-source.html │ │ │ └── SoftFloat.html │ │ └── source │ │ │ ├── 8086 │ │ │ ├── extF80M_isSignalingNaN.c │ │ │ ├── f128M_isSignalingNaN.c │ │ │ ├── s_commonNaNToExtF80M.c │ │ │ ├── s_commonNaNToExtF80UI.c │ │ │ ├── s_commonNaNToF128M.c │ │ │ ├── s_commonNaNToF128UI.c │ │ │ ├── s_commonNaNToF16UI.c │ │ │ ├── s_commonNaNToF32UI.c │ │ │ ├── s_commonNaNToF64UI.c │ │ │ ├── s_extF80MToCommonNaN.c │ │ │ ├── s_extF80UIToCommonNaN.c │ │ │ ├── s_f128MToCommonNaN.c │ │ │ ├── s_f128UIToCommonNaN.c │ │ │ ├── s_f16UIToCommonNaN.c │ │ │ ├── s_f32UIToCommonNaN.c │ │ │ ├── s_f64UIToCommonNaN.c │ │ │ ├── s_propagateNaNExtF80M.c │ │ │ ├── s_propagateNaNExtF80UI.c │ │ │ ├── s_propagateNaNF128M.c │ │ │ ├── s_propagateNaNF128UI.c │ │ │ ├── s_propagateNaNF16UI.c │ │ │ ├── s_propagateNaNF32UI.c │ │ │ ├── s_propagateNaNF64UI.c │ │ │ ├── softfloat_raiseFlags.c │ │ │ └── specialize.h │ │ │ ├── 8086-SSE │ │ │ ├── extF80M_isSignalingNaN.c │ │ │ ├── f128M_isSignalingNaN.c │ │ │ ├── s_commonNaNToExtF80M.c │ │ │ ├── s_commonNaNToExtF80UI.c │ │ │ ├── s_commonNaNToF128M.c │ │ │ ├── s_commonNaNToF128UI.c │ │ │ ├── s_commonNaNToF16UI.c │ │ │ ├── s_commonNaNToF32UI.c │ │ │ ├── s_commonNaNToF64UI.c │ │ │ ├── s_extF80MToCommonNaN.c │ │ │ ├── s_extF80UIToCommonNaN.c │ │ │ ├── s_f128MToCommonNaN.c │ │ │ ├── s_f128UIToCommonNaN.c │ │ │ ├── s_f16UIToCommonNaN.c │ │ │ ├── s_f32UIToCommonNaN.c │ │ │ ├── s_f64UIToCommonNaN.c │ │ │ ├── s_propagateNaNExtF80M.c │ │ │ ├── s_propagateNaNExtF80UI.c │ │ │ ├── s_propagateNaNF128M.c │ │ │ ├── s_propagateNaNF128UI.c │ │ │ ├── s_propagateNaNF16UI.c │ │ │ ├── s_propagateNaNF32UI.c │ │ │ ├── s_propagateNaNF64UI.c │ │ │ ├── softfloat_raiseFlags.c │ │ │ └── specialize.h │ │ │ ├── extF80M_add.c │ │ │ ├── extF80M_div.c │ │ │ ├── extF80M_eq.c │ │ │ ├── extF80M_eq_signaling.c │ │ │ ├── extF80M_le.c │ │ │ ├── extF80M_le_quiet.c │ │ │ ├── extF80M_lt.c │ │ │ ├── extF80M_lt_quiet.c │ │ │ ├── extF80M_mul.c │ │ │ ├── extF80M_rem.c │ │ │ ├── extF80M_roundToInt.c │ │ │ ├── extF80M_sqrt.c │ │ │ ├── extF80M_sub.c │ │ │ ├── extF80M_to_f128M.c │ │ │ ├── extF80M_to_f16.c │ │ │ ├── extF80M_to_f32.c │ │ │ ├── extF80M_to_f64.c │ │ │ ├── extF80M_to_i32.c │ │ │ ├── extF80M_to_i32_r_minMag.c │ │ │ ├── extF80M_to_i64.c │ │ │ ├── extF80M_to_i64_r_minMag.c │ │ │ ├── extF80M_to_ui32.c │ │ │ ├── extF80M_to_ui32_r_minMag.c │ │ │ ├── extF80M_to_ui64.c │ │ │ ├── extF80M_to_ui64_r_minMag.c │ │ │ ├── extF80_add.c │ │ │ ├── extF80_div.c │ │ │ ├── extF80_eq.c │ │ │ ├── extF80_eq_signaling.c │ │ │ ├── extF80_isSignalingNaN.c │ │ │ ├── extF80_le.c │ │ │ ├── extF80_le_quiet.c │ │ │ ├── extF80_lt.c │ │ │ ├── extF80_lt_quiet.c │ │ │ ├── extF80_mul.c │ │ │ ├── extF80_rem.c │ │ │ ├── extF80_roundToInt.c │ │ │ ├── extF80_sqrt.c │ │ │ ├── extF80_sub.c │ │ │ ├── extF80_to_f128.c │ │ │ ├── extF80_to_f16.c │ │ │ ├── extF80_to_f32.c │ │ │ ├── extF80_to_f64.c │ │ │ ├── extF80_to_i32.c │ │ │ ├── extF80_to_i32_r_minMag.c │ │ │ ├── extF80_to_i64.c │ │ │ ├── extF80_to_i64_r_minMag.c │ │ │ ├── extF80_to_ui32.c │ │ │ ├── extF80_to_ui32_r_minMag.c │ │ │ ├── extF80_to_ui64.c │ │ │ ├── extF80_to_ui64_r_minMag.c │ │ │ ├── f128M_add.c │ │ │ ├── f128M_div.c │ │ │ ├── f128M_eq.c │ │ │ ├── f128M_eq_signaling.c │ │ │ ├── f128M_le.c │ │ │ ├── f128M_le_quiet.c │ │ │ ├── f128M_lt.c │ │ │ ├── f128M_lt_quiet.c │ │ │ ├── f128M_mul.c │ │ │ ├── f128M_mulAdd.c │ │ │ ├── f128M_rem.c │ │ │ ├── f128M_roundToInt.c │ │ │ ├── f128M_sqrt.c │ │ │ ├── f128M_sub.c │ │ │ ├── f128M_to_extF80M.c │ │ │ ├── f128M_to_f16.c │ │ │ ├── f128M_to_f32.c │ │ │ ├── f128M_to_f64.c │ │ │ ├── f128M_to_i32.c │ │ │ ├── f128M_to_i32_r_minMag.c │ │ │ ├── f128M_to_i64.c │ │ │ ├── f128M_to_i64_r_minMag.c │ │ │ ├── f128M_to_ui32.c │ │ │ ├── f128M_to_ui32_r_minMag.c │ │ │ ├── f128M_to_ui64.c │ │ │ ├── f128M_to_ui64_r_minMag.c │ │ │ ├── f128_add.c │ │ │ ├── f128_div.c │ │ │ ├── f128_eq.c │ │ │ ├── f128_eq_signaling.c │ │ │ ├── f128_isSignalingNaN.c │ │ │ ├── f128_le.c │ │ │ ├── f128_le_quiet.c │ │ │ ├── f128_lt.c │ │ │ ├── f128_lt_quiet.c │ │ │ ├── f128_mul.c │ │ │ ├── f128_mulAdd.c │ │ │ ├── f128_rem.c │ │ │ ├── f128_roundToInt.c │ │ │ ├── f128_sqrt.c │ │ │ ├── f128_sub.c │ │ │ ├── f128_to_extF80.c │ │ │ ├── f128_to_f16.c │ │ │ ├── f128_to_f32.c │ │ │ ├── f128_to_f64.c │ │ │ ├── f128_to_i32.c │ │ │ ├── f128_to_i32_r_minMag.c │ │ │ ├── f128_to_i64.c │ │ │ ├── f128_to_i64_r_minMag.c │ │ │ ├── f128_to_ui32.c │ │ │ ├── f128_to_ui32_r_minMag.c │ │ │ ├── f128_to_ui64.c │ │ │ ├── f128_to_ui64_r_minMag.c │ │ │ ├── f16_add.c │ │ │ ├── f16_div.c │ │ │ ├── f16_eq.c │ │ │ ├── f16_eq_signaling.c │ │ │ ├── f16_isSignalingNaN.c │ │ │ ├── f16_le.c │ │ │ ├── f16_le_quiet.c │ │ │ ├── f16_lt.c │ │ │ ├── f16_lt_quiet.c │ │ │ ├── f16_mul.c │ │ │ ├── f16_mulAdd.c │ │ │ ├── f16_rem.c │ │ │ ├── f16_roundToInt.c │ │ │ ├── f16_sqrt.c │ │ │ ├── f16_sub.c │ │ │ ├── f16_to_extF80.c │ │ │ ├── f16_to_extF80M.c │ │ │ ├── f16_to_f128.c │ │ │ ├── f16_to_f128M.c │ │ │ ├── f16_to_f32.c │ │ │ ├── f16_to_f64.c │ │ │ ├── f16_to_i32.c │ │ │ ├── f16_to_i32_r_minMag.c │ │ │ ├── f16_to_i64.c │ │ │ ├── f16_to_i64_r_minMag.c │ │ │ ├── f16_to_ui32.c │ │ │ ├── f16_to_ui32_r_minMag.c │ │ │ ├── f16_to_ui64.c │ │ │ ├── f16_to_ui64_r_minMag.c │ │ │ ├── f32_add.c │ │ │ ├── f32_div.c │ │ │ ├── f32_eq.c │ │ │ ├── f32_eq_signaling.c │ │ │ ├── f32_isSignalingNaN.c │ │ │ ├── f32_le.c │ │ │ ├── f32_le_quiet.c │ │ │ ├── f32_lt.c │ │ │ ├── f32_lt_quiet.c │ │ │ ├── f32_mul.c │ │ │ ├── f32_mulAdd.c │ │ │ ├── f32_rem.c │ │ │ ├── f32_roundToInt.c │ │ │ ├── f32_sqrt.c │ │ │ ├── f32_sub.c │ │ │ ├── f32_to_extF80.c │ │ │ ├── f32_to_extF80M.c │ │ │ ├── f32_to_f128.c │ │ │ ├── f32_to_f128M.c │ │ │ ├── f32_to_f16.c │ │ │ ├── f32_to_f64.c │ │ │ ├── f32_to_i32.c │ │ │ ├── f32_to_i32_r_minMag.c │ │ │ ├── f32_to_i64.c │ │ │ ├── f32_to_i64_r_minMag.c │ │ │ ├── f32_to_ui32.c │ │ │ ├── f32_to_ui32_r_minMag.c │ │ │ ├── f32_to_ui64.c │ │ │ ├── f32_to_ui64_r_minMag.c │ │ │ ├── f64_add.c │ │ │ ├── f64_div.c │ │ │ ├── f64_eq.c │ │ │ ├── f64_eq_signaling.c │ │ │ ├── f64_isSignalingNaN.c │ │ │ ├── f64_le.c │ │ │ ├── f64_le_quiet.c │ │ │ ├── f64_lt.c │ │ │ ├── f64_lt_quiet.c │ │ │ ├── f64_mul.c │ │ │ ├── f64_mulAdd.c │ │ │ ├── f64_rem.c │ │ │ ├── f64_roundToInt.c │ │ │ ├── f64_sqrt.c │ │ │ ├── f64_sub.c │ │ │ ├── f64_to_extF80.c │ │ │ ├── f64_to_extF80M.c │ │ │ ├── f64_to_f128.c │ │ │ ├── f64_to_f128M.c │ │ │ ├── f64_to_f16.c │ │ │ ├── f64_to_f32.c │ │ │ ├── f64_to_i32.c │ │ │ ├── f64_to_i32_r_minMag.c │ │ │ ├── f64_to_i64.c │ │ │ ├── f64_to_i64_r_minMag.c │ │ │ ├── f64_to_ui32.c │ │ │ ├── f64_to_ui32_r_minMag.c │ │ │ ├── f64_to_ui64.c │ │ │ ├── f64_to_ui64_r_minMag.c │ │ │ ├── i32_to_extF80.c │ │ │ ├── i32_to_extF80M.c │ │ │ ├── i32_to_f128.c │ │ │ ├── i32_to_f128M.c │ │ │ ├── i32_to_f16.c │ │ │ ├── i32_to_f32.c │ │ │ ├── i32_to_f64.c │ │ │ ├── i64_to_extF80.c │ │ │ ├── i64_to_extF80M.c │ │ │ ├── i64_to_f128.c │ │ │ ├── i64_to_f128M.c │ │ │ ├── i64_to_f16.c │ │ │ ├── i64_to_f32.c │ │ │ ├── i64_to_f64.c │ │ │ ├── include │ │ │ ├── internals.h │ │ │ ├── primitiveTypes.h │ │ │ ├── primitives.h │ │ │ ├── softfloat.h │ │ │ └── softfloat_types.h │ │ │ ├── s_add128.c │ │ │ ├── s_add256M.c │ │ │ ├── s_addCarryM.c │ │ │ ├── s_addComplCarryM.c │ │ │ ├── s_addExtF80M.c │ │ │ ├── s_addF128M.c │ │ │ ├── s_addM.c │ │ │ ├── s_addMagsExtF80.c │ │ │ ├── s_addMagsF128.c │ │ │ ├── s_addMagsF16.c │ │ │ ├── s_addMagsF32.c │ │ │ ├── s_addMagsF64.c │ │ │ ├── s_approxRecip32_1.c │ │ │ ├── s_approxRecipSqrt32_1.c │ │ │ ├── s_approxRecipSqrt_1Ks.c │ │ │ ├── s_approxRecip_1Ks.c │ │ │ ├── s_compare128M.c │ │ │ ├── s_compare96M.c │ │ │ ├── s_compareNonnormExtF80M.c │ │ │ ├── s_countLeadingZeros16.c │ │ │ ├── s_countLeadingZeros32.c │ │ │ ├── s_countLeadingZeros64.c │ │ │ ├── s_countLeadingZeros8.c │ │ │ ├── s_eq128.c │ │ │ ├── s_invalidExtF80M.c │ │ │ ├── s_invalidF128M.c │ │ │ ├── s_isNaNF128M.c │ │ │ ├── s_le128.c │ │ │ ├── s_lt128.c │ │ │ ├── s_mul128By32.c │ │ │ ├── s_mul128MTo256M.c │ │ │ ├── s_mul128To256M.c │ │ │ ├── s_mul64ByShifted32To128.c │ │ │ ├── s_mul64To128.c │ │ │ ├── s_mul64To128M.c │ │ │ ├── s_mulAddF128.c │ │ │ ├── s_mulAddF128M.c │ │ │ ├── s_mulAddF16.c │ │ │ ├── s_mulAddF32.c │ │ │ ├── s_mulAddF64.c │ │ │ ├── s_negXM.c │ │ │ ├── s_normExtF80SigM.c │ │ │ ├── s_normRoundPackMToExtF80M.c │ │ │ ├── s_normRoundPackMToF128M.c │ │ │ ├── s_normRoundPackToExtF80.c │ │ │ ├── s_normRoundPackToF128.c │ │ │ ├── s_normRoundPackToF16.c │ │ │ ├── s_normRoundPackToF32.c │ │ │ ├── s_normRoundPackToF64.c │ │ │ ├── s_normSubnormalExtF80Sig.c │ │ │ ├── s_normSubnormalF128Sig.c │ │ │ ├── s_normSubnormalF128SigM.c │ │ │ ├── s_normSubnormalF16Sig.c │ │ │ ├── s_normSubnormalF32Sig.c │ │ │ ├── s_normSubnormalF64Sig.c │ │ │ ├── s_remStepMBy32.c │ │ │ ├── s_roundMToI64.c │ │ │ ├── s_roundMToUI64.c │ │ │ ├── s_roundPackMToExtF80M.c │ │ │ ├── s_roundPackMToF128M.c │ │ │ ├── s_roundPackToExtF80.c │ │ │ ├── s_roundPackToF128.c │ │ │ ├── s_roundPackToF16.c │ │ │ ├── s_roundPackToF32.c │ │ │ ├── s_roundPackToF64.c │ │ │ ├── s_roundToI32.c │ │ │ ├── s_roundToI64.c │ │ │ ├── s_roundToUI32.c │ │ │ ├── s_roundToUI64.c │ │ │ ├── s_shiftLeftM.c │ │ │ ├── s_shiftNormSigF128M.c │ │ │ ├── s_shiftRightJam128.c │ │ │ ├── s_shiftRightJam128Extra.c │ │ │ ├── s_shiftRightJam256M.c │ │ │ ├── s_shiftRightJam32.c │ │ │ ├── s_shiftRightJam64.c │ │ │ ├── s_shiftRightJam64Extra.c │ │ │ ├── s_shiftRightJamM.c │ │ │ ├── s_shiftRightM.c │ │ │ ├── s_shortShiftLeft128.c │ │ │ ├── s_shortShiftLeft64To96M.c │ │ │ ├── s_shortShiftLeftM.c │ │ │ ├── s_shortShiftRight128.c │ │ │ ├── s_shortShiftRightExtendM.c │ │ │ ├── s_shortShiftRightJam128.c │ │ │ ├── s_shortShiftRightJam128Extra.c │ │ │ ├── s_shortShiftRightJam64.c │ │ │ ├── s_shortShiftRightJam64Extra.c │ │ │ ├── s_shortShiftRightJamM.c │ │ │ ├── s_shortShiftRightM.c │ │ │ ├── s_sub128.c │ │ │ ├── s_sub1XM.c │ │ │ ├── s_sub256M.c │ │ │ ├── s_subM.c │ │ │ ├── s_subMagsExtF80.c │ │ │ ├── s_subMagsF128.c │ │ │ ├── s_subMagsF16.c │ │ │ ├── s_subMagsF32.c │ │ │ ├── s_subMagsF64.c │ │ │ ├── s_tryPropagateNaNExtF80M.c │ │ │ ├── s_tryPropagateNaNF128M.c │ │ │ ├── softfloat_state.c │ │ │ ├── ui32_to_extF80.c │ │ │ ├── ui32_to_extF80M.c │ │ │ ├── ui32_to_f128.c │ │ │ ├── ui32_to_f128M.c │ │ │ ├── ui32_to_f16.c │ │ │ ├── ui32_to_f32.c │ │ │ ├── ui32_to_f64.c │ │ │ ├── ui64_to_extF80.c │ │ │ ├── ui64_to_extF80M.c │ │ │ ├── ui64_to_f128.c │ │ │ ├── ui64_to_f128M.c │ │ │ ├── ui64_to_f16.c │ │ │ ├── ui64_to_f32.c │ │ │ └── ui64_to_f64.c │ ├── SoftFloatLib.dec │ └── SoftFloatLib.inf ├── StdExtLib │ ├── README.md │ ├── StdExtLib.inf │ ├── fnmatch.c │ ├── getline.c │ ├── getopt_long.c │ ├── humanize.c │ ├── reallocarr.c │ ├── strmode.c │ ├── strsuftoll.c │ ├── swab.c │ └── toascii.c ├── StdLibDevConsole │ ├── README.md │ ├── daConsole.c │ └── daConsole.inf ├── StdLibInteractiveIO │ ├── CanonRead.c │ ├── IIO.c │ ├── IIO.inf │ ├── IIOecho.c │ ├── IIOechoCtrl.h │ ├── IIOutilities.c │ ├── IIOutilities.h │ ├── IIOwrite.c │ ├── NonCanonRead.c │ ├── README.md │ └── TerminalFunctions.c ├── StdLibUefi │ ├── README.md │ ├── StubFunctions.c │ ├── SysCalls.c │ ├── Uefi.inf │ ├── Xform.c │ ├── compat.c │ ├── select.c │ └── writev.c └── UtilsLib │ ├── RangeCheck.c │ ├── Utils.c │ └── UtilsLib.inf ├── OTHER.md ├── README.md ├── Scripts └── GdbUefi │ ├── README.md │ └── gdb_uefi.py ├── UefiToolsPkg.dec ├── UefiToolsPkg.dsc └── UefiToolsPkg2023.dsc /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Applications/tinycc"] 2 | path = Applications/tinycc 3 | url = https://github.com/andreiw/tinycc 4 | -------------------------------------------------------------------------------- /Applications/AcpiDump/AcpiDump.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-28 23:31:36 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = AcpiDump 17 | FILE_GUID = 12345678-abcd-effe-dcba-876543210fed 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | AcpiDump.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | UefiToolsPkg/UefiToolsPkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | UtilsLib 32 | 33 | [Guids] 34 | 35 | [Protocols] 36 | gEfiLoadedImageProtocolGuid 37 | -------------------------------------------------------------------------------- /Applications/AcpiDump/README.md: -------------------------------------------------------------------------------- 1 | # AcpiDump 2 | 3 | AcpiDump will dump all of the ACPI tables to the same volume 4 | the tool is located on. This is sometimes useful, but keep 5 | in mind that some UEFI implementations can patch ACPI tables 6 | on the way out during ExitBootServices, meaning you might 7 | not get the same (correct) data if you dumped tables from 8 | the OS proper. 9 | 10 | An optional parameter specifies the path, relative to the 11 | volume root, where to place the tables. E.g.: 12 | 13 | fs16:> AcpiDump.efi 14 | fs16:> AcpiDump.efi MyFunkySystem 15 | 16 | The files produced can be loaded by [AcpiLoader](../AcpiLoader). 17 | -------------------------------------------------------------------------------- /Applications/AcpiLoader/AcpiLoader.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-23 00:05:12 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = AcpiLoader 17 | FILE_GUID = 12345678-abcd-effe-dcba-876543210123 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | AcpiLoader.c 24 | AcpiSupport.c 25 | 26 | [Packages] 27 | MdePkg/MdePkg.dec 28 | UefiToolsPkg/UefiToolsPkg.dec 29 | 30 | [LibraryClasses] 31 | UefiApplicationEntryPoint 32 | UtilsLib 33 | UefiLib 34 | 35 | [Guids] 36 | gEfiFileInfoGuid 37 | gEfiAcpiTableGuid 38 | 39 | [Protocols] 40 | gEfiAcpiTableProtocolGuid 41 | gEfiSimpleFileSystemProtocolGuid 42 | gEfiLoadedImageProtocolGuid 43 | 44 | 45 | -------------------------------------------------------------------------------- /Applications/AcpiLoader/README.md: -------------------------------------------------------------------------------- 1 | # AcpiLoader 2 | 3 | AcpiLoader will remove all of the existing ACPI tables 4 | and install tables loaded from the same volume the 5 | tool is on. Every file with an AML (`.aml`) extension 6 | is loaded. 7 | 8 | An optional parameter specifies the path, relative to 9 | the volume root, where the tables are loaded from. E.g.: 10 | 11 | fs16:> AcpiLoader.efi 12 | fs16:> AcpiLoader.efi MyFunkySystem 13 | 14 | Features (or limitations, depending on how you look): 15 | * XSDT only. 16 | * No ACPI 1.0. 17 | * No special ordering (i.e. FADT can be in any XSDT slot). 18 | * No 32-bit restrictions on placement. 19 | * 32-bit DSDT and FACS pointers are not supported. 20 | -------------------------------------------------------------------------------- /Applications/FdtDump/FdtDump.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-23 00:05:50 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = FdtDump 17 | FILE_GUID = 12345678-abcd-effe-dcba-876543210fcc 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | FdtDump.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | EmbeddedPkg/EmbeddedPkg.dec 28 | UefiToolsPkg/UefiToolsPkg.dec 29 | 30 | [LibraryClasses] 31 | UefiApplicationEntryPoint 32 | UtilsLib 33 | FdtLib 34 | 35 | [Guids] 36 | gFdtTableGuid 37 | 38 | [Protocols] 39 | gEfiLoadedImageProtocolGuid 40 | 41 | -------------------------------------------------------------------------------- /Applications/FdtDump/README.md: -------------------------------------------------------------------------------- 1 | # FdtDump 2 | 3 | FdtDump will dump the device tree blob to the same volume 4 | the tool is located on. This is sometimes useful, but keep 5 | in mind that some UEFI implementations can patch the DTB 6 | on the way out during ExitBootServices, meaning you might 7 | not get the same (correct) data if you dumped the DTB from 8 | the OS proper. 9 | 10 | Note: this tool is not available for IA32, X64, IPF and 11 | EBC targets. 12 | 13 | An optional parameter specifies the path, relative to the 14 | volume root, where to place the tables. E.g.: 15 | 16 | fs16:> FdtDump.efi 17 | fs16:> FdtDump.efi MyFunkySystem 18 | -------------------------------------------------------------------------------- /Applications/GdbSyms/GdbSyms.c: -------------------------------------------------------------------------------- 1 | /* Time-stamp: <2016-06-10 01:44:57 andreiw> 2 | * Copyright (C) 2016 Andrei Evgenievich Warkentin 3 | * 4 | * Bare-minimum GDB symbols needed for reloading symbols. 5 | * Do not add this into an FV/FD. It is just needed for 6 | * Scripts/gdb_uefi.py. 7 | * 8 | * This program and the accompanying materials 9 | * are licensed and made available under the terms and conditions of the BSD License 10 | * which accompanies this distribution. The full text of the license may be found at 11 | * http://opensource.org/licenses/bsd-license.php 12 | * 13 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | EFI_STATUS 22 | EFIAPI 23 | Initialize ( 24 | IN EFI_HANDLE ImageHandle, 25 | IN EFI_SYSTEM_TABLE *SystemTable 26 | ) 27 | { 28 | EFI_SYSTEM_TABLE_POINTER ESTP; 29 | EFI_DEBUG_IMAGE_INFO_TABLE_HEADER EDIITH; 30 | EFI_IMAGE_DOS_HEADER EIDH; 31 | EFI_IMAGE_OPTIONAL_HEADER_UNION EIOHU; 32 | EFI_IMAGE_DEBUG_DIRECTORY_ENTRY EIDDE; 33 | EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY EIDCNE; 34 | EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY EIDCRE; 35 | EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY EIDCME; 36 | UINTN Dummy = 37 | (UINTN) &ESTP | 38 | (UINTN) &EDIITH | 39 | (UINTN) &EIDH | 40 | (UINTN) &EIOHU | 41 | (UINTN) &EIDDE | 42 | (UINTN) &EIDCNE | 43 | (UINTN) &EIDCRE | 44 | (UINTN) &EIDCME | 45 | 1 46 | ; 47 | return !!Dummy & EFI_SUCCESS; 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /Applications/GdbSyms/GdbSyms.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2016-06-10 01:42:43 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010005 16 | BASE_NAME = GdbSyms 17 | FILE_GUID = 22abcb60-fb40-42ac-b01f-3ab1fad9aad8 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 1.0 20 | ENTRY_POINT = Initialize 21 | 22 | [Sources] 23 | GdbSyms.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | MdeModulePkg/MdeModulePkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | UefiLib 32 | 33 | [Guids] 34 | 35 | [Protocols] 36 | 37 | -------------------------------------------------------------------------------- /Applications/GopTool/GopTool.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-22 01:14:13 andreiw> 3 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = GopTool 17 | FILE_GUID = fefe5678-abcd-effe-dcba-876543210fee 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | GopTool.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | UefiToolsPkg/UefiToolsPkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | UtilsLib 32 | 33 | [Guids] 34 | 35 | [Protocols] 36 | gEfiGraphicsOutputProtocolGuid 37 | gEfiPciIoProtocolGuid 38 | gEfiDevicePathProtocolGuid -------------------------------------------------------------------------------- /Applications/GopTool/README.md: -------------------------------------------------------------------------------- 1 | # GopTool 2 | 3 | List and manipulate framebuffer information. 4 | 5 | fs1:\> GopTool 6 | 0: EFI_HANDLE 0xBFFE6518D8, Mode 1/5 (800x600, format 1) 7 | 0: framebuffer is 0x80000000-0x801D4C00 8 | 0: PCI(e) device 1:2:0:0 9 | 10 | With `-i`, info on a specific instance can be printed, instead. 11 | `-b` may be used to patch the framebuffer address. 12 | 13 | fs1:\> GopTool -i 0 -b 0x180000000 14 | 0: EFI_HANDLE 0xBFFE6518D8, Mode 1/5 (800x600, format 1) 15 | 0: framebuffer is 0x80000000-0x801D4C00 16 | 0: framebuffer is 0x180000000-0x1801D4C00 [overidden] 17 | -------------------------------------------------------------------------------- /Applications/MemResv/MemResv.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-23 00:06:05 andreiw> 3 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = MemResv 17 | FILE_GUID = fefe5678-abcd-effe-dcba-876543210fcc 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | MemResv.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | UefiToolsPkg/UefiToolsPkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | UtilsLib 32 | 33 | [Guids] 34 | gEfiDxeServicesTableGuid 35 | 36 | [Protocols] 37 | -------------------------------------------------------------------------------- /Applications/MemResv/README.md: -------------------------------------------------------------------------------- 1 | # MemResv 2 | 3 | Allows creating memory map entries of type **reserved** or 4 | **MMIO**. This is useful to steal some memory for 5 | OS low-memory testing, or to create some missing 6 | MMIO entries. 7 | 8 | The range is specified as base address and number of pages. 9 | All values are hexadecimal, and may be provided with or 10 | without the leading `0x`. The type parameter is optional. 11 | 12 | For example, to reserve memory in the range 0x90000000-0x90004FFF: 13 | 14 | fs16:> MemResv.efi 0x90000000 5 15 | 16 | To reserve MMIO range 0x91000000-0x910FEFFF: 17 | 18 | fs16:> MemResv.efi 0x91000000 ff mmio 19 | 20 | Note: This tool requires Tiano Core, as it uses the DXE services. 21 | -------------------------------------------------------------------------------- /Applications/PciRom/PciRom.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-28 23:31:35 andreiw> 3 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = PciRom 17 | FILE_GUID = fef05678-abcd-effe-dcba-876543210fee 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | PciRom.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | UefiToolsPkg/UefiToolsPkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | UtilsLib 32 | 33 | [Guids] 34 | 35 | [Protocols] 36 | gEfiPciIoProtocolGuid 37 | gEfiLoadedImageProtocolGuid -------------------------------------------------------------------------------- /Applications/PciRom/README.md: -------------------------------------------------------------------------------- 1 | # PciRom 2 | 3 | List PCI ROM images for a device given by SBDF. 4 | 5 | fs1:\> PciRom 0 0 2 0 6 | ROM 0x00009800 bytes 7 | -------------------- 8 | +0x0: BIOS image (0x9800 bytes) 9 | 10 | With the `-s` option and a volume path 11 | (relative to the volume root), will save all images. 12 | 13 | fs1:\> PciRom -s MyFunkySystem 0 0 2 0 14 | ROM 0x00009800 bytes 15 | -------------------- 16 | +0x0: BIOS image (0x9800 bytes) 17 | Saving .\00-BIOS.rom 18 | fs:1\> 19 | fs1:\> dir MyFunkySystem 20 | Directory of: fs1:\MyFunkySystem\ 21 | 09/29/2017 03:38 8,192 . 22 | 09/29/2017 03:38 0 .. 23 | 09/29/2017 03:38 38,912 00-BIOS.rom 24 | 1 File(s) 38,912 bytes 25 | 2 Dir(s) 26 | 27 | And yes, it even knows about HP-PA and OF 1275 images. 28 | 29 | It would be nice to encode the UEFI image architecture 30 | type, but...meh. 31 | -------------------------------------------------------------------------------- /Applications/RangeIsMapped/README.md: -------------------------------------------------------------------------------- 1 | # RangeIsMapped 2 | 3 | Easily check if a range is described in the UEFI memory map, 4 | either interactively or in a script. 5 | 6 | fs1:\> RangeIsMapped.efi 10540000 10000 7 | 0x10540000-0x1054FFFF is in the memory map 8 | fs1:\> set lasterror 9 | lasterror = 0x0 10 | fs1:\> RangeIsMapped.efi 10540000 10001 11 | 0x10540000-0x10550000 not in memory map (starting at 0x10550000) 12 | fs1:\> set lasterror 13 | lasterror = 0xE 14 | 15 | With `-q`, the tool can be used quietly in a script. 16 | 17 | fs1:\> RangeIsMapped.efi -q 10540000 10001 18 | fs1:\> echo %lasterror% 19 | 0xE 20 | -------------------------------------------------------------------------------- /Applications/RangeIsMapped/RangeIsMapped.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-23 00:00:54 andreiw> 3 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = RangeIsMapped 17 | FILE_GUID = fefe5678-abcd-effe-dcba-876512345fcc 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | RangeIsMapped.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | UefiToolsPkg/UefiToolsPkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | UtilsLib 32 | 33 | [Guids] 34 | 35 | [Protocols] 36 | 37 | -------------------------------------------------------------------------------- /Applications/SetCon/README.md: -------------------------------------------------------------------------------- 1 | # SetCon 2 | 3 | SetCon manipulates the console variables: `ConIn`, `ConOut`, `ErrOut` 4 | and `ConInDev`, `ConOutDev`, `ErrOutDev`. 5 | 6 | Use it to see the current devices encoded: 7 | 8 | fs0:\> SetCon ConOut 9 | ConOut: 10 | VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenMsg(DFA66065-B419-11D3-9A2D-0090273FC14D) 11 | PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80010100) 12 | 13 | Use it to set the variables: 14 | 15 | - `-i` takes a handle index as produced by `dh`. 16 | - `-h` takes an actual EFI_HANDLE value. 17 | - `-p` takes a textual path representation. 18 | 19 | The optional `-a` flag results in appending the new path to the existing set of device paths instead of replacing. 20 | 21 | fs0:\> SetCon -i AA ConIn 22 | fs0:\> SetCon -h 1ABCDEF01 ErrOutDev 23 | fs0:\> SetCon -a -p PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80010100) ConOut 24 | 25 | Note that no validation is done on the device path. Yes, you can set `ConOut` to your disk drive. No, it won't work or do anything. 26 | 27 | Finally, the `-A` option will automatically build console variables from 28 | the current available devices. This is especially interesting in 29 | Shell scripts. The example below loads a GOP driver, sets `ConOut` 30 | to include the video device, and forces UEFI to refresh active 31 | consoles by disconnecting and reconnecting all drivers to devices. 32 | 33 | ShellMapVar.efi 34 | %mapvar% 35 | ShellPlatVars.efi 36 | if x%pvar-smbios-manufacturer% eq xQEMU then 37 | load QemuVideoDxe.efi 38 | SetCon -A ConOut 39 | reconnect -r 40 | endif 41 | -------------------------------------------------------------------------------- /Applications/SetCon/SetCon.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-23 00:13:15 andreiw> 3 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = SetCon 17 | FILE_GUID = fefe5678-abcd-afbb-dcba-876512345fcc 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | SetCon.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | ShellPkg/ShellPkg.dec 28 | UefiToolsPkg/UefiToolsPkg.dec 29 | 30 | [LibraryClasses] 31 | UefiApplicationEntryPoint 32 | HandleParsingLib 33 | DevicePathLib 34 | UtilsLib 35 | 36 | [Guids] 37 | gEfiGlobalVariableGuid 38 | 39 | [Protocols] 40 | gEfiSimpleTextOutProtocolGuid 41 | gEfiSimpleTextInProtocolGuid 42 | gEfiDevicePathProtocolGuid -------------------------------------------------------------------------------- /Applications/ShellErrVars/README.md: -------------------------------------------------------------------------------- 1 | # ShellErrVars 2 | 3 | This tool is meant to be run from the UEFI Shell, 4 | and will set shell environment variables to 5 | quickly test for and look up EFI return statuses 6 | and error codes. 7 | 8 | Usage: 9 | 10 | fs16:> ShellErrVars.efi [-i] 11 | 12 | A few examples of what gets set: 13 | 14 | evar_RETURN_SUCCESS = 0x0 15 | evar_0x0 = RETURN_SUCCESS 16 | svar_RETURN_SUCCESS = 0x0 17 | svar_0x0 = RETURN_SUCCESS 18 | ... 19 | evar_RETURN_HTTP_ERROR = 0x23 20 | evar_0x23 = RETURN_HTTP_ERROR 21 | svar_RETURN_HTTP_ERROR = 0x8000000000000023 22 | svar_0x8000000000000023 = RETURN_HTTP_ERROR 23 | ... 24 | wvar_RETURN_WARN_WRITE_FAILURE = 0x3 25 | wvar_0x3 = RETURN_WARN_WRITE_FAILURE 26 | svar_RETURN_WARN_WRITE_FAILURE = 0x3 27 | svar_0x3 = RETURN_WARN_WRITE_FAILURE 28 | 29 | `svar_` refers to the raw RETURN_STATUS value, while 30 | `evar_` will strip the high error bit, since that's 31 | the way the UEFI Shell `%lasterror%` reports status. 32 | 33 | Note: `svar_`, `wvar_` and reverse (value to name) variables 34 | are only set with the `-i` (interactive) flag, as they 35 | are mostly useless in a script setting. Sadly, the UEFI shell is too 36 | dumb to do double expansion. 37 | 38 | Examples of use: 39 | 40 | FS1:\> echo %evar_0x0% 41 | RETURN_SUCCESS 42 | FS1:\> echo %evar_0xE% 43 | RETURN_NOT_FOUND 44 | FS1:\> echo %svar_RETURN_NOT_FOUND% 45 | 0x800000000000000E 46 | 47 | In a script: 48 | 49 | if x%lasterror% eq x%evar_RETURN_NOT_FOUND% 50 | echo Something wasn't found. 51 | endif 52 | -------------------------------------------------------------------------------- /Applications/ShellErrVars/ShellErrVars.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010006 15 | BASE_NAME = ShellErrVars 16 | FILE_GUID = 12345678-dbcd-dffe-ddba-812343210fef 17 | MODULE_TYPE = UEFI_APPLICATION 18 | VERSION_STRING = 0.1 19 | ENTRY_POINT = UefiMain 20 | 21 | [Sources] 22 | ShellErrVars.c 23 | 24 | [Packages] 25 | MdePkg/MdePkg.dec 26 | ShellPkg/ShellPkg.dec 27 | UefiToolsPkg/UefiToolsPkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | ShellLib 32 | UtilsLib 33 | 34 | [Protocols] 35 | -------------------------------------------------------------------------------- /Applications/ShellMapVar/README.md: -------------------------------------------------------------------------------- 1 | # ShellMapVar 2 | 3 | This tool will set the `mapvar` Shell environment 4 | variable to the device mapping the tool is run 5 | from. 6 | 7 | Usage: 8 | 9 | Shell> ShellMapVar.efi 10 | Shell> %mapvar% 11 | fs0:\> 12 | 13 | This is primarily interesting for writing 14 | robust UEFI Shell startup scripts, since many 15 | commands and tools don't work correctly without 16 | a mapping and the actual mapping depends on the 17 | mappings present. 18 | 19 | Example: 20 | 21 | ShellMapVar.efi 22 | %mapvar% 23 | load path\to\my\driver.efi 24 | -------------------------------------------------------------------------------- /Applications/ShellMapVar/ShellMapVar.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | * 4 | * This program and the accompanying materials 5 | * are licensed and made available under the terms and conditions of the BSD License 6 | * which accompanies this distribution. The full text of the license may be found at 7 | * http://opensource.org/licenses/bsd-license.php 8 | * 9 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | EFI_STATUS 22 | EFIAPI 23 | UefiMain ( 24 | IN EFI_HANDLE ImageHandle, 25 | IN EFI_SYSTEM_TABLE *SystemTable 26 | ) 27 | { 28 | CHAR16 *MapValue; 29 | CHAR16 *Temp; 30 | EFI_STATUS Status; 31 | CONST CHAR16 *Mapping; 32 | EFI_DEVICE_PATH_PROTOCOL *Path; 33 | EFI_LOADED_IMAGE_PROTOCOL *ImageProtocol; 34 | 35 | Status = gBS->HandleProtocol (ImageHandle, 36 | &gEfiLoadedImageProtocolGuid, 37 | (void **) &ImageProtocol); 38 | if (Status != EFI_SUCCESS) { 39 | return EFI_ABORTED; 40 | } 41 | 42 | if (gEfiShellProtocol == NULL) { 43 | return EFI_UNSUPPORTED; 44 | } 45 | 46 | Status = gBS->HandleProtocol(ImageProtocol->DeviceHandle, 47 | &gEfiDevicePathProtocolGuid, 48 | (VOID **) &Path); 49 | if (Status != EFI_SUCCESS) { 50 | return Status; 51 | } 52 | 53 | Mapping = gEfiShellProtocol->GetMapFromDevicePath (&Path); 54 | if (Mapping == NULL) { 55 | return EFI_NOT_FOUND; 56 | } 57 | 58 | MapValue = StrDuplicate (Mapping); 59 | if (MapValue == NULL) { 60 | return EFI_OUT_OF_RESOURCES; 61 | } 62 | 63 | Temp = StrStr(MapValue, L";"); 64 | if (Temp != NULL) { 65 | *Temp = L'\0'; 66 | } 67 | 68 | Status = ShellSetEnvironmentVariable(L"mapvar", MapValue, TRUE); 69 | FreePool (MapValue); 70 | 71 | return Status; 72 | } 73 | -------------------------------------------------------------------------------- /Applications/ShellMapVar/ShellMapVar.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010006 15 | BASE_NAME = ShellMapVar 16 | FILE_GUID = 12345678-dbcd-bdfe-ddba-812343210fef 17 | MODULE_TYPE = UEFI_APPLICATION 18 | VERSION_STRING = 0.1 19 | ENTRY_POINT = UefiMain 20 | 21 | [Sources] 22 | ShellMapVar.c 23 | 24 | [Packages] 25 | MdePkg/MdePkg.dec 26 | ShellPkg/ShellPkg.dec 27 | UefiToolsPkg/UefiToolsPkg.dec 28 | 29 | [LibraryClasses] 30 | UefiApplicationEntryPoint 31 | ShellLib 32 | UtilsLib 33 | MemoryAllocationLib 34 | 35 | [Protocols] 36 | gEfiDevicePathProtocolGuid 37 | gEfiLoadedImageProtocolGuid -------------------------------------------------------------------------------- /Applications/ShellPlatVars/README.md: -------------------------------------------------------------------------------- 1 | # ShellPlatVars 2 | 3 | This tool is meant to be run from the UEFI Shell, 4 | and will set the shell environment variables based 5 | on SMBIOS/ACPI/FDT configuration. 6 | 7 | For SMBIOS: 8 | * `pvar-have-smbios` for SMBIOS < 3.0. 9 | * `pvar-have-smbios64` for SMBIOS >= 3.0. 10 | * `pvar-smbios-bios-vendor` for firmware vendor. 11 | * `pvar-smbios-bios-ver` for firmware version. 12 | * `pvar-smbios-bios-data` for firmware release data. 13 | * `pvar-smbios-manufacturer` for system manufacturer. 14 | * `pvar-smbios-product` for product name. 15 | * `pvar-smbios-product-ver` for product version. 16 | * `pvar-smbios-product-sn` for product serial number. 17 | * `pvar-smbios-product-family` for product family. 18 | 19 | For ACPI: 20 | * `pvar-have-acpi` for ACPI presence. 21 | * `pvar-acpi- = True` 22 | * `pvar-acpi- = True` 23 | * `pvar-acpi--rev = ` 24 | * `pvar-acpi--oem-id = ` 25 | * `pvar-acpi--oem-rev = ` 26 | * `pvar-acpi--tab-id = ` 27 | 28 | Note: `` and `` are sanitized, replacing 29 | all occurances of ` ` with `_`. 30 | 31 | For FDT (not available on IA32, X64, IPF and EBC): 32 | * `pvar-have-fdt` for FDT presence. 33 | * `pvar-fdt-compat-0 = ` 34 | * ... 35 | * `pvar-fdt-compat-9 = ` 36 | 37 | Usage: 38 | 39 | fs16:> ShellPlatVars.efi 40 | fs16:> set 41 | path = .\;FS0:\efi\tools\;FS0:\efi\boot\;FS0:\ 42 | profiles = ;Driver1;Install;Debug1;network1; 43 | uefishellsupport = 3 44 | uefishellversion = 2.0 45 | uefiversion = 2.40 46 | pvar-have-smbios = False 47 | pvar-have-smbios64 = False 48 | pvar-have-acpi = False 49 | pvar-have-fdt = False 50 | 51 | This is meant to be used from a shell script. E.g.: 52 | 53 | if x%pvar-have-fdt% eq xTrue then 54 | echo I am running on a %pvar-fdt-compat-0% 55 | endif 56 | 57 | if x%pvar-have-acpi% eq xFalse then 58 | AcpiLoader MyFunkySystem 59 | endif 60 | 61 | if x%pvar-acpi-DSDT-tab-id% eq xPOWER_NV then 62 | load fs16:\PowerNV\IODA2HostBridge.efi 63 | endif 64 | 65 | if x"%pvar-smbios-product-family%" eq x"Whatever This Is" then 66 | echo I am running on Whatever 67 | endif 68 | -------------------------------------------------------------------------------- /Applications/ShellPlatVars/ShellPlatVars.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-03-13 13:10:46 andreiw> 3 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010006 16 | BASE_NAME = ShellPlatVars 17 | FILE_GUID = 12345678-abcd-effe-dcba-812343210fef 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 0.1 20 | ENTRY_POINT = UefiMain 21 | 22 | [Sources] 23 | ShellPlatVars.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | ShellPkg/ShellPkg.dec 28 | UefiToolsPkg/UefiToolsPkg.dec 29 | 30 | [Packages.ARM,Packages.AARCH64,Packages.RISCV64] 31 | EmbeddedPkg/EmbeddedPkg.dec 32 | 33 | [LibraryClasses] 34 | UefiApplicationEntryPoint 35 | ShellLib 36 | UtilsLib 37 | 38 | [LibraryClasses.ARM,LibraryClasses.AARCH64,LibraryClasses.RISCV64] 39 | FdtLib 40 | 41 | [Guids] 42 | gEfiSmbiosTableGuid 43 | gEfiSmbios3TableGuid 44 | 45 | [Guids.ARM,Guids.AARCH64,Guids.RISCV64] 46 | gFdtTableGuid 47 | 48 | [Protocols] 49 | 50 | [BuildOptions.ARM,BuildOptions.AARCH64,BuildOptions.RISCV64] 51 | GCC:*_*_*_CC_FLAGS = -DWITH_FDT 52 | XCODE:*_*_*_CC_FLAGS = -DWITH_FDT 53 | RVCT:*_*_*_CC_FLAGS = -DWITH_FDT 54 | MSFT:*_*_*_CC_FLAGS = /D WITH_FDT 55 | INTEL:*_*_*_CC_FLAGS = /D WITH_FDT -------------------------------------------------------------------------------- /Applications/cat/README.md: -------------------------------------------------------------------------------- 1 | # NetBSD `cat` utility, revision 1.47.20.1 2 | 3 | Really hacky port. Sorry. 4 | 5 | **This tool has been only validated with the modified StdLib libraries in this distributon.** 6 | 7 | UEFI Shell Redirection and pipes do work. E.g.: 8 | 9 | fs3:\> ls.efi -l | cat.efi 10 | fs3:\> ls.efi > ls.uni 11 | fs3:\> ls.efi >a ls.txt 12 | fs3:\> cat.efi ls.txt 13 | fs3:\> cat.efi cat.efi < ls.uni 15 | 16 | Opened files are expected to be ASCII, while files created with the UEFI Shell are UTF-16. 17 | Either use the `a` 18 | redirector). 19 | 20 | Also, the regular `stdin:`/`stdout:`/`stderr:` devices read and write UTF16 data, and 21 | while the Shell `>a`, ``, `<` and `|` redirectors. Never use `>a`, ` cat hello.efi -o out.efi 32 | fs3:\> cat.efi -o nstdout: nstdin: < hello.efi > out.efi 33 | fs3:\> cat.efi nstdin: < hello.efi | cat.efi -o nstdout: > out2.efi 34 | fs3:\> cat.efi -o nstdout: stdin: < text.utf16 > text.ascii 35 | 36 | Differences: 37 | - `-o` allow specifying an output file. 38 | 39 | Other limitations (mostly of edk2 StdLib implementation): 40 | - `-l` flag is useless (no file locking) 41 | - has a slow memory leak since it can malloc, but never frees. 42 | -------------------------------------------------------------------------------- /Applications/cat/cat.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010006 15 | BASE_NAME = cat 16 | FILE_GUID = 4fb94346-7491-4dfd-b442-747010f3cefd 17 | MODULE_TYPE = UEFI_APPLICATION 18 | VERSION_STRING = 0.1 19 | ENTRY_POINT = ShellCEntryLib 20 | 21 | [Sources] 22 | cat.c 23 | 24 | [Packages] 25 | StdLib/StdLib.dec 26 | MdePkg/MdePkg.dec 27 | ShellPkg/ShellPkg.dec 28 | UefiToolsPkg/UefiToolsPkg.dec 29 | 30 | [LibraryClasses] 31 | LibC 32 | LibStdio 33 | LibMath 34 | LibLocale 35 | DevShell 36 | LibErr 37 | LibTime 38 | StdExtLib 39 | -------------------------------------------------------------------------------- /Applications/dd/README.md: -------------------------------------------------------------------------------- 1 | # NetBSD `dd` utility, revision 1.51 2 | 3 | Really hacky port. Sorry. 4 | 5 | **This tool has been only validated with the modified StdLib libraries in this distributon.** 6 | 7 | Examples: 8 | 9 | fs3:\> dd if=stdin: of=nstdout: < text.utf16 > text.ascii err 2> dd.errs 10 | 11 | Limitations (mostly of edk2 StdLib implementation): 12 | - No ftruncate - Will not truncate the output file. 13 | - No alt_oio. 14 | - No async. 15 | - No cloexec. 16 | - No direct. 17 | - No dsync. 18 | - No exlock. 19 | - No nofollow. 20 | - No nosigpipe. 21 | - No rsync. 22 | - No search. 23 | - No shlock. 24 | - No sync. 25 | - No MTIO. 26 | -------------------------------------------------------------------------------- /Applications/dd/dd.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010006 15 | BASE_NAME = dd 16 | FILE_GUID = 4aaf546-7491-4dfd-b442-747010f3cefd 17 | MODULE_TYPE = UEFI_APPLICATION 18 | VERSION_STRING = 0.1 19 | ENTRY_POINT = ShellCEntryLib 20 | 21 | [Sources] 22 | args.c 23 | conv.c 24 | conv_tab.c 25 | dd.c 26 | misc.c 27 | position.c 28 | 29 | [Packages] 30 | StdLib/StdLib.dec 31 | MdePkg/MdePkg.dec 32 | ShellPkg/ShellPkg.dec 33 | UefiToolsPkg/UefiToolsPkg.dec 34 | 35 | [LibraryClasses] 36 | LibC 37 | LibStdio 38 | LibMath 39 | LibLocale 40 | DevShell 41 | LibErr 42 | LibTime 43 | StdExtLib 44 | -------------------------------------------------------------------------------- /Applications/grep/README.md: -------------------------------------------------------------------------------- 1 | # NetBSD `grep` utility, revision 1.7. 2 | 3 | Really hacky port. Sorry. 4 | 5 | **This tool has been only validated with the modified StdLib libraries in this distributon.** 6 | 7 | Examples: 8 | 9 | fs3:\> memmap | grep RT_Code 10 | ... 11 | 12 | Limitations (mostly of edk2 StdLib implementation): 13 | - No explicit line buffering (`--line-buffered`). Interactive console is implicitly line buffered. 14 | - No gzip or bzip2 support. 15 | -------------------------------------------------------------------------------- /Applications/grep/grep.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010006 15 | BASE_NAME = grep 16 | FILE_GUID = 4fb94346-7491-4dfd-b442-123010abdfee 17 | MODULE_TYPE = UEFI_APPLICATION 18 | VERSION_STRING = 0.1 19 | ENTRY_POINT = ShellCEntryLib 20 | 21 | [Sources] 22 | fastgrep.c 23 | file.c 24 | grep.c 25 | queue.c 26 | util.c 27 | 28 | [Packages] 29 | StdLib/StdLib.dec 30 | MdePkg/MdePkg.dec 31 | ShellPkg/ShellPkg.dec 32 | UefiToolsPkg/UefiToolsPkg.dec 33 | 34 | [LibraryClasses] 35 | LibC 36 | LibStdio 37 | LibMath 38 | LibLocale 39 | DevShell 40 | LibErr 41 | LibTime 42 | StdExtLib 43 | RegexLib 44 | FTSLib -------------------------------------------------------------------------------- /Applications/ls/README.md: -------------------------------------------------------------------------------- 1 | # NetBSD `ls` utility, revision 1.75.4.1. 2 | 3 | Really hacky port. Sorry. 4 | 5 | **This tool has been only validated with the modified StdLib libraries in this distributon.** 6 | 7 | Limitations (mostly of edk2 StdLib implementation): 8 | - Terminal columns always 80. 9 | - No `-o` option (show flags) 10 | - No `-i` option (show inode) 11 | - No `-q` option (don't hide unprintable chars as `?`) 12 | - No `-B` option (escape non-printing chars as octal) 13 | - No `-b` option (escape non-printing chars as C escapes) 14 | - `-X` is useless (there are no mount points) 15 | - `-W` is useless (there are no whiteouts) 16 | - `-A` is useless (always root) 17 | - uid/gid is 0/0 (none/none) 18 | - block sizes are always 512 or 1024 (via `-k`), UEFI-derived `st_blksize` is not honored 19 | - no minor/major info for devices 20 | - no ctime 21 | - no link counts (all link counts are 1) 22 | - No way to detect directory cycles (so uh, be careful with third-part file system drivers) 23 | - No symlinks support 24 | - Locale decimal delimiter is always `.` -------------------------------------------------------------------------------- /Applications/ls/extern.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: extern.h,v 1.17 2011/08/29 14:44:21 joerg Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1991, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the University nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | * 31 | * @(#)extern.h 8.1 (Berkeley) 5/31/93 32 | */ 33 | 34 | int acccmp(const FTSENT *, const FTSENT *); 35 | int revacccmp(const FTSENT *, const FTSENT *); 36 | int modcmp(const FTSENT *, const FTSENT *); 37 | int revmodcmp(const FTSENT *, const FTSENT *); 38 | int namecmp(const FTSENT *, const FTSENT *); 39 | int revnamecmp(const FTSENT *, const FTSENT *); 40 | int statcmp(const FTSENT *, const FTSENT *); 41 | int revstatcmp(const FTSENT *, const FTSENT *); 42 | int sizecmp(const FTSENT *, const FTSENT *); 43 | int revsizecmp(const FTSENT *, const FTSENT *); 44 | 45 | int ls_main(int, char *[]); 46 | 47 | int printescaped(const char *); 48 | void printacol(DISPLAY *); 49 | void printcol(DISPLAY *); 50 | void printlong(DISPLAY *); 51 | void printscol(DISPLAY *); 52 | void printstream(DISPLAY *); 53 | int safe_print(const char *); 54 | -------------------------------------------------------------------------------- /Applications/ls/ls.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010006 15 | BASE_NAME = ls 16 | FILE_GUID = 4ea84346-7491-4dfd-b442-747010f3cefd 17 | MODULE_TYPE = UEFI_APPLICATION 18 | VERSION_STRING = 0.1 19 | ENTRY_POINT = ShellCEntryLib 20 | 21 | [Sources] 22 | ls.c 23 | cmp.c 24 | print.c 25 | 26 | [Packages] 27 | StdLib/StdLib.dec 28 | MdePkg/MdePkg.dec 29 | ShellPkg/ShellPkg.dec 30 | UefiToolsPkg/UefiToolsPkg.dec 31 | 32 | [LibraryClasses] 33 | LibC 34 | LibStdio 35 | LibMath 36 | LibLocale 37 | DevShell 38 | LibErr 39 | LibTime 40 | FTSLib 41 | StdExtLib 42 | -------------------------------------------------------------------------------- /Applications/stat/README.md: -------------------------------------------------------------------------------- 1 | # NetBSD `stat` utility, revision 1.38. 2 | 3 | Really hacky port. Sorry. 4 | 5 | **This tool has been only validated with the modified StdLib libraries in this distributon.** 6 | 7 | Examples: 8 | 9 | fs3:\> stat -x 10 | File: "(stdin)" 11 | Size: 0 12 | FileType: Character Device 13 | Mode: (0555/cr-xr-xr-x) 14 | Access: Wed Dec 31 23:59:59 1969 15 | Modify: Wed Dec 31 23:59:59 1969 16 | 17 | Limitations (mostly of edk2 StdLib implementation): 18 | - No `st_dev` (%d format) 19 | - No `st_ino` (%i format) 20 | - No `st_nlink` (%l format) 21 | - No `st_uid` (%u format) 22 | - No `st_gid` (%g format) 23 | - No `st_rdev` (%r format) 24 | - No `st_ctime` (%c format) 25 | - No `st_gen` (%v format) 26 | - No symlink support (%Y format) 27 | - No %Z format, as there is no `st_rdev`. 28 | - No string escaping via vis(3) 29 | 30 | ...otherwise fine? -------------------------------------------------------------------------------- /Applications/stat/stat.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010006 15 | BASE_NAME = stat 16 | FILE_GUID = 4ea84346-7491-4dfd-b442-747010f3cefd 17 | MODULE_TYPE = UEFI_APPLICATION 18 | VERSION_STRING = 0.1 19 | ENTRY_POINT = ShellCEntryLib 20 | 21 | [Sources] 22 | stat.c 23 | 24 | [Packages] 25 | StdLib/StdLib.dec 26 | MdePkg/MdePkg.dec 27 | ShellPkg/ShellPkg.dec 28 | UefiToolsPkg/UefiToolsPkg.dec 29 | 30 | [LibraryClasses] 31 | LibC 32 | LibStdio 33 | LibMath 34 | LibLocale 35 | DevShell 36 | LibErr 37 | LibTime 38 | StdExtLib 39 | -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/DriverSupportedEfiVersion.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | Driver supported version protocol for the QEMU video driver. 3 | 4 | Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
5 | 6 | This program and the accompanying materials 7 | are licensed and made available under the terms and conditions of the BSD License 8 | which accompanies this distribution. The full text of the license may be found at 9 | http://opensource.org/licenses/bsd-license.php 10 | 11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 | 14 | **/ 15 | #include "Qemu.h" 16 | 17 | EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL gQemuVideoDriverSupportedEfiVersion = { 18 | sizeof (EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL), // Size of Protocol structure. 19 | 0 // Version number to be filled at start up. 20 | }; 21 | 22 | -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/QemuVideoDxe.inf: -------------------------------------------------------------------------------- 1 | ## @file 2 | # This driver is a sample implementation of the Graphics Output Protocol for 3 | # the QEMU (Cirrus Logic 5446) video controller. 4 | # 5 | # Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
6 | # 7 | # This program and the accompanying materials 8 | # are licensed and made available under the terms and conditions of the BSD License 9 | # which accompanies this distribution. The full text of the license may be found at 10 | # http://opensource.org/licenses/bsd-license.php 11 | # 12 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 | # 15 | ## 16 | 17 | [Defines] 18 | INF_VERSION = 0x00010005 19 | BASE_NAME = QemuVideoDxe 20 | FILE_GUID = e3752948-b9a1-4770-90c4-df41c38986be 21 | MODULE_TYPE = UEFI_DRIVER 22 | VERSION_STRING = 1.0 23 | 24 | ENTRY_POINT = InitializeQemuVideo 25 | 26 | # 27 | # The following information is for reference only and not required by the build tools. 28 | # 29 | # VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AArch64 30 | # 31 | # DRIVER_BINDING = gQemuVideoDriverBinding 32 | # COMPONENT_NAME = gQemuVideoComponentName 33 | # 34 | 35 | [Sources.common] 36 | ComponentName.c 37 | Driver.c 38 | DriverSupportedEfiVersion.c 39 | Gop.c 40 | Initialize.c 41 | 42 | [Sources.Ia32, Sources.X64] 43 | VbeShim.c 44 | UnalignedIoGcc.c | GCC 45 | UnalignedIoMsc.c | MSFT 46 | UnalignedIoIcc.c | INTEL 47 | 48 | [Sources.IPF, Sources.EBC, Sources.ARM, Sources.AARCH64] 49 | UnalignedIoUnsupported.c 50 | 51 | [Packages] 52 | MdePkg/MdePkg.dec 53 | MdeModulePkg/MdeModulePkg.dec 54 | OptionRomPkg/OptionRomPkg.dec 55 | OvmfPkg/OvmfPkg.dec 56 | 57 | [LibraryClasses] 58 | BaseMemoryLib 59 | FrameBufferBltLib 60 | DebugLib 61 | DevicePathLib 62 | MemoryAllocationLib 63 | PciLib 64 | PrintLib 65 | UefiBootServicesTableLib 66 | UefiDriverEntryPoint 67 | UefiLib 68 | 69 | [Protocols] 70 | gEfiDriverSupportedEfiVersionProtocolGuid # PROTOCOL ALWAYS_PRODUCED 71 | gEfiGraphicsOutputProtocolGuid # PROTOCOL BY_START 72 | gEfiDevicePathProtocolGuid # PROTOCOL BY_START 73 | gEfiPciIoProtocolGuid # PROTOCOL TO_START 74 | 75 | [Pcd] 76 | gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion 77 | 78 | -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/README.md: -------------------------------------------------------------------------------- 1 | # QemuVideoDxe 2 | 3 | Since the upstream edk2 removed ARM support from QemuVideoDxe 4 | (in commit cefbbb3d087143316fba077dd02964afb92f647f), I've 5 | decided to duplicate the driver here in a convenient form 6 | that still builds for ARM and AARCH64. 7 | 8 | I love how breaking TCG qemu is fine because of a KVM issue. 9 | 10 | That totally makes sense. Right? Oh... 11 | 12 | This reverts the changes done as part of edk2 commit 13 | bfb0ee0adbb1838a371e9f5b1c1b49e1f354447a. 14 | 15 | Other changes: 16 | - Remove dependency on TimerLib (not used). -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/UnalignedIoGcc.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | Unaligned Port I/O. This file has compiler specifics for GCC as there is no 3 | ANSI C standard for doing IO. 4 | 5 | Based on IoLibGcc.c. 6 | 7 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
8 | This program and the accompanying materials are licensed and made available 9 | under the terms and conditions of the BSD License which accompanies this 10 | distribution. The full text of the license may be found at 11 | http://opensource.org/licenses/bsd-license.php. 12 | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 | 16 | **/ 17 | 18 | 19 | #include "UnalignedIoInternal.h" 20 | 21 | /** 22 | Performs a 32-bit write to the specified, possibly unaligned I/O-type 23 | address. 24 | 25 | Writes the 32-bit I/O port specified by Port with the value specified by 26 | Value and returns Value. This function must guarantee that all I/O read and 27 | write operations are serialized. 28 | 29 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 30 | 31 | @param[in] Port I/O port address 32 | @param[in] Value 32-bit word to write 33 | 34 | @return The value written to the I/O port. 35 | 36 | **/ 37 | UINT32 38 | UnalignedIoWrite32 ( 39 | IN UINTN Port, 40 | IN UINT32 Value 41 | ) 42 | { 43 | __asm__ __volatile__ ( "outl %0, %1" : : "a" (Value), "d" ((UINT16)Port) ); 44 | return Value; 45 | } 46 | 47 | /** 48 | Reads a 32-bit word from the specified, possibly unaligned I/O-type address. 49 | 50 | Reads the 32-bit I/O port specified by Port. The 32-bit read value is 51 | returned. This function must guarantee that all I/O read and write operations 52 | are serialized. 53 | 54 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 55 | 56 | @param[in] Port The I/O port to read. 57 | 58 | @return The value read. 59 | 60 | **/ 61 | UINT32 62 | UnalignedIoRead32 ( 63 | IN UINTN Port 64 | ) 65 | { 66 | UINT32 Data; 67 | __asm__ __volatile__ ( "inl %1, %0" : "=a" (Data) : "d" ((UINT16)Port) ); 68 | return Data; 69 | } 70 | 71 | -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/UnalignedIoIcc.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | Unaligned port I/O. This file has compiler specifics for ICC as there 3 | is no ANSI C standard for doing IO. 4 | 5 | Based on IoLibIcc.c. 6 | 7 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
8 | This program and the accompanying materials are licensed and made available 9 | under the terms and conditions of the BSD License which accompanies this 10 | distribution. The full text of the license may be found at 11 | http://opensource.org/licenses/bsd-license.php. 12 | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 | 16 | **/ 17 | 18 | 19 | #include "UnalignedIoInternal.h" 20 | 21 | /** 22 | Performs a 32-bit write to the specified, possibly unaligned I/O-type 23 | address. 24 | 25 | Writes the 32-bit I/O port specified by Port with the value specified by 26 | Value and returns Value. This function must guarantee that all I/O read and 27 | write operations are serialized. 28 | 29 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 30 | 31 | @param[in] Port I/O port address 32 | @param[in] Value 32-bit word to write 33 | 34 | @return The value written to the I/O port. 35 | 36 | **/ 37 | UINT32 38 | UnalignedIoWrite32 ( 39 | IN UINTN Port, 40 | IN UINT32 Value 41 | ) 42 | { 43 | __asm { 44 | mov eax, dword ptr [Value] 45 | mov dx, word ptr [Port] 46 | out dx, eax 47 | } 48 | 49 | return Value; 50 | } 51 | 52 | /** 53 | Reads a 32-bit word from the specified, possibly unaligned I/O-type address. 54 | 55 | Reads the 32-bit I/O port specified by Port. The 32-bit read value is 56 | returned. This function must guarantee that all I/O read and write operations 57 | are serialized. 58 | 59 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 60 | 61 | @param[in] Port The I/O port to read. 62 | 63 | @return The value read. 64 | 65 | **/ 66 | UINT32 67 | UnalignedIoRead32 ( 68 | IN UINTN Port 69 | ) 70 | { 71 | UINT32 Data; 72 | 73 | __asm { 74 | mov dx, word ptr [Port] 75 | in eax, dx 76 | mov dword ptr [Data], eax 77 | } 78 | 79 | return Data; 80 | } 81 | -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/UnalignedIoInternal.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | Unaligned port I/O, with implementations for various x86 compilers and a 3 | dummy for platforms which do not support unaligned port I/O. 4 | 5 | Copyright (c) 2017, Phil Dennis-Jordan.
6 | This program and the accompanying materials are licensed and made available 7 | under the terms and conditions of the BSD License which accompanies this 8 | distribution. The full text of the license may be found at 9 | http://opensource.org/licenses/bsd-license.php. 10 | 11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 | 14 | **/ 15 | 16 | #ifndef _UNALIGNED_IO_INTERNAL_H_ 17 | #define _UNALIGNED_IO_INTERNAL_H_ 18 | 19 | /** 20 | Performs a 32-bit write to the specified, possibly unaligned I/O-type address. 21 | 22 | Writes the 32-bit I/O port specified by Port with the value specified by Value 23 | and returns Value. This function must guarantee that all I/O read and write 24 | operations are serialized. 25 | 26 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 27 | 28 | @param[in] Port I/O port address 29 | @param[in] Value 32-bit word to write 30 | 31 | @return The value written to the I/O port. 32 | 33 | **/ 34 | UINT32 35 | UnalignedIoWrite32 ( 36 | IN UINTN Port, 37 | IN UINT32 Value 38 | ); 39 | 40 | /** 41 | Reads a 32-bit word from the specified, possibly unaligned I/O-type address. 42 | 43 | Reads the 32-bit I/O port specified by Port. The 32-bit read value is 44 | returned. This function must guarantee that all I/O read and write operations 45 | are serialized. 46 | 47 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 48 | 49 | @param[in] Port The I/O port to read. 50 | 51 | @return The value read. 52 | 53 | **/ 54 | UINT32 55 | UnalignedIoRead32 ( 56 | IN UINTN Port 57 | ); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/UnalignedIoMsc.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | Unaligned port I/O. This file has compiler specifics for Microsoft C as there 3 | is no ANSI C standard for doing IO. 4 | 5 | Based on IoLibMsc.c 6 | 7 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
8 | This program and the accompanying materials are licensed and made available 9 | under the terms and conditions of the BSD License which accompanies this 10 | distribution. The full text of the license may be found at 11 | http://opensource.org/licenses/bsd-license.php. 12 | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 | 16 | **/ 17 | 18 | 19 | #include "UnalignedIoInternal.h" 20 | 21 | unsigned long _inpd (unsigned short port); 22 | unsigned long _outpd (unsigned short port, unsigned long dataword ); 23 | void _ReadWriteBarrier (void); 24 | 25 | /** 26 | Performs a 32-bit write to the specified, possibly unaligned I/O-type 27 | address. 28 | 29 | Writes the 32-bit I/O port specified by Port with the value specified by 30 | Value and returns Value. This function must guarantee that all I/O read and 31 | write operations are serialized. 32 | 33 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 34 | 35 | @param[in] Port I/O port address 36 | @param[in] Value 32-bit word to write 37 | 38 | @return The value written to the I/O port. 39 | 40 | **/ 41 | UINT32 42 | UnalignedIoWrite32 ( 43 | IN UINTN Port, 44 | IN UINT32 Value 45 | ) 46 | { 47 | _ReadWriteBarrier (); 48 | _outpd ((UINT16)Port, Value); 49 | _ReadWriteBarrier (); 50 | return Value; 51 | } 52 | 53 | /** 54 | Reads a 32-bit word from the specified, possibly unaligned I/O-type address. 55 | 56 | Reads the 32-bit I/O port specified by Port. The 32-bit read value is 57 | returned. This function must guarantee that all I/O read and write operations 58 | are serialized. 59 | 60 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 61 | 62 | @param[in] Port The I/O port to read. 63 | 64 | @return The value read. 65 | 66 | **/ 67 | UINT32 68 | UnalignedIoRead32 ( 69 | IN UINTN Port 70 | ) 71 | { 72 | UINT32 Value; 73 | 74 | _ReadWriteBarrier (); 75 | Value = _inpd ((UINT16)Port); 76 | _ReadWriteBarrier (); 77 | return Value; 78 | } 79 | -------------------------------------------------------------------------------- /Drivers/QemuVideoDxe/UnalignedIoUnsupported.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | Unaligned port I/O dummy implementation for platforms which do not support it. 3 | 4 | Copyright (c) 2017, Phil Dennis-Jordan.
5 | This program and the accompanying materials are licensed and made available 6 | under the terms and conditions of the BSD License which accompanies this 7 | distribution. The full text of the license may be found at 8 | http://opensource.org/licenses/bsd-license.php. 9 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | 13 | **/ 14 | 15 | 16 | #include 17 | #include "UnalignedIoInternal.h" 18 | 19 | /** 20 | Performs a 32-bit write to the specified, possibly unaligned I/O-type 21 | address. 22 | 23 | Writes the 32-bit I/O port specified by Port with the value specified by 24 | Value and returns Value. This function must guarantee that all I/O read and 25 | write operations are serialized. 26 | 27 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 28 | 29 | @param[in] Port I/O port address 30 | @param[in] Value 32-bit word to write 31 | 32 | @return The value written to the I/O port. 33 | 34 | **/ 35 | UINT32 36 | UnalignedIoWrite32 ( 37 | IN UINTN Port, 38 | IN UINT32 Value 39 | ) 40 | { 41 | ASSERT (FALSE); 42 | return Value; 43 | } 44 | 45 | /** 46 | Reads a 32-bit word from the specified, possibly unaligned I/O-type address. 47 | 48 | Reads the 32-bit I/O port specified by Port. The 32-bit read value is 49 | returned. This function must guarantee that all I/O read and write operations 50 | are serialized. 51 | 52 | If 32-bit unaligned I/O port operations are not supported, then ASSERT(). 53 | 54 | @param[in] Port The I/O port to read. 55 | 56 | @return The value read. 57 | 58 | **/ 59 | UINT32 60 | UnalignedIoRead32 ( 61 | IN UINTN Port 62 | ) 63 | { 64 | ASSERT (FALSE); 65 | return 0; 66 | } 67 | -------------------------------------------------------------------------------- /Library/FTSLib/FTSLib.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2016-06-11 00:40:05 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010005 16 | BASE_NAME = FTSLib 17 | FILE_GUID = ddbacbb1-bb25-11df-8e4e-0002a5d5d51c 18 | MODULE_TYPE = BASE 19 | VERSION_STRING = 1.0 20 | LIBRARY_CLASS = FTSLib 21 | 22 | [Sources] 23 | fts.c 24 | 25 | [Packages] 26 | MdePkg/MdePkg.dec 27 | MdeModulePkg/MdeModulePkg.dec 28 | UefiToolsPkg/UefiToolsPkg.dec 29 | StdLib/StdLib.dec 30 | 31 | [LibraryClasses] 32 | LibC 33 | LibStdio 34 | 35 | [Guids] 36 | 37 | [Protocols] -------------------------------------------------------------------------------- /Library/FTSLib/README.md: -------------------------------------------------------------------------------- 1 | # FreeBSD `fts.c`, 05d8276 on Feb 10, 2013 (https://github.com/lattera/freebsd/) 2 | 3 | Really hacky port. Sorry. 4 | 5 | Don't forget to include [`Library/FTSLib.h`](../../Include/Library/FTSLib.h) instead of `fts.h`. 6 | 7 | Limitations (mostly of edk2 StdLib implementation): 8 | - `FTS_NOCHDIR` is forced (no `fchdir`) 9 | - No smartness around avoiding extra stat calls (no `st_nlink`) 10 | - No `st_dev`, `st_ino` (no cycle detection, among other things) 11 | - No graceful dealing with non-ASCII file names (`d_name` is wide). 12 | -------------------------------------------------------------------------------- /Library/RegexLib/README.md: -------------------------------------------------------------------------------- 1 | # NetBSD src/lib/libc/regex, revision 1.36. 2 | 3 | Don't forget to include [`Library/RegexLib.h`](../../Include/Library/RegexLib.h) instead of `regex.h`. 4 | -------------------------------------------------------------------------------- /Library/RegexLib/RegexLib.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2016-06-11 00:40:05 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010005 16 | BASE_NAME = RegexLib 17 | FILE_GUID = ddbacbb1-bb25-11df-8e4f-0002a5d5432d 18 | MODULE_TYPE = BASE 19 | VERSION_STRING = 1.0 20 | LIBRARY_CLASS = RegexLib 21 | 22 | [Sources] 23 | regcomp.c 24 | regerror.c 25 | regexec.c 26 | regfree.c 27 | regsub.c 28 | 29 | [Packages] 30 | MdePkg/MdePkg.dec 31 | MdeModulePkg/MdeModulePkg.dec 32 | UefiToolsPkg/UefiToolsPkg.dec 33 | StdLib/StdLib.dec 34 | 35 | [LibraryClasses] 36 | LibC 37 | LibStdio 38 | 39 | [Guids] 40 | 41 | [Protocols] -------------------------------------------------------------------------------- /Library/SoftFloatLib/AArch64/bindings.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "platform.h" 3 | #include "internals.h" 4 | #include "softfloat.h" 5 | 6 | float128_t __floatunditf(uint64_t a) 7 | { 8 | return ui64_to_f128(a); 9 | } 10 | 11 | uint64_t __fixunstfdi(float128_t a) 12 | { 13 | return f128_to_ui64_r_minMag(a, false); 14 | } 15 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/README.md: -------------------------------------------------------------------------------- 1 | # Softfloat-3d for UEFI 2 | 3 | This gives you an alternate software floating point implementation that doesn't 4 | rely on compiler intrinsics or arch-specific behavior. On 5 | certain architectures, this library also provides an implementation 6 | for certain missing compiler intrinsics (e.g. `__floatunditf` and 7 | `__fixunstfdi` on AArch64). 8 | 9 | The way this is put together, the Softfloat-3d/ directory contains a 10 | completely unmodified Release 3d of the Berkeley SoftFloat package. 11 | This should make you feel better about bugs introduced in the UEFI 12 | packaging, but also allow reasonably simple updates. 13 | 14 | [`SoftFloatLib.inf`](SoftFloatLib.inf) is derived from the `SoftFloat-3d/build/Linux-x86_64-GCC` 15 | configuration. [`Include/SoftFloatLib.h`](../../Include/Library/SoftFloatLib.h) is the header 16 | file, and is derived from [`SoftFloat-3d/source/include/softfloat.h`](SoftFloat-3d/source/include/softfloat.h). 17 | 18 | See http://www.jhauser.us/arithmetic/SoftFloat.html 19 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | License for Berkeley SoftFloat Release 3d 3 | 4 | John R. Hauser 5 | 2017 August 10 6 | 7 | The following applies to the whole of SoftFloat Release 3d as well as to 8 | each source file individually. 9 | 10 | Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the 11 | University of California. All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 16 | 1. Redistributions of source code must retain the above copyright notice, 17 | this list of conditions, and the following disclaimer. 18 | 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions, and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 23 | 3. Neither the name of the University nor the names of its contributors 24 | may be used to endorse or promote products derived from this software 25 | without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 30 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 36 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Berkeley SoftFloat Package Overview 6 | 7 | 8 | 9 | 10 |

Package Overview for Berkeley SoftFloat Release 3d

11 | 12 |

13 | John R. Hauser
14 | 2017 August 10
15 |

16 | 17 |

18 | Berkeley SoftFloat is a software implementation of binary floating-point that 19 | conforms to the IEEE Standard for Floating-Point Arithmetic. 20 | SoftFloat is distributed in the form of C source code. 21 | Building the SoftFloat sources generates a library file (typically 22 | softfloat.a or libsoftfloat.a) containing the 23 | floating-point subroutines. 24 |

25 | 26 |

27 | The SoftFloat package is documented in the following files in the 28 | doc subdirectory: 29 |

30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
SoftFloat.htmlDocumentation for using the SoftFloat functions.
SoftFloat-source.htmlDocumentation for building SoftFloat.
SoftFloat-history.html   History of the major changes to SoftFloat.
44 |
45 | Other files in the package comprise the source code for SoftFloat. 46 |

47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Package Overview for Berkeley SoftFloat Release 3d 3 | 4 | John R. Hauser 5 | 2017 August 10 6 | 7 | Berkeley SoftFloat is a software implementation of binary floating-point 8 | that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat 9 | is distributed in the form of C source code. Building the SoftFloat sources 10 | generates a library file (typically "softfloat.a" or "libsoftfloat.a") 11 | containing the floating-point subroutines. 12 | 13 | The SoftFloat package is documented in the following files in the "doc" 14 | subdirectory: 15 | 16 | SoftFloat.html Documentation for using the SoftFloat functions. 17 | SoftFloat-source.html Documentation for building SoftFloat. 18 | SoftFloat-history.html History of the major changes to SoftFloat. 19 | 20 | Other files in the package comprise the source code for SoftFloat. 21 | 22 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/build/Linux-386-GCC/platform.h: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | /*---------------------------------------------------------------------------- 38 | *----------------------------------------------------------------------------*/ 39 | #define LITTLEENDIAN 1 40 | 41 | /*---------------------------------------------------------------------------- 42 | *----------------------------------------------------------------------------*/ 43 | #ifdef __GNUC_STDC_INLINE__ 44 | #define INLINE inline 45 | #else 46 | #define INLINE extern inline 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/build/Linux-386-SSE2-GCC/platform.h: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | /*---------------------------------------------------------------------------- 38 | *----------------------------------------------------------------------------*/ 39 | #define LITTLEENDIAN 1 40 | 41 | /*---------------------------------------------------------------------------- 42 | *----------------------------------------------------------------------------*/ 43 | #ifdef __GNUC_STDC_INLINE__ 44 | #define INLINE inline 45 | #else 46 | #define INLINE extern inline 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/build/Linux-x86_64-GCC/platform.h: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | /*---------------------------------------------------------------------------- 38 | *----------------------------------------------------------------------------*/ 39 | #define LITTLEENDIAN 1 40 | 41 | /*---------------------------------------------------------------------------- 42 | *----------------------------------------------------------------------------*/ 43 | #ifdef __GNUC_STDC_INLINE__ 44 | #define INLINE inline 45 | #else 46 | #define INLINE extern inline 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/build/Win32-MinGW/platform.h: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | /*---------------------------------------------------------------------------- 38 | *----------------------------------------------------------------------------*/ 39 | #define LITTLEENDIAN 1 40 | 41 | /*---------------------------------------------------------------------------- 42 | *----------------------------------------------------------------------------*/ 43 | #ifdef __GNUC_STDC_INLINE__ 44 | #define INLINE inline 45 | #else 46 | #define INLINE extern inline 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/build/Win32-SSE2-MinGW/platform.h: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | /*---------------------------------------------------------------------------- 38 | *----------------------------------------------------------------------------*/ 39 | #define LITTLEENDIAN 1 40 | 41 | /*---------------------------------------------------------------------------- 42 | *----------------------------------------------------------------------------*/ 43 | #ifdef __GNUC_STDC_INLINE__ 44 | #define INLINE inline 45 | #else 46 | #define INLINE extern inline 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/build/Win64-MinGW-w64/platform.h: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | /*---------------------------------------------------------------------------- 38 | *----------------------------------------------------------------------------*/ 39 | #define LITTLEENDIAN 1 40 | 41 | /*---------------------------------------------------------------------------- 42 | *----------------------------------------------------------------------------*/ 43 | #ifdef __GNUC_STDC_INLINE__ 44 | #define INLINE inline 45 | #else 46 | #define INLINE extern inline 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/8086-SSE/s_commonNaNToF16UI.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "specialize.h" 40 | 41 | /*---------------------------------------------------------------------------- 42 | | Converts the common NaN pointed to by `aPtr' into a 16-bit floating-point 43 | | NaN, and returns the bit pattern of this value as an unsigned integer. 44 | *----------------------------------------------------------------------------*/ 45 | uint_fast16_t softfloat_commonNaNToF16UI( const struct commonNaN *aPtr ) 46 | { 47 | 48 | return (uint_fast16_t) aPtr->sign<<15 | 0x7E00 | aPtr->v64>>54; 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/8086-SSE/s_commonNaNToF32UI.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "specialize.h" 40 | 41 | /*---------------------------------------------------------------------------- 42 | | Converts the common NaN pointed to by `aPtr' into a 32-bit floating-point 43 | | NaN, and returns the bit pattern of this value as an unsigned integer. 44 | *----------------------------------------------------------------------------*/ 45 | uint_fast32_t softfloat_commonNaNToF32UI( const struct commonNaN *aPtr ) 46 | { 47 | 48 | return (uint_fast32_t) aPtr->sign<<31 | 0x7FC00000 | aPtr->v64>>41; 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/8086/s_commonNaNToF16UI.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "specialize.h" 40 | 41 | /*---------------------------------------------------------------------------- 42 | | Converts the common NaN pointed to by `aPtr' into a 16-bit floating-point 43 | | NaN, and returns the bit pattern of this value as an unsigned integer. 44 | *----------------------------------------------------------------------------*/ 45 | uint_fast16_t softfloat_commonNaNToF16UI( const struct commonNaN *aPtr ) 46 | { 47 | 48 | return (uint_fast16_t) aPtr->sign<<15 | 0x7E00 | aPtr->v64>>54; 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/8086/s_commonNaNToF32UI.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "specialize.h" 40 | 41 | /*---------------------------------------------------------------------------- 42 | | Converts the common NaN pointed to by `aPtr' into a 32-bit floating-point 43 | | NaN, and returns the bit pattern of this value as an unsigned integer. 44 | *----------------------------------------------------------------------------*/ 45 | uint_fast32_t softfloat_commonNaNToF32UI( const struct commonNaN *aPtr ) 46 | { 47 | 48 | return (uint_fast32_t) aPtr->sign<<31 | 0x7FC00000 | aPtr->v64>>41; 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/extF80_isSignalingNaN.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "specialize.h" 41 | #include "softfloat.h" 42 | 43 | bool extF80_isSignalingNaN( extFloat80_t a ) 44 | { 45 | union { struct extFloat80M s; extFloat80_t f; } uA; 46 | 47 | uA.f = a; 48 | return softfloat_isSigNaNExtF80UI( uA.s.signExp, uA.s.signif ); 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/f128_isSignalingNaN.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "specialize.h" 41 | #include "softfloat.h" 42 | 43 | bool f128_isSignalingNaN( float128_t a ) 44 | { 45 | union ui128_f128 uA; 46 | 47 | uA.f = a; 48 | return softfloat_isSigNaNF128UI( uA.ui.v64, uA.ui.v0 ); 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/f16_isSignalingNaN.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "specialize.h" 41 | #include "softfloat.h" 42 | 43 | bool f16_isSignalingNaN( float16_t a ) 44 | { 45 | union ui16_f16 uA; 46 | 47 | uA.f = a; 48 | return softfloat_isSigNaNF16UI( uA.ui ); 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/f16_mulAdd.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "softfloat.h" 41 | 42 | float16_t f16_mulAdd( float16_t a, float16_t b, float16_t c ) 43 | { 44 | union ui16_f16 uA; 45 | uint_fast16_t uiA; 46 | union ui16_f16 uB; 47 | uint_fast16_t uiB; 48 | union ui16_f16 uC; 49 | uint_fast16_t uiC; 50 | 51 | uA.f = a; 52 | uiA = uA.ui; 53 | uB.f = b; 54 | uiB = uB.ui; 55 | uC.f = c; 56 | uiC = uC.ui; 57 | return softfloat_mulAddF16( uiA, uiB, uiC, 0 ); 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/f32_isSignalingNaN.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "specialize.h" 41 | #include "softfloat.h" 42 | 43 | bool f32_isSignalingNaN( float32_t a ) 44 | { 45 | union ui32_f32 uA; 46 | 47 | uA.f = a; 48 | return softfloat_isSigNaNF32UI( uA.ui ); 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/f32_mulAdd.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "softfloat.h" 41 | 42 | float32_t f32_mulAdd( float32_t a, float32_t b, float32_t c ) 43 | { 44 | union ui32_f32 uA; 45 | uint_fast32_t uiA; 46 | union ui32_f32 uB; 47 | uint_fast32_t uiB; 48 | union ui32_f32 uC; 49 | uint_fast32_t uiC; 50 | 51 | uA.f = a; 52 | uiA = uA.ui; 53 | uB.f = b; 54 | uiB = uB.ui; 55 | uC.f = c; 56 | uiC = uC.ui; 57 | return softfloat_mulAddF32( uiA, uiB, uiC, 0 ); 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/f64_isSignalingNaN.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "specialize.h" 41 | #include "softfloat.h" 42 | 43 | bool f64_isSignalingNaN( float64_t a ) 44 | { 45 | union ui64_f64 uA; 46 | 47 | uA.f = a; 48 | return softfloat_isSigNaNF64UI( uA.ui ); 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/f64_mulAdd.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "softfloat.h" 41 | 42 | float64_t f64_mulAdd( float64_t a, float64_t b, float64_t c ) 43 | { 44 | union ui64_f64 uA; 45 | uint_fast64_t uiA; 46 | union ui64_f64 uB; 47 | uint_fast64_t uiB; 48 | union ui64_f64 uC; 49 | uint_fast64_t uiC; 50 | 51 | uA.f = a; 52 | uiA = uA.ui; 53 | uB.f = b; 54 | uiB = uB.ui; 55 | uC.f = c; 56 | uiC = uC.ui; 57 | return softfloat_mulAddF64( uiA, uiB, uiC, 0 ); 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/i32_to_f32.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include 39 | #include "platform.h" 40 | #include "internals.h" 41 | #include "softfloat.h" 42 | 43 | float32_t i32_to_f32( int32_t a ) 44 | { 45 | bool sign; 46 | union ui32_f32 uZ; 47 | uint_fast32_t absA; 48 | 49 | sign = (a < 0); 50 | if ( ! (a & 0x7FFFFFFF) ) { 51 | uZ.ui = sign ? packToF32UI( 1, 0x9E, 0 ) : 0; 52 | return uZ.f; 53 | } 54 | absA = sign ? -(uint_fast32_t) a : (uint_fast32_t) a; 55 | return softfloat_normRoundPackToF32( sign, 0x9C, absA ); 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/i64_to_f64.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include 39 | #include "platform.h" 40 | #include "internals.h" 41 | #include "softfloat.h" 42 | 43 | float64_t i64_to_f64( int64_t a ) 44 | { 45 | bool sign; 46 | union ui64_f64 uZ; 47 | uint_fast64_t absA; 48 | 49 | sign = (a < 0); 50 | if ( ! (a & UINT64_C( 0x7FFFFFFFFFFFFFFF )) ) { 51 | uZ.ui = sign ? packToF64UI( 1, 0x43E, 0 ) : 0; 52 | return uZ.f; 53 | } 54 | absA = sign ? -(uint_fast64_t) a : (uint_fast64_t) a; 55 | return softfloat_normRoundPackToF64( sign, 0x43C, absA ); 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_add128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_add128 42 | 43 | struct uint128 44 | softfloat_add128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) 45 | { 46 | struct uint128 z; 47 | 48 | z.v0 = a0 + b0; 49 | z.v64 = a64 + b64 + (z.v0 < a0); 50 | return z; 51 | 52 | } 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_approxRecipSqrt_1Ks.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitives.h" 40 | 41 | const uint16_t softfloat_approxRecipSqrt_1k0s[16] = { 42 | 0xB4C9, 0xFFAB, 0xAA7D, 0xF11C, 0xA1C5, 0xE4C7, 0x9A43, 0xDA29, 43 | 0x93B5, 0xD0E5, 0x8DED, 0xC8B7, 0x88C6, 0xC16D, 0x8424, 0xBAE1 44 | }; 45 | const uint16_t softfloat_approxRecipSqrt_1k1s[16] = { 46 | 0xA5A5, 0xEA42, 0x8C21, 0xC62D, 0x788F, 0xAA7F, 0x6928, 0x94B6, 47 | 0x5CC7, 0x8335, 0x52A6, 0x74E2, 0x4A3E, 0x68FE, 0x432B, 0x5EFD 48 | }; 49 | 50 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_approxRecip_1Ks.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitives.h" 40 | 41 | const uint16_t softfloat_approxRecip_1k0s[16] = { 42 | 0xFFC4, 0xF0BE, 0xE363, 0xD76F, 0xCCAD, 0xC2F0, 0xBA16, 0xB201, 43 | 0xAA97, 0xA3C6, 0x9D7A, 0x97A6, 0x923C, 0x8D32, 0x887E, 0x8417 44 | }; 45 | const uint16_t softfloat_approxRecip_1k1s[16] = { 46 | 0xF0F1, 0xD62C, 0xBFA1, 0xAC77, 0x9C0A, 0x8DDB, 0x8185, 0x76BA, 47 | 0x6D3B, 0x64D4, 0x5D5C, 0x56B1, 0x50B6, 0x4B55, 0x4679, 0x4211 48 | }; 49 | 50 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_countLeadingZeros16.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | 40 | #ifndef softfloat_countLeadingZeros16 41 | 42 | #define softfloat_countLeadingZeros16 softfloat_countLeadingZeros16 43 | #include "primitives.h" 44 | 45 | uint_fast8_t softfloat_countLeadingZeros16( uint16_t a ) 46 | { 47 | uint_fast8_t count; 48 | 49 | count = 8; 50 | if ( 0x100 <= a ) { 51 | count = 0; 52 | a >>= 8; 53 | } 54 | count += softfloat_countLeadingZeros8[a]; 55 | return count; 56 | 57 | } 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_eq128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include 39 | #include "platform.h" 40 | 41 | #ifndef softfloat_eq128 42 | 43 | bool softfloat_eq128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) 44 | { 45 | 46 | return (a64 == b64) && (a0 == b0); 47 | 48 | } 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_invalidExtF80M.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include "platform.h" 38 | #include "specialize.h" 39 | #include "softfloat.h" 40 | 41 | void softfloat_invalidExtF80M( struct extFloat80M *zSPtr ) 42 | { 43 | 44 | softfloat_raiseFlags( softfloat_flag_invalid ); 45 | zSPtr->signExp = defaultNaNExtF80UI64; 46 | zSPtr->signif = defaultNaNExtF80UI0; 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_invalidF128M.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitives.h" 40 | #include "specialize.h" 41 | #include "softfloat.h" 42 | 43 | void softfloat_invalidF128M( uint32_t *zWPtr ) 44 | { 45 | 46 | softfloat_raiseFlags( softfloat_flag_invalid ); 47 | zWPtr[indexWord( 4, 3 )] = defaultNaNF128UI96; 48 | zWPtr[indexWord( 4, 2 )] = defaultNaNF128UI64; 49 | zWPtr[indexWord( 4, 1 )] = defaultNaNF128UI32; 50 | zWPtr[indexWord( 4, 0 )] = defaultNaNF128UI0; 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_le128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include 39 | #include "platform.h" 40 | 41 | #ifndef softfloat_le128 42 | 43 | bool softfloat_le128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) 44 | { 45 | 46 | return (a64 < b64) || ((a64 == b64) && (a0 <= b0)); 47 | 48 | } 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_lt128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include 39 | #include "platform.h" 40 | 41 | #ifndef softfloat_lt128 42 | 43 | bool softfloat_lt128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) 44 | { 45 | 46 | return (a64 < b64) || ((a64 == b64) && (a0 < b0)); 47 | 48 | } 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_mul128By32.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_mul128By32 42 | 43 | struct uint128 softfloat_mul128By32( uint64_t a64, uint64_t a0, uint32_t b ) 44 | { 45 | struct uint128 z; 46 | uint_fast64_t mid; 47 | uint_fast32_t carry; 48 | 49 | z.v0 = a0 * b; 50 | mid = (uint_fast64_t) (uint32_t) (a0>>32) * b; 51 | carry = (uint32_t) ((uint_fast32_t) (z.v0>>32) - (uint_fast32_t) mid); 52 | z.v64 = a64 * b + (uint_fast32_t) ((mid + carry)>>32); 53 | return z; 54 | 55 | } 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_mul64ByShifted32To128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_mul64ByShifted32To128 42 | 43 | struct uint128 softfloat_mul64ByShifted32To128( uint64_t a, uint32_t b ) 44 | { 45 | uint_fast64_t mid; 46 | struct uint128 z; 47 | 48 | mid = (uint_fast64_t) (uint32_t) a * b; 49 | z.v0 = mid<<32; 50 | z.v64 = (uint_fast64_t) (uint32_t) (a>>32) * b + (mid>>32); 51 | return z; 52 | 53 | } 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_normExtF80SigM.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | 41 | int softfloat_normExtF80SigM( uint64_t *sigPtr ) 42 | { 43 | uint64_t sig; 44 | int_fast8_t shiftDist; 45 | 46 | sig = *sigPtr; 47 | shiftDist = softfloat_countLeadingZeros64( sig ); 48 | *sigPtr = sig< 38 | #include "platform.h" 39 | #include "internals.h" 40 | 41 | struct exp32_sig64 softfloat_normSubnormalExtF80Sig( uint_fast64_t sig ) 42 | { 43 | int_fast8_t shiftDist; 44 | struct exp32_sig64 z; 45 | 46 | shiftDist = softfloat_countLeadingZeros64( sig ); 47 | z.exp = -shiftDist; 48 | z.sig = sig< 38 | #include "platform.h" 39 | #include "internals.h" 40 | 41 | struct exp8_sig16 softfloat_normSubnormalF16Sig( uint_fast16_t sig ) 42 | { 43 | int_fast8_t shiftDist; 44 | struct exp8_sig16 z; 45 | 46 | shiftDist = softfloat_countLeadingZeros16( sig ) - 5; 47 | z.exp = 1 - shiftDist; 48 | z.sig = sig< 38 | #include "platform.h" 39 | #include "internals.h" 40 | 41 | struct exp16_sig32 softfloat_normSubnormalF32Sig( uint_fast32_t sig ) 42 | { 43 | int_fast8_t shiftDist; 44 | struct exp16_sig32 z; 45 | 46 | shiftDist = softfloat_countLeadingZeros32( sig ) - 8; 47 | z.exp = 1 - shiftDist; 48 | z.sig = sig< 38 | #include "platform.h" 39 | #include "internals.h" 40 | 41 | struct exp16_sig64 softfloat_normSubnormalF64Sig( uint_fast64_t sig ) 42 | { 43 | int_fast8_t shiftDist; 44 | struct exp16_sig64 z; 45 | 46 | shiftDist = softfloat_countLeadingZeros64( sig ) - 11; 47 | z.exp = 1 - shiftDist; 48 | z.sig = sig< 38 | #include "platform.h" 39 | 40 | #ifndef softfloat_shiftRightJam32 41 | 42 | uint32_t softfloat_shiftRightJam32( uint32_t a, uint_fast16_t dist ) 43 | { 44 | 45 | return 46 | (dist < 31) ? a>>dist | ((uint32_t) (a<<(-dist & 31)) != 0) : (a != 0); 47 | 48 | } 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_shiftRightJam64.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | 40 | #ifndef softfloat_shiftRightJam64 41 | 42 | uint64_t softfloat_shiftRightJam64( uint64_t a, uint_fast32_t dist ) 43 | { 44 | 45 | return 46 | (dist < 63) ? a>>dist | ((uint64_t) (a<<(-dist & 63)) != 0) : (a != 0); 47 | 48 | } 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_shortShiftLeft128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_shortShiftLeft128 42 | 43 | struct uint128 44 | softfloat_shortShiftLeft128( uint64_t a64, uint64_t a0, uint_fast8_t dist ) 45 | { 46 | struct uint128 z; 47 | 48 | z.v64 = a64<>(-dist & 63); 49 | z.v0 = a0< 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_shortShiftLeft64To96M 42 | 43 | void 44 | softfloat_shortShiftLeft64To96M( 45 | uint64_t a, uint_fast8_t dist, uint32_t *zPtr ) 46 | { 47 | 48 | zPtr[indexWord( 3, 0 )] = (uint32_t) a<>= 32 - dist; 50 | zPtr[indexWord( 3, 2 )] = a>>32; 51 | zPtr[indexWord( 3, 1 )] = a; 52 | 53 | } 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_shortShiftRight128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_shortShiftRight128 42 | 43 | struct uint128 44 | softfloat_shortShiftRight128( uint64_t a64, uint64_t a0, uint_fast8_t dist ) 45 | { 46 | struct uint128 z; 47 | 48 | z.v64 = a64>>dist; 49 | z.v0 = a64<<(-dist & 63) | a0>>dist; 50 | return z; 51 | 52 | } 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_shortShiftRightJam128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_shortShiftRightJam128 42 | 43 | struct uint128 44 | softfloat_shortShiftRightJam128( 45 | uint64_t a64, uint64_t a0, uint_fast8_t dist ) 46 | { 47 | uint_fast8_t uNegDist; 48 | struct uint128 z; 49 | 50 | uNegDist = -dist; 51 | z.v64 = a64>>dist; 52 | z.v0 = 53 | a64<<(uNegDist & 63) | a0>>dist 54 | | ((uint64_t) (a0<<(uNegDist & 63)) != 0); 55 | return z; 56 | 57 | } 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_shortShiftRightJam64.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | 40 | #ifndef softfloat_shortShiftRightJam64 41 | 42 | uint64_t softfloat_shortShiftRightJam64( uint64_t a, uint_fast8_t dist ) 43 | { 44 | 45 | return a>>dist | ((a & (((uint_fast64_t) 1< 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_shortShiftRightJam64Extra 42 | 43 | struct uint64_extra 44 | softfloat_shortShiftRightJam64Extra( 45 | uint64_t a, uint64_t extra, uint_fast8_t dist ) 46 | { 47 | struct uint64_extra z; 48 | 49 | z.v = a>>dist; 50 | z.extra = a<<(-dist & 63) | (extra != 0); 51 | return z; 52 | 53 | } 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_sub128.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_sub128 42 | 43 | struct uint128 44 | softfloat_sub128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) 45 | { 46 | struct uint128 z; 47 | 48 | z.v0 = a0 - b0; 49 | z.v64 = a64 - b64 - (a0 < b0); 50 | return z; 51 | 52 | } 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_sub1XM.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of 8 | California. All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "primitiveTypes.h" 40 | 41 | #ifndef softfloat_sub1XM 42 | 43 | void softfloat_sub1XM( uint_fast8_t size_words, uint32_t *zPtr ) 44 | { 45 | unsigned int index, lastIndex; 46 | uint32_t wordA; 47 | 48 | index = indexWordLo( size_words ); 49 | lastIndex = indexWordHi( size_words ); 50 | for (;;) { 51 | wordA = zPtr[index]; 52 | zPtr[index] = wordA - 1; 53 | if ( wordA || (index == lastIndex) ) break; 54 | index += wordIncr; 55 | } 56 | 57 | } 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/s_tryPropagateNaNF128M.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include 39 | #include "platform.h" 40 | #include "internals.h" 41 | #include "specialize.h" 42 | 43 | bool 44 | softfloat_tryPropagateNaNF128M( 45 | const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr ) 46 | { 47 | 48 | if ( softfloat_isNaNF128M( aWPtr ) || softfloat_isNaNF128M( bWPtr ) ) { 49 | softfloat_propagateNaNF128M( aWPtr, bWPtr, zWPtr ); 50 | return true; 51 | } 52 | return false; 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/softfloat_state.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All Rights Reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "specialize.h" 41 | #include "softfloat.h" 42 | 43 | #ifndef THREAD_LOCAL 44 | #define THREAD_LOCAL 45 | #endif 46 | 47 | THREAD_LOCAL uint_fast8_t softfloat_roundingMode = softfloat_round_near_even; 48 | THREAD_LOCAL uint_fast8_t softfloat_detectTininess = init_detectTininess; 49 | THREAD_LOCAL uint_fast8_t softfloat_exceptionFlags = 0; 50 | 51 | THREAD_LOCAL uint_fast8_t extF80_roundingPrecision = 80; 52 | 53 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/ui32_to_f32.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All Rights Reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "softfloat.h" 41 | 42 | float32_t ui32_to_f32( uint32_t a ) 43 | { 44 | union ui32_f32 uZ; 45 | 46 | if ( ! a ) { 47 | uZ.ui = 0; 48 | return uZ.f; 49 | } 50 | if ( a & 0x80000000 ) { 51 | return softfloat_roundPackToF32( 0, 0x9D, a>>1 | (a & 1) ); 52 | } else { 53 | return softfloat_normRoundPackToF32( 0, 0x9C, a ); 54 | } 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/ui32_to_f64.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of 8 | California. All Rights Reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "softfloat.h" 41 | 42 | float64_t ui32_to_f64( uint32_t a ) 43 | { 44 | uint_fast64_t uiZ; 45 | int_fast8_t shiftDist; 46 | union ui64_f64 uZ; 47 | 48 | if ( ! a ) { 49 | uiZ = 0; 50 | } else { 51 | shiftDist = softfloat_countLeadingZeros32( a ) + 21; 52 | uiZ = 53 | packToF64UI( 0, 0x432 - shiftDist, (uint_fast64_t) a< 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "softfloat.h" 41 | 42 | extFloat80_t ui64_to_extF80( uint64_t a ) 43 | { 44 | uint_fast16_t uiZ64; 45 | int_fast8_t shiftDist; 46 | union { struct extFloat80M s; extFloat80_t f; } uZ; 47 | 48 | uiZ64 = 0; 49 | if ( a ) { 50 | shiftDist = softfloat_countLeadingZeros64( a ); 51 | uiZ64 = 0x403E - shiftDist; 52 | a <<= shiftDist; 53 | } 54 | uZ.s.signExp = uiZ64; 55 | uZ.s.signif = a; 56 | return uZ.f; 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloat-3d/source/ui64_to_f64.c: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic 5 | Package, Release 3d, by John R. Hauser. 6 | 7 | Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. 8 | All Rights Reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, 14 | this list of conditions, and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions, and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | 3. Neither the name of the University nor the names of its contributors may 21 | be used to endorse or promote products derived from this software without 22 | specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | =============================================================================*/ 36 | 37 | #include 38 | #include "platform.h" 39 | #include "internals.h" 40 | #include "softfloat.h" 41 | 42 | float64_t ui64_to_f64( uint64_t a ) 43 | { 44 | union ui64_f64 uZ; 45 | 46 | if ( ! a ) { 47 | uZ.ui = 0; 48 | return uZ.f; 49 | } 50 | if ( a & UINT64_C( 0x8000000000000000 ) ) { 51 | return 52 | softfloat_roundPackToF64( 53 | 0, 0x43D, softfloat_shortShiftRightJam64( a, 1 ) ); 54 | } else { 55 | return softfloat_normRoundPackToF64( 0, 0x43C, a ); 56 | } 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /Library/SoftFloatLib/SoftFloatLib.dec: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | DEC_SPECIFICATION = 0x00010005 15 | PACKAGE_NAME = SoftFloatLibPkg 16 | PACKAGE_GUID = B3E3D4D5-D42B-4497-A175-464F483D127F 17 | PACKAGE_VERSION = 0.01 18 | 19 | [Includes] 20 | . 21 | SoftFloat-3d/build/Linux-x86_64-GCC/ 22 | SoftFloat-3d/source/include/ 23 | SoftFloat-3d/source/8086-SSE/ 24 | -------------------------------------------------------------------------------- /Library/StdExtLib/README.md: -------------------------------------------------------------------------------- 1 | # StdExtLib 2 | 3 | This provides functionality that should be in the edk2 StdLib, but isn't, and that 4 | isn't large enough to be a library on its own. This also overrides 5 | some broken behavior in StdLib, so be sure to include 6 | [`Library/StdExtLib.h`](../../Include/Library/StdExtLib.h) last. 7 | 8 | There also a few overrides for StdLib that fix broken StdLib 9 | behavior or add features. These are effectively to be treated 10 | as part of StdExtLib. 11 | 12 | What | Replaces | Notes 13 | --- | --- | --- 14 | StdLibUefi | DevUefi | [README.md](../StdLibUefi/README.md) 15 | StdLibDevConsole | DevConsole | [README.md](../StdLibDevConsole/README.md) 16 | StdLibInteractiveIO | LibIIO | [README.md](../StdLibInteractiveIO/README.md) 17 | 18 | I ought to upstream at least some of these fixes. Without these fixes, the 19 | NetBSD tools in this collection will work even worse than they do now ;-). 20 | -------------------------------------------------------------------------------- /Library/StdExtLib/StdExtLib.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Andrei Evgenievich Warkentin 3 | # 4 | # This program and the accompanying materials 5 | # are licensed and made available under the terms and conditions of the BSD License 6 | # which accompanies this distribution. The full text of the license may be found at 7 | # http://opensource.org/licenses/bsd-license.php 8 | # 9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 | # 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010005 15 | BASE_NAME = StdExtLib 16 | FILE_GUID = ddcbcbc1-bb25-11df-8e4e-0002a5d5c51c 17 | MODULE_TYPE = BASE 18 | VERSION_STRING = 1.0 19 | LIBRARY_CLASS = StdExtLib 20 | 21 | [Sources] 22 | strmode.c 23 | humanize.c 24 | toascii.c 25 | strsuftoll.c 26 | swab.c 27 | reallocarr.c 28 | getopt_long.c 29 | getline.c 30 | fnmatch.c 31 | 32 | [Packages] 33 | MdePkg/MdePkg.dec 34 | MdeModulePkg/MdeModulePkg.dec 35 | UefiToolsPkg/UefiToolsPkg.dec 36 | StdLib/StdLib.dec 37 | 38 | [LibraryClasses] 39 | LibC 40 | 41 | [Guids] 42 | 43 | [Protocols] 44 | -------------------------------------------------------------------------------- /Library/StdExtLib/toascii.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: toascii.c,v 1.3 2012/06/25 22:32:44 abs Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1989 The Regents of the University of California. 5 | * All rights reserved. 6 | * (c) UNIX System Laboratories, Inc. 7 | * All or some portions of this file are derived from material licensed 8 | * to the University of California by American Telephone and Telegraph 9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 10 | * the permission of UNIX System Laboratories, Inc. 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions 14 | * are met: 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 3. Neither the name of the University nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 | * SUCH DAMAGE. 35 | * 36 | * from: @(#)isctype.c 5.2 (Berkeley) 6/1/90 37 | */ 38 | 39 | #include 40 | #if defined(LIBC_SCCS) && !defined(lint) 41 | __RCSID("$NetBSD: toascii.c,v 1.3 2012/06/25 22:32:44 abs Exp $"); 42 | #endif /* LIBC_SCCS and not lint */ 43 | 44 | #include 45 | 46 | #undef toascii 47 | int 48 | toascii(int c) 49 | { 50 | return ((c) & 0177); 51 | } 52 | -------------------------------------------------------------------------------- /Library/StdLibDevConsole/README.md: -------------------------------------------------------------------------------- 1 | This is a fixed-up version of edk2's `StdLib/LibC/Uefi/Devices/Console`. 2 | 3 | NOTE: [`StdExtLib`](../StdExtLib), [`StdLibDevConsole`](../StdLibDevConsole), [`StdLibInteractiveIO`](../StdLibInteractiveIO) and [`StdLibUefi`](../StdLibUefi) all go together. 4 | 5 | NOTE: the redirection/pipe features rely on using a v2 UEFI Shell. 6 | 7 | Differences: 8 | - if StdErr isn't redirected via Shell to a file, redirect it out to ConOut. 9 | This solves the unexpected behavior of POSIX apps seemingly printing 10 | nothing on error on certain UEFI implementations that always redirect 11 | StdErr to serial or to noting. 12 | - Set correct permissions and current time on `stdin:`/`stdout:`/`stderr:`. 13 | - Disallow reading on `stdout:` and `stderr:`. 14 | - Make Shell redirection via pipes work (e.g. `ls | cat`). 15 | - Move Termio init from StdLibUefi. 16 | - Detect Shell redirection of StdIn/StdOut/Stderr (file or 'pipe') to 17 | properly apply termios flag. Interactive I/O behavior is only 18 | applied if we detect interactive console (e.g. don't want `ECHO` 19 | when redirecting to a file, don't want `ICANON` if redirecting 20 | from a file). 21 | - Strip UTF16 BOM tag from StdIn, which is useful when redirecting 22 | via pipe or file. 23 | - Ignore 0-sized writes. 24 | - Catch wide writes where StrLen doesn't match buffer size, to 25 | catch `Proto->OutputString` corruption. 26 | - Remove gMD->StdIo usage (no one cares about it at of 2017 for sure). 27 | - add the notion of "narrow" aliases `nstdin:`, `nstdout:` and `nstderr:`. 28 | These only function when dealing with redirection (i.e. *never* 29 | interactive console), and are useful for dealing with binary 30 | data. e.g. to make a perfect copy. 31 | - Strip UTF16 BOM tag from narrow StdOut/StdErr. 32 | - st_blksize == 1 to make up for lack of st_blocks 33 | (so you can always st_physsize / st_blksize) 34 | - Support v1 Shell mode (e.g. VMware Fusion). Redirection/pipes 35 | is a lost cause, but at least the basic use cases work. 36 | 37 | Improvements to make: 38 | - VINTR should raise signals. 39 | - `whence` should not be ignored in da_conSeek. 40 | -------------------------------------------------------------------------------- /Library/StdLibDevConsole/daConsole.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Standard C library: Console Device Abstraction. 3 | # 4 | # Copyright (C) 2017, Andrei Warkentin 5 | # 6 | # Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
7 | # This program and the accompanying materials are licensed and made available 8 | # under the terms and conditions of the BSD License which accompanies this 9 | # distribution. The full text of the license may be found at 10 | # http://opensource.org/licenses/bsd-license.php. 11 | # 12 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 | # 15 | 16 | [Defines] 17 | INF_VERSION = 0x00010005 18 | BASE_NAME = DevConsole 19 | FILE_GUID = f6937495-1f44-4a8a-8a1b-5a669f9396f6 20 | MODULE_TYPE = UEFI_APPLICATION 21 | VERSION_STRING = 1.0 22 | LIBRARY_CLASS = DevConsole 23 | CONSTRUCTOR = __Cons_construct 24 | DESTRUCTOR = __Cons_deconstruct 25 | 26 | # 27 | # VALID_ARCHITECTURES = IA32 X64 IPF 28 | # 29 | 30 | [Sources] 31 | daConsole.c 32 | 33 | [Packages] 34 | StdLib/StdLib.dec 35 | StdLibPrivateInternalFiles/DoNotUse.dec 36 | MdePkg/MdePkg.dec 37 | ShellPkg/ShellPkg.dec 38 | 39 | [LibraryClasses] 40 | BaseLib 41 | BaseMemoryLib 42 | MemoryAllocationLib 43 | UefiBootServicesTableLib 44 | LibC 45 | LibWchar 46 | LibUefi 47 | LibIIO 48 | DevUtility 49 | ShellLib 50 | 51 | [Protocols] 52 | gEfiSimpleTextInProtocolGuid ## CONSUMED 53 | gEfiSimpleTextOutProtocolGuid ## CONSUMED 54 | -------------------------------------------------------------------------------- /Library/StdLibInteractiveIO/IIO.inf: -------------------------------------------------------------------------------- 1 | ## @file 2 | # Interactive I/O Library. 3 | # 4 | # Copyright (c) 2012, Intel Corporation. All rights reserved.
5 | # This program and the accompanying materials are licensed and made available 6 | # under the terms and conditions of the BSD License which accompanies this 7 | # distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php. 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | ## 14 | 15 | [Defines] 16 | INF_VERSION = 0x00010005 17 | BASE_NAME = LibIIO 18 | FILE_GUID = c1e9fffb-5557-4cb5-a5f5-1fbd902a74ed 19 | MODULE_TYPE = UEFI_APPLICATION 20 | VERSION_STRING = 1.0 21 | LIBRARY_CLASS = LibIIO 22 | 23 | # 24 | # VALID_ARCHITECTURES = IA32 X64 25 | # 26 | 27 | [Sources] 28 | IIO.c 29 | NonCanonRead.c 30 | CanonRead.c 31 | TerminalFunctions.c 32 | IIOutilities.c 33 | IIOwrite.c 34 | IIOecho.c 35 | 36 | [Packages] 37 | MdePkg/MdePkg.dec 38 | StdLib/StdLib.dec 39 | StdLibPrivateInternalFiles/DoNotUse.dec 40 | 41 | [LibraryClasses] 42 | BaseLib 43 | BaseMemoryLib 44 | MemoryAllocationLib 45 | LibC 46 | LibWchar 47 | LibContainer 48 | 49 | [Protocols] 50 | gEfiSimpleTextInProtocolGuid ## CONSUMES 51 | gEfiSimpleTextOutProtocolGuid ## CONSUMES 52 | -------------------------------------------------------------------------------- /Library/StdLibInteractiveIO/IIOechoCtrl.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | Constants and declarations for the Echo function. 3 | 4 | Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials are licensed and made available 6 | under the terms and conditions of the BSD License which accompanies this 7 | distribution. The full text of the license may be found at 8 | http://opensource.org/licenses/bsd-license.php. 9 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | **/ 13 | #ifndef _IIO_ECHO_CTRL_H 14 | #define _IIO_ECHO_CTRL_H 15 | #include 16 | 17 | __BEGIN_DECLS 18 | 19 | /* These constants are assigned values within the Unicode Private Use range. 20 | The value of IIO_ECHO_MIN must be adjusted to ensure that IIO_ECHO_MAX 21 | never exceeds the value of (TtyFunKeyMin - 1). 22 | */ 23 | typedef enum { 24 | IIO_ECHO_MIN = (TtySpecKeyMin), 25 | IIO_ECHO_DISCARD = IIO_ECHO_MIN, // Ignore this character completely 26 | IIO_ECHO_ERASE, // Erase previous character 27 | IIO_ECHO_KILL, // Kill the entire line 28 | IIO_ECHO_MAX 29 | } IioEchoCtrl; 30 | 31 | __END_DECLS 32 | 33 | #endif /* _IIO_ECHO_CTRL_H */ 34 | -------------------------------------------------------------------------------- /Library/StdLibInteractiveIO/README.md: -------------------------------------------------------------------------------- 1 | This is a fixed-up version of edk2's `StdLib/LibC/Uefi/InteractiveIO`, the 2 | line discipline porition of StdLib. 3 | 4 | NOTE: [`StdExtLib`](../StdExtLib), [`StdLibDevConsole`](../StdLibDevConsole), [`StdLibInteractiveIO`](../StdLibInteractiveIO) and [`StdLibUefi`](../StdLibUefi) all go together. 5 | 6 | Differences: 7 | - Honor `c_cc[VEOF]` as `WEOF`, breaking out of input on `^D`. 8 | - Do not treat errors (inside `IIO_GetInChar`) as `WEOF`. 9 | - Properly percolate `IIO_GetInChar` errors through `IIO_CanonRead`. 10 | - Properly percolate `IIO_CanonRead`/`IIO_NonCanonRead` return values through `IIO_Read`, 11 | making errors and 0 (e.g. `VEOF`) work correctly. 12 | - Default `VQUIT` and `VINTR` to abort ongoing I/O with `EIO`. 13 | - No default Termios initialization. 14 | - Fix `IIO_Echo` calling `fo_write` with 0 bytes. 15 | - Fix `IIO_Write` callling `fo_write` with 0 bytes (not seen in the wild, but...) 16 | - Fix `IIO_Write` incorrectly treating CharLen as signed size, leading to crashes 17 | and unpredictable behavior on writes of binary data through IIO. 18 | - Fix `IIO_Write` to allow printing wide NULs. 19 | - Drop UTF8 support entirely. "POSIX" side is taken to be single-byte only. This 20 | may seem like loss of functionality, but in practice it will make, when 21 | combined with special "narrow" stdin/stdout variants and redirection, the UNIX 22 | tools work as expected on binary data (without corrupting it). 23 | 24 | It seem InteractiveIO is its own ad-hoc, and very buggy implementation 25 | of a line discipline. That seems like a mistake. Many issues exist 26 | because I/O is done through the UEFI Shell and that expects UTF16-coded 27 | data (the weird Shell 'narrow' `|a` `a` are just broken as they 28 | expect _printable_ NUL-terminated UTF16). 29 | -------------------------------------------------------------------------------- /Library/StdLibUefi/README.md: -------------------------------------------------------------------------------- 1 | This is a fixed-up version of edk2's `StdLib/LibC/Uefi`. 2 | 3 | NOTE: [`StdExtLib`](../StdExtLib), [`StdLibDevConsole`](../StdLibDevConsole), [`StdLibInteractiveIO`](../StdLibInteractiveIO) and [`StdLibUefi`](../StdLibUefi) all go together. 4 | 5 | Differences: 6 | - `^D` is the `VEOF` character, allowing to break out of input. 7 | - Termios init is moved to StdLibDevConsole, where it belongs. 8 | - getopt is now in StdExtLib (sharing the backing implementation for getopt_long). 9 | -------------------------------------------------------------------------------- /Library/StdLibUefi/StubFunctions.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | Implement the invalid functions to return failures. 3 | 4 | Copyright (c) 2011, Intel Corporation 5 | All rights reserved. This program and the accompanying materials 6 | are licensed and made available under the terms and conditions of the BSD License 7 | which accompanies this distribution. The full text of the license may be found at 8 | http://opensource.org/licenses/bsd-license 9 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | 13 | **/ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | struct passwd * 23 | getpwuid (uid_t uid) 24 | { 25 | errno = EPERM; 26 | return NULL; 27 | } 28 | 29 | char * 30 | getlogin (void) 31 | { 32 | errno = EPERM; 33 | return NULL; 34 | } 35 | 36 | struct passwd * 37 | getpwnam (const char *name) 38 | { 39 | errno = EPERM; 40 | return NULL; 41 | } 42 | 43 | uid_t 44 | getuid (void) 45 | { 46 | return 0; 47 | } 48 | 49 | pid_t 50 | getpid(void) 51 | { 52 | return 0; 53 | } 54 | 55 | pid_t 56 | fork (void) 57 | { 58 | errno = EPERM; 59 | return (-1); 60 | } 61 | 62 | int 63 | chmod (const char *c, mode_t m) 64 | { 65 | errno = EPERM; 66 | return (-1); 67 | } 68 | 69 | pid_t 70 | wait(int *stat_loc) { 71 | return 0; 72 | } 73 | 74 | FILE * 75 | popen (const char *cmd, const char *type) 76 | { 77 | errno = EPERM; 78 | return NULL; 79 | } 80 | 81 | int 82 | pclose (FILE *stream) 83 | { 84 | errno = EPERM; 85 | return -1; 86 | } 87 | 88 | mode_t 89 | umask(mode_t cmask) 90 | { 91 | return (mode_t)0; 92 | } 93 | -------------------------------------------------------------------------------- /Library/StdLibUefi/Uefi.inf: -------------------------------------------------------------------------------- 1 | ## @file 2 | # Standard C library: UEFI "system calls". 3 | # 4 | # Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
5 | # 6 | # This program and the accompanying materials 7 | # are licensed and made available under the terms and conditions of the BSD License 8 | # which accompanies this distribution. The full text of the license may be found at 9 | # http://opensource.org/licenses/bsd-license.php. 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | ## 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010005 16 | BASE_NAME = LibUefi 17 | FILE_GUID = 1dcff17c-aa53-4b78-b234-864027555035 18 | MODULE_TYPE = UEFI_APPLICATION 19 | VERSION_STRING = 1.05 20 | LIBRARY_CLASS = LibUefi 21 | LIBRARY_DESTRUCTOR = DestructMePlease 22 | 23 | # 24 | # VALID_ARCHITECTURES = IA32 X64 25 | # 26 | 27 | [Sources] 28 | select.c 29 | SysCalls.c 30 | writev.c 31 | Xform.c 32 | compat.c 33 | StubFunctions.c 34 | 35 | [Packages] 36 | StdLib/StdLib.dec 37 | StdLibPrivateInternalFiles/DoNotUse.dec 38 | MdePkg/MdePkg.dec 39 | ShellPkg/ShellPkg.dec 40 | 41 | [LibraryClasses] 42 | UefiLib 43 | BaseLib 44 | BaseMemoryLib 45 | MemoryAllocationLib 46 | UefiBootServicesTableLib 47 | ShellLib 48 | LibC 49 | LibLocale 50 | LibString 51 | LibTime 52 | LibGen 53 | DevUtility 54 | -------------------------------------------------------------------------------- /Library/UtilsLib/UtilsLib.inf: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2017-09-24 13:33:09 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | INF_VERSION = 0x00010005 16 | BASE_NAME = UtilsLib 17 | FILE_GUID = ddbbbbb1-bb25-11df-8e4e-0002a5d5c51b 18 | MODULE_TYPE = BASE 19 | VERSION_STRING = 1.0 20 | LIBRARY_CLASS = UtilsLib 21 | 22 | [Sources] 23 | Utils.c 24 | RangeCheck.c 25 | 26 | [Packages] 27 | MdePkg/MdePkg.dec 28 | ShellPkg/ShellPkg.dec 29 | MdeModulePkg/MdeModulePkg.dec 30 | UefiToolsPkg/UefiToolsPkg.dec 31 | 32 | [LibraryClasses] 33 | UefiLib 34 | BaseMemoryLib 35 | SortLib 36 | MemoryAllocationLib 37 | UefiBootServicesTableLib 38 | 39 | [Guids] 40 | gEfiFileInfoGuid 41 | 42 | [Protocols] 43 | gEfiSimpleFileSystemProtocolGuid 44 | gEfiShellInterfaceGuid 45 | gEfiShellParametersProtocolGuid 46 | -------------------------------------------------------------------------------- /Scripts/GdbUefi/README.md: -------------------------------------------------------------------------------- 1 | # gdb_uefi.py 2 | 3 | Allows loading TianoCore symbols into a GDB remote 4 | debugging session. 5 | 6 | Last validated with GDB 7.10. 7 | 8 | This is how it works: `GdbSyms.efi` is a dummy binary that 9 | contains the relevant symbols needed by the script 10 | to find and load image symbols. `GdbSyms.efi` does not 11 | need to be present on the target! 12 | 13 | $ gdb /path/to/GdbSyms.dll 14 | (gdb) target remote .... 15 | (gdb) source Scripts/gdb_uefi.py 16 | (gdb) reload-uefi -o /path/to/GdbSyms.dll 17 | 18 | N.B: it was noticed that GDB for certain targets behaves strangely 19 | when run without any binary - like assuming a certain physical 20 | address space size and endianness. To avoid this madness and 21 | seing strange bugs, make sure to pass `/path/to/GdbSyms.dll` 22 | when starting gdb. 23 | 24 | The `-o` option should be used if you've debugging EFI, where the PE 25 | images were converted from MACH-O or ELF binaries. 26 | -------------------------------------------------------------------------------- /UefiToolsPkg.dec: -------------------------------------------------------------------------------- 1 | # 2 | # Time-stamp: <2016-06-11 00:39:06 andreiw> 3 | # Copyright (C) 2016 Andrei Evgenievich Warkentin 4 | # 5 | # This program and the accompanying materials 6 | # are licensed and made available under the terms and conditions of the BSD License 7 | # which accompanies this distribution. The full text of the license may be found at 8 | # http://opensource.org/licenses/bsd-license.php 9 | # 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | 14 | [Defines] 15 | DEC_SPECIFICATION = 0x00010005 16 | PACKAGE_NAME = UefiToolsPkg 17 | PACKAGE_GUID = B3E3D4D5-D42B-4497-A175-464F489D127E 18 | PACKAGE_VERSION = 0.01 19 | 20 | [Includes] 21 | Include 22 | 23 | [LibraryClasses] 24 | UtilsLib|Include/Library/UtilsLib.h 25 | SoftFloatLib.h|Include/Library/SoftFloatLib.h 26 | FTSLib|Include/Library/FTSLib.h 27 | StdExtLib|Include/Library/StdExtLib.h 28 | RegexLib|Include/Library/RegexLib.h 29 | 30 | [Guids] 31 | gUefiToolsPkgTokenSpaceGuid = { 0xaba2deb5, 0x7607, 0x4a78, { 0xa7, 0xdd, 0x43, 0xe4, 0xbd, 0x72, 0xc0, 0x99 }} 32 | 33 | [PcdsFixedAtBuild] 34 | --------------------------------------------------------------------------------