# hosttrans.fragment — the generic HardwareJS host transport, devid 6. # # ONE SYMBOL, and the kernel half of `wasm_hosttrans` hangs off it: # arch/wasm32/kernel/hosttrans_wasm.c (the driver + /dev/hwjs-transport), # arch/wasm32/include/asm/hosttrans.h (the wire ABI), and # arch/wasm32/include/uapi/asm/hosttrans.h (the two ioctls a guest program # includes). With the symbol off, no object is built at all. # # WHY THIS IS A FRAGMENT OF ITS OWN AND NOT common.fragment. common.fragment is # the layer that must hold for every wasm32 kernel this tree builds, and its own # header says "so both get it" is the temptation it exists to prevent. This # device is wanted by the image kernel and the gate kernel, not by every kernel # the tree builds, and the symbol's Kconfig help keeps it default n. A kernel # carrying the guest half boots unchanged opposite a hardwarejs without the host # half (see WHAT IT COSTS), and the host half advertises what it supports, so # the guest no longer has to be built in lockstep with one hardwarejs. # # WHO MERGES THIS TODAY: the meta-brintos image kernel (linux-brintos passes # it as KERNEL_CONFIG_FRAGMENT), and the `vmlinux-hosttrans-gate` target in # the rig Makefile beside this directory. That target derives its OWN config # file in its OWN object tree (KBUILD_VARIANT=hosttrans-gate), so its gate # probe cannot reach any other kernel -- see the target's header for why that # isolation is not optional there. # # WHAT IT COSTS: one 4 KiB host-carved MMIO window, one IRQ line (7) and one # pending-word bit (6) at run time, plus the driver's text. It is inert # without a host: a boot whose hardwarejs emits no `wasm_hosttrans=` token # registers nothing and says so, and a boot whose host never sets the ring's # `active` word refuses every submit -ENODEV by name. # # THE RED ARM IS DELETING THIS LINE. arch/wasm32/kernel/Makefile then builds # neither hosttrans_wasm.o nor (even under HWJS_HOSTTRANS_GATE=1) the gate # probe, because both are keyed on this symbol rather than on obj-y — so a # gate kernel asked for without the driver fails to BUILD instead of linking # an undefined wasm_hosttrans_submit under --allow-undefined and trapping at # run time with nothing named. CONFIG_WASM32_HOSTTRANS=y