├── .gitignore ├── .gitmodules ├── .vscode ├── c_cpp_properties.json ├── launch.json ├── settings.json ├── tasks.json └── templates │ ├── Kiwi C Source.c │ ├── Kiwi C++ Source.cpp │ └── Kiwi Header.h ├── 3rdparty ├── bin │ └── dungeon │ │ ├── HISTORY │ │ ├── README │ │ ├── README.Kiwi │ │ ├── SConscript │ │ ├── actors.c │ │ ├── ballop.c │ │ ├── clockr.c │ │ ├── demons.c │ │ ├── dgame.c │ │ ├── dinit.c │ │ ├── dmain.c │ │ ├── dso1.c │ │ ├── dso2.c │ │ ├── dso3.c │ │ ├── dso4.c │ │ ├── dso5.c │ │ ├── dso6.c │ │ ├── dso7.c │ │ ├── dsub.c │ │ ├── dtextc.uu1 │ │ ├── dtextc.uu2 │ │ ├── dtextc.uu3 │ │ ├── dtextc.uu4 │ │ ├── dverb1.c │ │ ├── dverb2.c │ │ ├── funcs.h │ │ ├── gdt.c │ │ ├── lightp.c │ │ ├── local.c │ │ ├── manifest │ │ ├── nobjs.c │ │ ├── np.c │ │ ├── np1.c │ │ ├── np2.c │ │ ├── np3.c │ │ ├── nrooms.c │ │ ├── objcts.c │ │ ├── parse.h │ │ ├── rooms.c │ │ ├── sobjs.c │ │ ├── supp.c │ │ ├── sverbs.c │ │ ├── vars.h │ │ ├── verbs.c │ │ └── villns.c ├── kconfig │ ├── SConscript │ ├── conf.c │ ├── confdata.c │ ├── expr.c │ ├── expr.h │ ├── lex.zconf.c │ ├── lkc.h │ ├── lkc_proto.h │ ├── lxdialog │ │ ├── BIG.FAT.WARNING │ │ ├── checklist.c │ │ ├── dialog.h │ │ ├── inputbox.c │ │ ├── menubox.c │ │ ├── textbox.c │ │ ├── util.c │ │ └── yesno.c │ ├── mconf.c │ ├── menu.c │ ├── symbol.c │ ├── util.c │ ├── zconf.gperf │ ├── zconf.hash.c │ ├── zconf.l │ ├── zconf.tab.c │ └── zconf.y ├── kernel │ ├── font.c │ ├── libfdt │ │ ├── README.license │ │ ├── fdt.c │ │ ├── fdt_addresses.c │ │ ├── fdt_check.c │ │ ├── fdt_empty_tree.c │ │ ├── fdt_overlay.c │ │ ├── fdt_ro.c │ │ ├── fdt_rw.c │ │ ├── fdt_strerror.c │ │ ├── fdt_sw.c │ │ ├── fdt_wip.c │ │ ├── include │ │ │ ├── fdt.h │ │ │ ├── libfdt.h │ │ │ └── libfdt_env.h │ │ ├── kiwi-version.txt │ │ └── libfdt_internal.h │ ├── virtio │ │ ├── virtio_config.h │ │ ├── virtio_ids.h │ │ ├── virtio_net.h │ │ ├── virtio_pci.h │ │ ├── virtio_ring.h │ │ └── virtio_types.h │ └── x86emu │ │ ├── LICENSE │ │ ├── debug.c │ │ ├── decode.c │ │ ├── fpu.c │ │ ├── ops.c │ │ ├── ops2.c │ │ ├── prim_ops.c │ │ ├── sys.c │ │ ├── validate.c │ │ ├── x86emu.h │ │ └── x86emu │ │ ├── debug.h │ │ ├── decode.h │ │ ├── fpu.h │ │ ├── fpu_regs.h │ │ ├── ops.h │ │ ├── prim_asm.h │ │ ├── prim_ops.h │ │ ├── regs.h │ │ ├── types.h │ │ └── x86emui.h └── lib │ ├── compiler-rt │ ├── LICENSE.TXT │ ├── kiwi-version.txt │ └── lib │ │ ├── builtins │ │ ├── CMakeLists.txt │ │ ├── Darwin-excludes │ │ │ ├── CMakeLists.txt │ │ │ ├── README.TXT │ │ │ ├── ios-armv7.txt │ │ │ ├── ios-armv7s.txt │ │ │ ├── ios.txt │ │ │ ├── ios6-armv7.txt │ │ │ ├── ios6-armv7s.txt │ │ │ ├── ios7-arm64.txt │ │ │ ├── iossim-i386.txt │ │ │ ├── iossim-x86_64.txt │ │ │ ├── iossim.txt │ │ │ ├── osx-i386.txt │ │ │ └── osx.txt │ │ ├── README.txt │ │ ├── aarch64 │ │ │ ├── chkstk.S │ │ │ ├── fp_mode.c │ │ │ └── lse.S │ │ ├── absvdi2.c │ │ ├── absvsi2.c │ │ ├── absvti2.c │ │ ├── adddf3.c │ │ ├── addsf3.c │ │ ├── addtf3.c │ │ ├── addvdi3.c │ │ ├── addvsi3.c │ │ ├── addvti3.c │ │ ├── apple_versioning.c │ │ ├── arm │ │ │ ├── adddf3vfp.S │ │ │ ├── addsf3.S │ │ │ ├── addsf3vfp.S │ │ │ ├── aeabi_cdcmp.S │ │ │ ├── aeabi_cdcmpeq_check_nan.c │ │ │ ├── aeabi_cfcmp.S │ │ │ ├── aeabi_cfcmpeq_check_nan.c │ │ │ ├── aeabi_dcmp.S │ │ │ ├── aeabi_div0.c │ │ │ ├── aeabi_drsub.c │ │ │ ├── aeabi_fcmp.S │ │ │ ├── aeabi_frsub.c │ │ │ ├── aeabi_idivmod.S │ │ │ ├── aeabi_ldivmod.S │ │ │ ├── aeabi_memcmp.S │ │ │ ├── aeabi_memcpy.S │ │ │ ├── aeabi_memmove.S │ │ │ ├── aeabi_memset.S │ │ │ ├── aeabi_uidivmod.S │ │ │ ├── aeabi_uldivmod.S │ │ │ ├── bswapdi2.S │ │ │ ├── bswapsi2.S │ │ │ ├── chkstk.S │ │ │ ├── clzdi2.S │ │ │ ├── clzsi2.S │ │ │ ├── comparesf2.S │ │ │ ├── divdf3vfp.S │ │ │ ├── divmodsi4.S │ │ │ ├── divsf3vfp.S │ │ │ ├── divsi3.S │ │ │ ├── eqdf2vfp.S │ │ │ ├── eqsf2vfp.S │ │ │ ├── extendsfdf2vfp.S │ │ │ ├── fixdfsivfp.S │ │ │ ├── fixsfsivfp.S │ │ │ ├── fixunsdfsivfp.S │ │ │ ├── fixunssfsivfp.S │ │ │ ├── floatsidfvfp.S │ │ │ ├── floatsisfvfp.S │ │ │ ├── floatunssidfvfp.S │ │ │ ├── floatunssisfvfp.S │ │ │ ├── fp_mode.c │ │ │ ├── gedf2vfp.S │ │ │ ├── gesf2vfp.S │ │ │ ├── gtdf2vfp.S │ │ │ ├── gtsf2vfp.S │ │ │ ├── ledf2vfp.S │ │ │ ├── lesf2vfp.S │ │ │ ├── ltdf2vfp.S │ │ │ ├── ltsf2vfp.S │ │ │ ├── modsi3.S │ │ │ ├── muldf3vfp.S │ │ │ ├── mulsf3vfp.S │ │ │ ├── nedf2vfp.S │ │ │ ├── negdf2vfp.S │ │ │ ├── negsf2vfp.S │ │ │ ├── nesf2vfp.S │ │ │ ├── restore_vfp_d8_d15_regs.S │ │ │ ├── save_vfp_d8_d15_regs.S │ │ │ ├── softfloat-alias.list │ │ │ ├── subdf3vfp.S │ │ │ ├── subsf3vfp.S │ │ │ ├── switch16.S │ │ │ ├── switch32.S │ │ │ ├── switch8.S │ │ │ ├── switchu8.S │ │ │ ├── sync-ops.h │ │ │ ├── sync_fetch_and_add_4.S │ │ │ ├── sync_fetch_and_add_8.S │ │ │ ├── sync_fetch_and_and_4.S │ │ │ ├── sync_fetch_and_and_8.S │ │ │ ├── sync_fetch_and_max_4.S │ │ │ ├── sync_fetch_and_max_8.S │ │ │ ├── sync_fetch_and_min_4.S │ │ │ ├── sync_fetch_and_min_8.S │ │ │ ├── sync_fetch_and_nand_4.S │ │ │ ├── sync_fetch_and_nand_8.S │ │ │ ├── sync_fetch_and_or_4.S │ │ │ ├── sync_fetch_and_or_8.S │ │ │ ├── sync_fetch_and_sub_4.S │ │ │ ├── sync_fetch_and_sub_8.S │ │ │ ├── sync_fetch_and_umax_4.S │ │ │ ├── sync_fetch_and_umax_8.S │ │ │ ├── sync_fetch_and_umin_4.S │ │ │ ├── sync_fetch_and_umin_8.S │ │ │ ├── sync_fetch_and_xor_4.S │ │ │ ├── sync_fetch_and_xor_8.S │ │ │ ├── sync_synchronize.S │ │ │ ├── truncdfsf2vfp.S │ │ │ ├── udivmodsi4.S │ │ │ ├── udivsi3.S │ │ │ ├── umodsi3.S │ │ │ ├── unorddf2vfp.S │ │ │ └── unordsf2vfp.S │ │ ├── ashldi3.c │ │ ├── ashlti3.c │ │ ├── ashrdi3.c │ │ ├── ashrti3.c │ │ ├── assembly.h │ │ ├── atomic.c │ │ ├── atomic_flag_clear.c │ │ ├── atomic_flag_clear_explicit.c │ │ ├── atomic_flag_test_and_set.c │ │ ├── atomic_flag_test_and_set_explicit.c │ │ ├── atomic_signal_fence.c │ │ ├── atomic_thread_fence.c │ │ ├── bswapdi2.c │ │ ├── bswapsi2.c │ │ ├── clear_cache.c │ │ ├── clzdi2.c │ │ ├── clzsi2.c │ │ ├── clzti2.c │ │ ├── cmpdi2.c │ │ ├── cmpti2.c │ │ ├── comparedf2.c │ │ ├── comparesf2.c │ │ ├── comparetf2.c │ │ ├── cpu_model.c │ │ ├── ctzdi2.c │ │ ├── ctzsi2.c │ │ ├── ctzti2.c │ │ ├── divdc3.c │ │ ├── divdf3.c │ │ ├── divdi3.c │ │ ├── divmoddi4.c │ │ ├── divmodsi4.c │ │ ├── divmodti4.c │ │ ├── divsc3.c │ │ ├── divsf3.c │ │ ├── divsi3.c │ │ ├── divtc3.c │ │ ├── divtf3.c │ │ ├── divti3.c │ │ ├── divxc3.c │ │ ├── emutls.c │ │ ├── enable_execute_stack.c │ │ ├── eprintf.c │ │ ├── extenddftf2.c │ │ ├── extendhfsf2.c │ │ ├── extendhftf2.c │ │ ├── extendsfdf2.c │ │ ├── extendsftf2.c │ │ ├── ffsdi2.c │ │ ├── ffssi2.c │ │ ├── ffsti2.c │ │ ├── fixdfdi.c │ │ ├── fixdfsi.c │ │ ├── fixdfti.c │ │ ├── fixsfdi.c │ │ ├── fixsfsi.c │ │ ├── fixsfti.c │ │ ├── fixtfdi.c │ │ ├── fixtfsi.c │ │ ├── fixtfti.c │ │ ├── fixunsdfdi.c │ │ ├── fixunsdfsi.c │ │ ├── fixunsdfti.c │ │ ├── fixunssfdi.c │ │ ├── fixunssfsi.c │ │ ├── fixunssfti.c │ │ ├── fixunstfdi.c │ │ ├── fixunstfsi.c │ │ ├── fixunstfti.c │ │ ├── fixunsxfdi.c │ │ ├── fixunsxfsi.c │ │ ├── fixunsxfti.c │ │ ├── fixxfdi.c │ │ ├── fixxfti.c │ │ ├── floatdidf.c │ │ ├── floatdisf.c │ │ ├── floatditf.c │ │ ├── floatdixf.c │ │ ├── floatsidf.c │ │ ├── floatsisf.c │ │ ├── floatsitf.c │ │ ├── floattidf.c │ │ ├── floattisf.c │ │ ├── floattitf.c │ │ ├── floattixf.c │ │ ├── floatundidf.c │ │ ├── floatundisf.c │ │ ├── floatunditf.c │ │ ├── floatundixf.c │ │ ├── floatunsidf.c │ │ ├── floatunsisf.c │ │ ├── floatunsitf.c │ │ ├── floatuntidf.c │ │ ├── floatuntisf.c │ │ ├── floatuntitf.c │ │ ├── floatuntixf.c │ │ ├── fp_add_impl.inc │ │ ├── fp_compare_impl.inc │ │ ├── fp_div_impl.inc │ │ ├── fp_extend.h │ │ ├── fp_extend_impl.inc │ │ ├── fp_fixint_impl.inc │ │ ├── fp_fixuint_impl.inc │ │ ├── fp_lib.h │ │ ├── fp_mode.c │ │ ├── fp_mode.h │ │ ├── fp_mul_impl.inc │ │ ├── fp_trunc.h │ │ ├── fp_trunc_impl.inc │ │ ├── gcc_personality_v0.c │ │ ├── hexagon │ │ │ ├── common_entry_exit_abi1.S │ │ │ ├── common_entry_exit_abi2.S │ │ │ ├── common_entry_exit_legacy.S │ │ │ ├── dfaddsub.S │ │ │ ├── dfdiv.S │ │ │ ├── dffma.S │ │ │ ├── dfminmax.S │ │ │ ├── dfmul.S │ │ │ ├── dfsqrt.S │ │ │ ├── divdi3.S │ │ │ ├── divsi3.S │ │ │ ├── fastmath2_dlib_asm.S │ │ │ ├── fastmath2_ldlib_asm.S │ │ │ ├── fastmath_dlib_asm.S │ │ │ ├── memcpy_forward_vp4cp4n2.S │ │ │ ├── memcpy_likely_aligned.S │ │ │ ├── moddi3.S │ │ │ ├── modsi3.S │ │ │ ├── sfdiv_opt.S │ │ │ ├── sfsqrt_opt.S │ │ │ ├── udivdi3.S │ │ │ ├── udivmoddi4.S │ │ │ ├── udivmodsi4.S │ │ │ ├── udivsi3.S │ │ │ ├── umoddi3.S │ │ │ └── umodsi3.S │ │ ├── i386 │ │ │ ├── ashldi3.S │ │ │ ├── ashrdi3.S │ │ │ ├── chkstk.S │ │ │ ├── chkstk2.S │ │ │ ├── divdi3.S │ │ │ ├── floatdidf.S │ │ │ ├── floatdisf.S │ │ │ ├── floatdixf.S │ │ │ ├── floatundidf.S │ │ │ ├── floatundisf.S │ │ │ ├── floatundixf.S │ │ │ ├── fp_mode.c │ │ │ ├── lshrdi3.S │ │ │ ├── moddi3.S │ │ │ ├── muldi3.S │ │ │ ├── udivdi3.S │ │ │ └── umoddi3.S │ │ ├── int_div_impl.inc │ │ ├── int_endianness.h │ │ ├── int_lib.h │ │ ├── int_math.h │ │ ├── int_mulo_impl.inc │ │ ├── int_mulv_impl.inc │ │ ├── int_types.h │ │ ├── int_util.c │ │ ├── int_util.h │ │ ├── lshrdi3.c │ │ ├── lshrti3.c │ │ ├── macho_embedded │ │ │ ├── CMakeLists.txt │ │ │ ├── arm.txt │ │ │ ├── common.txt │ │ │ ├── i386.txt │ │ │ ├── thumb2-64.txt │ │ │ └── thumb2.txt │ │ ├── moddi3.c │ │ ├── modsi3.c │ │ ├── modti3.c │ │ ├── muldc3.c │ │ ├── muldf3.c │ │ ├── muldi3.c │ │ ├── mulodi4.c │ │ ├── mulosi4.c │ │ ├── muloti4.c │ │ ├── mulsc3.c │ │ ├── mulsf3.c │ │ ├── multc3.c │ │ ├── multf3.c │ │ ├── multi3.c │ │ ├── mulvdi3.c │ │ ├── mulvsi3.c │ │ ├── mulvti3.c │ │ ├── mulxc3.c │ │ ├── negdf2.c │ │ ├── negdi2.c │ │ ├── negsf2.c │ │ ├── negti2.c │ │ ├── negvdi2.c │ │ ├── negvsi2.c │ │ ├── negvti2.c │ │ ├── os_version_check.c │ │ ├── paritydi2.c │ │ ├── paritysi2.c │ │ ├── parityti2.c │ │ ├── popcountdi2.c │ │ ├── popcountsi2.c │ │ ├── popcountti2.c │ │ ├── powidf2.c │ │ ├── powisf2.c │ │ ├── powitf2.c │ │ ├── powixf2.c │ │ ├── ppc │ │ │ ├── DD.h │ │ │ ├── atomic.exp │ │ │ ├── divtc3.c │ │ │ ├── fixtfdi.c │ │ │ ├── fixtfti.c │ │ │ ├── fixunstfdi.c │ │ │ ├── fixunstfti.c │ │ │ ├── floatditf.c │ │ │ ├── floattitf.c │ │ │ ├── floatunditf.c │ │ │ ├── gcc_qadd.c │ │ │ ├── gcc_qdiv.c │ │ │ ├── gcc_qmul.c │ │ │ ├── gcc_qsub.c │ │ │ ├── multc3.c │ │ │ ├── restFP.S │ │ │ └── saveFP.S │ │ ├── riscv │ │ │ ├── int_mul_impl.inc │ │ │ ├── muldi3.S │ │ │ ├── mulsi3.S │ │ │ ├── restore.S │ │ │ └── save.S │ │ ├── subdf3.c │ │ ├── subsf3.c │ │ ├── subtf3.c │ │ ├── subvdi3.c │ │ ├── subvsi3.c │ │ ├── subvti3.c │ │ ├── trampoline_setup.c │ │ ├── truncdfhf2.c │ │ ├── truncdfsf2.c │ │ ├── truncsfhf2.c │ │ ├── trunctfdf2.c │ │ ├── trunctfhf2.c │ │ ├── trunctfsf2.c │ │ ├── ucmpdi2.c │ │ ├── ucmpti2.c │ │ ├── udivdi3.c │ │ ├── udivmoddi4.c │ │ ├── udivmodsi4.c │ │ ├── udivmodti4.c │ │ ├── udivsi3.c │ │ ├── udivti3.c │ │ ├── umoddi3.c │ │ ├── umodsi3.c │ │ ├── umodti3.c │ │ ├── unwind-ehabi-helpers.h │ │ ├── ve │ │ │ ├── grow_stack.S │ │ │ └── grow_stack_align.S │ │ └── x86_64 │ │ │ ├── chkstk.S │ │ │ ├── chkstk2.S │ │ │ ├── floatdidf.c │ │ │ ├── floatdisf.c │ │ │ ├── floatdixf.c │ │ │ ├── floatundidf.S │ │ │ ├── floatundisf.S │ │ │ └── floatundixf.S │ │ └── crt │ │ ├── crtbegin.c │ │ └── crtend.c │ ├── dlmalloc.c │ ├── libcxx │ ├── CREDITS.TXT │ ├── LICENSE.TXT │ ├── include │ │ ├── CMakeLists.txt │ │ ├── __algorithm │ │ │ ├── adjacent_find.h │ │ │ ├── all_of.h │ │ │ ├── any_of.h │ │ │ ├── binary_search.h │ │ │ ├── clamp.h │ │ │ ├── comp.h │ │ │ ├── comp_ref_type.h │ │ │ ├── copy.h │ │ │ ├── copy_backward.h │ │ │ ├── copy_if.h │ │ │ ├── copy_n.h │ │ │ ├── count.h │ │ │ ├── count_if.h │ │ │ ├── equal.h │ │ │ ├── equal_range.h │ │ │ ├── fill.h │ │ │ ├── fill_n.h │ │ │ ├── find.h │ │ │ ├── find_end.h │ │ │ ├── find_first_of.h │ │ │ ├── find_if.h │ │ │ ├── find_if_not.h │ │ │ ├── for_each.h │ │ │ ├── for_each_n.h │ │ │ ├── generate.h │ │ │ ├── generate_n.h │ │ │ ├── half_positive.h │ │ │ ├── in_in_out_result.h │ │ │ ├── in_in_result.h │ │ │ ├── in_out_result.h │ │ │ ├── includes.h │ │ │ ├── inplace_merge.h │ │ │ ├── is_heap.h │ │ │ ├── is_heap_until.h │ │ │ ├── is_partitioned.h │ │ │ ├── is_permutation.h │ │ │ ├── is_sorted.h │ │ │ ├── is_sorted_until.h │ │ │ ├── iter_swap.h │ │ │ ├── lexicographical_compare.h │ │ │ ├── lower_bound.h │ │ │ ├── make_heap.h │ │ │ ├── max.h │ │ │ ├── max_element.h │ │ │ ├── merge.h │ │ │ ├── min.h │ │ │ ├── min_element.h │ │ │ ├── minmax.h │ │ │ ├── minmax_element.h │ │ │ ├── mismatch.h │ │ │ ├── move.h │ │ │ ├── move_backward.h │ │ │ ├── next_permutation.h │ │ │ ├── none_of.h │ │ │ ├── nth_element.h │ │ │ ├── partial_sort.h │ │ │ ├── partial_sort_copy.h │ │ │ ├── partition.h │ │ │ ├── partition_copy.h │ │ │ ├── partition_point.h │ │ │ ├── pop_heap.h │ │ │ ├── prev_permutation.h │ │ │ ├── push_heap.h │ │ │ ├── remove.h │ │ │ ├── remove_copy.h │ │ │ ├── remove_copy_if.h │ │ │ ├── remove_if.h │ │ │ ├── replace.h │ │ │ ├── replace_copy.h │ │ │ ├── replace_copy_if.h │ │ │ ├── replace_if.h │ │ │ ├── reverse.h │ │ │ ├── reverse_copy.h │ │ │ ├── rotate.h │ │ │ ├── rotate_copy.h │ │ │ ├── sample.h │ │ │ ├── search.h │ │ │ ├── search_n.h │ │ │ ├── set_difference.h │ │ │ ├── set_intersection.h │ │ │ ├── set_symmetric_difference.h │ │ │ ├── set_union.h │ │ │ ├── shift_left.h │ │ │ ├── shift_right.h │ │ │ ├── shuffle.h │ │ │ ├── sift_down.h │ │ │ ├── sort.h │ │ │ ├── sort_heap.h │ │ │ ├── stable_partition.h │ │ │ ├── stable_sort.h │ │ │ ├── swap_ranges.h │ │ │ ├── transform.h │ │ │ ├── unique.h │ │ │ ├── unique_copy.h │ │ │ ├── unwrap_iter.h │ │ │ └── upper_bound.h │ │ ├── __availability │ │ ├── __bit │ │ │ ├── bit_cast.h │ │ │ └── byteswap.h │ │ ├── __bit_reference │ │ ├── __bits │ │ ├── __bsd_locale_defaults.h │ │ ├── __bsd_locale_fallbacks.h │ │ ├── __charconv │ │ │ ├── chars_format.h │ │ │ ├── from_chars_result.h │ │ │ └── to_chars_result.h │ │ ├── __chrono │ │ │ ├── calendar.h │ │ │ ├── convert_to_timespec.h │ │ │ ├── duration.h │ │ │ ├── file_clock.h │ │ │ ├── high_resolution_clock.h │ │ │ ├── steady_clock.h │ │ │ ├── system_clock.h │ │ │ └── time_point.h │ │ ├── __compare │ │ │ ├── common_comparison_category.h │ │ │ ├── compare_partial_order_fallback.h │ │ │ ├── compare_strong_order_fallback.h │ │ │ ├── compare_three_way.h │ │ │ ├── compare_three_way_result.h │ │ │ ├── compare_weak_order_fallback.h │ │ │ ├── is_eq.h │ │ │ ├── ordering.h │ │ │ ├── partial_order.h │ │ │ ├── strong_order.h │ │ │ ├── synth_three_way.h │ │ │ ├── three_way_comparable.h │ │ │ └── weak_order.h │ │ ├── __concepts │ │ │ ├── arithmetic.h │ │ │ ├── assignable.h │ │ │ ├── boolean_testable.h │ │ │ ├── class_or_enum.h │ │ │ ├── common_reference_with.h │ │ │ ├── common_with.h │ │ │ ├── constructible.h │ │ │ ├── convertible_to.h │ │ │ ├── copyable.h │ │ │ ├── derived_from.h │ │ │ ├── destructible.h │ │ │ ├── different_from.h │ │ │ ├── equality_comparable.h │ │ │ ├── invocable.h │ │ │ ├── movable.h │ │ │ ├── predicate.h │ │ │ ├── regular.h │ │ │ ├── relation.h │ │ │ ├── same_as.h │ │ │ ├── semiregular.h │ │ │ ├── swappable.h │ │ │ └── totally_ordered.h │ │ ├── __config │ │ ├── __config_site │ │ ├── __config_site.in │ │ ├── __coroutine │ │ │ ├── coroutine_handle.h │ │ │ ├── coroutine_traits.h │ │ │ ├── noop_coroutine_handle.h │ │ │ └── trivial_awaitables.h │ │ ├── __debug │ │ ├── __errc │ │ ├── __filesystem │ │ │ ├── copy_options.h │ │ │ ├── directory_entry.h │ │ │ ├── directory_iterator.h │ │ │ ├── directory_options.h │ │ │ ├── file_status.h │ │ │ ├── file_time_type.h │ │ │ ├── file_type.h │ │ │ ├── filesystem_error.h │ │ │ ├── operations.h │ │ │ ├── path.h │ │ │ ├── path_iterator.h │ │ │ ├── perm_options.h │ │ │ ├── perms.h │ │ │ ├── recursive_directory_iterator.h │ │ │ ├── space_info.h │ │ │ └── u8path.h │ │ ├── __format │ │ │ ├── format_arg.h │ │ │ ├── format_args.h │ │ │ ├── format_context.h │ │ │ ├── format_error.h │ │ │ ├── format_fwd.h │ │ │ ├── format_parse_context.h │ │ │ ├── format_string.h │ │ │ ├── format_to_n_result.h │ │ │ ├── formatter.h │ │ │ ├── formatter_bool.h │ │ │ ├── formatter_char.h │ │ │ ├── formatter_floating_point.h │ │ │ ├── formatter_integer.h │ │ │ ├── formatter_integral.h │ │ │ ├── formatter_pointer.h │ │ │ ├── formatter_string.h │ │ │ └── parser_std_format_spec.h │ │ ├── __functional │ │ │ ├── binary_function.h │ │ │ ├── binary_negate.h │ │ │ ├── bind.h │ │ │ ├── bind_back.h │ │ │ ├── bind_front.h │ │ │ ├── binder1st.h │ │ │ ├── binder2nd.h │ │ │ ├── compose.h │ │ │ ├── default_searcher.h │ │ │ ├── function.h │ │ │ ├── hash.h │ │ │ ├── identity.h │ │ │ ├── invoke.h │ │ │ ├── is_transparent.h │ │ │ ├── mem_fn.h │ │ │ ├── mem_fun_ref.h │ │ │ ├── not_fn.h │ │ │ ├── operations.h │ │ │ ├── perfect_forward.h │ │ │ ├── pointer_to_binary_function.h │ │ │ ├── pointer_to_unary_function.h │ │ │ ├── ranges_operations.h │ │ │ ├── reference_wrapper.h │ │ │ ├── unary_function.h │ │ │ ├── unary_negate.h │ │ │ ├── unwrap_ref.h │ │ │ └── weak_result_type.h │ │ ├── __functional_base │ │ ├── __hash_table │ │ ├── __iterator │ │ │ ├── access.h │ │ │ ├── advance.h │ │ │ ├── back_insert_iterator.h │ │ │ ├── common_iterator.h │ │ │ ├── concepts.h │ │ │ ├── counted_iterator.h │ │ │ ├── data.h │ │ │ ├── default_sentinel.h │ │ │ ├── distance.h │ │ │ ├── empty.h │ │ │ ├── erase_if_container.h │ │ │ ├── front_insert_iterator.h │ │ │ ├── incrementable_traits.h │ │ │ ├── indirectly_comparable.h │ │ │ ├── insert_iterator.h │ │ │ ├── istream_iterator.h │ │ │ ├── istreambuf_iterator.h │ │ │ ├── iter_move.h │ │ │ ├── iter_swap.h │ │ │ ├── iterator.h │ │ │ ├── iterator_traits.h │ │ │ ├── move_iterator.h │ │ │ ├── next.h │ │ │ ├── ostream_iterator.h │ │ │ ├── ostreambuf_iterator.h │ │ │ ├── prev.h │ │ │ ├── projected.h │ │ │ ├── readable_traits.h │ │ │ ├── reverse_access.h │ │ │ ├── reverse_iterator.h │ │ │ ├── size.h │ │ │ ├── unreachable_sentinel.h │ │ │ └── wrap_iter.h │ │ ├── __libcpp_version │ │ ├── __locale │ │ ├── __mbstate_t.h │ │ ├── __memory │ │ │ ├── addressof.h │ │ │ ├── allocation_guard.h │ │ │ ├── allocator.h │ │ │ ├── allocator_arg_t.h │ │ │ ├── allocator_traits.h │ │ │ ├── auto_ptr.h │ │ │ ├── compressed_pair.h │ │ │ ├── concepts.h │ │ │ ├── construct_at.h │ │ │ ├── pointer_traits.h │ │ │ ├── ranges_construct_at.h │ │ │ ├── ranges_uninitialized_algorithms.h │ │ │ ├── raw_storage_iterator.h │ │ │ ├── shared_ptr.h │ │ │ ├── temporary_buffer.h │ │ │ ├── uninitialized_algorithms.h │ │ │ ├── unique_ptr.h │ │ │ ├── uses_allocator.h │ │ │ └── voidify.h │ │ ├── __mutex_base │ │ ├── __node_handle │ │ ├── __nullptr │ │ ├── __numeric │ │ │ ├── accumulate.h │ │ │ ├── adjacent_difference.h │ │ │ ├── exclusive_scan.h │ │ │ ├── gcd_lcm.h │ │ │ ├── inclusive_scan.h │ │ │ ├── inner_product.h │ │ │ ├── iota.h │ │ │ ├── midpoint.h │ │ │ ├── partial_sum.h │ │ │ ├── reduce.h │ │ │ ├── transform_exclusive_scan.h │ │ │ ├── transform_inclusive_scan.h │ │ │ └── transform_reduce.h │ │ ├── __random │ │ │ ├── bernoulli_distribution.h │ │ │ ├── binomial_distribution.h │ │ │ ├── cauchy_distribution.h │ │ │ ├── chi_squared_distribution.h │ │ │ ├── clamp_to_integral.h │ │ │ ├── default_random_engine.h │ │ │ ├── discard_block_engine.h │ │ │ ├── discrete_distribution.h │ │ │ ├── exponential_distribution.h │ │ │ ├── extreme_value_distribution.h │ │ │ ├── fisher_f_distribution.h │ │ │ ├── gamma_distribution.h │ │ │ ├── generate_canonical.h │ │ │ ├── geometric_distribution.h │ │ │ ├── independent_bits_engine.h │ │ │ ├── is_seed_sequence.h │ │ │ ├── knuth_b.h │ │ │ ├── linear_congruential_engine.h │ │ │ ├── log2.h │ │ │ ├── lognormal_distribution.h │ │ │ ├── mersenne_twister_engine.h │ │ │ ├── negative_binomial_distribution.h │ │ │ ├── normal_distribution.h │ │ │ ├── piecewise_constant_distribution.h │ │ │ ├── piecewise_linear_distribution.h │ │ │ ├── poisson_distribution.h │ │ │ ├── random_device.h │ │ │ ├── ranlux.h │ │ │ ├── seed_seq.h │ │ │ ├── shuffle_order_engine.h │ │ │ ├── student_t_distribution.h │ │ │ ├── subtract_with_carry_engine.h │ │ │ ├── uniform_int_distribution.h │ │ │ ├── uniform_random_bit_generator.h │ │ │ ├── uniform_real_distribution.h │ │ │ └── weibull_distribution.h │ │ ├── __ranges │ │ │ ├── access.h │ │ │ ├── all.h │ │ │ ├── common_view.h │ │ │ ├── concepts.h │ │ │ ├── copyable_box.h │ │ │ ├── counted.h │ │ │ ├── dangling.h │ │ │ ├── data.h │ │ │ ├── drop_view.h │ │ │ ├── empty.h │ │ │ ├── empty_view.h │ │ │ ├── enable_borrowed_range.h │ │ │ ├── enable_view.h │ │ │ ├── iota_view.h │ │ │ ├── join_view.h │ │ │ ├── non_propagating_cache.h │ │ │ ├── owning_view.h │ │ │ ├── range_adaptor.h │ │ │ ├── ref_view.h │ │ │ ├── reverse_view.h │ │ │ ├── single_view.h │ │ │ ├── size.h │ │ │ ├── subrange.h │ │ │ ├── take_view.h │ │ │ ├── transform_view.h │ │ │ └── view_interface.h │ │ ├── __split_buffer │ │ ├── __std_stream │ │ ├── __string │ │ ├── __support │ │ │ ├── android │ │ │ │ └── locale_bionic.h │ │ │ ├── fuchsia │ │ │ │ └── xlocale.h │ │ │ ├── ibm │ │ │ │ ├── gettod_zos.h │ │ │ │ ├── limits.h │ │ │ │ ├── locale_mgmt_zos.h │ │ │ │ ├── nanosleep.h │ │ │ │ ├── support.h │ │ │ │ └── xlocale.h │ │ │ ├── musl │ │ │ │ └── xlocale.h │ │ │ ├── newlib │ │ │ │ └── xlocale.h │ │ │ ├── openbsd │ │ │ │ └── xlocale.h │ │ │ ├── solaris │ │ │ │ ├── floatingpoint.h │ │ │ │ ├── wchar.h │ │ │ │ └── xlocale.h │ │ │ ├── win32 │ │ │ │ ├── limits_msvc_win32.h │ │ │ │ └── locale_win32.h │ │ │ └── xlocale │ │ │ │ ├── __nop_locale_mgmt.h │ │ │ │ ├── __posix_l_fallback.h │ │ │ │ └── __strtonum_fallback.h │ │ ├── __thread │ │ │ ├── poll_with_backoff.h │ │ │ └── timed_backoff_policy.h │ │ ├── __threading_support │ │ ├── __tree │ │ ├── __tuple │ │ ├── __undef_macros │ │ ├── __utility │ │ │ ├── as_const.h │ │ │ ├── auto_cast.h │ │ │ ├── cmp.h │ │ │ ├── declval.h │ │ │ ├── exchange.h │ │ │ ├── forward.h │ │ │ ├── in_place.h │ │ │ ├── integer_sequence.h │ │ │ ├── move.h │ │ │ ├── pair.h │ │ │ ├── piecewise_construct.h │ │ │ ├── priority_tag.h │ │ │ ├── rel_ops.h │ │ │ ├── swap.h │ │ │ ├── to_underlying.h │ │ │ └── transaction.h │ │ ├── __variant │ │ │ └── monostate.h │ │ ├── algorithm │ │ ├── any │ │ ├── array │ │ ├── atomic │ │ ├── barrier │ │ ├── bit │ │ ├── bitset │ │ ├── cassert │ │ ├── ccomplex │ │ ├── cctype │ │ ├── cerrno │ │ ├── cfenv │ │ ├── cfloat │ │ ├── charconv │ │ ├── chrono │ │ ├── cinttypes │ │ ├── ciso646 │ │ ├── climits │ │ ├── clocale │ │ ├── cmath │ │ ├── codecvt │ │ ├── compare │ │ ├── complex │ │ ├── complex.h │ │ ├── concepts │ │ ├── condition_variable │ │ ├── coroutine │ │ ├── csetjmp │ │ ├── csignal │ │ ├── cstdarg │ │ ├── cstdbool │ │ ├── cstddef │ │ ├── cstdint │ │ ├── cstdio │ │ ├── cstdlib │ │ ├── cstring │ │ ├── ctgmath │ │ ├── ctime │ │ ├── ctype.h │ │ ├── cwchar │ │ ├── cwctype │ │ ├── deque │ │ ├── errno.h │ │ ├── exception │ │ ├── execution │ │ ├── experimental │ │ │ ├── __config │ │ │ ├── __memory │ │ │ ├── algorithm │ │ │ ├── coroutine │ │ │ ├── deque │ │ │ ├── filesystem │ │ │ ├── forward_list │ │ │ ├── functional │ │ │ ├── iterator │ │ │ ├── list │ │ │ ├── map │ │ │ ├── memory_resource │ │ │ ├── propagate_const │ │ │ ├── regex │ │ │ ├── set │ │ │ ├── simd │ │ │ ├── string │ │ │ ├── type_traits │ │ │ ├── unordered_map │ │ │ ├── unordered_set │ │ │ ├── utility │ │ │ └── vector │ │ ├── ext │ │ │ ├── __hash │ │ │ ├── hash_map │ │ │ └── hash_set │ │ ├── fenv.h │ │ ├── filesystem │ │ ├── float.h │ │ ├── format │ │ ├── forward_list │ │ ├── fstream │ │ ├── functional │ │ ├── future │ │ ├── initializer_list │ │ ├── inttypes.h │ │ ├── iomanip │ │ ├── ios │ │ ├── iosfwd │ │ ├── iostream │ │ ├── istream │ │ ├── iterator │ │ ├── latch │ │ ├── limits │ │ ├── limits.h │ │ ├── list │ │ ├── locale │ │ ├── locale.h │ │ ├── map │ │ ├── math.h │ │ ├── memory │ │ ├── module.modulemap │ │ ├── mutex │ │ ├── new │ │ ├── numbers │ │ ├── numeric │ │ ├── optional │ │ ├── ostream │ │ ├── queue │ │ ├── random │ │ ├── ranges │ │ ├── ratio │ │ ├── regex │ │ ├── scoped_allocator │ │ ├── semaphore │ │ ├── set │ │ ├── setjmp.h │ │ ├── shared_mutex │ │ ├── span │ │ ├── sstream │ │ ├── stack │ │ ├── stdbool.h │ │ ├── stddef.h │ │ ├── stdexcept │ │ ├── stdint.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── streambuf │ │ ├── string │ │ ├── string.h │ │ ├── string_view │ │ ├── strstream │ │ ├── system_error │ │ ├── tgmath.h │ │ ├── thread │ │ ├── tuple │ │ ├── type_traits │ │ ├── typeindex │ │ ├── typeinfo │ │ ├── unordered_map │ │ ├── unordered_set │ │ ├── utility │ │ ├── valarray │ │ ├── variant │ │ ├── vector │ │ ├── version │ │ ├── wchar.h │ │ └── wctype.h │ ├── kiwi-version.txt │ ├── lib │ │ ├── abi │ │ │ ├── CHANGELOG.TXT │ │ │ ├── CMakeLists.txt │ │ │ ├── README.TXT │ │ │ ├── arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist │ │ │ ├── x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist │ │ │ └── x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist │ │ ├── libc++abi.v1.exp │ │ ├── libc++abi.v2.exp │ │ ├── libc++unexp.exp │ │ ├── notweak.exp │ │ └── weak.exp │ └── src │ │ ├── CMakeLists.txt │ │ ├── algorithm.cpp │ │ ├── any.cpp │ │ ├── atomic.cpp │ │ ├── barrier.cpp │ │ ├── bind.cpp │ │ ├── charconv.cpp │ │ ├── chrono.cpp │ │ ├── chrono_system_time_init.h │ │ ├── condition_variable.cpp │ │ ├── condition_variable_destructor.cpp │ │ ├── debug.cpp │ │ ├── exception.cpp │ │ ├── experimental │ │ ├── memory_resource.cpp │ │ └── memory_resource_init_helper.h │ │ ├── filesystem │ │ ├── directory_iterator.cpp │ │ ├── filesystem_common.h │ │ ├── int128_builtins.cpp │ │ ├── operations.cpp │ │ └── posix_compat.h │ │ ├── format.cpp │ │ ├── functional.cpp │ │ ├── future.cpp │ │ ├── hash.cpp │ │ ├── include │ │ ├── apple_availability.h │ │ ├── atomic_support.h │ │ ├── config_elast.h │ │ ├── refstring.h │ │ ├── ryu │ │ │ ├── common.h │ │ │ ├── d2fixed.h │ │ │ ├── d2fixed_full_table.h │ │ │ ├── d2s.h │ │ │ ├── d2s_full_table.h │ │ │ ├── d2s_intrinsics.h │ │ │ ├── digit_table.h │ │ │ ├── f2s.h │ │ │ └── ryu.h │ │ ├── sso_allocator.h │ │ └── to_chars_floating_point.h │ │ ├── ios.cpp │ │ ├── ios.instantiations.cpp │ │ ├── iostream.cpp │ │ ├── iostream_init.h │ │ ├── legacy_pointer_safety.cpp │ │ ├── locale.cpp │ │ ├── memory.cpp │ │ ├── mutex.cpp │ │ ├── mutex_destructor.cpp │ │ ├── new.cpp │ │ ├── optional.cpp │ │ ├── random.cpp │ │ ├── random_shuffle.cpp │ │ ├── regex.cpp │ │ ├── ryu │ │ ├── README.txt │ │ ├── d2fixed.cpp │ │ ├── d2s.cpp │ │ └── f2s.cpp │ │ ├── shared_mutex.cpp │ │ ├── stdexcept.cpp │ │ ├── string.cpp │ │ ├── strstream.cpp │ │ ├── support │ │ ├── ibm │ │ │ ├── mbsnrtowcs.cpp │ │ │ ├── wcsnrtombs.cpp │ │ │ └── xlocale_zos.cpp │ │ ├── runtime │ │ │ ├── exception_fallback.ipp │ │ │ ├── exception_glibcxx.ipp │ │ │ ├── exception_libcxxabi.ipp │ │ │ ├── exception_libcxxrt.ipp │ │ │ ├── exception_msvc.ipp │ │ │ ├── exception_pointer_cxxabi.ipp │ │ │ ├── exception_pointer_glibcxx.ipp │ │ │ ├── exception_pointer_msvc.ipp │ │ │ ├── exception_pointer_unimplemented.ipp │ │ │ ├── new_handler_fallback.ipp │ │ │ ├── stdexcept_default.ipp │ │ │ └── stdexcept_vcruntime.ipp │ │ ├── solaris │ │ │ ├── README │ │ │ ├── mbsnrtowcs.inc │ │ │ ├── wcsnrtombs.inc │ │ │ └── xlocale.cpp │ │ └── win32 │ │ │ ├── locale_win32.cpp │ │ │ ├── support.cpp │ │ │ └── thread_win32.cpp │ │ ├── system_error.cpp │ │ ├── thread.cpp │ │ ├── typeinfo.cpp │ │ ├── utility.cpp │ │ ├── valarray.cpp │ │ ├── variant.cpp │ │ └── vector.cpp │ ├── libcxxrt │ ├── AUTHORS │ ├── CMakeLists.txt │ ├── COPYRIGHT │ ├── LICENSE │ ├── README │ ├── kiwi-version.txt │ ├── src │ │ ├── CMakeLists.txt │ │ ├── abi_namespace.h │ │ ├── atomic.h │ │ ├── auxhelper.cc │ │ ├── cxa_atexit.c │ │ ├── cxa_finalize.c │ │ ├── cxxabi.h │ │ ├── doxygen_config │ │ ├── dwarf_eh.h │ │ ├── dynamic_cast.cc │ │ ├── exception.cc │ │ ├── guard.cc │ │ ├── libelftc_dem_gnu3.c │ │ ├── memory.cc │ │ ├── noexception.cc │ │ ├── stdexcept.cc │ │ ├── stdexcept.h │ │ ├── terminate.cc │ │ ├── typeinfo.cc │ │ ├── typeinfo.h │ │ ├── unwind-arm.h │ │ ├── unwind-itanium.h │ │ └── unwind.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── run_test.sh │ │ ├── test.cc │ │ ├── test.h │ │ ├── test_demangle.cc │ │ ├── test_exception.cc │ │ ├── test_foreign_exceptions.cc │ │ ├── test_guard.cc │ │ └── test_typeinfo.cc │ ├── libunwind │ ├── .arcconfig │ ├── .clang-format │ ├── CMakeLists.txt │ ├── LICENSE.TXT │ ├── cmake │ │ ├── Modules │ │ │ └── HandleLibunwindFlags.cmake │ │ └── config-ix.cmake │ ├── docs │ │ ├── BuildingLibunwind.rst │ │ ├── CMakeLists.txt │ │ ├── README.txt │ │ ├── conf.py │ │ └── index.rst │ ├── include │ │ ├── CMakeLists.txt │ │ ├── __libunwind_config.h │ │ ├── libunwind.h │ │ ├── mach-o │ │ │ └── compact_unwind_encoding.h │ │ ├── unwind.h │ │ ├── unwind_arm_ehabi.h │ │ └── unwind_itanium.h │ ├── kiwi-version.txt │ └── src │ │ ├── AddressSpace.hpp │ │ ├── CMakeLists.txt │ │ ├── CompactUnwinder.hpp │ │ ├── DwarfInstructions.hpp │ │ ├── DwarfParser.hpp │ │ ├── EHHeaderParser.hpp │ │ ├── FrameHeaderCache.hpp │ │ ├── RWMutex.hpp │ │ ├── Registers.hpp │ │ ├── Unwind-EHABI.cpp │ │ ├── Unwind-EHABI.h │ │ ├── Unwind-seh.cpp │ │ ├── Unwind-sjlj.c │ │ ├── UnwindCursor.hpp │ │ ├── UnwindLevel1-gcc-ext.c │ │ ├── UnwindLevel1.c │ │ ├── UnwindRegistersRestore.S │ │ ├── UnwindRegistersSave.S │ │ ├── Unwind_AppleExtras.cpp │ │ ├── assembly.h │ │ ├── cet_unwind.h │ │ ├── config.h │ │ ├── dwarf2.h │ │ ├── libunwind.cpp │ │ └── libunwind_ext.h │ ├── mt19937-64.h │ └── musl │ ├── COPYRIGHT │ ├── arch │ ├── generic │ │ └── fp_arch.h │ └── x86_64 │ │ ├── atomic_arch.h │ │ └── bits │ │ └── fenv.h │ ├── include │ ├── arpa │ │ └── nameser.h │ ├── complex.h │ ├── ctype.h │ ├── endian.h │ ├── features.h │ ├── fenv.h │ ├── math.h │ ├── netdb.h │ ├── resolv.h │ ├── uchar.h │ ├── wchar.h │ └── wctype.h │ ├── kiwi-version.txt │ └── src │ ├── complex │ ├── __cexp.c │ ├── __cexpf.c │ ├── cabs.c │ ├── cabsf.c │ ├── cabsl.c │ ├── cacos.c │ ├── cacosf.c │ ├── cacosh.c │ ├── cacoshf.c │ ├── cacoshl.c │ ├── cacosl.c │ ├── carg.c │ ├── cargf.c │ ├── cargl.c │ ├── casin.c │ ├── casinf.c │ ├── casinh.c │ ├── casinhf.c │ ├── casinhl.c │ ├── casinl.c │ ├── catan.c │ ├── catanf.c │ ├── catanh.c │ ├── catanhf.c │ ├── catanhl.c │ ├── catanl.c │ ├── ccos.c │ ├── ccosf.c │ ├── ccosh.c │ ├── ccoshf.c │ ├── ccoshl.c │ ├── ccosl.c │ ├── cexp.c │ ├── cexpf.c │ ├── cexpl.c │ ├── cimag.c │ ├── cimagf.c │ ├── cimagl.c │ ├── clog.c │ ├── clogf.c │ ├── clogl.c │ ├── conj.c │ ├── conjf.c │ ├── conjl.c │ ├── cpow.c │ ├── cpowf.c │ ├── cpowl.c │ ├── cproj.c │ ├── cprojf.c │ ├── cprojl.c │ ├── creal.c │ ├── crealf.c │ ├── creall.c │ ├── csin.c │ ├── csinf.c │ ├── csinh.c │ ├── csinhf.c │ ├── csinhl.c │ ├── csinl.c │ ├── csqrt.c │ ├── csqrtf.c │ ├── csqrtl.c │ ├── ctan.c │ ├── ctanf.c │ ├── ctanh.c │ ├── ctanhf.c │ ├── ctanhl.c │ └── ctanl.c │ ├── ctype │ ├── alpha.h │ ├── casemap.h │ ├── isalnum.c │ ├── isalpha.c │ ├── isascii.c │ ├── isblank.c │ ├── iscntrl.c │ ├── isdigit.c │ ├── isgraph.c │ ├── islower.c │ ├── isprint.c │ ├── ispunct.c │ ├── isspace.c │ ├── isupper.c │ ├── iswalnum.c │ ├── iswalpha.c │ ├── iswblank.c │ ├── iswcntrl.c │ ├── iswctype.c │ ├── iswdigit.c │ ├── iswgraph.c │ ├── iswlower.c │ ├── iswprint.c │ ├── iswpunct.c │ ├── iswspace.c │ ├── iswupper.c │ ├── iswxdigit.c │ ├── isxdigit.c │ ├── nonspacing.h │ ├── punct.h │ ├── toascii.c │ ├── tolower.c │ ├── toupper.c │ ├── towctrans.c │ ├── wcswidth.c │ ├── wctrans.c │ ├── wcwidth.c │ └── wide.h │ ├── fenv │ ├── __flt_rounds.c │ ├── aarch64 │ │ └── fenv.s │ ├── fegetexceptflag.c │ ├── feholdexcept.c │ ├── fenv.c │ ├── fesetexceptflag.c │ ├── fesetround.c │ ├── feupdateenv.c │ └── x86_64 │ │ └── fenv.s │ ├── include │ ├── arpa │ │ └── inet.h │ ├── features.h │ └── resolv.h │ ├── internal │ ├── atomic.h │ ├── complex_impl.h │ ├── libm.h │ ├── locale_impl.h │ └── lock.h │ ├── locale │ ├── c_locale.c │ └── wcscoll.c │ ├── math │ ├── __cos.c │ ├── __cosdf.c │ ├── __cosl.c │ ├── __expo2.c │ ├── __expo2f.c │ ├── __fpclassify.c │ ├── __fpclassifyf.c │ ├── __fpclassifyl.c │ ├── __invtrigl.c │ ├── __invtrigl.h │ ├── __math_divzero.c │ ├── __math_divzerof.c │ ├── __math_invalid.c │ ├── __math_invalidf.c │ ├── __math_invalidl.c │ ├── __math_oflow.c │ ├── __math_oflowf.c │ ├── __math_uflow.c │ ├── __math_uflowf.c │ ├── __math_xflow.c │ ├── __math_xflowf.c │ ├── __polevll.c │ ├── __rem_pio2.c │ ├── __rem_pio2_large.c │ ├── __rem_pio2f.c │ ├── __rem_pio2l.c │ ├── __signbit.c │ ├── __signbitf.c │ ├── __signbitl.c │ ├── __sin.c │ ├── __sindf.c │ ├── __sinl.c │ ├── __tan.c │ ├── __tandf.c │ ├── __tanl.c │ ├── aarch64 │ │ ├── ceil.c │ │ ├── ceilf.c │ │ ├── fabs.c │ │ ├── fabsf.c │ │ ├── floor.c │ │ ├── floorf.c │ │ ├── fma.c │ │ ├── fmaf.c │ │ ├── fmax.c │ │ ├── fmaxf.c │ │ ├── fmin.c │ │ ├── fminf.c │ │ ├── llrint.c │ │ ├── llrintf.c │ │ ├── llround.c │ │ ├── llroundf.c │ │ ├── lrint.c │ │ ├── lrintf.c │ │ ├── lround.c │ │ ├── lroundf.c │ │ ├── nearbyint.c │ │ ├── nearbyintf.c │ │ ├── rint.c │ │ ├── rintf.c │ │ ├── round.c │ │ ├── roundf.c │ │ ├── sqrt.c │ │ ├── sqrtf.c │ │ ├── trunc.c │ │ └── truncf.c │ ├── acos.c │ ├── acosf.c │ ├── acosh.c │ ├── acoshf.c │ ├── acoshl.c │ ├── acosl.c │ ├── asin.c │ ├── asinf.c │ ├── asinh.c │ ├── asinhf.c │ ├── asinhl.c │ ├── asinl.c │ ├── atan.c │ ├── atan2.c │ ├── atan2f.c │ ├── atan2l.c │ ├── atanf.c │ ├── atanh.c │ ├── atanhf.c │ ├── atanhl.c │ ├── atanl.c │ ├── cbrt.c │ ├── cbrtf.c │ ├── cbrtl.c │ ├── ceil.c │ ├── ceilf.c │ ├── ceill.c │ ├── copysign.c │ ├── copysignf.c │ ├── copysignl.c │ ├── cos.c │ ├── cosf.c │ ├── cosh.c │ ├── coshf.c │ ├── coshl.c │ ├── cosl.c │ ├── erf.c │ ├── erff.c │ ├── erfl.c │ ├── exp.c │ ├── exp10.c │ ├── exp10f.c │ ├── exp10l.c │ ├── exp2.c │ ├── exp2f.c │ ├── exp2f_data.c │ ├── exp2f_data.h │ ├── exp2l.c │ ├── exp_data.c │ ├── exp_data.h │ ├── expf.c │ ├── expl.c │ ├── expm1.c │ ├── expm1f.c │ ├── expm1l.c │ ├── fabs.c │ ├── fabsf.c │ ├── fabsl.c │ ├── fdim.c │ ├── fdimf.c │ ├── fdiml.c │ ├── finite.c │ ├── finitef.c │ ├── floor.c │ ├── floorf.c │ ├── floorl.c │ ├── fma.c │ ├── fmaf.c │ ├── fmal.c │ ├── fmax.c │ ├── fmaxf.c │ ├── fmaxl.c │ ├── fmin.c │ ├── fminf.c │ ├── fminl.c │ ├── fmod.c │ ├── fmodf.c │ ├── fmodl.c │ ├── frexp.c │ ├── frexpf.c │ ├── frexpl.c │ ├── hypot.c │ ├── hypotf.c │ ├── hypotl.c │ ├── ilogb.c │ ├── ilogbf.c │ ├── ilogbl.c │ ├── j0.c │ ├── j0f.c │ ├── j1.c │ ├── j1f.c │ ├── jn.c │ ├── jnf.c │ ├── ldexp.c │ ├── ldexpf.c │ ├── ldexpl.c │ ├── lgamma.c │ ├── lgamma_r.c │ ├── lgammaf.c │ ├── lgammaf_r.c │ ├── lgammal.c │ ├── llrint.c │ ├── llrintf.c │ ├── llrintl.c │ ├── llround.c │ ├── llroundf.c │ ├── llroundl.c │ ├── log.c │ ├── log10.c │ ├── log10f.c │ ├── log10l.c │ ├── log1p.c │ ├── log1pf.c │ ├── log1pl.c │ ├── log2.c │ ├── log2_data.c │ ├── log2_data.h │ ├── log2f.c │ ├── log2f_data.c │ ├── log2f_data.h │ ├── log2l.c │ ├── log_data.c │ ├── log_data.h │ ├── logb.c │ ├── logbf.c │ ├── logbl.c │ ├── logf.c │ ├── logf_data.c │ ├── logf_data.h │ ├── logl.c │ ├── lrint.c │ ├── lrintf.c │ ├── lrintl.c │ ├── lround.c │ ├── lroundf.c │ ├── lroundl.c │ ├── modf.c │ ├── modff.c │ ├── modfl.c │ ├── nan.c │ ├── nanf.c │ ├── nanl.c │ ├── nearbyint.c │ ├── nearbyintf.c │ ├── nearbyintl.c │ ├── nextafter.c │ ├── nextafterf.c │ ├── nextafterl.c │ ├── nexttoward.c │ ├── nexttowardf.c │ ├── nexttowardl.c │ ├── pow.c │ ├── pow_data.c │ ├── pow_data.h │ ├── powf.c │ ├── powf_data.c │ ├── powf_data.h │ ├── powl.c │ ├── remainder.c │ ├── remainderf.c │ ├── remainderl.c │ ├── remquo.c │ ├── remquof.c │ ├── remquol.c │ ├── rint.c │ ├── rintf.c │ ├── rintl.c │ ├── round.c │ ├── roundf.c │ ├── roundl.c │ ├── scalb.c │ ├── scalbf.c │ ├── scalbln.c │ ├── scalblnf.c │ ├── scalblnl.c │ ├── scalbn.c │ ├── scalbnf.c │ ├── scalbnl.c │ ├── signgam.c │ ├── significand.c │ ├── significandf.c │ ├── sin.c │ ├── sincos.c │ ├── sincosf.c │ ├── sincosl.c │ ├── sinf.c │ ├── sinh.c │ ├── sinhf.c │ ├── sinhl.c │ ├── sinl.c │ ├── sqrt.c │ ├── sqrt_data.c │ ├── sqrt_data.h │ ├── sqrtf.c │ ├── sqrtl.c │ ├── tan.c │ ├── tanf.c │ ├── tanh.c │ ├── tanhf.c │ ├── tanhl.c │ ├── tanl.c │ ├── tgamma.c │ ├── tgammaf.c │ ├── tgammal.c │ ├── trunc.c │ ├── truncf.c │ ├── truncl.c │ └── x86_64 │ │ ├── __invtrigl.s │ │ ├── acosl.s │ │ ├── asinl.s │ │ ├── atan2l.s │ │ ├── atanl.s │ │ ├── ceill.s │ │ ├── exp2l.s │ │ ├── expl.s │ │ ├── expm1l.s │ │ ├── fabs.c │ │ ├── fabsf.c │ │ ├── fabsl.c │ │ ├── floorl.s │ │ ├── fma.c │ │ ├── fmaf.c │ │ ├── fmodl.c │ │ ├── llrint.c │ │ ├── llrintf.c │ │ ├── llrintl.c │ │ ├── log10l.s │ │ ├── log1pl.s │ │ ├── log2l.s │ │ ├── logl.s │ │ ├── lrint.c │ │ ├── lrintf.c │ │ ├── lrintl.c │ │ ├── remainderl.c │ │ ├── remquol.c │ │ ├── rintl.c │ │ ├── sqrt.c │ │ ├── sqrtf.c │ │ ├── sqrtl.c │ │ └── truncl.s │ ├── multibyte │ ├── btowc.c │ ├── c16rtomb.c │ ├── c32rtomb.c │ ├── internal.c │ ├── internal.h │ ├── mblen.c │ ├── mbrlen.c │ ├── mbrtoc16.c │ ├── mbrtoc32.c │ ├── mbrtowc.c │ ├── mbsinit.c │ ├── mbsnrtowcs.c │ ├── mbsrtowcs.c │ ├── mbstowcs.c │ ├── mbtowc.c │ ├── wcrtomb.c │ ├── wcsnrtombs.c │ ├── wcsrtombs.c │ ├── wcstombs.c │ ├── wctob.c │ └── wctomb.c │ ├── network │ ├── dn_expand.c │ ├── dns_parse.c │ ├── freeaddrinfo.c │ ├── gai_strerror.c │ ├── getaddrinfo.c │ ├── gethostbyname.c │ ├── gethostbyname2.c │ ├── gethostbyname2_r.c │ ├── gethostbyname_r.c │ ├── getnameinfo.c │ ├── getservbyname.c │ ├── getservbyname_r.c │ ├── getservbyport.c │ ├── getservbyport_r.c │ ├── h_errno.c │ ├── herror.c │ ├── hstrerror.c │ ├── inet_addr.c │ ├── inet_aton.c │ ├── inet_ntoa.c │ ├── inet_ntop.c │ ├── inet_pton.c │ ├── lookup.h │ ├── lookup_ipliteral.c │ ├── lookup_name.c │ ├── lookup_serv.c │ ├── res_mkquery.c │ ├── res_msend.c │ ├── res_query.c │ ├── res_send.c │ ├── resolvconf.c │ └── serv.c │ ├── prng │ ├── rand.c │ └── rand_r.c │ └── string │ ├── wcpcpy.c │ ├── wcpncpy.c │ ├── wcscasecmp.c │ ├── wcscasecmp_l.c │ ├── wcscat.c │ ├── wcschr.c │ ├── wcscmp.c │ ├── wcscpy.c │ ├── wcscspn.c │ ├── wcsdup.c │ ├── wcslen.c │ ├── wcsncasecmp.c │ ├── wcsncasecmp_l.c │ ├── wcsncat.c │ ├── wcsncmp.c │ ├── wcsncpy.c │ ├── wcsnlen.c │ ├── wcspbrk.c │ ├── wcsrchr.c │ ├── wcsspn.c │ ├── wcsstr.c │ ├── wcstok.c │ ├── wcswcs.c │ ├── wmemchr.c │ ├── wmemcmp.c │ ├── wmemcpy.c │ ├── wmemmove.c │ └── wmemset.c ├── Kconfig ├── README.md ├── SConstruct ├── data ├── bin ├── dev │ ├── null │ └── urandom ├── system │ ├── bin │ │ └── ldd │ ├── etc │ │ ├── hosts │ │ ├── init.sh │ │ └── resolv.conf │ └── fonts │ │ └── source-code-pro │ │ ├── LICENSE.md │ │ ├── SourceCodePro-Black.ttf │ │ ├── SourceCodePro-BlackIt.ttf │ │ ├── SourceCodePro-Bold.ttf │ │ ├── SourceCodePro-BoldIt.ttf │ │ ├── SourceCodePro-ExtraLight.ttf │ │ ├── SourceCodePro-ExtraLightIt.ttf │ │ ├── SourceCodePro-It.ttf │ │ ├── SourceCodePro-Light.ttf │ │ ├── SourceCodePro-LightIt.ttf │ │ ├── SourceCodePro-Medium.ttf │ │ ├── SourceCodePro-MediumIt.ttf │ │ ├── SourceCodePro-Regular.ttf │ │ ├── SourceCodePro-Semibold.ttf │ │ └── SourceCodePro-SemiboldIt.ttf └── users │ ├── admin │ └── dummy.txt │ └── template │ ├── .bashrc │ └── .nanorc ├── documentation ├── authors.md ├── design │ ├── devices.md │ ├── sched-priorities.txt │ └── security.md ├── licenses │ ├── cc-by-nc-nd.txt │ └── isc.txt ├── logo │ ├── logo-small.svg │ ├── logo.svg │ └── readme.txt ├── markdown │ ├── generate-docs.py │ └── template.html ├── rpi-testing.md ├── screenshots.md └── screenshots │ ├── 1.png │ ├── 2.png │ ├── 3.jpg │ ├── 3_small.jpg │ ├── 4.png │ ├── 5.png │ └── 6.png ├── source ├── SConscript ├── bin │ ├── SConscript │ ├── dungeon │ ├── posix │ │ ├── SConscript │ │ ├── cat.c │ │ ├── common.h │ │ ├── cp.c │ │ ├── ln.c │ │ ├── ls.c │ │ ├── mkdir.c │ │ ├── mv.c │ │ ├── rm.c │ │ ├── rmdir.c │ │ └── unlink.c │ ├── terminal │ │ ├── SConscript │ │ ├── font.cpp │ │ ├── font.h │ │ ├── framebuffer.cpp │ │ ├── framebuffer.h │ │ ├── keyboard.cpp │ │ ├── keyboard.h │ │ ├── keys.c │ │ ├── terminal.cpp │ │ ├── terminal.h │ │ ├── terminal_app.cpp │ │ ├── terminal_app.h │ │ ├── terminal_buffer.cpp │ │ ├── terminal_buffer.h │ │ ├── terminal_window.cpp │ │ ├── terminal_window.h │ │ ├── xterm.cpp │ │ └── xterm.h │ ├── test │ │ ├── SConscript │ │ ├── test_event.c │ │ ├── test_hello.c │ │ ├── test_ipc.c │ │ ├── test_kfb.c │ │ ├── test_net_client.c │ │ ├── test_net_server.c │ │ ├── test_net_tcpcat.c │ │ ├── test_process_group.c │ │ ├── test_service.c │ │ ├── test_signals.c │ │ ├── test_signals_stress.c │ │ └── test_threads.cpp │ └── utilities │ │ ├── SConscript │ │ ├── mount.c │ │ ├── net_control │ │ ├── SConscript │ │ ├── dhcp.c │ │ ├── dhcp.h │ │ ├── net_control.c │ │ ├── net_control.h │ │ └── utility.c │ │ └── unmount.c ├── boot ├── kernel │ ├── Kconfig │ ├── SConscript │ ├── arch │ │ ├── Kconfig │ │ ├── amd64 │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── acpi.c │ │ │ ├── ap_boot.S │ │ │ ├── arch.c │ │ │ ├── console.c │ │ │ ├── cpu.c │ │ │ ├── descriptor.c │ │ │ ├── elf.c │ │ │ ├── entry.S │ │ │ ├── include │ │ │ │ ├── arch │ │ │ │ │ ├── aspace.h │ │ │ │ │ ├── barrier.h │ │ │ │ │ ├── cache.h │ │ │ │ │ ├── cpu.h │ │ │ │ │ ├── elf.h │ │ │ │ │ ├── frame.h │ │ │ │ │ ├── io.h │ │ │ │ │ ├── kdb.h │ │ │ │ │ ├── lirq.h │ │ │ │ │ ├── mmu.h │ │ │ │ │ ├── page.h │ │ │ │ │ ├── setjmp.h │ │ │ │ │ ├── stack.h │ │ │ │ │ ├── thread.h │ │ │ │ │ └── types.h │ │ │ │ └── x86 │ │ │ │ │ ├── acpi.h │ │ │ │ │ ├── asm.h │ │ │ │ │ ├── console.h │ │ │ │ │ ├── cpu.h │ │ │ │ │ ├── descriptor.h │ │ │ │ │ ├── fpu.h │ │ │ │ │ ├── interrupt.h │ │ │ │ │ ├── lapic.h │ │ │ │ │ ├── mmu.h │ │ │ │ │ ├── pic.h │ │ │ │ │ ├── pit.h │ │ │ │ │ ├── smp.h │ │ │ │ │ └── tsc.h │ │ │ ├── interrupt.c │ │ │ ├── kdb.c │ │ │ ├── lapic.c │ │ │ ├── link.ld.in │ │ │ ├── mmu.c │ │ │ ├── page.c │ │ │ ├── pic.c │ │ │ ├── pit.c │ │ │ ├── rtc.c │ │ │ ├── setjmp.S │ │ │ ├── smp.c │ │ │ ├── switch.S │ │ │ ├── thread.c │ │ │ └── time.c │ │ └── arm64 │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── arch.c │ │ │ ├── cpu.c │ │ │ ├── elf.c │ │ │ ├── entry.S │ │ │ ├── exception.c │ │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── aspace.h │ │ │ │ ├── barrier.h │ │ │ │ ├── cache.h │ │ │ │ ├── cpu.h │ │ │ │ ├── elf.h │ │ │ │ ├── frame.h │ │ │ │ ├── io.h │ │ │ │ ├── kdb.h │ │ │ │ ├── lirq.h │ │ │ │ ├── mmu.h │ │ │ │ ├── page.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stack.h │ │ │ │ ├── thread.h │ │ │ │ └── types.h │ │ │ └── arm64 │ │ │ │ ├── asm.h │ │ │ │ ├── cpu.h │ │ │ │ ├── exception.h │ │ │ │ ├── kdb.h │ │ │ │ ├── mmu.h │ │ │ │ └── time.h │ │ │ ├── kdb.c │ │ │ ├── link.ld.in │ │ │ ├── mmu.c │ │ │ ├── page.c │ │ │ ├── setjmp.S │ │ │ ├── smp.c │ │ │ ├── switch.S │ │ │ ├── thread.c │ │ │ └── time.c │ ├── console │ │ ├── SConscript │ │ ├── console.c │ │ ├── fb.c │ │ ├── font.c │ │ └── logo.ppm │ ├── cpu.c │ ├── device │ │ ├── Kconfig │ │ ├── SConscript │ │ ├── bus.c │ │ ├── bus │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── dt │ │ │ │ ├── SConscript │ │ │ │ ├── dt.c │ │ │ │ ├── dt.h │ │ │ │ ├── fdt │ │ │ │ └── irq.c │ │ │ ├── pci │ │ │ │ ├── SConscript │ │ │ │ ├── pci.c │ │ │ │ ├── pci.h │ │ │ │ └── platform │ │ │ │ │ └── pc.c │ │ │ └── virtio │ │ │ │ ├── SConscript │ │ │ │ ├── virtio.c │ │ │ │ ├── virtio_pci.c │ │ │ │ └── virtio_pci.h │ │ ├── class.c │ │ ├── console │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── ns16550.c │ │ │ ├── pl011.c │ │ │ └── serial.c │ │ ├── device.c │ │ ├── disk │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── ata │ │ │ │ ├── SConscript │ │ │ │ ├── ata.c │ │ │ │ ├── ata.h │ │ │ │ ├── channel.c │ │ │ │ ├── device.c │ │ │ │ └── sff.c │ │ │ ├── disk.c │ │ │ ├── disk.h │ │ │ ├── gpt.c │ │ │ ├── gpt.h │ │ │ ├── mbr.c │ │ │ ├── mbr.h │ │ │ ├── partition.c │ │ │ └── pci_ata │ │ │ │ ├── SConscript │ │ │ │ └── pci_ata.c │ │ ├── dma.c │ │ ├── input │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── i8042 │ │ │ │ ├── SConscript │ │ │ │ ├── i8042.c │ │ │ │ └── keycodes.c │ │ │ └── input.c │ │ ├── io.c │ │ ├── irq.c │ │ ├── irq │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── arm_gic_v2 │ │ │ │ ├── SConscript │ │ │ │ └── arm_gic_v2.c │ │ │ └── bcm2836_l1_irq │ │ │ │ ├── SConscript │ │ │ │ └── bcm2836_l1_irq.c │ │ ├── net │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── net.c │ │ │ └── virtio_net │ │ │ │ ├── SConscript │ │ │ │ ├── virtio_net.c │ │ │ │ └── virtio_net.h │ │ └── timer │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ └── arm_timer │ │ │ ├── SConscript │ │ │ └── arm_timer.c │ ├── elf.c │ ├── fatal.c │ ├── include │ │ ├── assert.h │ │ ├── compiler.h │ │ ├── console.h │ │ ├── cpu.h │ │ ├── device │ │ │ ├── bus.h │ │ │ ├── bus │ │ │ │ ├── dt.h │ │ │ │ ├── pci.h │ │ │ │ └── virtio │ │ │ │ │ ├── virtio.h │ │ │ │ │ ├── virtio_config.h │ │ │ │ │ ├── virtio_ids.h │ │ │ │ │ ├── virtio_ring.h │ │ │ │ │ └── virtio_types.h │ │ │ ├── class.h │ │ │ ├── console │ │ │ │ ├── ns16550.h │ │ │ │ ├── pl011.h │ │ │ │ └── serial.h │ │ │ ├── device.h │ │ │ ├── disk │ │ │ │ ├── ata.h │ │ │ │ └── disk.h │ │ │ ├── dma.h │ │ │ ├── input │ │ │ │ └── input.h │ │ │ ├── io.h │ │ │ ├── irq.h │ │ │ └── net │ │ │ │ └── net.h │ │ ├── elf.h │ │ ├── io │ │ │ ├── context.h │ │ │ ├── file.h │ │ │ ├── file_map.h │ │ │ ├── fs.h │ │ │ ├── memory_file.h │ │ │ ├── request.h │ │ │ └── socket.h │ │ ├── kboot.h │ │ ├── kdb.h │ │ ├── kernel.h │ │ ├── kernel │ │ │ ├── condition.h │ │ │ ├── context.h │ │ │ ├── device.h │ │ │ ├── device │ │ │ │ ├── bus │ │ │ │ │ ├── dt.h │ │ │ │ │ ├── pci.h │ │ │ │ │ └── virtio.h │ │ │ │ ├── disk.h │ │ │ │ ├── input.h │ │ │ │ ├── ipv4_control.h │ │ │ │ ├── kfb.h │ │ │ │ └── net.h │ │ │ ├── exception.h │ │ │ ├── exit.h │ │ │ ├── file.h │ │ │ ├── fs.h │ │ │ ├── futex.h │ │ │ ├── image.h │ │ │ ├── ipc.h │ │ │ ├── limits.h │ │ │ ├── log.h │ │ │ ├── module.h │ │ │ ├── net │ │ │ │ ├── family.h │ │ │ │ ├── interface.h │ │ │ │ ├── ipv4.h │ │ │ │ ├── ipv6.h │ │ │ │ └── unix.h │ │ │ ├── object.h │ │ │ ├── pipe.h │ │ │ ├── private │ │ │ │ ├── image.h │ │ │ │ ├── process.h │ │ │ │ └── thread.h │ │ │ ├── process.h │ │ │ ├── process_group.h │ │ │ ├── security.h │ │ │ ├── semaphore.h │ │ │ ├── socket.h │ │ │ ├── status.h │ │ │ ├── system.h │ │ │ ├── thread.h │ │ │ ├── time.h │ │ │ ├── types.h │ │ │ ├── user_file.h │ │ │ └── vm.h │ │ ├── lib │ │ │ ├── ansi_parser.h │ │ │ ├── array.h │ │ │ ├── avl_tree.h │ │ │ ├── bitmap.h │ │ │ ├── ctype.h │ │ │ ├── fixed_heap.h │ │ │ ├── fnv.h │ │ │ ├── id_allocator.h │ │ │ ├── list.h │ │ │ ├── notifier.h │ │ │ ├── printf.h │ │ │ ├── radix_tree.h │ │ │ ├── random.h │ │ │ ├── refcount.h │ │ │ ├── string.h │ │ │ ├── tar.h │ │ │ └── utility.h │ │ ├── mm │ │ │ ├── aspace.h │ │ │ ├── kmem.h │ │ │ ├── malloc.h │ │ │ ├── mm.h │ │ │ ├── mmu.h │ │ │ ├── page.h │ │ │ ├── page_cache.h │ │ │ ├── phys.h │ │ │ ├── safe.h │ │ │ ├── slab.h │ │ │ └── vm.h │ │ ├── module.h │ │ ├── net │ │ │ ├── arp.h │ │ │ ├── ethernet.h │ │ │ ├── family.h │ │ │ ├── interface.h │ │ │ ├── ip.h │ │ │ ├── ipv4.h │ │ │ ├── ipv6.h │ │ │ ├── net.h │ │ │ ├── packet.h │ │ │ ├── port.h │ │ │ ├── route.h │ │ │ ├── socket.h │ │ │ ├── tcp.h │ │ │ └── udp.h │ │ ├── object.h │ │ ├── proc │ │ │ ├── ipc.h │ │ │ ├── process.h │ │ │ ├── sched.h │ │ │ └── thread.h │ │ ├── security │ │ │ ├── security.h │ │ │ └── token.h │ │ ├── setjmp.h │ │ ├── smp.h │ │ ├── status.h │ │ ├── sync │ │ │ ├── condvar.h │ │ │ ├── futex.h │ │ │ ├── mutex.h │ │ │ ├── rwlock.h │ │ │ ├── semaphore.h │ │ │ └── spinlock.h │ │ ├── syscall.h │ │ ├── time.h │ │ └── types.h │ ├── info.c │ ├── init.c │ ├── io │ │ ├── SConscript │ │ ├── context.c │ │ ├── file.c │ │ ├── file_map.c │ │ ├── fs.c │ │ ├── fs │ │ │ ├── Kconfig │ │ │ ├── SConscript │ │ │ ├── ext2 │ │ │ │ ├── SConscript │ │ │ │ ├── block.c │ │ │ │ ├── dir.c │ │ │ │ ├── ext2.c │ │ │ │ ├── ext2.h │ │ │ │ └── inode.c │ │ │ └── ramfs.c │ │ ├── memory_file.c │ │ ├── pipe.c │ │ ├── request.c │ │ ├── socket.c │ │ └── user_file.c │ ├── kdb.c │ ├── lib │ │ ├── SConscript │ │ ├── ansi_parser.c │ │ ├── avl_tree.c │ │ ├── bitmap.c │ │ ├── fixed_heap.c │ │ ├── id_allocator.c │ │ ├── mt19937-64.h │ │ ├── notifier.c │ │ ├── printf.c │ │ ├── qsort.c │ │ ├── radix_tree.c │ │ ├── random.c │ │ ├── string.c │ │ └── tar.c │ ├── log.c │ ├── mm │ │ ├── SConscript │ │ ├── kmem.c │ │ ├── malloc.c │ │ ├── mmu.c │ │ ├── page.c │ │ ├── page_cache.c │ │ ├── phys.c │ │ ├── safe.c │ │ ├── slab.c │ │ ├── trace.h │ │ └── vm.c │ ├── module.c │ ├── net │ │ ├── SConscript │ │ ├── arp.c │ │ ├── ethernet.c │ │ ├── family.c │ │ ├── interface.c │ │ ├── ip.c │ │ ├── ipv4.c │ │ ├── net.c │ │ ├── packet.c │ │ ├── port.c │ │ ├── socket.c │ │ ├── tcp.c │ │ └── udp.c │ ├── object.c │ ├── proc │ │ ├── SConscript │ │ ├── ipc.c │ │ ├── process.c │ │ ├── sched.c │ │ └── thread.c │ ├── security │ │ ├── SConscript │ │ └── token.c │ ├── shutdown.c │ ├── smp.c │ ├── sync │ │ ├── SConscript │ │ ├── condition.c │ │ ├── condvar.c │ │ ├── futex.c │ │ ├── mutex.c │ │ ├── rwlock.c │ │ ├── semaphore.c │ │ └── spinlock.c │ ├── syscalls.def │ └── time.c ├── lib │ ├── SConscript │ ├── compiler-rt │ │ ├── SConscript │ │ └── lib │ ├── crt │ │ ├── SConscript │ │ ├── arch │ │ │ ├── amd64 │ │ │ │ ├── SConscript │ │ │ │ ├── crt1.S │ │ │ │ ├── crti.S │ │ │ │ └── crtn.S │ │ │ └── arm64 │ │ │ │ ├── SConscript │ │ │ │ ├── crt1.S │ │ │ │ ├── crti.S │ │ │ │ └── crtn.S │ │ └── lib │ ├── cxx │ │ ├── SConscript │ │ ├── include │ │ ├── src │ │ └── stubs.c │ ├── cxxrt │ │ ├── SConscript │ │ ├── include │ │ │ ├── cxxabi.h │ │ │ ├── unwind-arm.h │ │ │ ├── unwind-itanium.h │ │ │ └── unwind.h │ │ ├── src │ │ └── unwind │ │ │ ├── SConscript │ │ │ ├── include │ │ │ └── src │ ├── device │ │ ├── SConscript │ │ ├── device.c │ │ ├── device.h │ │ ├── include │ │ │ └── device │ │ │ │ ├── device.h │ │ │ │ ├── input.h │ │ │ │ └── net.h │ │ ├── input.c │ │ └── net.c │ ├── kernel │ │ ├── SConscript │ │ ├── arch │ │ │ ├── amd64 │ │ │ │ ├── SConscript │ │ │ │ ├── arch.h │ │ │ │ ├── relocate.c │ │ │ │ ├── rtld.c │ │ │ │ ├── start.S │ │ │ │ └── tls.c │ │ │ └── arm64 │ │ │ │ ├── SConscript │ │ │ │ ├── arch.h │ │ │ │ ├── relocate.c │ │ │ │ ├── rtld.c │ │ │ │ └── start.S │ │ ├── fs.c │ │ ├── include │ │ │ └── kernel │ │ ├── init.c │ │ ├── lib │ │ │ ├── heap.c │ │ │ ├── printf.c │ │ │ └── string.c │ │ ├── libkernel.h │ │ ├── process.c │ │ ├── rtld │ │ │ ├── image.c │ │ │ └── symbol.c │ │ ├── status.c │ │ ├── thread.c │ │ └── tls.c │ ├── kiwi │ │ ├── SConscript │ │ ├── core │ │ │ └── event_loop.cpp │ │ └── include │ │ │ └── kiwi │ │ │ └── core │ │ │ ├── connection.h │ │ │ ├── event_loop.h │ │ │ ├── handle.h │ │ │ ├── message.h │ │ │ └── token_setter.h │ ├── m │ │ ├── SConscript │ │ ├── arch │ │ │ └── x86_64 │ │ │ │ └── bits │ │ │ │ └── fenv.h │ │ ├── include │ │ │ ├── complex.h │ │ │ ├── fenv.h │ │ │ └── math.h │ │ └── musl │ └── system │ │ ├── SConscript │ │ ├── arch │ │ ├── amd64 │ │ │ ├── SConscript │ │ │ ├── include │ │ │ │ └── system │ │ │ │ │ ├── amd64 │ │ │ │ │ └── asm.h │ │ │ │ │ └── arch │ │ │ │ │ ├── defs.h │ │ │ │ │ ├── setjmp.h │ │ │ │ │ └── unistd.h │ │ │ └── setjmp.S │ │ └── arm64 │ │ │ ├── SConscript │ │ │ ├── include │ │ │ └── system │ │ │ │ ├── arch │ │ │ │ ├── defs.h │ │ │ │ ├── setjmp.h │ │ │ │ └── unistd.h │ │ │ │ └── arm64 │ │ │ │ └── asm.h │ │ │ └── setjmp.S │ │ ├── core │ │ ├── ipc.c │ │ ├── log.c │ │ ├── mutex.c │ │ ├── path.c │ │ └── service.c │ │ ├── dirent │ │ ├── alphasort.c │ │ ├── closedir.c │ │ ├── dirent.h │ │ ├── opendir.c │ │ ├── readdir.c │ │ ├── rewinddir.c │ │ └── scandir.c │ │ ├── errno.c │ │ ├── fatal.c │ │ ├── include │ │ ├── alloca.h │ │ ├── arpa │ │ │ ├── inet.h │ │ │ └── nameser.h │ │ ├── assert.h │ │ ├── bits │ │ │ └── alltypes.h │ │ ├── core │ │ │ ├── endian.h │ │ │ ├── ipc.h │ │ │ ├── list.h │ │ │ ├── log.h │ │ │ ├── mutex.h │ │ │ ├── path.h │ │ │ ├── service.h │ │ │ ├── time.h │ │ │ └── utility.h │ │ ├── ctype.h │ │ ├── dirent.h │ │ ├── dlfcn.h │ │ ├── elf.h │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── features.h │ │ ├── inttypes.h │ │ ├── langinfo.h │ │ ├── libgen.h │ │ ├── limits.h │ │ ├── link.h │ │ ├── locale.h │ │ ├── memory.h │ │ ├── net │ │ │ └── if.h │ │ ├── netdb.h │ │ ├── netinet │ │ │ ├── in.h │ │ │ └── tcp.h │ │ ├── nl_types.h │ │ ├── poll.h │ │ ├── pthread.h │ │ ├── pwd.h │ │ ├── resolv.h │ │ ├── sched.h │ │ ├── services │ │ │ ├── posix_service.h │ │ │ ├── service_manager.h │ │ │ └── terminal_service.h │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── stdint.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── string.h │ │ ├── strings.h │ │ ├── sys │ │ │ ├── ioctl.h │ │ │ ├── mman.h │ │ │ ├── param.h │ │ │ ├── poll.h │ │ │ ├── random.h │ │ │ ├── select.h │ │ │ ├── socket.h │ │ │ ├── stat.h │ │ │ ├── time.h │ │ │ ├── types.h │ │ │ ├── un.h │ │ │ └── wait.h │ │ ├── system │ │ │ ├── defs.h │ │ │ └── pthread.h │ │ ├── termios.h │ │ ├── time.h │ │ ├── uchar.h │ │ ├── ucontext.h │ │ ├── unistd.h │ │ ├── utime.h │ │ ├── wchar.h │ │ └── wctype.h │ │ ├── init.c │ │ ├── libsystem.h │ │ ├── locale │ │ ├── localeconv.c │ │ └── setlocale.c │ │ ├── musl │ │ ├── net │ │ ├── if.c │ │ └── socket.c │ │ ├── posix │ │ ├── dlfcn.c │ │ ├── exec.c │ │ ├── fd.c │ │ ├── fs.c │ │ ├── getopt.c │ │ ├── io.c │ │ ├── mman.c │ │ ├── pipe.c │ │ ├── poll.c │ │ ├── posix.c │ │ ├── posix.h │ │ ├── process.c │ │ ├── pwd.c │ │ ├── select.c │ │ ├── signal.c │ │ ├── stubs.c │ │ ├── termios.c │ │ ├── time.c │ │ └── uidgid.c │ │ ├── pthread │ │ ├── cond.c │ │ ├── mutex.c │ │ ├── once.c │ │ ├── pthread.c │ │ ├── pthread.h │ │ └── specific.c │ │ ├── sched.c │ │ ├── stdio │ │ ├── buffer.c │ │ ├── do_printf.c │ │ ├── do_scanf.c │ │ ├── fclose.c │ │ ├── fflush.c │ │ ├── fgetc.c │ │ ├── fgets.c │ │ ├── fopen.c │ │ ├── fputc.c │ │ ├── fputs.c │ │ ├── fread.c │ │ ├── fseek.c │ │ ├── fstatus.c │ │ ├── fwrite.c │ │ ├── perror.c │ │ ├── remove.c │ │ ├── rename.c │ │ ├── stdio.h │ │ ├── tmpfile.c │ │ ├── vfprintf.c │ │ ├── vfscanf.c │ │ ├── vsnprintf.c │ │ └── vsscanf.c │ │ ├── stdlib │ │ ├── abort.c │ │ ├── abs.c │ │ ├── atoi.c │ │ ├── bsearch.c │ │ ├── dlmalloc.c │ │ ├── environ.c │ │ ├── environ.h │ │ ├── exit.c │ │ ├── ldiv.c │ │ ├── malloc.c │ │ ├── mkstemp.c │ │ ├── qsort.c │ │ ├── strtod.c │ │ ├── strtoul.c │ │ └── system.c │ │ ├── string │ │ ├── ffs.c │ │ ├── memchr.c │ │ ├── memcmp.c │ │ ├── memcpy.c │ │ ├── memmove.c │ │ ├── memset.c │ │ ├── strcasecmp.c │ │ ├── strcat.c │ │ ├── strchr.c │ │ ├── strcmp.c │ │ ├── strcpy.c │ │ ├── strcspn.c │ │ ├── strdup.c │ │ ├── strerror.c │ │ ├── strlen.c │ │ ├── strpbrk.c │ │ ├── strsep.c │ │ ├── strstr.c │ │ └── strtok.c │ │ └── time │ │ ├── asctime.c │ │ ├── gmtime.c │ │ ├── localtime.c │ │ ├── mktime.c │ │ ├── strftime.c │ │ └── time.c └── services │ ├── SConscript │ ├── posix_service │ ├── SConscript │ ├── posix_service.cpp │ ├── posix_service.h │ ├── process.cpp │ ├── process.h │ ├── process_group.cpp │ ├── process_group.h │ ├── session.cpp │ └── session.h │ ├── service_manager │ ├── SConscript │ ├── client.cpp │ ├── client.h │ ├── service.cpp │ ├── service.h │ ├── service_manager.cpp │ └── service_manager.h │ ├── terminal_service │ ├── SConscript │ ├── terminal.cpp │ ├── terminal.h │ ├── terminal_service.cpp │ └── terminal_service.h │ └── test │ ├── SConscript │ ├── main.c │ └── protocol.h └── utilities ├── SConscript ├── __init__.py ├── alloc_stats.py ├── bin2hex.py ├── boot ├── build ├── builders.py ├── image.py ├── kconfig.py ├── manager.py ├── manifest.py ├── package.py ├── toolchain.py ├── util.py └── vcs.py ├── config-clang ├── gdb_extensions.py ├── generrlist.py ├── image_tool ├── COPYING.mbr ├── README.mbr ├── SConscript ├── image_tool.c └── mbr.bin ├── kconfig ├── psf2raw.c ├── sercat.c ├── sysgen ├── SConscript ├── amd64_target.cpp ├── amd64_target.h ├── arm64_target.cpp ├── arm64_target.h ├── lexer.l ├── main.cpp ├── parser.y └── sysgen.h ├── todo.sh └── toolchain ├── binutils-2.40-kiwi.patch └── llvm-16.0.6-kiwi.patch /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.pyc 3 | .DS_Store 4 | /.config* 5 | /build 6 | /images 7 | /.sconsign.dblite 8 | /documentation/markdown/output 9 | /.gdb_history 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3rdparty/kboot"] 2 | path = 3rdparty/kboot 3 | url = https://github.com/aejsmith/kboot.git 4 | [submodule "packages"] 5 | path = packages 6 | url = https://github.com/aejsmith/kiwi-packages.git 7 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "SConscript": "python", 4 | "SConstruct": "python", 5 | "package.build": "shellscript", 6 | "*.package": "json", 7 | "*.manifest": "json" 8 | }, 9 | "files.exclude": { 10 | ".sconsign.dblite": true 11 | }, 12 | "search.followSymlinks": false, 13 | } 14 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "SCons", 8 | "type": "shell", 9 | "command": "scons PARALLEL=1", 10 | "options": { 11 | "cwd": "${workspaceFolder}" 12 | }, 13 | "group": { 14 | "kind": "build", 15 | "isDefault": true 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /.vscode/templates/Kiwi C Source.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Author 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief . 9 | */ 10 | 11 | 12 | -------------------------------------------------------------------------------- /.vscode/templates/Kiwi C++ Source.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Author 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief . 9 | */ 10 | 11 | 12 | -------------------------------------------------------------------------------- /.vscode/templates/Kiwi Header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Author 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief . 9 | */ 10 | 11 | #pragma once 12 | -------------------------------------------------------------------------------- /3rdparty/bin/dungeon/README.Kiwi: -------------------------------------------------------------------------------- 1 | This is based on the MINIX 3 port of Dungeon, obtained from 2 | 3 | http://www.minix3.org/software/dungeon-2.7.1.tar.bz2 4 | 5 | With small modifications by Alex Smith 6 | -------------------------------------------------------------------------------- /3rdparty/kconfig/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It is for use by the Linux 3 | kernel configuration script. Please do not bother Savio Lam with 4 | questions about this program. 5 | -------------------------------------------------------------------------------- /3rdparty/kernel/libfdt/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | git://git.kernel.org/pub/scm/utils/dtc/dtc.git 2 | 9d2279e7e6ee937d7c47250720c92dd58fa1aa68 3 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 14.0.0 2 | Unmodified 3 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB filter_files ${CMAKE_CURRENT_SOURCE_DIR}/*.txt) 2 | foreach(filter_file ${filter_files}) 3 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filter_file}) 4 | endforeach() 5 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/ios.txt: -------------------------------------------------------------------------------- 1 | apple_versioning 2 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/ios7-arm64.txt: -------------------------------------------------------------------------------- 1 | clzti2 2 | divti3 3 | fixdfti 4 | fixsfti 5 | fixunsdfti 6 | floattidf 7 | floattisf 8 | floatuntidf 9 | floatuntisf 10 | gcc_personality_v0 11 | modti3 12 | powidf2 13 | powisf2 14 | udivmodti4 15 | udivti3 16 | umodti3 17 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/iossim-x86_64.txt: -------------------------------------------------------------------------------- 1 | addtf3 2 | divtf3 3 | multf3 4 | powitf2 5 | subtf3 6 | trampoline_setup 7 | addtf3 8 | divtf3 9 | multf3 10 | powitf2 11 | subtf3 12 | trampoline_setup 13 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/iossim.txt: -------------------------------------------------------------------------------- 1 | apple_versioning 2 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/osx-i386.txt: -------------------------------------------------------------------------------- 1 | absvti2 2 | addvti3 3 | ashlti3 4 | ashrti3 5 | clzti2 6 | cmpti2 7 | ctzti2 8 | divti3 9 | ffsti2 10 | fixdfti 11 | fixsfti 12 | fixunsdfti 13 | fixunssfti 14 | fixunsxfti 15 | fixxfti 16 | floattidf 17 | floattisf 18 | floattixf 19 | floatuntidf 20 | floatuntisf 21 | floatuntixf 22 | lshrti3 23 | modti3 24 | muloti4 25 | multi3 26 | mulvti3 27 | negti2 28 | negvti2 29 | parityti2 30 | popcountti2 31 | subvti3 32 | ucmpti2 33 | udivmodti4 34 | udivti3 35 | umodti3 36 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/osx.txt: -------------------------------------------------------------------------------- 1 | apple_versioning 2 | addtf3 3 | divtf3 4 | multf3 5 | powitf2 6 | subtf3 7 | trampoline_setup 8 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB filter_files ${CMAKE_CURRENT_SOURCE_DIR}/*.txt) 2 | foreach(filter_file ${filter_files}) 3 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filter_file}) 4 | endforeach() 5 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/arm.txt: -------------------------------------------------------------------------------- 1 | aeabi_cdcmpeq 2 | aeabi_cdrcmple 3 | aeabi_cfcmpeq 4 | aeabi_cfrcmple 5 | aeabi_dcmpeq 6 | aeabi_dcmpge 7 | aeabi_dcmpgt 8 | aeabi_dcmple 9 | aeabi_dcmplt 10 | aeabi_drsub 11 | aeabi_fcmpeq 12 | aeabi_fcmpge 13 | aeabi_fcmpgt 14 | aeabi_fcmple 15 | aeabi_fcmplt 16 | aeabi_frsub 17 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/i386.txt: -------------------------------------------------------------------------------- 1 | i686.get_pc_thunk.eax 2 | i686.get_pc_thunk.ebp 3 | i686.get_pc_thunk.ebx 4 | i686.get_pc_thunk.ecx 5 | i686.get_pc_thunk.edi 6 | i686.get_pc_thunk.edx 7 | i686.get_pc_thunk.esi 8 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/thumb2-64.txt: -------------------------------------------------------------------------------- 1 | sync_fetch_and_add_8 2 | sync_fetch_and_sub_8 3 | sync_fetch_and_and_8 4 | sync_fetch_and_or_8 5 | sync_fetch_and_xor_8 6 | sync_fetch_and_nand_8 7 | sync_fetch_and_max_8 8 | sync_fetch_and_umax_8 9 | sync_fetch_and_min_8 10 | sync_fetch_and_umin_8 11 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/thumb2.txt: -------------------------------------------------------------------------------- 1 | switch16 2 | switch32 3 | switch8 4 | switchu8 5 | sync_fetch_and_add_4 6 | sync_fetch_and_sub_4 7 | sync_fetch_and_and_4 8 | sync_fetch_and_or_4 9 | sync_fetch_and_xor_4 10 | sync_fetch_and_nand_4 11 | sync_fetch_and_max_4 12 | sync_fetch_and_umax_4 13 | sync_fetch_and_min_4 14 | sync_fetch_and_umin_4 15 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/riscv/muldi3.S: -------------------------------------------------------------------------------- 1 | //===--- muldi3.S - Integer multiplication routines -----------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #if __riscv_xlen == 64 9 | #define __mulxi3 __muldi3 10 | #include "int_mul_impl.inc" 11 | #endif 12 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/riscv/mulsi3.S: -------------------------------------------------------------------------------- 1 | //===--- mulsi3.S - Integer multiplication routines -----------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #if __riscv_xlen == 32 10 | #define __mulxi3 __mulsi3 11 | #include "int_mul_impl.inc" 12 | #endif 13 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/x86_64/floatdidf.c: -------------------------------------------------------------------------------- 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 2 | // See https://llvm.org/LICENSE.txt for license information. 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | 5 | // double __floatdidf(di_int a); 6 | 7 | #if defined(__x86_64__) || defined(_M_X64) 8 | 9 | #include "../int_lib.h" 10 | 11 | double __floatdidf(int64_t a) { return (double)a; } 12 | 13 | #endif // __x86_64__ 14 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/x86_64/floatdisf.c: -------------------------------------------------------------------------------- 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 2 | // See https://llvm.org/LICENSE.txt for license information. 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | 5 | #if defined(__x86_64__) || defined(_M_X64) 6 | 7 | #include "../int_lib.h" 8 | 9 | float __floatdisf(int64_t a) { return (float)a; } 10 | 11 | #endif // __x86_64__ 12 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/x86_64/floatdixf.c: -------------------------------------------------------------------------------- 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 2 | // See https://llvm.org/LICENSE.txt for license information. 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | 5 | // long double __floatdixf(di_int a); 6 | 7 | #ifdef __x86_64__ 8 | 9 | #include "../int_lib.h" 10 | 11 | long double __floatdixf(int64_t a) { return (long double)a; } 12 | 13 | #endif // __i386__ 14 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/include/__libcpp_version: -------------------------------------------------------------------------------- 1 | 14000 2 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/include/__support/solaris/floatingpoint.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #define atof sun_atof 10 | #define strtod sun_strtod 11 | #include_next "floatingpoint.h" 12 | #undef atof 13 | #undef strtod 14 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 14.0.0 2 | Modified (see commit) 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/abi/README.TXT: -------------------------------------------------------------------------------- 1 | This directory contains abi lists representing the symbols exported 2 | by the libc++ library. The lists are generated using libcxx/utils/generate_abi_list.py. 3 | 4 | Every time a symbol is added or removed from the libc++ library, each of the 5 | lists *MUST* be updated to reflect the changes. This can be done by using the 6 | `generate-cxx-abilist` CMake target. 7 | 8 | We do not keep an up-to-date ABI list for all the build configurations of libc++. 9 | Currently, only the default configuration on MacOS and Linux are supported. 10 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/libc++unexp.exp: -------------------------------------------------------------------------------- 1 | # all guard variables 2 | __ZGVNSt3__* 3 | # all vtables 4 | # __ZTV* 5 | # all VTT 6 | # __ZTT* 7 | # all non-virtual thunks 8 | # __ZTh* 9 | # all virtual thunks 10 | # __ZTv* 11 | # typeinfo for std::__1::__types 12 | # There are no std::__types 13 | # __ZTINSt3__1[0-9][0-9]*__* 14 | # typeinfo name for std::__1::__types 15 | __ZTSNSt3__1[0-9][0-9]*__* 16 | # anything using __hidden_allocator 17 | *__hidden_allocator* 18 | # anything using __sso_allocator 19 | *__sso_allocator* 20 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/notweak.exp: -------------------------------------------------------------------------------- 1 | # Remove the weak-def bit from these external symbols 2 | __ZT* 3 | __ZN* 4 | __ZS* 5 | 6 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/weak.exp: -------------------------------------------------------------------------------- 1 | __ZTISt10bad_typeid 2 | __ZTISt11logic_error 3 | __ZTISt11range_error 4 | __ZTISt12domain_error 5 | __ZTISt12length_error 6 | __ZTISt12out_of_range 7 | __ZTISt13bad_exception 8 | __ZTISt13runtime_error 9 | __ZTISt14overflow_error 10 | __ZTISt15underflow_error 11 | __ZTISt16invalid_argument 12 | __ZTISt16nested_exception 13 | __ZTISt20bad_array_new_length 14 | __ZTISt8bad_cast 15 | __ZTISt9bad_alloc 16 | __ZTISt9exception 17 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/chrono_system_time_init.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | GetSystemTimeInit GetSystemTimeAsFileTimeFunc _LIBCPP_INIT_PRIORITY_MAX; 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/experimental/memory_resource_init_helper.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | _LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX; 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/format.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include "format" 10 | 11 | _LIBCPP_BEGIN_NAMESPACE_STD 12 | 13 | format_error::~format_error() noexcept = default; 14 | 15 | _LIBCPP_END_NAMESPACE_STD 16 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/iostream_init.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | _LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX; 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/ryu/README.txt: -------------------------------------------------------------------------------- 1 | The code in this directory is based on Ulf Adams's work. The upstream for the 2 | code is: 3 | 4 | https://github.com/ulfjack/ryu/tree/59661c3/ryu 5 | 6 | The code has been adapted by Stephan T. Lavavej of Microsoft for usage in 7 | std::to_chars. This code has been contributed by Microsoft for inclusion in 8 | libc++. 9 | 10 | The code in this directory has a different coding style than other parts to 11 | minimize the number of changes by both upstream sources. 12 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/support/solaris/README: -------------------------------------------------------------------------------- 1 | This directory contains a partial implementation of the xlocale APIs for 2 | Solaris. Some portions are lifted from FreeBSD libc, and so are covered by a 3 | 2-clause BSD license instead of the MIT/UUIC license that the rest of libc++ is 4 | distributed under. 5 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/utility.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include "utility" 10 | 11 | _LIBCPP_BEGIN_NAMESPACE_STD 12 | 13 | const piecewise_construct_t piecewise_construct{}; 14 | 15 | _LIBCPP_END_NAMESPACE_STD 16 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/variant.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include "variant" 10 | 11 | namespace std { 12 | 13 | const char* bad_variant_access::what() const noexcept { 14 | return "bad_variant_access"; 15 | } 16 | 17 | } // namespace std 18 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/AUTHORS: -------------------------------------------------------------------------------- 1 | David Chisnall 2 | PathScale engineers 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/COPYRIGHT: -------------------------------------------------------------------------------- 1 | PathScale Inc 2 | NetBSD Foundation 3 | FreeBSD Foundation 4 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | https://github.com/libcxxrt/libcxxrt.git 2 | 45ca8b1942090226ba9368caeeeabc0d4ee41ad6 3 | Unmodified 4 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/src/abi_namespace.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The namespace used for the ABI declarations. This is currently defined to 3 | * be the same as GNU libsupc++, however this may change in the future. 4 | */ 5 | #define ABI_NAMESPACE __cxxabiv1 6 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/test/run_test.sh: -------------------------------------------------------------------------------- 1 | test_command=$1 2 | expected_output=$2 3 | test_log=$3 4 | $test_command > $test_log 2>&1 5 | diff $test_log $expected_output 6 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/test/test.h: -------------------------------------------------------------------------------- 1 | 2 | void log_test(bool predicate, const char *file, int line, const char *message); 3 | 4 | #define TEST(p, m) log_test(p, __FILE__, __LINE__, m) 5 | #define TEST_LOC(p, m, file, line) log_test(p, file, line, m) 6 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/.arcconfig: -------------------------------------------------------------------------------- 1 | { 2 | "repository.callsign" : "UNW", 3 | "conduit_uri" : "https://reviews.llvm.org/" 4 | } 5 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(FindSphinx) 2 | if (SPHINX_FOUND AND LLVM_ENABLE_SPHINX) 3 | include(AddSphinxTarget) 4 | if (${SPHINX_OUTPUT_HTML}) 5 | add_sphinx_target(html libunwind) 6 | endif() 7 | endif() 8 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/docs/README.txt: -------------------------------------------------------------------------------- 1 | libunwind Documentation 2 | ==================== 3 | 4 | The libunwind documentation is written using the Sphinx documentation generator. It is 5 | currently tested with Sphinx 1.1.3. 6 | 7 | To build the documents into html configure libunwind with the following cmake options: 8 | 9 | * -DLLVM_ENABLE_SPHINX=ON 10 | * -DLIBUNWIND_INCLUDE_DOCS=ON 11 | 12 | After configuring libunwind with these options the make rule `docs-libunwind-html` 13 | should be available. 14 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 14.0.0 2 | Changes: 3 | - src/assembly.h 4 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/arch/generic/fp_arch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/3rdparty/lib/musl/arch/generic/fp_arch.h -------------------------------------------------------------------------------- /3rdparty/lib/musl/include/fenv.h: -------------------------------------------------------------------------------- 1 | #ifndef _FENV_H 2 | #define _FENV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | int feclearexcept(int); 11 | int fegetexceptflag(fexcept_t *, int); 12 | int feraiseexcept(int); 13 | int fesetexceptflag(const fexcept_t *, int); 14 | int fetestexcept(int); 15 | 16 | int fegetround(void); 17 | int fesetround(int); 18 | 19 | int fegetenv(fenv_t *); 20 | int feholdexcept(fenv_t *); 21 | int fesetenv(const fenv_t *); 22 | int feupdateenv(const fenv_t *); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 1.2.3 2 | Kiwi modifications indicated by __Kiwi__ defines (with original code in the else) 3 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cabs.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double cabs(double complex z) 4 | { 5 | return hypot(creal(z), cimag(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cabsf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float cabsf(float complex z) 4 | { 5 | return hypotf(crealf(z), cimagf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cabsl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double cabsl(long double complex z) 5 | { 6 | return cabs(z); 7 | } 8 | #else 9 | long double cabsl(long double complex z) 10 | { 11 | return hypotl(creall(z), cimagl(z)); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacos.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME: Hull et al. "Implementing the complex arcsine and arccosine functions using exception handling" 1997 4 | 5 | /* acos(z) = pi/2 - asin(z) */ 6 | 7 | double complex cacos(double complex z) 8 | { 9 | z = casin(z); 10 | return CMPLX(M_PI_2 - creal(z), -cimag(z)); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacosf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | static const float float_pi_2 = M_PI_2; 6 | 7 | float complex cacosf(float complex z) 8 | { 9 | z = casinf(z); 10 | return CMPLXF(float_pi_2 - crealf(z), -cimagf(z)); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacosh.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* acosh(z) = i acos(z) */ 4 | 5 | double complex cacosh(double complex z) 6 | { 7 | int zineg = signbit(cimag(z)); 8 | 9 | z = cacos(z); 10 | if (zineg) return CMPLX(cimag(z), -creal(z)); 11 | else return CMPLX(-cimag(z), creal(z)); 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacoshf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex cacoshf(float complex z) 4 | { 5 | int zineg = signbit(cimagf(z)); 6 | 7 | z = cacosf(z); 8 | if (zineg) return CMPLXF(cimagf(z), -crealf(z)); 9 | else return CMPLXF(-cimagf(z), crealf(z)); 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacoshl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cacoshl(long double complex z) 5 | { 6 | return cacosh(z); 7 | } 8 | #else 9 | long double complex cacoshl(long double complex z) 10 | { 11 | int zineg = signbit(cimagl(z)); 12 | 13 | z = cacosl(z); 14 | if (zineg) return CMPLXL(cimagl(z), -creall(z)); 15 | else return CMPLXL(-cimagl(z), creall(z)); 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacosl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cacosl(long double complex z) 5 | { 6 | return cacos(z); 7 | } 8 | #else 9 | // FIXME 10 | #define PI_2 1.57079632679489661923132169163975144L 11 | long double complex cacosl(long double complex z) 12 | { 13 | z = casinl(z); 14 | return CMPLXL(PI_2 - creall(z), -cimagl(z)); 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/carg.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double carg(double complex z) 4 | { 5 | return atan2(cimag(z), creal(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cargf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float cargf(float complex z) 4 | { 5 | return atan2f(cimagf(z), crealf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cargl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double cargl(long double complex z) 5 | { 6 | return carg(z); 7 | } 8 | #else 9 | long double cargl(long double complex z) 10 | { 11 | return atan2l(cimagl(z), creall(z)); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casin.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | /* asin(z) = -i log(i z + sqrt(1 - z*z)) */ 6 | 7 | double complex casin(double complex z) 8 | { 9 | double complex w; 10 | double x, y; 11 | 12 | x = creal(z); 13 | y = cimag(z); 14 | w = CMPLX(1.0 - (x - y)*(x + y), -2.0*x*y); 15 | double complex r = clog(CMPLX(-y, x) + csqrt(w)); 16 | return CMPLX(cimag(r), -creal(r)); 17 | } 18 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | float complex casinf(float complex z) 6 | { 7 | float complex w; 8 | float x, y; 9 | 10 | x = crealf(z); 11 | y = cimagf(z); 12 | w = CMPLXF(1.0 - (x - y)*(x + y), -2.0*x*y); 13 | float complex r = clogf(CMPLXF(-y, x) + csqrtf(w)); 14 | return CMPLXF(cimagf(r), -crealf(r)); 15 | } 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinh.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* asinh(z) = -i asin(i z) */ 4 | 5 | double complex casinh(double complex z) 6 | { 7 | z = casin(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinhf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex casinhf(float complex z) 4 | { 5 | z = casinf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex casinhl(long double complex z) 5 | { 6 | return casinh(z); 7 | } 8 | #else 9 | long double complex casinhl(long double complex z) 10 | { 11 | z = casinl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex casinl(long double complex z) 5 | { 6 | return casin(z); 7 | } 8 | #else 9 | // FIXME 10 | long double complex casinl(long double complex z) 11 | { 12 | long double complex w; 13 | long double x, y; 14 | 15 | x = creall(z); 16 | y = cimagl(z); 17 | w = CMPLXL(1.0 - (x - y)*(x + y), -2.0*x*y); 18 | long double complex r = clogl(CMPLXL(-y, x) + csqrtl(w)); 19 | return CMPLXL(cimagl(r), -creall(r)); 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/catanh.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* atanh = -i atan(i z) */ 4 | 5 | double complex catanh(double complex z) 6 | { 7 | z = catan(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/catanhf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex catanhf(float complex z) 4 | { 5 | z = catanf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/catanhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex catanhl(long double complex z) 5 | { 6 | return catanh(z); 7 | } 8 | #else 9 | long double complex catanhl(long double complex z) 10 | { 11 | z = catanl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccos.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* cos(z) = cosh(i z) */ 4 | 5 | double complex ccos(double complex z) 6 | { 7 | return ccosh(CMPLX(-cimag(z), creal(z))); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccosf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex ccosf(float complex z) 4 | { 5 | return ccoshf(CMPLXF(-cimagf(z), crealf(z))); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccoshl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex ccoshl(long double complex z) 5 | { 6 | return ccosh(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccosl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex ccosl(long double complex z) 5 | { 6 | return ccos(z); 7 | } 8 | #else 9 | long double complex ccosl(long double complex z) 10 | { 11 | return ccoshl(CMPLXL(-cimagl(z), creall(z))); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cexpl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex cexpl(long double complex z) 5 | { 6 | return cexp(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cimag.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double (cimag)(double complex z) 4 | { 5 | return cimag(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cimagf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float (cimagf)(float complex z) 4 | { 5 | return cimagf(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cimagl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | long double (cimagl)(long double complex z) 4 | { 5 | return cimagl(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/clog.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | /* log(z) = log(|z|) + i arg(z) */ 6 | 7 | double complex clog(double complex z) 8 | { 9 | double r, phi; 10 | 11 | r = cabs(z); 12 | phi = carg(z); 13 | return CMPLX(log(r), phi); 14 | } 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/clogf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | float complex clogf(float complex z) 6 | { 7 | float r, phi; 8 | 9 | r = cabsf(z); 10 | phi = cargf(z); 11 | return CMPLXF(logf(r), phi); 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/clogl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex clogl(long double complex z) 5 | { 6 | return clog(z); 7 | } 8 | #else 9 | // FIXME 10 | long double complex clogl(long double complex z) 11 | { 12 | long double r, phi; 13 | 14 | r = cabsl(z); 15 | phi = cargl(z); 16 | return CMPLXL(logl(r), phi); 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/conj.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double complex conj(double complex z) 4 | { 5 | return CMPLX(creal(z), -cimag(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/conjf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex conjf(float complex z) 4 | { 5 | return CMPLXF(crealf(z), -cimagf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/conjl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | long double complex conjl(long double complex z) 4 | { 5 | return CMPLXL(creall(z), -cimagl(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cpow.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* pow(z, c) = exp(c log(z)), See C99 G.6.4.1 */ 4 | 5 | double complex cpow(double complex z, double complex c) 6 | { 7 | return cexp(c * clog(z)); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cpowf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex cpowf(float complex z, float complex c) 4 | { 5 | return cexpf(c * clogf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cpowl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cpowl(long double complex z, long double complex c) 5 | { 6 | return cpow(z, c); 7 | } 8 | #else 9 | long double complex cpowl(long double complex z, long double complex c) 10 | { 11 | return cexpl(c * clogl(z)); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cproj.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double complex cproj(double complex z) 4 | { 5 | if (isinf(creal(z)) || isinf(cimag(z))) 6 | return CMPLX(INFINITY, copysign(0.0, cimag(z))); 7 | return z; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cprojf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex cprojf(float complex z) 4 | { 5 | if (isinf(crealf(z)) || isinf(cimagf(z))) 6 | return CMPLXF(INFINITY, copysignf(0.0, cimagf(z))); 7 | return z; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cprojl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cprojl(long double complex z) 5 | { 6 | return cproj(z); 7 | } 8 | #else 9 | long double complex cprojl(long double complex z) 10 | { 11 | if (isinf(creall(z)) || isinf(cimagl(z))) 12 | return CMPLXL(INFINITY, copysignl(0.0, cimagl(z))); 13 | return z; 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/creal.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double (creal)(double complex z) 4 | { 5 | return creal(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/crealf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float (crealf)(float complex z) 4 | { 5 | return crealf(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/creall.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double (creall)(long double complex z) 4 | { 5 | return creall(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csin.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* sin(z) = -i sinh(i z) */ 4 | 5 | double complex csin(double complex z) 6 | { 7 | z = csinh(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csinf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex csinf(float complex z) 4 | { 5 | z = csinhf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csinhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex csinhl(long double complex z) 5 | { 6 | return csinh(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csinl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex csinl(long double complex z) 5 | { 6 | return csin(z); 7 | } 8 | #else 9 | long double complex csinl(long double complex z) 10 | { 11 | z = csinhl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csqrtl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex csqrtl(long double complex z) 5 | { 6 | return csqrt(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctan.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* tan(z) = -i tanh(i z) */ 4 | 5 | double complex ctan(double complex z) 6 | { 7 | z = ctanh(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctanf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex ctanf(float complex z) 4 | { 5 | z = ctanhf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctanhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex ctanhl(long double complex z) 5 | { 6 | return ctanh(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctanl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex ctanl(long double complex z) 5 | { 6 | return ctan(z); 7 | } 8 | #else 9 | long double complex ctanl(long double complex z) 10 | { 11 | z = ctanhl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isalnum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isalnum(int c) 4 | { 5 | return isalpha(c) || isdigit(c); 6 | } 7 | 8 | int __isalnum_l(int c, locale_t l) 9 | { 10 | return isalnum(c); 11 | } 12 | 13 | weak_alias(__isalnum_l, isalnum_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isalpha.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isalpha 3 | 4 | int isalpha(int c) 5 | { 6 | return ((unsigned)c|32)-'a' < 26; 7 | } 8 | 9 | int __isalpha_l(int c, locale_t l) 10 | { 11 | return isalpha(c); 12 | } 13 | 14 | weak_alias(__isalpha_l, isalpha_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isascii 3 | 4 | int isascii(int c) 5 | { 6 | return !(c&~0x7f); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isblank.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isblank(int c) 4 | { 5 | return (c == ' ' || c == '\t'); 6 | } 7 | 8 | int __isblank_l(int c, locale_t l) 9 | { 10 | return isblank(c); 11 | } 12 | 13 | weak_alias(__isblank_l, isblank_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iscntrl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iscntrl(int c) 4 | { 5 | return (unsigned)c < 0x20 || c == 0x7f; 6 | } 7 | 8 | int __iscntrl_l(int c, locale_t l) 9 | { 10 | return iscntrl(c); 11 | } 12 | 13 | weak_alias(__iscntrl_l, iscntrl_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isdigit 3 | 4 | int isdigit(int c) 5 | { 6 | return (unsigned)c-'0' < 10; 7 | } 8 | 9 | int __isdigit_l(int c, locale_t l) 10 | { 11 | return isdigit(c); 12 | } 13 | 14 | weak_alias(__isdigit_l, isdigit_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isgraph.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isgraph 3 | 4 | int isgraph(int c) 5 | { 6 | return (unsigned)c-0x21 < 0x5e; 7 | } 8 | 9 | int __isgraph_l(int c, locale_t l) 10 | { 11 | return isgraph(c); 12 | } 13 | 14 | weak_alias(__isgraph_l, isgraph_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/islower.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef islower 3 | 4 | int islower(int c) 5 | { 6 | return (unsigned)c-'a' < 26; 7 | } 8 | 9 | int __islower_l(int c, locale_t l) 10 | { 11 | return islower(c); 12 | } 13 | 14 | weak_alias(__islower_l, islower_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isprint 3 | 4 | int isprint(int c) 5 | { 6 | return (unsigned)c-0x20 < 0x5f; 7 | } 8 | 9 | int __isprint_l(int c, locale_t l) 10 | { 11 | return isprint(c); 12 | } 13 | 14 | weak_alias(__isprint_l, isprint_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/ispunct.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int ispunct(int c) 4 | { 5 | return isgraph(c) && !isalnum(c); 6 | } 7 | 8 | int __ispunct_l(int c, locale_t l) 9 | { 10 | return ispunct(c); 11 | } 12 | 13 | weak_alias(__ispunct_l, ispunct_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isspace.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isspace 3 | 4 | int isspace(int c) 5 | { 6 | return c == ' ' || (unsigned)c-'\t' < 5; 7 | } 8 | 9 | int __isspace_l(int c, locale_t l) 10 | { 11 | return isspace(c); 12 | } 13 | 14 | weak_alias(__isspace_l, isspace_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isupper 3 | 4 | int isupper(int c) 5 | { 6 | return (unsigned)c-'A' < 26; 7 | } 8 | 9 | int __isupper_l(int c, locale_t l) 10 | { 11 | return isupper(c); 12 | } 13 | 14 | weak_alias(__isupper_l, isupper_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswalnum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswalnum(wint_t wc) 4 | { 5 | return iswdigit(wc) || iswalpha(wc); 6 | } 7 | 8 | int __iswalnum_l(wint_t c, locale_t l) 9 | { 10 | return iswalnum(c); 11 | } 12 | 13 | weak_alias(__iswalnum_l, iswalnum_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswalpha.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static const unsigned char table[] = { 4 | #include "alpha.h" 5 | }; 6 | 7 | int iswalpha(wint_t wc) 8 | { 9 | if (wc<0x20000U) 10 | return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1; 11 | if (wc<0x2fffeU) 12 | return 1; 13 | return 0; 14 | } 15 | 16 | int __iswalpha_l(wint_t c, locale_t l) 17 | { 18 | return iswalpha(c); 19 | } 20 | 21 | weak_alias(__iswalpha_l, iswalpha_l); 22 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswblank.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int iswblank(wint_t wc) 5 | { 6 | return isblank(wc); 7 | } 8 | 9 | int __iswblank_l(wint_t c, locale_t l) 10 | { 11 | return iswblank(c); 12 | } 13 | 14 | weak_alias(__iswblank_l, iswblank_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswcntrl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswcntrl(wint_t wc) 4 | { 5 | return (unsigned)wc < 32 6 | || (unsigned)(wc-0x7f) < 33 7 | || (unsigned)(wc-0x2028) < 2 8 | || (unsigned)(wc-0xfff9) < 3; 9 | } 10 | 11 | int __iswcntrl_l(wint_t c, locale_t l) 12 | { 13 | return iswcntrl(c); 14 | } 15 | 16 | weak_alias(__iswcntrl_l, iswcntrl_l); 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #undef iswdigit 4 | 5 | int iswdigit(wint_t wc) 6 | { 7 | return (unsigned)wc-'0' < 10; 8 | } 9 | 10 | int __iswdigit_l(wint_t c, locale_t l) 11 | { 12 | return iswdigit(c); 13 | } 14 | 15 | weak_alias(__iswdigit_l, iswdigit_l); 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswgraph.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswgraph(wint_t wc) 4 | { 5 | /* ISO C defines this function as: */ 6 | return !iswspace(wc) && iswprint(wc); 7 | } 8 | 9 | int __iswgraph_l(wint_t c, locale_t l) 10 | { 11 | return iswgraph(c); 12 | } 13 | 14 | weak_alias(__iswgraph_l, iswgraph_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswlower.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswlower(wint_t wc) 4 | { 5 | return towupper(wc) != wc; 6 | } 7 | 8 | int __iswlower_l(wint_t c, locale_t l) 9 | { 10 | return iswlower(c); 11 | } 12 | 13 | weak_alias(__iswlower_l, iswlower_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswpunct.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static const unsigned char table[] = { 4 | #include "punct.h" 5 | }; 6 | 7 | int iswpunct(wint_t wc) 8 | { 9 | if (wc<0x20000U) 10 | return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1; 11 | return 0; 12 | } 13 | 14 | int __iswpunct_l(wint_t c, locale_t l) 15 | { 16 | return iswpunct(c); 17 | } 18 | 19 | weak_alias(__iswpunct_l, iswpunct_l); 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswupper(wint_t wc) 4 | { 5 | return towlower(wc) != wc; 6 | } 7 | 8 | int __iswupper_l(wint_t c, locale_t l) 9 | { 10 | return iswupper(c); 11 | } 12 | 13 | weak_alias(__iswupper_l, iswupper_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswxdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswxdigit(wint_t wc) 4 | { 5 | return (unsigned)(wc-'0') < 10 || (unsigned)((wc|32)-'a') < 6; 6 | } 7 | 8 | int __iswxdigit_l(wint_t c, locale_t l) 9 | { 10 | return iswxdigit(c); 11 | } 12 | 13 | weak_alias(__iswxdigit_l, iswxdigit_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isxdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isxdigit(int c) 4 | { 5 | return isdigit(c) || ((unsigned)c|32)-'a' < 6; 6 | } 7 | 8 | int __isxdigit_l(int c, locale_t l) 9 | { 10 | return isxdigit(c); 11 | } 12 | 13 | weak_alias(__isxdigit_l, isxdigit_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/toascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* nonsense function that should NEVER be used! */ 4 | int toascii(int c) 5 | { 6 | return c & 0x7f; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/tolower.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int tolower(int c) 4 | { 5 | if (isupper(c)) return c | 32; 6 | return c; 7 | } 8 | 9 | int __tolower_l(int c, locale_t l) 10 | { 11 | return tolower(c); 12 | } 13 | 14 | weak_alias(__tolower_l, tolower_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/toupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int toupper(int c) 4 | { 5 | if (islower(c)) return c & 0x5f; 6 | return c; 7 | } 8 | 9 | int __toupper_l(int c, locale_t l) 10 | { 11 | return toupper(c); 12 | } 13 | 14 | weak_alias(__toupper_l, toupper_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/wcswidth.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcswidth(const wchar_t *wcs, size_t n) 4 | { 5 | int l=0, k=0; 6 | for (; n-- && *wcs && (k = wcwidth(*wcs)) >= 0; l+=k, wcs++); 7 | return (k < 0) ? k : l; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/__flt_rounds.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __flt_rounds() 5 | { 6 | switch (fegetround()) { 7 | #ifdef FE_TOWARDZERO 8 | case FE_TOWARDZERO: return 0; 9 | #endif 10 | case FE_TONEAREST: return 1; 11 | #ifdef FE_UPWARD 12 | case FE_UPWARD: return 2; 13 | #endif 14 | #ifdef FE_DOWNWARD 15 | case FE_DOWNWARD: return 3; 16 | #endif 17 | } 18 | return -1; 19 | } 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fegetexceptflag.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fegetexceptflag(fexcept_t *fp, int mask) 4 | { 5 | *fp = fetestexcept(mask); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/feholdexcept.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int feholdexcept(fenv_t *envp) 4 | { 5 | fegetenv(envp); 6 | feclearexcept(FE_ALL_EXCEPT); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* Dummy functions for archs lacking fenv implementation */ 4 | 5 | int feclearexcept(int mask) 6 | { 7 | return 0; 8 | } 9 | 10 | int feraiseexcept(int mask) 11 | { 12 | return 0; 13 | } 14 | 15 | int fetestexcept(int mask) 16 | { 17 | return 0; 18 | } 19 | 20 | int fegetround(void) 21 | { 22 | return FE_TONEAREST; 23 | } 24 | 25 | int __fesetround(int r) 26 | { 27 | return 0; 28 | } 29 | 30 | int fegetenv(fenv_t *envp) 31 | { 32 | return 0; 33 | } 34 | 35 | int fesetenv(const fenv_t *envp) 36 | { 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fesetexceptflag.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fesetexceptflag(const fexcept_t *fp, int mask) 4 | { 5 | feclearexcept(~*fp & mask); 6 | feraiseexcept(*fp & mask); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fesetround.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* __fesetround wrapper for arch independent argument check */ 5 | 6 | hidden int __fesetround(int); 7 | 8 | int fesetround(int r) 9 | { 10 | if (r != FE_TONEAREST 11 | #ifdef FE_DOWNWARD 12 | && r != FE_DOWNWARD 13 | #endif 14 | #ifdef FE_UPWARD 15 | && r != FE_UPWARD 16 | #endif 17 | #ifdef FE_TOWARDZERO 18 | && r != FE_TOWARDZERO 19 | #endif 20 | ) 21 | return -1; 22 | return __fesetround(r); 23 | } 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/feupdateenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int feupdateenv(const fenv_t *envp) 4 | { 5 | int ex = fetestexcept(FE_ALL_EXCEPT); 6 | fesetenv(envp); 7 | feraiseexcept(ex); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | #ifndef ARPA_INET_H 2 | #define ARPA_INET_H 3 | 4 | #include "../../../include/arpa/inet.h" 5 | 6 | hidden int __inet_aton(const char *, struct in_addr *); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/include/features.h: -------------------------------------------------------------------------------- 1 | #ifndef FEATURES_H 2 | #define FEATURES_H 3 | 4 | #include "../../include/features.h" 5 | 6 | #define weak __attribute__((__weak__)) 7 | #define hidden __attribute__((__visibility__("hidden"))) 8 | #define weak_alias(old, new) \ 9 | extern __typeof(old) new __attribute__((__weak__, __alias__(#old))) 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/include/resolv.h: -------------------------------------------------------------------------------- 1 | #ifndef RESOLV_H 2 | #define RESOLV_H 3 | 4 | #include "../../include/resolv.h" 5 | 6 | hidden int __dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int); 7 | 8 | hidden int __res_mkquery(int, const char *, int, int, const unsigned char *, int, const unsigned char*, unsigned char *, int); 9 | hidden int __res_send(const unsigned char *, int, unsigned char *, int); 10 | hidden int __res_msend(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/internal/complex_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPLEX_IMPL_H 2 | #define _COMPLEX_IMPL_H 3 | 4 | #include 5 | #include "libm.h" 6 | 7 | #undef __CMPLX 8 | #undef CMPLX 9 | #undef CMPLXF 10 | #undef CMPLXL 11 | 12 | #define __CMPLX(x, y, t) \ 13 | ((union { _Complex t __z; t __xy[2]; }){.__xy = {(x),(y)}}.__z) 14 | 15 | #define CMPLX(x, y) __CMPLX(x, y, double) 16 | #define CMPLXF(x, y) __CMPLX(x, y, float) 17 | #define CMPLXL(x, y) __CMPLX(x, y, long double) 18 | 19 | hidden double complex __ldexp_cexp(double complex,int); 20 | hidden float complex __ldexp_cexpf(float complex,int); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/locale/c_locale.c: -------------------------------------------------------------------------------- 1 | #include "locale_impl.h" 2 | #include 3 | 4 | static const uint32_t empty_mo[] = { 0x950412de, 0, -1, -1, -1 }; 5 | 6 | const struct __locale_map __c_dot_utf8 = { 7 | .map = empty_mo, 8 | .map_size = sizeof empty_mo, 9 | .name = "C.UTF-8" 10 | }; 11 | 12 | const struct __locale_struct __c_locale = { 0 }; 13 | const struct __locale_struct __c_dot_utf8_locale = { 14 | .cat[LC_CTYPE] = &__c_dot_utf8 15 | }; 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/locale/wcscoll.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "locale_impl.h" 4 | 5 | /* FIXME: stub */ 6 | int __wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale) 7 | { 8 | return wcscmp(l, r); 9 | } 10 | 11 | int wcscoll(const wchar_t *l, const wchar_t *r) 12 | { 13 | return __wcscoll_l(l, r, CURRENT_LOCALE); 14 | } 15 | 16 | weak_alias(__wcscoll_l, wcscoll_l); 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__fpclassify.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __fpclassify(double x) 5 | { 6 | union {double f; uint64_t i;} u = {x}; 7 | int e = u.i>>52 & 0x7ff; 8 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 9 | if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE; 10 | return FP_NORMAL; 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__fpclassifyf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __fpclassifyf(float x) 5 | { 6 | union {float f; uint32_t i;} u = {x}; 7 | int e = u.i>>23 & 0xff; 8 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 9 | if (e==0xff) return u.i<<9 ? FP_NAN : FP_INFINITE; 10 | return FP_NORMAL; 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__invtrigl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* shared by acosl, asinl and atan2l */ 4 | #define pio2_hi __pio2_hi 5 | #define pio2_lo __pio2_lo 6 | hidden extern const long double pio2_hi, pio2_lo; 7 | 8 | hidden long double __invtrigl_R(long double z); 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_divzero.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_divzero(uint32_t sign) 4 | { 5 | return fp_barrier(sign ? -1.0 : 1.0) / 0.0; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_divzerof.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_divzerof(uint32_t sign) 4 | { 5 | return fp_barrierf(sign ? -1.0f : 1.0f) / 0.0f; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_invalid.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_invalid(double x) 4 | { 5 | return (x - x) / (x - x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_invalidf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_invalidf(float x) 4 | { 5 | return (x - x) / (x - x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_invalidl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | #if LDBL_MANT_DIG != DBL_MANT_DIG 5 | long double __math_invalidl(long double x) 6 | { 7 | return (x - x) / (x - x); 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_oflow.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_oflow(uint32_t sign) 4 | { 5 | return __math_xflow(sign, 0x1p769); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_oflowf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_oflowf(uint32_t sign) 4 | { 5 | return __math_xflowf(sign, 0x1p97f); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_uflow.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_uflow(uint32_t sign) 4 | { 5 | return __math_xflow(sign, 0x1p-767); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_uflowf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_uflowf(uint32_t sign) 4 | { 5 | return __math_xflowf(sign, 0x1p-95f); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_xflow.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_xflow(uint32_t sign, double y) 4 | { 5 | return eval_as_double(fp_barrier(sign ? -y : y) * y); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_xflowf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_xflowf(uint32_t sign, float y) 4 | { 5 | return eval_as_float(fp_barrierf(sign ? -y : y) * y); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__signbit.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME: macro in math.h 4 | int __signbit(double x) 5 | { 6 | union { 7 | double d; 8 | uint64_t i; 9 | } y = { x }; 10 | return y.i>>63; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__signbitf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME: macro in math.h 4 | int __signbitf(float x) 5 | { 6 | union { 7 | float f; 8 | uint32_t i; 9 | } y = { x }; 10 | return y.i>>31; 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__signbitl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | #if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 4 | int __signbitl(long double x) 5 | { 6 | union ldshape u = {x}; 7 | return u.i.se >> 15; 8 | } 9 | #elif LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 10 | int __signbitl(long double x) 11 | { 12 | return __signbit(x); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/ceil.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ceil(double x) 4 | { 5 | __asm__ ("frintp %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/ceilf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float ceilf(float x) 4 | { 5 | __asm__ ("frintp %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fabs(double x) 4 | { 5 | __asm__ ("fabs %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fabsf(float x) 4 | { 5 | __asm__ ("fabs %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/floor.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double floor(double x) 4 | { 5 | __asm__ ("frintm %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/floorf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float floorf(float x) 4 | { 5 | __asm__ ("frintm %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fma(double x, double y, double z) 4 | { 5 | __asm__ ("fmadd %d0, %d1, %d2, %d3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaf(float x, float y, float z) 4 | { 5 | __asm__ ("fmadd %s0, %s1, %s2, %s3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmax.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmax(double x, double y) 4 | { 5 | __asm__ ("fmaxnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmaxf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaxf(float x, float y) 4 | { 5 | __asm__ ("fmaxnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmin(double x, double y) 4 | { 5 | __asm__ ("fminnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fminf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fminf(float x, float y) 4 | { 5 | __asm__ ("fminnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrint(double x) 4 | { 5 | long long n; 6 | __asm__ ( 7 | "frintx %d1, %d1\n" 8 | "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintf(float x) 4 | { 5 | long long n; 6 | __asm__ ( 7 | "frintx %s1, %s1\n" 8 | "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llround(double x) 4 | { 5 | long long n; 6 | __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundf(float x) 4 | { 5 | long long n; 6 | __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrint(double x) 4 | { 5 | long n; 6 | __asm__ ( 7 | "frintx %d1, %d1\n" 8 | "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintf(float x) 4 | { 5 | long n; 6 | __asm__ ( 7 | "frintx %s1, %s1\n" 8 | "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lround(double x) 4 | { 5 | long n; 6 | __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundf(float x) 4 | { 5 | long n; 6 | __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/nearbyint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double nearbyint(double x) 4 | { 5 | __asm__ ("frinti %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/nearbyintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float nearbyintf(float x) 4 | { 5 | __asm__ ("frinti %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/rint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double rint(double x) 4 | { 5 | __asm__ ("frintx %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/rintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float rintf(float x) 4 | { 5 | __asm__ ("frintx %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/round.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double round(double x) 4 | { 5 | __asm__ ("frinta %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/roundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float roundf(float x) 4 | { 5 | __asm__ ("frinta %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/sqrt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double sqrt(double x) 4 | { 5 | __asm__ ("fsqrt %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/sqrtf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float sqrtf(float x) 4 | { 5 | __asm__ ("fsqrt %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/trunc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double trunc(double x) 4 | { 5 | __asm__ ("frintz %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/truncf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float truncf(float x) 4 | { 5 | __asm__ ("frintz %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ceilf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float ceilf(float x) 4 | { 5 | union {float f; uint32_t i;} u = {x}; 6 | int e = (int)(u.i >> 23 & 0xff) - 0x7f; 7 | uint32_t m; 8 | 9 | if (e >= 23) 10 | return x; 11 | if (e >= 0) { 12 | m = 0x007fffff >> e; 13 | if ((u.i & m) == 0) 14 | return x; 15 | FORCE_EVAL(x + 0x1p120f); 16 | if (u.i >> 31 == 0) 17 | u.i += m; 18 | u.i &= ~m; 19 | } else { 20 | FORCE_EVAL(x + 0x1p120f); 21 | if (u.i >> 31) 22 | u.f = -0.0; 23 | else if (u.i << 1) 24 | u.f = 1.0; 25 | } 26 | return u.f; 27 | } 28 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/copysign.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double copysign(double x, double y) { 4 | union {double f; uint64_t i;} ux={x}, uy={y}; 5 | ux.i &= -1ULL/2; 6 | ux.i |= uy.i & 1ULL<<63; 7 | return ux.f; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/copysignf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float copysignf(float x, float y) 5 | { 6 | union {float f; uint32_t i;} ux={x}, uy={y}; 7 | ux.i &= 0x7fffffff; 8 | ux.i |= uy.i & 0x80000000; 9 | return ux.f; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/copysignl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double copysignl(long double x, long double y) 5 | { 6 | return copysign(x, y); 7 | } 8 | #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 9 | long double copysignl(long double x, long double y) 10 | { 11 | union ldshape ux = {x}, uy = {y}; 12 | ux.i.se &= 0x7fff; 13 | ux.i.se |= uy.i.se & 0x8000; 14 | return ux.f; 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double fabs(double x) 5 | { 6 | union {double f; uint64_t i;} u = {x}; 7 | u.i &= -1ULL/2; 8 | return u.f; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float fabsf(float x) 5 | { 6 | union {float f; uint32_t i;} u = {x}; 7 | u.i &= 0x7fffffff; 8 | return u.f; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fabsl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 3 | long double fabsl(long double x) 4 | { 5 | return fabs(x); 6 | } 7 | #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 8 | long double fabsl(long double x) 9 | { 10 | union ldshape u = {x}; 11 | 12 | u.i.se &= 0x7fff; 13 | return u.f; 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fdim.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fdim(double x, double y) 4 | { 5 | if (isnan(x)) 6 | return x; 7 | if (isnan(y)) 8 | return y; 9 | return x > y ? x - y : 0; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fdimf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fdimf(float x, float y) 4 | { 5 | if (isnan(x)) 6 | return x; 7 | if (isnan(y)) 8 | return y; 9 | return x > y ? x - y : 0; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fdiml.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double fdiml(long double x, long double y) 6 | { 7 | return fdim(x, y); 8 | } 9 | #else 10 | long double fdiml(long double x, long double y) 11 | { 12 | if (isnan(x)) 13 | return x; 14 | if (isnan(y)) 15 | return y; 16 | return x > y ? x - y : 0; 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/finite.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int finite(double x) 5 | { 6 | return isfinite(x); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/finitef.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int finitef(float x) 5 | { 6 | return isfinite(x); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/floorf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float floorf(float x) 4 | { 5 | union {float f; uint32_t i;} u = {x}; 6 | int e = (int)(u.i >> 23 & 0xff) - 0x7f; 7 | uint32_t m; 8 | 9 | if (e >= 23) 10 | return x; 11 | if (e >= 0) { 12 | m = 0x007fffff >> e; 13 | if ((u.i & m) == 0) 14 | return x; 15 | FORCE_EVAL(x + 0x1p120f); 16 | if (u.i >> 31) 17 | u.i += m; 18 | u.i &= ~m; 19 | } else { 20 | FORCE_EVAL(x + 0x1p120f); 21 | if (u.i >> 31 == 0) 22 | u.i = 0; 23 | else if (u.i << 1) 24 | u.f = -1.0; 25 | } 26 | return u.f; 27 | } 28 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmax.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmax(double x, double y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? y : x; 12 | return x < y ? y : x; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmaxf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaxf(float x, float y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeroes, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? y : x; 12 | return x < y ? y : x; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmaxl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double fmaxl(long double x, long double y) 6 | { 7 | return fmax(x, y); 8 | } 9 | #else 10 | long double fmaxl(long double x, long double y) 11 | { 12 | if (isnan(x)) 13 | return y; 14 | if (isnan(y)) 15 | return x; 16 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 17 | if (signbit(x) != signbit(y)) 18 | return signbit(x) ? y : x; 19 | return x < y ? y : x; 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmin(double x, double y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? x : y; 12 | return x < y ? x : y; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fminf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fminf(float x, float y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? x : y; 12 | return x < y ? x : y; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fminl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double fminl(long double x, long double y) 6 | { 7 | return fmin(x, y); 8 | } 9 | #else 10 | long double fminl(long double x, long double y) 11 | { 12 | if (isnan(x)) 13 | return y; 14 | if (isnan(y)) 15 | return x; 16 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 17 | if (signbit(x) != signbit(y)) 18 | return signbit(x) ? x : y; 19 | return x < y ? x : y; 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/frexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double frexp(double x, int *e) 5 | { 6 | union { double d; uint64_t i; } y = { x }; 7 | int ee = y.i>>52 & 0x7ff; 8 | 9 | if (!ee) { 10 | if (x) { 11 | x = frexp(x*0x1p64, e); 12 | *e -= 64; 13 | } else *e = 0; 14 | return x; 15 | } else if (ee == 0x7ff) { 16 | return x; 17 | } 18 | 19 | *e = ee - 0x3fe; 20 | y.i &= 0x800fffffffffffffull; 21 | y.i |= 0x3fe0000000000000ull; 22 | return y.d; 23 | } 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/frexpf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float frexpf(float x, int *e) 5 | { 6 | union { float f; uint32_t i; } y = { x }; 7 | int ee = y.i>>23 & 0xff; 8 | 9 | if (!ee) { 10 | if (x) { 11 | x = frexpf(x*0x1p64, e); 12 | *e -= 64; 13 | } else *e = 0; 14 | return x; 15 | } else if (ee == 0xff) { 16 | return x; 17 | } 18 | 19 | *e = ee - 0x7e; 20 | y.i &= 0x807ffffful; 21 | y.i |= 0x3f000000ul; 22 | return y.f; 23 | } 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ilogb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | int ilogb(double x) 5 | { 6 | #pragma STDC FENV_ACCESS ON 7 | union {double f; uint64_t i;} u = {x}; 8 | uint64_t i = u.i; 9 | int e = i>>52 & 0x7ff; 10 | 11 | if (!e) { 12 | i <<= 12; 13 | if (i == 0) { 14 | FORCE_EVAL(0/0.0f); 15 | return FP_ILOGB0; 16 | } 17 | /* subnormal x */ 18 | for (e = -0x3ff; i>>63 == 0; e--, i<<=1); 19 | return e; 20 | } 21 | if (e == 0x7ff) { 22 | FORCE_EVAL(0/0.0f); 23 | return i<<12 ? FP_ILOGBNAN : INT_MAX; 24 | } 25 | return e - 0x3ff; 26 | } 27 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ilogbf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | int ilogbf(float x) 5 | { 6 | #pragma STDC FENV_ACCESS ON 7 | union {float f; uint32_t i;} u = {x}; 8 | uint32_t i = u.i; 9 | int e = i>>23 & 0xff; 10 | 11 | if (!e) { 12 | i <<= 9; 13 | if (i == 0) { 14 | FORCE_EVAL(0/0.0f); 15 | return FP_ILOGB0; 16 | } 17 | /* subnormal x */ 18 | for (e = -0x7f; i>>31 == 0; e--, i<<=1); 19 | return e; 20 | } 21 | if (e == 0xff) { 22 | FORCE_EVAL(0/0.0f); 23 | return i<<9 ? FP_ILOGBNAN : INT_MAX; 24 | } 25 | return e - 0x7f; 26 | } 27 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ldexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ldexp(double x, int n) 4 | { 5 | return scalbn(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ldexpf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float ldexpf(float x, int n) 4 | { 5 | return scalbnf(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ldexpl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double ldexpl(long double x, int n) 4 | { 5 | return scalbnl(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lgamma.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | double lgamma(double x) 5 | { 6 | return __lgamma_r(x, &__signgam); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lgammaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | float lgammaf(float x) 5 | { 6 | return __lgammaf_r(x, &__signgam); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LLONG_MAX > 2^53, see comments in lrint.c */ 4 | 5 | long long llrint(double x) 6 | { 7 | return rint(x); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LLONG_MAX > 2^24, see comments in lrint.c */ 4 | 5 | long long llrintf(float x) 6 | { 7 | return rintf(x); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llround(double x) 4 | { 5 | return round(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llroundl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundl(long double x) 4 | { 5 | return roundl(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/log2f_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, Arm Limited. 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | #ifndef _LOG2F_DATA_H 6 | #define _LOG2F_DATA_H 7 | 8 | #include 9 | 10 | #define LOG2F_TABLE_BITS 4 11 | #define LOG2F_POLY_ORDER 4 12 | extern hidden const struct log2f_data { 13 | struct { 14 | double invc, logc; 15 | } tab[1 << LOG2F_TABLE_BITS]; 16 | double poly[LOG2F_POLY_ORDER]; 17 | } __log2f_data; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logb.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* 4 | special cases: 5 | logb(+-0) = -inf, and raise divbyzero 6 | logb(+-inf) = +inf 7 | logb(nan) = nan 8 | */ 9 | 10 | double logb(double x) 11 | { 12 | if (!isfinite(x)) 13 | return x * x; 14 | if (x == 0) 15 | return -1/(x*x); 16 | return ilogb(x); 17 | } 18 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logbf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float logbf(float x) 4 | { 5 | if (!isfinite(x)) 6 | return x * x; 7 | if (x == 0) 8 | return -1/(x*x); 9 | return ilogbf(x); 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logbl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 3 | long double logbl(long double x) 4 | { 5 | return logb(x); 6 | } 7 | #else 8 | long double logbl(long double x) 9 | { 10 | if (!isfinite(x)) 11 | return x * x; 12 | if (x == 0) 13 | return -1/(x*x); 14 | return ilogbl(x); 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logf_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, Arm Limited. 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | #ifndef _LOGF_DATA_H 6 | #define _LOGF_DATA_H 7 | 8 | #include 9 | 10 | #define LOGF_TABLE_BITS 4 11 | #define LOGF_POLY_ORDER 4 12 | extern hidden const struct logf_data { 13 | struct { 14 | double invc, logc; 15 | } tab[1 << LOGF_TABLE_BITS]; 16 | double ln2; 17 | double poly[LOGF_POLY_ORDER - 1]; /* First order coefficient is 1. */ 18 | } __logf_data; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LONG_MAX > 2^24, see comments in lrint.c */ 4 | 5 | long lrintf(float x) 6 | { 7 | return rintf(x); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lround(double x) 4 | { 5 | return round(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lroundl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundl(long double x) 4 | { 5 | return roundl(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nan.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double nan(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float nanf(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nanl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double nanl(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nearbyint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* nearbyint is the same as rint, but it must not raise the inexact exception */ 5 | 6 | double nearbyint(double x) 7 | { 8 | #ifdef FE_INEXACT 9 | #pragma STDC FENV_ACCESS ON 10 | int e; 11 | 12 | e = fetestexcept(FE_INEXACT); 13 | #endif 14 | x = rint(x); 15 | #ifdef FE_INEXACT 16 | if (!e) 17 | feclearexcept(FE_INEXACT); 18 | #endif 19 | return x; 20 | } 21 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nearbyintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float nearbyintf(float x) 5 | { 6 | #ifdef FE_INEXACT 7 | #pragma STDC FENV_ACCESS ON 8 | int e; 9 | 10 | e = fetestexcept(FE_INEXACT); 11 | #endif 12 | x = rintf(x); 13 | #ifdef FE_INEXACT 14 | if (!e) 15 | feclearexcept(FE_INEXACT); 16 | #endif 17 | return x; 18 | } 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nearbyintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double nearbyintl(long double x) 6 | { 7 | return nearbyint(x); 8 | } 9 | #else 10 | #include 11 | long double nearbyintl(long double x) 12 | { 13 | #ifdef FE_INEXACT 14 | #pragma STDC FENV_ACCESS ON 15 | int e; 16 | 17 | e = fetestexcept(FE_INEXACT); 18 | #endif 19 | x = rintl(x); 20 | #ifdef FE_INEXACT 21 | if (!e) 22 | feclearexcept(FE_INEXACT); 23 | #endif 24 | return x; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nexttowardl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double nexttowardl(long double x, long double y) 4 | { 5 | return nextafterl(x, y); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/remainder.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double remainder(double x, double y) 4 | { 5 | int q; 6 | return remquo(x, y, &q); 7 | } 8 | 9 | weak_alias(remainder, drem); 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/remainderf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float remainderf(float x, float y) 4 | { 5 | int q; 6 | return remquof(x, y, &q); 7 | } 8 | 9 | weak_alias(remainderf, dremf); 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/remainderl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double remainderl(long double x, long double y) 6 | { 7 | return remainder(x, y); 8 | } 9 | #else 10 | long double remainderl(long double x, long double y) 11 | { 12 | int q; 13 | return remquol(x, y, &q); 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/scalbln.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double scalbln(double x, long n) 5 | { 6 | if (n > INT_MAX) 7 | n = INT_MAX; 8 | else if (n < INT_MIN) 9 | n = INT_MIN; 10 | return scalbn(x, n); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/scalblnf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float scalblnf(float x, long n) 5 | { 6 | if (n > INT_MAX) 7 | n = INT_MAX; 8 | else if (n < INT_MIN) 9 | n = INT_MIN; 10 | return scalbnf(x, n); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/scalblnl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 6 | long double scalblnl(long double x, long n) 7 | { 8 | return scalbln(x, n); 9 | } 10 | #else 11 | long double scalblnl(long double x, long n) 12 | { 13 | if (n > INT_MAX) 14 | n = INT_MAX; 15 | else if (n < INT_MIN) 16 | n = INT_MIN; 17 | return scalbnl(x, n); 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/signgam.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | int __signgam = 0; 5 | 6 | weak_alias(__signgam, signgam); 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/significand.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | double significand(double x) 5 | { 6 | return scalbn(x, -ilogb(x)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/significandf.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | float significandf(float x) 5 | { 6 | return scalbnf(x, -ilogbf(x)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/sqrt_data.h: -------------------------------------------------------------------------------- 1 | #ifndef _SQRT_DATA_H 2 | #define _SQRT_DATA_H 3 | 4 | #include 5 | #include 6 | 7 | /* if x in [1,2): i = (int)(64*x); 8 | if x in [2,4): i = (int)(32*x-64); 9 | __rsqrt_tab[i]*2^-16 is estimating 1/sqrt(x) with small relative error: 10 | |__rsqrt_tab[i]*0x1p-16*sqrt(x) - 1| < -0x1.fdp-9 < 2^-8 */ 11 | extern hidden const uint16_t __rsqrt_tab[128]; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/tgammaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float tgammaf(float x) 4 | { 5 | return tgamma(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/trunc.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double trunc(double x) 4 | { 5 | union {double f; uint64_t i;} u = {x}; 6 | int e = (int)(u.i >> 52 & 0x7ff) - 0x3ff + 12; 7 | uint64_t m; 8 | 9 | if (e >= 52 + 12) 10 | return x; 11 | if (e < 12) 12 | e = 1; 13 | m = -1ULL >> e; 14 | if ((u.i & m) == 0) 15 | return x; 16 | FORCE_EVAL(x + 0x1p120f); 17 | u.i &= ~m; 18 | return u.f; 19 | } 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/truncf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float truncf(float x) 4 | { 5 | union {float f; uint32_t i;} u = {x}; 6 | int e = (int)(u.i >> 23 & 0xff) - 0x7f + 9; 7 | uint32_t m; 8 | 9 | if (e >= 23 + 9) 10 | return x; 11 | if (e < 9) 12 | e = 1; 13 | m = -1U >> e; 14 | if ((u.i & m) == 0) 15 | return x; 16 | FORCE_EVAL(x + 0x1p120f); 17 | u.i &= ~m; 18 | return u.f; 19 | } 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/__invtrigl.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/3rdparty/lib/musl/src/math/x86_64/__invtrigl.s -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/acosl.s: -------------------------------------------------------------------------------- 1 | # see ../i386/acos.s 2 | 3 | .global acosl 4 | .type acosl,@function 5 | acosl: 6 | fldt 8(%rsp) 7 | 1: fld %st(0) 8 | fld1 9 | fsub %st(0),%st(1) 10 | fadd %st(2) 11 | fmulp 12 | fsqrt 13 | fabs 14 | fxch %st(1) 15 | fpatan 16 | ret 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/asinl.s: -------------------------------------------------------------------------------- 1 | .global asinl 2 | .type asinl,@function 3 | asinl: 4 | fldt 8(%rsp) 5 | 1: fld %st(0) 6 | fld1 7 | fsub %st(0),%st(1) 8 | fadd %st(2) 9 | fmulp 10 | fsqrt 11 | fpatan 12 | ret 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/atan2l.s: -------------------------------------------------------------------------------- 1 | .global atan2l 2 | .type atan2l,@function 3 | atan2l: 4 | fldt 8(%rsp) 5 | fldt 24(%rsp) 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/atanl.s: -------------------------------------------------------------------------------- 1 | .global atanl 2 | .type atanl,@function 3 | atanl: 4 | fldt 8(%rsp) 5 | fld1 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/ceill.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/expm1l.s: -------------------------------------------------------------------------------- 1 | # see exp2l.s 2 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fabs(double x) 4 | { 5 | double t; 6 | __asm__ ("pcmpeqd %0, %0" : "=x"(t)); // t = ~0 7 | __asm__ ("psrlq $1, %0" : "+x"(t)); // t >>= 1 8 | __asm__ ("andps %1, %0" : "+x"(x) : "x"(t)); // x &= t 9 | return x; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fabsf(float x) 4 | { 5 | float t; 6 | __asm__ ("pcmpeqd %0, %0" : "=x"(t)); // t = ~0 7 | __asm__ ("psrld $1, %0" : "+x"(t)); // t >>= 1 8 | __asm__ ("andps %1, %0" : "+x"(x) : "x"(t)); // x &= t 9 | return x; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fabsl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double fabsl(long double x) 4 | { 5 | __asm__ ("fabs" : "+t"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/floorl.s: -------------------------------------------------------------------------------- 1 | .global floorl 2 | .type floorl,@function 3 | floorl: 4 | fldt 8(%rsp) 5 | 1: mov $0x7,%al 6 | 1: fstcw 8(%rsp) 7 | mov 9(%rsp),%ah 8 | mov %al,9(%rsp) 9 | fldcw 8(%rsp) 10 | frndint 11 | mov %ah,9(%rsp) 12 | fldcw 8(%rsp) 13 | ret 14 | 15 | .global ceill 16 | .type ceill,@function 17 | ceill: 18 | fldt 8(%rsp) 19 | mov $0xb,%al 20 | jmp 1b 21 | 22 | .global truncl 23 | .type truncl,@function 24 | truncl: 25 | fldt 8(%rsp) 26 | mov $0xf,%al 27 | jmp 1b 28 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if __FMA__ 4 | 5 | double fma(double x, double y, double z) 6 | { 7 | __asm__ ("vfmadd132sd %1, %2, %0" : "+x" (x) : "x" (y), "x" (z)); 8 | return x; 9 | } 10 | 11 | #elif __FMA4__ 12 | 13 | double fma(double x, double y, double z) 14 | { 15 | __asm__ ("vfmaddsd %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); 16 | return x; 17 | } 18 | 19 | #else 20 | 21 | #include "../fma.c" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fmaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if __FMA__ 4 | 5 | float fmaf(float x, float y, float z) 6 | { 7 | __asm__ ("vfmadd132ss %1, %2, %0" : "+x" (x) : "x" (y), "x" (z)); 8 | return x; 9 | } 10 | 11 | #elif __FMA4__ 12 | 13 | float fmaf(float x, float y, float z) 14 | { 15 | __asm__ ("vfmaddss %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); 16 | return x; 17 | } 18 | 19 | #else 20 | 21 | #include "../fmaf.c" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fmodl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double fmodl(long double x, long double y) 4 | { 5 | unsigned short fpsr; 6 | do __asm__ ("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); 7 | while (fpsr & 0x400); 8 | return x; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrint(double x) 4 | { 5 | long long r; 6 | __asm__ ("cvtsd2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintf(float x) 4 | { 5 | long long r; 6 | __asm__ ("cvtss2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/llrintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintl(long double x) 4 | { 5 | long long r; 6 | __asm__ ("fistpll %0" : "=m"(r) : "t"(x) : "st"); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/log10l.s: -------------------------------------------------------------------------------- 1 | .global log10l 2 | .type log10l,@function 3 | log10l: 4 | fldlg2 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/log1pl.s: -------------------------------------------------------------------------------- 1 | .global log1pl 2 | .type log1pl,@function 3 | log1pl: 4 | mov 14(%rsp),%eax 5 | fldln2 6 | and $0x7fffffff,%eax 7 | fldt 8(%rsp) 8 | cmp $0x3ffd9400,%eax 9 | ja 1f 10 | fyl2xp1 11 | ret 12 | 1: fld1 13 | faddp 14 | fyl2x 15 | ret 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/log2l.s: -------------------------------------------------------------------------------- 1 | .global log2l 2 | .type log2l,@function 3 | log2l: 4 | fld1 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/logl.s: -------------------------------------------------------------------------------- 1 | .global logl 2 | .type logl,@function 3 | logl: 4 | fldln2 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/lrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrint(double x) 4 | { 5 | long r; 6 | __asm__ ("cvtsd2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintf(float x) 4 | { 5 | long r; 6 | __asm__ ("cvtss2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/lrintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintl(long double x) 4 | { 5 | long r; 6 | __asm__ ("fistpll %0" : "=m"(r) : "t"(x) : "st"); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/remainderl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double remainderl(long double x, long double y) 4 | { 5 | unsigned short fpsr; 6 | do __asm__ ("fprem1; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); 7 | while (fpsr & 0x400); 8 | return x; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/rintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double rintl(long double x) 4 | { 5 | __asm__ ("frndint" : "+t"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/sqrt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double sqrt(double x) 4 | { 5 | __asm__ ("sqrtsd %1, %0" : "=x"(x) : "x"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/sqrtf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float sqrtf(float x) 4 | { 5 | __asm__ ("sqrtss %1, %0" : "=x"(x) : "x"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/sqrtl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double sqrtl(long double x) 4 | { 5 | __asm__ ("fsqrt" : "+t"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/truncl.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/btowc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "internal.h" 5 | 6 | wint_t btowc(int c) 7 | { 8 | int b = (unsigned char)c; 9 | return b<128U ? b : (MB_CUR_MAX==1 && c!=EOF) ? CODEUNIT(c) : WEOF; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/c32rtomb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t c32rtomb(char *restrict s, char32_t c32, mbstate_t *restrict ps) 5 | { 6 | return wcrtomb(s, c32, ps); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mblen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mblen(const char *s, size_t n) 4 | { 5 | return mbtowc(0, s, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbrlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st) 4 | { 5 | static unsigned internal; 6 | return mbrtowc(0, s, n, st ? st : (mbstate_t *)&internal); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbrtoc32.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t mbrtoc32(char32_t *restrict pc32, const char *restrict s, size_t n, mbstate_t *restrict ps) 5 | { 6 | static unsigned internal_state; 7 | if (!ps) ps = (void *)&internal_state; 8 | if (!s) return mbrtoc32(0, "", 1, ps); 9 | wchar_t wc; 10 | size_t ret = mbrtowc(&wc, s, n, ps); 11 | if (ret <= 4 && pc32) *pc32 = wc; 12 | return ret; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbsinit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mbsinit(const mbstate_t *st) 4 | { 5 | return !st || !*(unsigned *)st; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbstowcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t mbstowcs(wchar_t *restrict ws, const char *restrict s, size_t wn) 5 | { 6 | return mbsrtowcs(ws, (void*)&s, wn, 0); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/wcstombs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t wcstombs(char *restrict s, const wchar_t *restrict ws, size_t n) 5 | { 6 | return wcsrtombs(s, &(const wchar_t *){ws}, n, 0); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/wctob.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "internal.h" 5 | 6 | int wctob(wint_t c) 7 | { 8 | if (c < 128U) return c; 9 | if (MB_CUR_MAX==1 && IS_CODEUNIT(c)) return (unsigned char)c; 10 | return EOF; 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/wctomb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wctomb(char *s, wchar_t wc) 5 | { 6 | if (!s) return 0; 7 | return wcrtomb(s, wc, 0); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/freeaddrinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "lookup.h" 5 | #include "lock.h" 6 | 7 | void freeaddrinfo(struct addrinfo *p) 8 | { 9 | size_t cnt; 10 | for (cnt=1; p->ai_next; cnt++, p=p->ai_next); 11 | struct aibuf *b = (void *)((char *)p - offsetof(struct aibuf, ai)); 12 | b -= b->slot; 13 | LOCK(b->lock); 14 | if (!(b->ref -= cnt)) free(b); 15 | else UNLOCK(b->lock); 16 | } 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/gethostbyname.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct hostent *gethostbyname(const char *name) 9 | { 10 | return gethostbyname2(name, AF_INET); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/gethostbyname_r.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | 3 | #include 4 | #include 5 | 6 | int gethostbyname_r(const char *name, 7 | struct hostent *h, char *buf, size_t buflen, 8 | struct hostent **res, int *err) 9 | { 10 | return gethostbyname2_r(name, AF_INET, h, buf, buflen, res, err); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/getservbyname.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | struct servent *getservbyname(const char *name, const char *prots) 5 | { 6 | static struct servent se; 7 | static char *buf[2]; 8 | struct servent *res; 9 | if (getservbyname_r(name, prots, &se, (void *)buf, sizeof buf, &res)) 10 | return 0; 11 | return &se; 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/getservbyport.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | struct servent *getservbyport(int port, const char *prots) 5 | { 6 | static struct servent se; 7 | static long buf[32/sizeof(long)]; 8 | struct servent *res; 9 | if (getservbyport_r(port, prots, &se, (void *)buf, sizeof buf, &res)) 10 | return 0; 11 | return &se; 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/h_errno.c: -------------------------------------------------------------------------------- 1 | #include 2 | #ifdef __Kiwi__ 3 | static __thread int __h_errno = 0; 4 | #else 5 | #include "pthread_impl.h" 6 | 7 | #undef h_errno 8 | int h_errno; 9 | #endif 10 | 11 | int *__h_errno_location(void) 12 | { 13 | #ifdef __Kiwi__ 14 | return &__h_errno; 15 | #else 16 | if (!__pthread_self()->stack) return &h_errno; 17 | return &__pthread_self()->h_errno_val; 18 | #endif 19 | } 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/herror.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | 5 | void herror(const char *msg) 6 | { 7 | fprintf(stderr, "%s%s%s\n", msg?msg:"", msg?": ":"", hstrerror(h_errno)); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/hstrerror.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #ifdef __Kiwi__ 4 | // TODO 5 | #define LCTRANS_CUR(s) s 6 | #else 7 | #include "locale_impl.h" 8 | #endif 9 | 10 | static const char msgs[] = 11 | "Host not found\0" 12 | "Try again\0" 13 | "Non-recoverable error\0" 14 | "Address not available\0" 15 | "\0Unknown error"; 16 | 17 | const char *hstrerror(int ecode) 18 | { 19 | const char *s; 20 | for (s=msgs, ecode--; ecode && *s; ecode--, s++) for (; *s; s++); 21 | if (!*s) s++; 22 | return LCTRANS_CUR(s); 23 | } 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/inet_addr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | in_addr_t inet_addr(const char *p) 6 | { 7 | struct in_addr a; 8 | if (!__inet_aton(p, &a)) return -1; 9 | return a.s_addr; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/inet_ntoa.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *inet_ntoa(struct in_addr in) 5 | { 6 | static char buf[16]; 7 | unsigned char *a = (void *)∈ 8 | snprintf(buf, sizeof buf, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); 9 | return buf; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/res_send.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int __res_send(const unsigned char *msg, int msglen, unsigned char *answer, int anslen) 4 | { 5 | int r = __res_msend(1, &msg, &msglen, &answer, &anslen, anslen); 6 | return r<0 || !anslen ? -1 : anslen; 7 | } 8 | 9 | weak_alias(__res_send, res_send); 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/serv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void endservent(void) 4 | { 5 | } 6 | 7 | void setservent(int stayopen) 8 | { 9 | } 10 | 11 | struct servent *getservent(void) 12 | { 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/prng/rand.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static uint64_t seed; 5 | 6 | void srand(unsigned s) 7 | { 8 | seed = s-1; 9 | } 10 | 11 | int rand(void) 12 | { 13 | seed = 6364136223846793005ULL*seed + 1; 14 | return seed>>33; 15 | } 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/prng/rand_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static unsigned temper(unsigned x) 4 | { 5 | x ^= x>>11; 6 | x ^= x<<7 & 0x9D2C5680; 7 | x ^= x<<15 & 0xEFC60000; 8 | x ^= x>>18; 9 | return x; 10 | } 11 | 12 | int rand_r(unsigned *seed) 13 | { 14 | return temper(*seed = *seed * 1103515245 + 12345)/2; 15 | } 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcpcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcpcpy(wchar_t *restrict d, const wchar_t *restrict s) 4 | { 5 | return wcscpy(d, s) + wcslen(s); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcpncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcpncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | return wcsncpy(d, s, n) + wcsnlen(s, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wcscasecmp(const wchar_t *l, const wchar_t *r) 5 | { 6 | return wcsncasecmp(l, r, -1); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscasecmp_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcscasecmp_l(const wchar_t *l, const wchar_t *r, locale_t locale) 4 | { 5 | return wcscasecmp(l, r); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscat(wchar_t *restrict dest, const wchar_t *restrict src) 4 | { 5 | wcscpy(dest + wcslen(dest), src); 6 | return dest; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcschr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcschr(const wchar_t *s, wchar_t c) 4 | { 5 | if (!c) return (wchar_t *)s + wcslen(s); 6 | for (; *s && *s != c; s++); 7 | return *s ? (wchar_t *)s : 0; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcscmp(const wchar_t *l, const wchar_t *r) 4 | { 5 | for (; *l==*r && *l && *r; l++, r++); 6 | return *l - *r; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscpy(wchar_t *restrict d, const wchar_t *restrict s) 4 | { 5 | wchar_t *a = d; 6 | while ((*d++ = *s++)); 7 | return a; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscspn.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcscspn(const wchar_t *s, const wchar_t *c) 4 | { 5 | const wchar_t *a; 6 | if (!c[0]) return wcslen(s); 7 | if (!c[1]) return (s=wcschr(a=s, *c)) ? s-a : wcslen(a); 8 | for (a=s; *s && !wcschr(c, *s); s++); 9 | return s-a; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsdup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wcsdup(const wchar_t *s) 5 | { 6 | size_t l = wcslen(s); 7 | wchar_t *d = malloc((l+1)*sizeof(wchar_t)); 8 | if (!d) return NULL; 9 | return wmemcpy(d, s, l+1); 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcslen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcslen(const wchar_t *s) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s; s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wcsncasecmp(const wchar_t *l, const wchar_t *r, size_t n) 5 | { 6 | if (!n--) return 0; 7 | for (; *l && *r && n && (*l == *r || towlower(*l) == towlower(*r)); l++, r++, n--); 8 | return towlower(*l) - towlower(*r); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncasecmp_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcsncasecmp_l(const wchar_t *l, const wchar_t *r, size_t n, locale_t locale) 4 | { 5 | return wcsncasecmp(l, r, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsncat(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | d += wcslen(d); 7 | while (n && *s) n--, *d++ = *s++; 8 | *d++ = 0; 9 | return a; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n) 4 | { 5 | for (; n && *l==*r && *l && *r; n--, l++, r++); 6 | return n ? *l - *r : 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | while (n && *s) n--, *d++ = *s++; 7 | wmemset(d, 0, n); 8 | return a; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsnlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcsnlen(const wchar_t *s, size_t n) 4 | { 5 | const wchar_t *z = wmemchr(s, 0, n); 6 | if (z) n = z-s; 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcspbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcspbrk(const wchar_t *s, const wchar_t *b) 4 | { 5 | s += wcscspn(s, b); 6 | return *s ? (wchar_t *)s : NULL; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsrchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsrchr(const wchar_t *s, wchar_t c) 4 | { 5 | const wchar_t *p; 6 | for (p=s+wcslen(s); p>=s && *p!=c; p--); 7 | return p>=s ? (wchar_t *)p : 0; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsspn.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcsspn(const wchar_t *s, const wchar_t *c) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s && wcschr(c, *s); s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcstok.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcstok(wchar_t *restrict s, const wchar_t *restrict sep, wchar_t **restrict p) 4 | { 5 | if (!s && !(s = *p)) return NULL; 6 | s += wcsspn(s, sep); 7 | if (!*s) return *p = 0; 8 | *p = s + wcscspn(s, sep); 9 | if (**p) *(*p)++ = 0; 10 | else *p = 0; 11 | return s; 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcswcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcswcs(const wchar_t *haystack, const wchar_t *needle) 4 | { 5 | return wcsstr(haystack, needle); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n) 4 | { 5 | for (; n && *s != c; n--, s++); 6 | return n ? (wchar_t *)s : 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wmemcmp(const wchar_t *l, const wchar_t *r, size_t n) 4 | { 5 | for (; n && *l==*r; n--, l++, r++); 6 | return n ? *l-*r : 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemcpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | while (n--) *d++ = *s++; 7 | return a; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemmove.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) 5 | { 6 | wchar_t *d0 = d; 7 | if (d == s) return d; 8 | if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d) 9 | while (n--) d[n] = s[n]; 10 | else 11 | while (n--) *d++ = *s++; 12 | return d0; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemset.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemset(wchar_t *d, wchar_t c, size_t n) 4 | { 5 | wchar_t *ret = d; 6 | while (n--) *d++ = c; 7 | return ret; 8 | } 9 | -------------------------------------------------------------------------------- /data/bin: -------------------------------------------------------------------------------- 1 | system/bin -------------------------------------------------------------------------------- /data/dev/null: -------------------------------------------------------------------------------- 1 | //@/virtual/null -------------------------------------------------------------------------------- /data/dev/urandom: -------------------------------------------------------------------------------- 1 | //@/virtual/pseudo_random -------------------------------------------------------------------------------- /data/system/bin/ldd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # SPDX-FileCopyrightText: (C) Alex Smith 4 | # SPDX-License-Identifier: ISC 5 | # 6 | 7 | if [ $# -ne 1 ]; then 8 | echo "Usage: ldd file" 9 | exit 1 10 | fi 11 | 12 | export LIBKERNEL_DRY_RUN=1 13 | exec "$1" 14 | -------------------------------------------------------------------------------- /data/system/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 2 | ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 3 | -------------------------------------------------------------------------------- /data/system/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-Black.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-BlackIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-BlackIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-Bold.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-BoldIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-BoldIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-ExtraLight.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-ExtraLightIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-ExtraLightIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-It.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-It.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-Light.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-LightIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-LightIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-Medium.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-MediumIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-MediumIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-Semibold.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-SemiboldIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/data/system/fonts/source-code-pro/SourceCodePro-SemiboldIt.ttf -------------------------------------------------------------------------------- /data/users/admin/dummy.txt: -------------------------------------------------------------------------------- 1 | Placeholder to get this directory created in the filesystem. 2 | -------------------------------------------------------------------------------- /documentation/screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/documentation/screenshots/1.png -------------------------------------------------------------------------------- /documentation/screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/documentation/screenshots/2.png -------------------------------------------------------------------------------- /documentation/screenshots/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/documentation/screenshots/3.jpg -------------------------------------------------------------------------------- /documentation/screenshots/3_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/documentation/screenshots/3_small.jpg -------------------------------------------------------------------------------- /documentation/screenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/documentation/screenshots/4.png -------------------------------------------------------------------------------- /documentation/screenshots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/documentation/screenshots/5.png -------------------------------------------------------------------------------- /documentation/screenshots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/documentation/screenshots/6.png -------------------------------------------------------------------------------- /source/bin/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config') 7 | 8 | minimal_bins = [ 9 | 'test', 10 | ] 11 | 12 | SConscript(dirs = minimal_bins) 13 | 14 | if config['SYS_MINIMAL_USERSPACE']: 15 | Return() 16 | 17 | bins = [ 18 | 'dungeon', 19 | 'posix', 20 | 'terminal', 21 | 'utilities', 22 | ] 23 | 24 | SConscript(dirs = bins) 25 | -------------------------------------------------------------------------------- /source/bin/dungeon: -------------------------------------------------------------------------------- 1 | ../../3rdparty/bin/dungeon -------------------------------------------------------------------------------- /source/bin/posix/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create() 9 | 10 | env.KiwiApplication('cat', ['cat.c']) 11 | env.KiwiApplication('cp', ['cp.c']) 12 | env.KiwiApplication('ln', ['ln.c']) 13 | env.KiwiApplication('ls', ['ls.c']) 14 | env.KiwiApplication('mkdir', ['mkdir.c']) 15 | env.KiwiApplication('mv', ['mv.c']) 16 | env.KiwiApplication('rm', ['rm.c']) 17 | env.KiwiApplication('rmdir', ['rmdir.c']) 18 | env.KiwiApplication('unlink', ['unlink.c']) 19 | -------------------------------------------------------------------------------- /source/bin/terminal/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['device', 'freetype', 'kiwi']) 9 | 10 | env.KiwiApplication('terminal', [ 11 | 'font.cpp', 12 | 'framebuffer.cpp', 13 | 'keyboard.cpp', 14 | 'keys.c', 15 | 'terminal_app.cpp', 16 | 'terminal_buffer.cpp', 17 | 'terminal_window.cpp', 18 | 'terminal.cpp', 19 | 'xterm.cpp', 20 | ]) 21 | -------------------------------------------------------------------------------- /source/bin/test/test_hello.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Hello World test application. 9 | */ 10 | 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | int main(int argc, char **argv) { 18 | while (true) { 19 | printf("Hello, World!\n"); 20 | kern_thread_sleep(core_secs_to_nsecs(1), NULL); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /source/bin/utilities/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | dirs = [ 9 | 'net_control', 10 | ] 11 | 12 | SConscript(dirs = dirs) 13 | 14 | env = manager.create(libraries = []) 15 | 16 | env.KiwiApplication('mount', ['mount.c']) 17 | env.KiwiApplication('unmount', ['unmount.c']) 18 | -------------------------------------------------------------------------------- /source/bin/utilities/net_control/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['device']) 9 | 10 | env.KiwiApplication('net_control', [ 11 | 'dhcp.c', 12 | 'net_control.c', 13 | 'utility.c', 14 | ]) 15 | -------------------------------------------------------------------------------- /source/boot: -------------------------------------------------------------------------------- 1 | ../3rdparty/kboot/source -------------------------------------------------------------------------------- /source/kernel/arch/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | if ARCH_AMD64 7 | source "amd64/Kconfig" 8 | endif 9 | 10 | if ARCH_ARM64 11 | source "arm64/Kconfig" 12 | endif 13 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | config KERNEL_ARCH_AMD64 7 | def_bool y 8 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/barrier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 memory barrier functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #define memory_barrier() __asm__ volatile("mfence" ::: "memory") 14 | #define read_barrier() __asm__ volatile("lfence" ::: "memory") 15 | #define write_barrier() __asm__ volatile("sfence" ::: "memory") 16 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 CPU cache definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** CPU cache line shift/size. */ 14 | #define CPU_CACHE_SHIFT 6 15 | #define CPU_CACHE_SIZE (1 << CPU_CACHE_SHIFT) 16 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/kdb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 kernel debugger definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Number of breakpoints supported. */ 14 | #define KDB_BREAKPOINT_COUNT 4 15 | #define KDB_WATCHPOINT_COUNT 4 16 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 setjmp() definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** Type of the buffer for setjmp(). */ 16 | typedef unsigned long jmp_buf[8]; 17 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 stack size definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Stack size definitions. */ 14 | #define KSTACK_SIZE 0x2000 /**< Kernel stack size (8KB). */ 15 | #define USTACK_SIZE 0x200000 /**< User stack size (2MB). */ 16 | 17 | /** Stack direction definition. */ 18 | #define STACK_GROWS_DOWN 1 19 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/x86/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 console code. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Keyboard code definitions */ 14 | #define LEFT_CTRL 0x1d 15 | #define RIGHT_CTRL 0x1d 16 | #define LEFT_ALT 0x38 17 | #define RIGHT_ALT 0x38 18 | #define LEFT_SHIFT 0x2a 19 | #define RIGHT_SHIFT 0x36 20 | 21 | extern void i8042_init(void); 22 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/x86/smp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief x86 SMP definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | struct cpu; 14 | 15 | /** x86-specific SMP boot status values. */ 16 | #define SMP_BOOT_TSC_SYNC1 4 /**< Stage 1 of TSC synchronization. */ 17 | #define SMP_BOOT_TSC_SYNC2 5 /**< Stage 2 of TSC synchronization. */ 18 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | config KERNEL_ARCH_ARM64 7 | def_bool y 8 | select DEVICE_BUS_DT 9 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/barrier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 memory barrier functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #define memory_barrier() __asm__ volatile("dsb sy" ::: "memory") 14 | #define read_barrier() __asm__ volatile("dsb ld" ::: "memory") 15 | #define write_barrier() __asm__ volatile("dsb st" ::: "memory") 16 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 CPU cache definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** CPU cache line shift/size. */ 14 | #define CPU_CACHE_SHIFT 6 15 | #define CPU_CACHE_SIZE (1 << CPU_CACHE_SHIFT) 16 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/kdb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 kernel debugger definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Number of breakpoints supported. */ 14 | // TODO 15 | #define KDB_BREAKPOINT_COUNT 4 16 | #define KDB_WATCHPOINT_COUNT 4 17 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 setjmp() definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** 16 | * Type of the buffer for setjmp(). In the kernel we don't use floating point 17 | * so no need to store those here. 18 | */ 19 | typedef unsigned long jmp_buf[13]; 20 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 stack size definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Stack size definitions. */ 14 | #define KSTACK_SIZE 0x2000 /**< Kernel stack size (8KB). */ 15 | #define USTACK_SIZE 0x200000 /**< User stack size (2MB). */ 16 | 17 | /** Stack direction definition. */ 18 | #define STACK_GROWS_DOWN 1 19 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arm64/kdb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 KDB definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern void arm64_kdb_brk_handler(frame_t *frame); 16 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arm64/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 generic timer functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | extern void arm64_time_init(void); 14 | -------------------------------------------------------------------------------- /source/kernel/console/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_env', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'console.c', 11 | 'fb.c', 12 | 'font.c', 13 | 'logo.c', 14 | ]) 15 | 16 | # Generate the boot splash image files. 17 | kern_env.Command( 18 | 'logo.c', 19 | ['logo.ppm'], 20 | Action('$BIN2HEX $SOURCE logo_ppm > $TARGET', '$GENCOMSTR')) 21 | -------------------------------------------------------------------------------- /source/kernel/console/font.c: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/kernel/font.c -------------------------------------------------------------------------------- /source/kernel/console/logo.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/source/kernel/console/logo.ppm -------------------------------------------------------------------------------- /source/kernel/device/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | menu "Device support" 7 | 8 | source "bus/Kconfig" 9 | source "console/Kconfig" 10 | source "disk/Kconfig" 11 | source "input/Kconfig" 12 | source "irq/Kconfig" 13 | source "net/Kconfig" 14 | source "timer/Kconfig" 15 | 16 | endmenu 17 | -------------------------------------------------------------------------------- /source/kernel/device/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources, feature_dirs 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'bus.c', 11 | 'class.c', 12 | 'device.c', 13 | 'dma.c', 14 | 'io.c', 15 | 'irq.c', 16 | ]) 17 | 18 | SConscript(dirs = feature_dirs(config, [ 19 | 'bus', 20 | 'console', 21 | 'disk', 22 | 'irq', 23 | 'input', 24 | 'net', 25 | 'timer', 26 | ])) 27 | -------------------------------------------------------------------------------- /source/kernel/device/bus/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config') 7 | from util import feature_dirs 8 | 9 | SConscript(dirs = feature_dirs(config, [ 10 | ('DEVICE_BUS_DT', 'dt'), 11 | ('DEVICE_BUS_PCI', 'pci'), 12 | ('DEVICE_BUS_VIRTIO', 'virtio'), 13 | ])) 14 | -------------------------------------------------------------------------------- /source/kernel/device/bus/dt/fdt: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/kernel/libfdt -------------------------------------------------------------------------------- /source/kernel/device/bus/pci/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | 8 | if config['ARCH'] == 'amd64': 9 | pci_platform = 'pc' 10 | 11 | mod_env.Module('pci', [ 12 | 'platform/%s.c' % (pci_platform), 13 | 'pci.c', 14 | ]) 15 | -------------------------------------------------------------------------------- /source/kernel/device/bus/virtio/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | mod_env.Module('virtio', [ 10 | 'virtio.c', 11 | ]) 12 | 13 | if config['DEVICE_BUS_VIRTIO_PCI']: 14 | mod_env.Module('virtio_pci', [ 15 | 'virtio_pci.c', 16 | ]) 17 | -------------------------------------------------------------------------------- /source/kernel/device/bus/virtio/virtio_pci.h: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/kernel/virtio/virtio_pci.h -------------------------------------------------------------------------------- /source/kernel/device/console/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | config DEVICE_CONSOLE_NS16550 7 | depends on ARCH_ARM64 || ARCH_X86 8 | def_bool y 9 | 10 | config DEVICE_CONSOLE_PL011 11 | depends on ARCH_ARM64 12 | def_bool y 13 | -------------------------------------------------------------------------------- /source/kernel/device/console/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | ('DEVICE_CONSOLE_NS16550', 'ns16550.c'), 11 | ('DEVICE_CONSOLE_PL011', 'pl011.c'), 12 | 'serial.c', 13 | ]) 14 | -------------------------------------------------------------------------------- /source/kernel/device/disk/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Disk devices" 7 | 8 | # Selected by ATA device drivers if enabled. 9 | config DEVICE_DISK_ATA 10 | bool 11 | 12 | config DEVICE_DISK_PCI_ATA 13 | bool "PCI ATA controller driver" 14 | default y 15 | select DEVICE_DISK_ATA 16 | depends on DEVICE_BUS_PCI 17 | help 18 | Enable the PCI ATA controller driver. This supports PATA (IDE) 19 | controllers, and SATA controllers in IDE emulation mode. 20 | -------------------------------------------------------------------------------- /source/kernel/device/disk/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | mod_env.Module('disk', [ 10 | 'disk.c', 11 | 'gpt.c', 12 | 'mbr.c', 13 | 'partition.c', 14 | ]) 15 | 16 | SConscript(dirs = feature_dirs(config, [ 17 | ('DEVICE_DISK_ATA', 'ata'), 18 | ('DEVICE_DISK_PCI_ATA', 'pci_ata'), 19 | ])) 20 | -------------------------------------------------------------------------------- /source/kernel/device/disk/ata/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('ata', [ 9 | 'ata.c', 10 | 'channel.c', 11 | 'device.c', 12 | 'sff.c', 13 | ]) 14 | -------------------------------------------------------------------------------- /source/kernel/device/disk/pci_ata/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('pci_ata', [ 9 | 'pci_ata.c', 10 | ]) 11 | -------------------------------------------------------------------------------- /source/kernel/device/input/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Input devices" 7 | 8 | config DEVICE_INPUT_I8042 9 | bool "i8042 keyboard/mouse port" 10 | default y 11 | depends on ARCH_X86 12 | help 13 | Enable the i8042 (PS/2) keyboard/mouse port driver. 14 | -------------------------------------------------------------------------------- /source/kernel/device/input/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | mod_env.Module('input', [ 10 | 'input.c', 11 | ]) 12 | 13 | SConscript(dirs = feature_dirs(config, [ 14 | ('DEVICE_INPUT_I8042', 'i8042'), 15 | ])) 16 | -------------------------------------------------------------------------------- /source/kernel/device/input/i8042/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('i8042', [ 9 | 'i8042.c', 10 | 'keycodes.c', 11 | ]) 12 | -------------------------------------------------------------------------------- /source/kernel/device/irq/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "IRQ controllers" 7 | 8 | config DEVICE_IRQ_ARM_GIC_V2 9 | bool "ARM GIC v2 IRQ controller" 10 | default y 11 | depends on DEVICE_BUS_DT && ARCH_ARM64 12 | help 13 | Enable the driver for the ARM GIC v2 IRQ controller. 14 | 15 | config DEVICE_IRQ_BCM2836_L1 16 | bool "BCM2836 L1 IRQ controller" 17 | default y 18 | depends on DEVICE_BUS_DT && ARCH_ARM64 19 | help 20 | Enable the driver for the root IRQ controller on the Raspberry Pi 2+. 21 | -------------------------------------------------------------------------------- /source/kernel/device/irq/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | SConscript(dirs = feature_dirs(config, [ 10 | ('DEVICE_IRQ_ARM_GIC_V2', 'arm_gic_v2'), 11 | ('DEVICE_IRQ_BCM2836_L1', 'bcm2836_l1_irq'), 12 | ])) 13 | -------------------------------------------------------------------------------- /source/kernel/device/irq/arm_gic_v2/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | # Built-in driver. 10 | kern_sources += feature_sources(config, [ 11 | 'arm_gic_v2.c', 12 | ]) 13 | -------------------------------------------------------------------------------- /source/kernel/device/irq/bcm2836_l1_irq/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | # Built-in driver. 10 | kern_sources += feature_sources(config, [ 11 | 'bcm2836_l1_irq.c', 12 | ]) 13 | -------------------------------------------------------------------------------- /source/kernel/device/net/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Network devices" 7 | 8 | config DEVICE_NET_VIRTIO_NET 9 | bool "VirtIO network device" 10 | default y 11 | depends on DEVICE_BUS_VIRTIO 12 | help 13 | Enable support for VirtIO network devices implemented by virtual machines 14 | such as QEMU and VirtualBox. 15 | 16 | -------------------------------------------------------------------------------- /source/kernel/device/net/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | # Note that net.c is compiled as part of the net module. 10 | 11 | SConscript(dirs = feature_dirs(config, [ 12 | ('DEVICE_NET_VIRTIO_NET', 'virtio_net'), 13 | ])) 14 | -------------------------------------------------------------------------------- /source/kernel/device/net/virtio_net/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('virtio_net', [ 9 | 'virtio_net.c', 10 | ]) 11 | -------------------------------------------------------------------------------- /source/kernel/device/net/virtio_net/virtio_net.h: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/kernel/virtio/virtio_net.h -------------------------------------------------------------------------------- /source/kernel/device/timer/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Timer devices" 7 | 8 | config DEVICE_TIMER_ARM 9 | bool "ARM Generic Timer" 10 | default y 11 | depends on DEVICE_BUS_DT && ARCH_ARM64 12 | help 13 | Enable the driver for the ARM Generic Timer defined in the ARMv7/8 14 | architectures. 15 | -------------------------------------------------------------------------------- /source/kernel/device/timer/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | SConscript(dirs = feature_dirs(config, [ 10 | ('DEVICE_TIMER_ARM', 'arm_timer'), 11 | ])) 12 | -------------------------------------------------------------------------------- /source/kernel/device/timer/arm_timer/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | # Built-in driver. 10 | kern_sources += feature_sources(config, [ 11 | 'arm_timer.c', 12 | ]) 13 | -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_config.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_config.h -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_ids.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_ids.h -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_ring.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_ring.h -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_types.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_types.h -------------------------------------------------------------------------------- /source/kernel/include/device/console/ns16550.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief NS16550 console implementation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #if CONFIG_DEVICE_CONSOLE_NS16550 16 | extern const serial_port_ops_t ns16550_serial_port_ops; 17 | #endif 18 | 19 | extern void ns16550_serial_configure(struct kboot_tag_serial *serial, uint32_t clock_rate); 20 | -------------------------------------------------------------------------------- /source/kernel/include/device/console/pl011.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief PL011 console implementation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #if CONFIG_DEVICE_CONSOLE_PL011 16 | extern const serial_port_ops_t pl011_serial_port_ops; 17 | #endif 18 | -------------------------------------------------------------------------------- /source/kernel/include/io/memory_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Memory file functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern object_handle_t *memory_file_create(const void *buf, size_t size); 16 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/device/bus/dt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Device Tree bus interface. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | /** DT device class name. */ 18 | #define DT_DEVICE_CLASS_NAME "dt_device" 19 | 20 | __KERNEL_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/device/bus/virtio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief VirtIO bus interface. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | /** VirtIO device class name. */ 18 | #define VIRTIO_DEVICE_CLASS_NAME "virtio_device" 19 | 20 | /** VirtIO device class attribute names. */ 21 | #define VIRTIO_DEVICE_ATTR_DEVICE_ID "virtio_device.device_id" /**< uint16 */ 22 | 23 | __KERNEL_EXTERN_C_END 24 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Library image loader. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | 18 | 19 | __KERNEL_EXTERN_C_END 20 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Kernel log definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Kernel log level definitions. */ 14 | #define LOG_DEBUG 1 /**< Debug message. */ 15 | #define LOG_NOTICE 2 /**< Normal message. */ 16 | #define LOG_WARN 3 /**< Warning message. */ 17 | #define LOG_ERROR 4 /**< Error message. */ 18 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/net/unix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief UNIX socket definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | /** UNIX socket address specification. */ 18 | typedef struct sockaddr_un { 19 | sa_family_t sun_family; 20 | char sun_path[SOCKADDR_STORAGE_SIZE - sizeof(sa_family_t)]; 21 | } sockaddr_un_t; 22 | 23 | __KERNEL_EXTERN_C_END 24 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/pipe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Pipe functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | extern status_t kern_pipe_create( 18 | uint32_t read_flags, uint32_t write_flags, handle_t *_read, 19 | handle_t *_write); 20 | 21 | __KERNEL_EXTERN_C_END 22 | -------------------------------------------------------------------------------- /source/kernel/include/lib/printf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Formatted output function. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** Type for a do_printf() helper function. */ 16 | typedef void (*printf_helper_t)(char, void *, int *); 17 | 18 | extern int do_vprintf(printf_helper_t helper, void *data, const char *fmt, va_list args); 19 | extern int do_printf(printf_helper_t helper, void *data, const char *fmt, ...); 20 | -------------------------------------------------------------------------------- /source/kernel/include/lib/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Random number generation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern uint64_t random_get_u64(void); 16 | extern int64_t random_get_s64(void); 17 | extern uint32_t random_get_u32(void); 18 | extern int32_t random_get_s32(void); 19 | 20 | extern void random_init(void); 21 | -------------------------------------------------------------------------------- /source/kernel/include/net/ipv6.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief IPv6 definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #include 16 | -------------------------------------------------------------------------------- /source/kernel/include/proc/sched.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Thread scheduler. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern void sched_reschedule(bool state); 16 | extern void sched_post_switch(bool state); 17 | extern void sched_preempt(void); 18 | extern void sched_insert_thread(thread_t *thread); 19 | 20 | extern void sched_init(void); 21 | extern void sched_init_percpu(void); 22 | extern void sched_enter(void) __noreturn; 23 | -------------------------------------------------------------------------------- /source/kernel/include/status.h: -------------------------------------------------------------------------------- 1 | kernel/status.h -------------------------------------------------------------------------------- /source/kernel/include/sync/futex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Futex implementation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | struct process; 16 | 17 | extern void futex_process_cleanup(struct process *proc); 18 | -------------------------------------------------------------------------------- /source/kernel/include/syscall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief System call dispatcher. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** Structure describing a system call handler. */ 16 | typedef struct __packed syscall { 17 | ptr_t addr; /**< Address of handler. */ 18 | size_t count; /**< Number of arguments. */ 19 | } syscall_t; 20 | -------------------------------------------------------------------------------- /source/kernel/io/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_dirs, feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'context.c', 11 | 'file.c', 12 | 'file_map.c', 13 | 'fs.c', 14 | 'memory_file.c', 15 | 'pipe.c', 16 | 'request.c', 17 | 'socket.c', 18 | 'user_file.c', 19 | ]) 20 | 21 | SConscript(dirs = feature_dirs(config, [ 22 | 'fs', 23 | ])) 24 | -------------------------------------------------------------------------------- /source/kernel/io/fs/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | menu "Filesystem support" 7 | 8 | config FS_EXT2 9 | bool "Ext2/3/4 filesystem support" 10 | default y 11 | help 12 | Enable support for Ext2/3/4 filesystems. 13 | 14 | endmenu 15 | -------------------------------------------------------------------------------- /source/kernel/io/fs/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_dirs, feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'ramfs.c', 11 | ]) 12 | 13 | SConscript(dirs = feature_dirs(config, [ 14 | ('FS_EXT2', 'ext2'), 15 | ])) 16 | -------------------------------------------------------------------------------- /source/kernel/io/fs/ext2/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('ext2', [ 9 | 'block.c', 10 | 'dir.c', 11 | 'ext2.c', 12 | 'inode.c', 13 | ]) 14 | -------------------------------------------------------------------------------- /source/kernel/lib/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'ansi_parser.c', 11 | 'avl_tree.c', 12 | 'bitmap.c', 13 | 'fixed_heap.c', 14 | 'id_allocator.c', 15 | 'notifier.c', 16 | 'printf.c', 17 | 'qsort.c', 18 | 'radix_tree.c', 19 | 'random.c', 20 | 'string.c', 21 | 'tar.c', 22 | ]) 23 | -------------------------------------------------------------------------------- /source/kernel/lib/mt19937-64.h: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/mt19937-64.h -------------------------------------------------------------------------------- /source/kernel/mm/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'kmem.c', 11 | 'malloc.c', 12 | 'mmu.c', 13 | 'page.c', 14 | 'page_cache.c', 15 | 'phys.c', 16 | 'safe.c', 17 | 'slab.c', 18 | 'vm.c', 19 | ]) 20 | -------------------------------------------------------------------------------- /source/kernel/proc/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'ipc.c', 11 | 'process.c', 12 | 'sched.c', 13 | 'thread.c', 14 | ]) 15 | -------------------------------------------------------------------------------- /source/kernel/security/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'token.c', 11 | ]) 12 | -------------------------------------------------------------------------------- /source/kernel/sync/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'condition.c', 11 | 'condvar.c', 12 | 'futex.c', 13 | 'mutex.c', 14 | 'rwlock.c', 15 | 'semaphore.c', 16 | 'spinlock.c', 17 | ]) 18 | -------------------------------------------------------------------------------- /source/lib/compiler-rt/lib: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/compiler-rt/lib -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env', 'manager') 7 | 8 | sysroot_env = manager['sysroot'] 9 | 10 | crt_files = ['crt1', 'crti', 'crtn'] 11 | 12 | for file in crt_files: 13 | path = '%s/%s.o' % (str(env['_LIBOUTDIR']), file) 14 | env.Object(path, ['%s.S' % (file)]) 15 | sysroot_env.AddFile(File(path), 'lib/%s.o' % (file)) 16 | -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/crt1.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 application startup code. 9 | */ 10 | 11 | .section .text 12 | 13 | /** Main program entry point. */ 14 | .global _start 15 | .type _start, @function 16 | _start: 17 | jmp libsystem_main 18 | .size _start, .-_start 19 | 20 | .section ".note.GNU-stack", "", @progbits 21 | -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/crti.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 C runtime. 9 | */ 10 | 11 | .section .init 12 | .global _init 13 | .type _init, @function 14 | _init: 15 | subq $8, %rsp 16 | 17 | .section .fini 18 | .global _fini 19 | .type _fini, @function 20 | _fini: 21 | subq $8, %rsp 22 | 23 | .section ".note.GNU-stack", "", @progbits 24 | -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/crtn.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 C runtime. 9 | */ 10 | 11 | .section .init 12 | .global _init 13 | .type _init, @function 14 | addq $8, %rsp 15 | ret 16 | 17 | .section .fini 18 | .global _fini 19 | .type _fini, @function 20 | addq $8, %rsp 21 | ret 22 | 23 | .section ".note.GNU-stack", "", @progbits 24 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env', 'manager') 7 | 8 | sysroot_env = manager['sysroot'] 9 | 10 | crt_files = ['crt1', 'crti', 'crtn'] 11 | 12 | for file in crt_files: 13 | path = '%s/%s.o' % (str(env['_LIBOUTDIR']), file) 14 | env.Object(path, ['%s.S' % (file)]) 15 | sysroot_env.AddFile(File(path), 'lib/%s.o' % (file)) 16 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/crt1.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 application startup code. 9 | */ 10 | 11 | .section .text 12 | 13 | /** Main program entry point. */ 14 | .global _start 15 | .type _start, @function 16 | _start: 17 | b libsystem_main 18 | .size _start, .-_start 19 | 20 | .section ".note.GNU-stack", "", @progbits 21 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/crti.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 C runtime. 9 | */ 10 | 11 | /* Not needed. */ 12 | 13 | .section ".note.GNU-stack", "", @progbits 14 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/crtn.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 C runtime. 9 | */ 10 | 11 | /* Not needed. */ 12 | 13 | .section ".note.GNU-stack", "", @progbits 14 | -------------------------------------------------------------------------------- /source/lib/crt/lib: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/compiler-rt/lib -------------------------------------------------------------------------------- /source/lib/cxx/include: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/libcxx/include -------------------------------------------------------------------------------- /source/lib/cxx/src: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/libcxx/src -------------------------------------------------------------------------------- /source/lib/cxxrt/include/cxxabi.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/cxxabi.h -------------------------------------------------------------------------------- /source/lib/cxxrt/include/unwind-arm.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/unwind-arm.h -------------------------------------------------------------------------------- /source/lib/cxxrt/include/unwind-itanium.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/unwind-itanium.h -------------------------------------------------------------------------------- /source/lib/cxxrt/include/unwind.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/unwind.h -------------------------------------------------------------------------------- /source/lib/cxxrt/src: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/libcxxrt/src -------------------------------------------------------------------------------- /source/lib/cxxrt/unwind/include: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libunwind/include -------------------------------------------------------------------------------- /source/lib/cxxrt/unwind/src: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libunwind/src -------------------------------------------------------------------------------- /source/lib/device/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager', 'config') 7 | 8 | env = manager.create(flags = { 9 | 'CPPPATH': [ 10 | Dir('include'), 11 | ], 12 | }) 13 | 14 | sources = [ 15 | 'device.c', 16 | 'input.c', 17 | 'net.c', 18 | ] 19 | 20 | env.KiwiLibrary('device', 21 | sources = sources, 22 | include_paths = [Dir('include')], 23 | ) 24 | -------------------------------------------------------------------------------- /source/lib/kernel/arch/amd64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | sources = [File(f) for f in [ 7 | 'relocate.c', 8 | 'rtld.c', 9 | 'start.S', 10 | 'tls.c', 11 | ]] 12 | 13 | Return('sources') 14 | -------------------------------------------------------------------------------- /source/lib/kernel/arch/arm64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | sources = [File(f) for f in [ 7 | 'relocate.c', 8 | 'rtld.c', 9 | 'start.S', 10 | ]] 11 | 12 | Return('sources') 13 | -------------------------------------------------------------------------------- /source/lib/kernel/include/kernel: -------------------------------------------------------------------------------- 1 | ../../../kernel/include/kernel -------------------------------------------------------------------------------- /source/lib/kiwi/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager', 'config') 7 | 8 | env = manager.create(flags = { 9 | 'CPPPATH': [ 10 | Dir('include'), 11 | ], 12 | }) 13 | 14 | sources = [ 15 | 'core/event_loop.cpp', 16 | ] 17 | 18 | # TODO: Split this into separate libraries once we have more (e.g. kiwi-core). 19 | env.KiwiLibrary('kiwi', 20 | sources = sources, 21 | include_paths = [Dir('include')], 22 | ) 23 | -------------------------------------------------------------------------------- /source/lib/m/arch/x86_64/bits/fenv.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/lib/musl/arch/x86_64/bits/fenv.h -------------------------------------------------------------------------------- /source/lib/m/include/complex.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/complex.h -------------------------------------------------------------------------------- /source/lib/m/include/fenv.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/fenv.h -------------------------------------------------------------------------------- /source/lib/m/include/math.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/math.h -------------------------------------------------------------------------------- /source/lib/m/musl: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/musl -------------------------------------------------------------------------------- /source/lib/system/arch/amd64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env') 7 | 8 | sources = [File(f) for f in [ 9 | 'setjmp.S', 10 | ]] 11 | 12 | Return('sources') 13 | -------------------------------------------------------------------------------- /source/lib/system/arch/amd64/include/system/arch/defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 type definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Word size of the architecture. */ 14 | #define __WORDSIZE 64 15 | -------------------------------------------------------------------------------- /source/lib/system/arch/amd64/include/system/arch/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 POSIX definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** POSIX environment definitions. */ 14 | #define _POSIX_V7_LP64_OFF64 1 15 | #define _POSIX_V6_LP64_OFF64 1 16 | #define _XBS5_LP64_OFF64 1 17 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env') 7 | 8 | sources = [File(f) for f in [ 9 | 'setjmp.S', 10 | ]] 11 | 12 | Return('sources') 13 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/include/system/arch/defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 type definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Word size of the architecture. */ 14 | #define __WORDSIZE 64 15 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/include/system/arch/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 setjmp definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Jump buffer size. */ 14 | #define JMP_BUF_SIZE 8 15 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/include/system/arch/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 POSIX definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** POSIX environment definitions. */ 14 | #define _POSIX_V7_LP64_OFF64 1 15 | #define _POSIX_V6_LP64_OFF64 1 16 | #define _XBS5_LP64_OFF64 1 17 | -------------------------------------------------------------------------------- /source/lib/system/dirent/rewinddir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Rewind directory function. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "dirent/dirent.h" 15 | 16 | /** Reset a directory stream's position to the beginning. 17 | * @param dir Directory stream to rewind. */ 18 | void rewinddir(DIR *dir) { 19 | kern_file_rewind_dir(dir->handle); 20 | } 21 | -------------------------------------------------------------------------------- /source/lib/system/include/alloca.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Automatically freed allocation function. 9 | */ 10 | 11 | #pragma once 12 | 13 | #undef alloca 14 | #define alloca(size) __builtin_alloca(size) 15 | -------------------------------------------------------------------------------- /source/lib/system/include/arpa/nameser.h: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/lib/musl/include/arpa/nameser.h -------------------------------------------------------------------------------- /source/lib/system/include/core/path.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Path manipulation functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | extern char *core_path_basename(const char *path); 18 | extern char *core_path_dirname(const char *path); 19 | 20 | __SYS_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /source/lib/system/include/ctype.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/ctype.h -------------------------------------------------------------------------------- /source/lib/system/include/endian.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/endian.h -------------------------------------------------------------------------------- /source/lib/system/include/features.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/features.h -------------------------------------------------------------------------------- /source/lib/system/include/langinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Locale functions/definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | 18 | 19 | __SYS_EXTERN_C_END 20 | -------------------------------------------------------------------------------- /source/lib/system/include/libgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Pattern matching functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | extern char *basename(char *path); 18 | extern char *dirname(char *path); 19 | 20 | __SYS_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /source/lib/system/include/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Memory functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | -------------------------------------------------------------------------------- /source/lib/system/include/netdb.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/netdb.h -------------------------------------------------------------------------------- /source/lib/system/include/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief TCP socket definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | #define TCP_NODELAY 1 18 | 19 | __SYS_EXTERN_C_BEGIN 20 | -------------------------------------------------------------------------------- /source/lib/system/include/poll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Input/output multiplexing. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | -------------------------------------------------------------------------------- /source/lib/system/include/resolv.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/resolv.h -------------------------------------------------------------------------------- /source/lib/system/include/sched.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Scheduling definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #include 16 | 17 | __SYS_EXTERN_C_BEGIN 18 | 19 | extern int sched_yield(void); 20 | 21 | __SYS_EXTERN_C_END 22 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Device control function. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Some things that use this expect termios.h to be included by it. */ 14 | #include 15 | 16 | __SYS_EXTERN_C_BEGIN 17 | 18 | extern int ioctl(int fd, int request, ...); 19 | 20 | __SYS_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/param.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Parameter definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #define MAXPATHLEN PATH_MAX 16 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Random number generation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | extern int getentropy(void *buffer, size_t length); 18 | 19 | __SYS_EXTERN_C_END 20 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/un.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief UNIX socket definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #include 16 | -------------------------------------------------------------------------------- /source/lib/system/include/uchar.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/uchar.h -------------------------------------------------------------------------------- /source/lib/system/include/ucontext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief User context definition. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | /* int getcontext(ucontext_t *); */ 18 | /* int setcontext(const ucontext_t *); */ 19 | /* void makecontext(ucontext_t *, (void *)(), int, ...); */ 20 | /* int swapcontext(ucontext_t *, const ucontext_t *); */ 21 | 22 | __SYS_EXTERN_C_END 23 | -------------------------------------------------------------------------------- /source/lib/system/include/wchar.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/wchar.h -------------------------------------------------------------------------------- /source/lib/system/include/wctype.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/wctype.h -------------------------------------------------------------------------------- /source/lib/system/musl: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/musl -------------------------------------------------------------------------------- /source/lib/system/sched.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Scheduling functions. 9 | */ 10 | 11 | #include 12 | 13 | /** Yield the processor. 14 | * @return Always returns 0. */ 15 | int sched_yield(void) { 16 | /* TODO */ 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /source/lib/system/stdio/fclose.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief File close function. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "stdio/stdio.h" 15 | 16 | /** Close a file stream. 17 | * @param stream File stream to close. 18 | * @return 0 on success, EOF on failure. */ 19 | int fclose(FILE *stream) { 20 | if (close(stream->fd) != 0) 21 | return EOF; 22 | 23 | free(stream); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /source/lib/system/stdio/fflush.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief File stream flush function. 9 | */ 10 | 11 | #include 12 | 13 | #include "stdio/stdio.h" 14 | 15 | /** Flush a file stream's buffer. 16 | * @param stream File stream to flush. 17 | * @return 0 on success, EOF on failure. */ 18 | int fflush(FILE *stream) { 19 | /* TODO */ 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /source/lib/system/stdio/remove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Path remove function. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | /** Remove a path from the filesystem. 15 | * @param path Path to remove. 16 | * @return 0 on success, -1 on failure. */ 17 | int remove(const char *path) { 18 | /* Our unlink implementation supports directory removal. */ 19 | return unlink(path); 20 | } 21 | -------------------------------------------------------------------------------- /source/lib/system/stdio/tmpfile.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Temporary file creation function. 9 | */ 10 | 11 | #include 12 | 13 | #include "libsystem.h" 14 | 15 | FILE *tmpfile(void) { 16 | libsystem_stub("tmpfile", true); 17 | return NULL; 18 | } 19 | 20 | char *tmpnam(char *s) { 21 | libsystem_stub("tmpnam", true); 22 | return NULL; 23 | } 24 | -------------------------------------------------------------------------------- /source/lib/system/stdlib/dlmalloc.c: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/dlmalloc.c -------------------------------------------------------------------------------- /source/lib/system/string/ffs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Find first set bit function. 9 | */ 10 | 11 | #include 12 | 13 | /** Find the first bit set in a value. 14 | * @param i Value to search in. 15 | * @return Position of first set bit + 1, or 0 if none set. */ 16 | int ffs(int i) { 17 | return __builtin_ffs(i); 18 | } 19 | -------------------------------------------------------------------------------- /source/services/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config') 7 | 8 | if config['SYS_MINIMAL_USERSPACE']: 9 | Return() 10 | 11 | dirs = [ 12 | 'posix_service', 13 | 'service_manager', 14 | 'terminal_service', 15 | 'test', 16 | ] 17 | 18 | SConscript(dirs = dirs) 19 | -------------------------------------------------------------------------------- /source/services/posix_service/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['kiwi']) 9 | 10 | env.KiwiService('posix_service', [ 11 | 'posix_service.cpp', 12 | 'process_group.cpp', 13 | 'process.cpp', 14 | 'session.cpp', 15 | ]) 16 | -------------------------------------------------------------------------------- /source/services/service_manager/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['kiwi']) 9 | 10 | env.KiwiService('service_manager', [ 11 | 'client.cpp', 12 | 'service_manager.cpp', 13 | 'service.cpp', 14 | ]) 15 | -------------------------------------------------------------------------------- /source/services/terminal_service/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['kiwi'], flags = { 9 | 'CPPPATH': [ 10 | Dir('../../lib/system'), 11 | ], 12 | }) 13 | 14 | env.KiwiService('terminal_service', [ 15 | 'terminal_service.cpp', 16 | 'terminal.cpp', 17 | ]) 18 | -------------------------------------------------------------------------------- /source/services/terminal_service/terminal_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Terminal service. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | class TerminalService { 16 | public: 17 | TerminalService(); 18 | ~TerminalService(); 19 | 20 | int run(); 21 | 22 | private: 23 | Kiwi::Core::Handle m_port; 24 | size_t m_nextTerminalId; 25 | }; 26 | 27 | extern TerminalService g_terminalService; 28 | -------------------------------------------------------------------------------- /source/services/test/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create() 9 | env.KiwiService('test', ['main.c']) 10 | -------------------------------------------------------------------------------- /source/services/test/protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Service manager IPC protocol. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Service manager message IDs. */ 14 | enum { 15 | TEST_SIGNAL_START = 0, 16 | TEST_REQUEST_PING = 1, 17 | }; 18 | 19 | #define TEST_STRING_LEN 16 20 | 21 | typedef struct test_request_ping { 22 | uint32_t index; 23 | char string[TEST_STRING_LEN]; 24 | } test_request_ping_t; 25 | -------------------------------------------------------------------------------- /utilities/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/utilities/__init__.py -------------------------------------------------------------------------------- /utilities/boot: -------------------------------------------------------------------------------- 1 | ../3rdparty/kboot/utilities -------------------------------------------------------------------------------- /utilities/image_tool/README.mbr: -------------------------------------------------------------------------------- 1 | mbr.bin from syslinux 6.04. See COPYING.mbr for license. 2 | -------------------------------------------------------------------------------- /utilities/image_tool/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env', 'manager') 7 | 8 | env.Command( 9 | 'mbr.bin.c', 10 | ['mbr.bin'], 11 | Action('$BIN2HEX $SOURCE mbr_bin > $TARGET', '$GENCOMSTR')) 12 | 13 | env.Program('image_tool', [ 14 | 'image_tool.c', 15 | 'mbr.bin.c', 16 | ]) 17 | 18 | manager.add_variable('IMAGE_TOOL', File('image_tool')) 19 | -------------------------------------------------------------------------------- /utilities/image_tool/mbr.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/d3fac318f5f3e8609142da7b5a8313f06ac77809/utilities/image_tool/mbr.bin -------------------------------------------------------------------------------- /utilities/kconfig: -------------------------------------------------------------------------------- 1 | ../3rdparty/kconfig -------------------------------------------------------------------------------- /utilities/sysgen/amd64_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 system call code generator. 9 | */ 10 | 11 | #ifndef SYSGEN_AMD64_TARGET_H 12 | #define SYSGEN_AMD64_TARGET_H 13 | 14 | #include "sysgen.h" 15 | 16 | /** AMD64 target class. */ 17 | class AMD64Target : public Target { 18 | public: 19 | void add_types(TypeMap &map); 20 | void generate(std::ostream &stream, const SyscallList &calls); 21 | }; 22 | 23 | #endif /* SYSGEN_AMD64_TARGET_H */ 24 | -------------------------------------------------------------------------------- /utilities/sysgen/arm64_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 system call code generator. 9 | */ 10 | 11 | #ifndef SYSGEN_ARM64_TARGET_H 12 | #define SYSGEN_ARM64_TARGET_H 13 | 14 | #include "sysgen.h" 15 | 16 | /** ARM64 target class. */ 17 | class ARM64Target : public Target { 18 | public: 19 | void add_types(TypeMap &map); 20 | void generate(std::ostream &stream, const SyscallList &calls); 21 | }; 22 | 23 | #endif /* SYSGEN_ARM64_TARGET_H */ 24 | -------------------------------------------------------------------------------- /utilities/todo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Kiwi TODO" 3 | echo "=========" 4 | echo 5 | find source -type f -print0 | xargs -0r egrep -HIi --color=auto "(TODO|FIXME)" 6 | --------------------------------------------------------------------------------