Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.
C
redwood becomes hakios everywhere that is ours: files hakios.<thing>.c, identifiers hakios_<thing>, sysctl kern.hakios, /dev/hakios-*, libhakios.*; the device directory is devices/poco-x5-pro; CI and CONTRIBUTING
shimoku741eeb5a33dc53
diff --git a/.github/workflows/check.yml b/.github/workflows/check.ymlnew file mode 100644index 0000000..8e6989f--- /dev/null+++ b/.github/workflows/check.yml@@ -0,0 +1,29 @@+name: check+on:+ push:+ pull_request:+jobs:+ check:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - name: Python compiles+ run: |+ git ls-files '*.py' | xargs -r python3 -m py_compile+ - name: Shell scripts parse+ run: |+ git ls-files '*.sh' xl | xargs -r -n1 bash -n+ - name: Makefile help+ run: make help+ - name: No Apple files, no screenshots+ run: |+ # the rule of the repository: nothing of iOS, no pictures of it+ ! git ls-files | grep -E -i '\.(png|jpe?g|gif|dylib|dmg|ipsw|car|nib|strings)$' | grep -v '^prebuilt/userland/'+ ! git ls-files | grep -E -i 'cryptex|dyld_shared_cache|SpringBoard\.app|/System/Library/'+ - name: The kernel patch applies to Apple's tree+ run: |+ git clone -q --depth 1 --branch xnu-8796.121.2 https://github.com/apple-oss-distributions/xnu.git /tmp/xnu+ git -C /tmp/xnu apply --check "$PWD/xnu/hakios.patch"+ - name: APFS tools self-test+ run: |+ [ -x tools/apfs/run-tests.sh ] && tools/apfs/run-tests.sh || echo "no self-test on this runner"diff --git a/.gitignore b/.gitignoreindex 0711cfc..172aa4e 100644--- a/.gitignore+++ b/.gitignore@@ -4,6 +4,8 @@/*!/.gitignore!/README.md+!/CONTRIBUTING.md+!/.github/!/README.uk.md!/README.zh.md!/Makefile@@ -46,7 +48,7 @@ __pycache__/!/userland/build.sh!/userland/*.py!/userland/rc.*-!/userland/com.redwood.*.plist+!/userland/com.hakios.*.plist!/userland/src/!/userland/libmini/!/userland/var/diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 0000000..725069a--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,17 @@+# Contributing++- One phone, one directory: anything that only one device needs goes to `devices/<name>/`; the+ kernel, loader and user space stay device-neutral and take their numbers from the device tree+ and the phone's own Android.+- Nothing of Apple's in the tree: no iOS files, images, caches, screenshots or headers derived+ from the firmware. The build fetches what it needs from the user's own IPSW+ (`sysimage/fetch.sh`, `xnuloader/mkidentity.sh`). CI refuses pictures and iOS files.+- Nothing of the vendor's either: firmware is pulled from the user's phone (`make firmware`).+- Kernel changes are made in `xnu-src/` and exported with `xnu/export.sh` before committing;+ the patch must apply to Apple's `xnu-8796.121.2` tag (CI checks).+- Say in the commit message what the phone did, not only what the code does: a run's log line+ is worth more than an adjective.+- Names: files are `hakios.<thing>.c`, identifiers `hakios_<thing>`, sysctls `kern.hakios.*`,+ devices `/dev/hakios-<thing>`.+- Licenses: the kernel patch and files are APSL 2.0 (derived from XNU); everything else is MIT.+ Third-party code goes into `NOTICE`.diff --git a/LICENSE b/LICENSEindex 212f57a..93b2ea5 100644--- a/LICENSE+++ b/LICENSE@@ -2,7 +2,7 @@ HakiOSTwo licenses apply, by directory:-1. The kernel: xnu/redwood.patch and everything under xnu/files/ are a derivative work of+1. The kernel: xnu/hakios.patch and everything under xnu/files/ are a derivative work ofApple's XNU and are licensed under the Apple Public Source License, Version 2.0, whose fulltext is in LICENSE.APSL. Per its terms the modifications are published here as source andApple's notices are kept in the files they belong to.diff --git a/NOTICE b/NOTICEindex b061008..c2eef7a 100644--- a/NOTICE+++ b/NOTICE@@ -5,14 +5,17 @@ In the repository:- XNU (Apple): the kernel sources are fetched by xnu/apply.sh from github.com/apple-oss-distributions/xnu;our patch and files are a derivative work under the Apple Public Source License 2.0 (LICENSE.APSL).- libdeflate (Eric Biggers), xnu/files/bsd/miscfs/apfs/libdeflate/: MIT, see its COPYING.-- mkbootimg.py (Android Open Source Project), devices/redwood/prebuilt/mkbootimg.py: Apache License 2.0.-- Mu-Silicium / Project Mu (Project Silicium, Microsoft and contributors): devices/redwood/uefi/ holds a+- mkbootimg.py (Android Open Source Project), devices/poco-x5-pro/prebuilt/mkbootimg.py: Apache License 2.0.+- Mu-Silicium / Project Mu (Project Silicium, Microsoft and contributors): devices/poco-x5-pro/uefi/ holds apatch and files against it; their license applies to the derived parts (BSD-2-Clause-Patent).-- UEFI driver binaries of the phone's own firmware, devices/redwood/uefi/files/Binaries/redwood/: the+- UEFI driver binaries of the phone's own firmware, devices/poco-x5-pro/uefi/files/Binaries/redwood/: thevendor's (Qualcomm/Xiaomi), extracted from the phone's xbl.img the way Project Silicium redistributessuch drivers for other phones. They are needed only to rebuild the UEFI image; they can be removed andextracted by each user from their own phone's firmware with UEFIReader.+- the Wi-Fi driver: Linux's ath11k (BSD-3-Clause-Clear) and FreeBSD's LinuxKPI headers (BSD-2-Clause) are+ fetched by tools/mk-ath11k.sh at pinned releases and built on our layer wifi/lx (MIT); only the layer is here.+Fetched at build time, never committed:- the iOS 16.5 IPSW (Apple): the user space of the system image; sysimage/fetch.sh downloads it from@@ -20,6 +23,6 @@ Fetched at build time, never committed:- the iPhoneOS 16.5 SDK from github.com/theos/sdks, and theos's cctools (Apple's open-source cctools): thekernel's and user space's build tools.- the phone's firmware (GPU, Wi-Fi, audio DSP, modem, haptics, cameras): the vendor's, pulled from the- user's own phone (devices/redwood/pull-firmware.sh).+ user's own phone (devices/poco-x5-pro/pull-firmware.sh).- lzfse (Apple, BSD-3-Clause), built by xnuloader/mkidentity.sh when no LZFSE decoder is installed.- Mesa (for GL=1 images), Procursus and Sileo packages (tools/mk-jb.sh): their own licenses.diff --git a/README.md b/README.mdindex 2316e60..3a147e6 100644--- a/README.md+++ b/README.md@@ -20,12 +20,12 @@ device tree and its own Android, so a port to another Qualcomm phone is a new diOnly my code and my data:-- the kernel: a patch to Apple's open-source XNU (`xnu/redwood.patch`, APSL 2.0) and my driver+- the kernel: a patch to Apple's open-source XNU (`xnu/hakios.patch`, APSL 2.0) and my driverfiles (`xnu/files/`), laid over a fresh clone by `xnu/apply.sh`;- the boot loader (`xnuloader/`), my programs and libraries (`userland/src/`), tools (`tools/`),build and run scripts;- `prebuilt/`: the kernel, loader and libraries built from this repository;-- `devices/redwood/`: what one phone needs (its UEFI port, device tree, firmware script).+- `devices/poco-x5-pro/`: what one phone needs (its UEFI port, device tree, firmware script).Not in the repository, never:@@ -58,7 +58,7 @@ Not in the repository, never:Linux x86-64, about 12 GB of disk, 7-Zip 23 or newer, `lz4`, `qemu-system-aarch64`, `edk2-aarch64`.```sh-git clone https://github.com/oosexgang/hackios-xnu-kernel.git hakios+git clone https://github.com/oosexgang/hakios-os.git hakioscd hakiossysimage/fetch.sh # the iOS 16.5 IPSW from Apple's servers, the needed parts unpacked (7.4 GB)REST=1 userland/build.sh # the APFS images: userland/root.apfs and userland/system.apfs@@ -71,11 +71,11 @@ The lock screen appears after two or three minutes. The mouse with the button he## On the phone-A phone with a port (`devices/redwood/`, POCO X5 Pro 5G), its boot loader unlocked, `adb` and+A phone with a port (`devices/poco-x5-pro/`, POCO X5 Pro 5G), its boot loader unlocked, `adb` and`fastboot` on the PC, the images from the previous section, and the phone's own firmware:```sh-devices/redwood/pull-firmware.sh # GPU, Wi-Fi, audio/battery, haptics, modem, cameras -> fw-*/+devices/poco-x5-pro/pull-firmware.sh # GPU, Wi-Fi, audio/battery, haptics, modem, cameras -> fw-*/./xl enter # Android -> fastboot -> our loader in RAM./xl ramdisk userland/system.apfs # the system image into the phone's RAM (~80 s), once per loader sessionXL_SB_DELAY=8 XL_SECS=600 \@@ -125,11 +125,11 @@ module, or the open lzfse library gets built). User space and the images: `REST=| Directory | Contents ||---|---|| `xnu/` | the kernel patch and files; `apply.sh`, `export.sh`; a README about the kernel |-| `xnu/files/bsd/dev/redwood_*.c` | my drivers: display, touch, UFS, GPU, Wi-Fi, audio, modem (`redwood_mpss.c`), SIM/NAS, haptics, cameras |+| `xnu/files/bsd/dev/hakios_*.c` | my drivers: display, touch, UFS, GPU, Wi-Fi, audio, modem (`hakios.mpss.c`), SIM/NAS, haptics, cameras || `xnuloader/` | the boot loader (a UEFI application) || `userland/` | my programs and libraries (`src/`), the image build, launchd jobs || `sysimage/` | scripts that fetch and unpack the OS files from the IPSW (none of the files themselves) |-| `devices/redwood/` | one phone: its UEFI port, device tree, prebuilt UEFI images, firmware script, tools |+| `devices/poco-x5-pro/` | one phone: its UEFI port, device tree, prebuilt UEFI images, firmware script, tools || `tools/` | APFS, firmware, QMI tests, run scripts || `qemu/` | running in QEMU || `docs/` | `notes.md`: the detailed notes (Russian); `cellular.md`: cellular; `air.md`, `metal.md`: the GPU |@@ -139,8 +139,8 @@ module, or the open lzfse library gets built). User space and the images: `REST=The kernel, loader and user space are shared. Everything about one phone lives in`devices/<name>/`: its UEFI, device tree, firmware list and tools. Today there is one,-`devices/redwood/`, and its README is the map of what a port to another Qualcomm phone must bring.-The phone's drivers are the files `xnu/files/bsd/dev/redwood_*.c`; the head of each says where its+`devices/poco-x5-pro/`, and its README is the map of what a port to another Qualcomm phone must bring.+The phone's drivers are the files `xnu/files/bsd/dev/hakios_*.c`; the head of each says where itsnumbers came from.## Cellulardiff --git a/README.uk.md b/README.uk.mdindex e99aba6..40f7fc7 100644--- a/README.uk.md+++ b/README.uk.md@@ -20,12 +20,12 @@ iOS 16.5: launchd, backboardd, SpringBoard, застосунки. Те самеЛише мій код і мої дані:-- ядро: патч до відкритого XNU від Apple (`xnu/redwood.patch`, APSL 2.0) і мої файли драйверів+- ядро: патч до відкритого XNU від Apple (`xnu/hakios.patch`, APSL 2.0) і мої файли драйверів(`xnu/files/`), які `xnu/apply.sh` накладає на свіжий клон;- завантажувач (`xnuloader/`), мої програми й бібліотеки (`userland/src/`), інструменти(`tools/`), скрипти збірки та запуску;- `prebuilt/`: ядро, завантажувач і бібліотеки, зібрані з цього репозиторію;-- `devices/redwood/`: те, що потрібно одному телефону (порт UEFI, дерево пристроїв, скрипт прошивок).+- `devices/poco-x5-pro/`: те, що потрібно одному телефону (порт UEFI, дерево пристроїв, скрипт прошивок).Чого немає і не буде:@@ -58,7 +58,7 @@ iOS 16.5: launchd, backboardd, SpringBoard, застосунки. Те самеLinux x86-64, близько 12 ГБ на диску, 7-Zip 23 або новіший, `lz4`, `qemu-system-aarch64`, `edk2-aarch64`.```sh-git clone https://github.com/oosexgang/hackios-xnu-kernel.git hakios+git clone https://github.com/oosexgang/hakios-os.git hakioscd hakiosmake fetch # IPSW iOS 16.5 із серверів Apple, потрібне розпаковується (7,4 ГБ)make images # образи APFS: userland/root.apfs і userland/system.apfs@@ -70,7 +70,7 @@ make qemu # сеанс на 20 хвилин## На телефоні-Телефон, для якого є порт (`devices/redwood/`, POCO X5 Pro 5G), з розблокованим завантажувачем,+Телефон, для якого є порт (`devices/poco-x5-pro/`, POCO X5 Pro 5G), з розблокованим завантажувачем,`adb` і `fastboot` на комп'ютері, образи з попереднього розділу і прошивки самого телефона:```sh@@ -108,11 +108,11 @@ make images # користувацький простір і образи| Каталог | Вміст ||---|---|| `xnu/` | патч і файли ядра; `apply.sh`, `export.sh`; README про ядро |-| `xnu/files/bsd/dev/redwood_*.c` | мої драйвери: екран, тач, UFS, GPU, Wi-Fi, звук, модем, SIM/NAS, вібро, камери |+| `xnu/files/bsd/dev/hakios_*.c` | мої драйвери: екран, тач, UFS, GPU, Wi-Fi, звук, модем, SIM/NAS, вібро, камери || `xnuloader/` | завантажувач (застосунок UEFI) || `userland/` | мої програми й бібліотеки (`src/`), збірка образів, завдання launchd || `sysimage/` | скрипти, що беруть і розпаковують файли ОС з IPSW (самих файлів немає) |-| `devices/redwood/` | один телефон: його порт UEFI, дерево пристроїв, готові образи UEFI, скрипт прошивок |+| `devices/poco-x5-pro/` | один телефон: його порт UEFI, дерево пристроїв, готові образи UEFI, скрипт прошивок || `tools/` | APFS, прошивки, тести QMI, скрипти прогонів || `qemu/` | запуск у QEMU || `docs/` | `cellular.md` — зв'язок (англійською); `ru/` — докладний щоденник розробки російською |diff --git a/README.zh.md b/README.zh.mdindex 5a6b8d3..4462033 100644--- a/README.zh.md+++ b/README.zh.md@@ -17,11 +17,11 @@ HakiOS 在搭载高通 SoC 的 Android 手机上运行开源的 XNU 内核(xnu只有我的代码和我的数据:-- 内核:对 Apple 开源 XNU 的补丁(`xnu/redwood.patch`,APSL 2.0)和我的驱动文件(`xnu/files/`),+- 内核:对 Apple 开源 XNU 的补丁(`xnu/hakios.patch`,APSL 2.0)和我的驱动文件(`xnu/files/`),由 `xnu/apply.sh` 叠加到一份新克隆上;- 引导程序(`xnuloader/`)、我的程序和库(`userland/src/`)、工具(`tools/`)、构建和运行脚本;- `prebuilt/`:用本仓库构建出的内核、引导程序和库;-- `devices/redwood/`:一台手机所需的东西(UEFI 移植、设备树、固件脚本)。+- `devices/poco-x5-pro/`:一台手机所需的东西(UEFI 移植、设备树、固件脚本)。永远不会有的东西:@@ -53,7 +53,7 @@ HakiOS 在搭载高通 SoC 的 Android 手机上运行开源的 XNU 内核(xnuLinux x86-64,约 12 GB 磁盘,7-Zip 23 或更新,`lz4`,`qemu-system-aarch64`,`edk2-aarch64`。```sh-git clone https://github.com/oosexgang/hackios-xnu-kernel.git hakios+git clone https://github.com/oosexgang/hakios-os.git hakioscd hakiosmake fetch # 从 Apple 服务器取 iOS 16.5 IPSW,解包所需部分(7.4 GB)make images # APFS 镜像:userland/root.apfs 和 userland/system.apfs@@ -64,7 +64,7 @@ make qemu # 20 分钟的会话## 在手机上-一台有移植的手机(`devices/redwood/`,POCO X5 Pro 5G),已解锁引导程序,电脑上有 `adb` 和+一台有移植的手机(`devices/poco-x5-pro/`,POCO X5 Pro 5G),已解锁引导程序,电脑上有 `adb` 和`fastboot`,上一节的镜像,以及手机自己的固件:```sh@@ -102,11 +102,11 @@ make images # 用户空间和镜像| 目录 | 内容 ||---|---|| `xnu/` | 内核补丁和文件;`apply.sh`、`export.sh`;内核 README |-| `xnu/files/bsd/dev/redwood_*.c` | 我的驱动:显示、触摸、UFS、GPU、Wi-Fi、音频、调制解调器、SIM/NAS、振动、摄像头 |+| `xnu/files/bsd/dev/hakios_*.c` | 我的驱动:显示、触摸、UFS、GPU、Wi-Fi、音频、调制解调器、SIM/NAS、振动、摄像头 || `xnuloader/` | 引导程序(UEFI 应用) || `userland/` | 我的程序和库(`src/`)、镜像构建、launchd 任务 || `sysimage/` | 从 IPSW 取得并解包系统文件的脚本(不含文件本身) |-| `devices/redwood/` | 一台手机:UEFI 移植、设备树、预构建 UEFI 镜像、固件脚本 |+| `devices/poco-x5-pro/` | 一台手机:UEFI 移植、设备树、预构建 UEFI 镜像、固件脚本 || `tools/` | APFS、固件、QMI 测试、运行脚本 || `qemu/` | 在 QEMU 中运行 || `docs/` | `cellular.md`:蜂窝网络(英文);`ru/`:详细的俄文开发日志 |diff --git a/devices/redwood/README.md b/devices/poco-x5-pro/README.mdsimilarity index 88%rename from devices/redwood/README.mdrename to devices/poco-x5-pro/README.mdindex 5b0f361..84ca947 100644--- a/devices/redwood/README.md+++ b/devices/poco-x5-pro/README.md@@ -8,11 +8,11 @@ tree and its Android. A port to another Qualcomm phone is another directory like|---|---|| SoC | Qualcomm Snapdragon 778G (SM7325, "yupik" in the device tree) || UEFI for the phone | `uefi/`: a port of Mu-Silicium (a patch and files; `apply.sh` clones and applies, `export.sh` saves) |-| Prebuilt UEFI images | `prebuilt/`: `SILICIUM_UEFI.fd`, `BootShim.bin`, the device tree `redwood.dtb` (the phone's Android kernel's), `ramdisk`, `mkbootimg.py` |+| Prebuilt UEFI images | `prebuilt/`: `SILICIUM_UEFI.fd`, `BootShim.bin`, the device tree `device-tree.dtb` (the phone's Android kernel's), `ramdisk`, `mkbootimg.py` || The phone's firmware | **not in the repository**: `pull-firmware.sh` pulls it off your phone over `adb` into `fw-*/` at the top || Tools | `tools/modem_firmware.py` (the modem image by the device tree), `tools/cellular_probe.py` (the modem's nodes in the device tree) |-What the kernel does for this phone in particular is the drivers `xnu/files/bsd/dev/redwood_*.c`+What the kernel does for this phone in particular is the drivers `xnu/files/bsd/dev/hakios_*.c`(display, Goodix touch, UFS, Adreno 642L, WCN6750 Wi-Fi, the audio DSP, the modem, the Awinichaptics, the cameras); the head of each file says where its numbers come from. That is the map ofwhat to rewrite for another phone.@@ -20,7 +20,7 @@ what to rewrite for another phone.## Firmware```sh-devices/redwood/pull-firmware.sh # the phone in Android, on adb+devices/poco-x5-pro/pull-firmware.sh # the phone in Android, on adb```Pulls the GPU (`fw-gpu/`), Wi-Fi (`fw-wifi/`), the audio DSP (`fw-audio/`, battery and chargingdiff --git a/devices/redwood/prebuilt/BootShim.bin b/devices/poco-x5-pro/prebuilt/BootShim.binsimilarity index 100%rename from devices/redwood/prebuilt/BootShim.binrename to devices/poco-x5-pro/prebuilt/BootShim.bindiff --git a/devices/redwood/prebuilt/SILICIUM_UEFI.fd b/devices/poco-x5-pro/prebuilt/SILICIUM_UEFI.fdsimilarity index 100%rename from devices/redwood/prebuilt/SILICIUM_UEFI.fdrename to devices/poco-x5-pro/prebuilt/SILICIUM_UEFI.fddiff --git a/devices/redwood/prebuilt/redwood.dtb b/devices/poco-x5-pro/prebuilt/device-tree.dtbsimilarity index 100%rename from devices/redwood/prebuilt/redwood.dtbrename to devices/poco-x5-pro/prebuilt/device-tree.dtbdiff --git a/devices/redwood/prebuilt/mkbootimg.py b/devices/poco-x5-pro/prebuilt/mkbootimg.pysimilarity index 100%rename from devices/redwood/prebuilt/mkbootimg.pyrename to devices/poco-x5-pro/prebuilt/mkbootimg.pydiff --git a/devices/redwood/prebuilt/ramdisk b/devices/poco-x5-pro/prebuilt/ramdisksimilarity index 100%rename from devices/redwood/prebuilt/ramdiskrename to devices/poco-x5-pro/prebuilt/ramdiskdiff --git a/devices/redwood/pull-firmware.sh b/devices/poco-x5-pro/pull-firmware.shsimilarity index 93%rename from devices/redwood/pull-firmware.shrename to devices/poco-x5-pro/pull-firmware.shindex 7b6ea26..f2efcdd 100755--- a/devices/redwood/pull-firmware.sh+++ b/devices/poco-x5-pro/pull-firmware.sh@@ -16,5 +16,5 @@ pull fw-audio /vendor/firmware_mnt/image/adsp.mdt $(for i in $(seq -w 2 36); dopull fw-haptic /vendor/firmware/aw8697_haptic.binpull fw-modem /vendor/firmware_mnt/image/modem.mdt $(for i in $(seq -w 0 28); do echo /vendor/firmware_mnt/image/modem.b$i; done)mkdir -p fw-modem/image && adb pull /vendor/firmware_mnt/image fw-modem/ >/dev/null 2>&1 && echo "pull-firmware.sh: fw-modem/image: the modem's own files (TFTP)"-pull fw-camera $(adb shell ls /vendor/lib64/camera/com.qti.sensormodule.redwood_*.bin /vendor/lib64/camera/com.qti.tuned.redwood_*.bin 2>/dev/null | tr -d '\r')+pull fw-camera $(adb shell ls /vendor/lib64/camera/com.qti.sensormodule.hakios_*.bin /vendor/lib64/camera/com.qti.tuned.hakios_*.bin 2>/dev/null | tr -d '\r')echo "pull-firmware.sh: done; Wi-Fi also wants fw-wifi/mac (the radio's address) and fw-wifi/network (the network's name and passphrase)"diff --git a/devices/redwood/tools/cellular_probe.py b/devices/poco-x5-pro/tools/cellular_probe.pysimilarity index 98%rename from devices/redwood/tools/cellular_probe.pyrename to devices/poco-x5-pro/tools/cellular_probe.pyindex ae93339..a0e78d6 100755--- a/devices/redwood/tools/cellular_probe.py+++ b/devices/poco-x5-pro/tools/cellular_probe.py@@ -116,7 +116,7 @@ def android_inventory(serial):def main():parser = argparse.ArgumentParser(description=__doc__)- parser.add_argument("--dtb", type=pathlib.Path, default=pathlib.Path(__file__).resolve().parents[1] / "prebuilt/redwood.dtb")+ parser.add_argument("--dtb", type=pathlib.Path, default=pathlib.Path(__file__).resolve().parents[1] / "prebuilt/device-tree.dtb")parser.add_argument("--adb", action="store_true", help="also query a connected Android phone without changing it")parser.add_argument("--serial", help="ADB serial when more than one phone is connected")args = parser.parse_args()diff --git a/devices/redwood/tools/modem_firmware.py b/devices/poco-x5-pro/tools/modem_firmware.pysimilarity index 100%rename from devices/redwood/tools/modem_firmware.pyrename to devices/poco-x5-pro/tools/modem_firmware.pydiff --git a/devices/redwood/uefi/BASE b/devices/poco-x5-pro/uefi/BASEsimilarity index 100%rename from devices/redwood/uefi/BASErename to devices/poco-x5-pro/uefi/BASEdiff --git a/devices/redwood/uefi/README.md b/devices/poco-x5-pro/uefi/README.mdsimilarity index 100%rename from devices/redwood/uefi/README.mdrename to devices/poco-x5-pro/uefi/README.mddiff --git a/devices/redwood/uefi/apply.sh b/devices/poco-x5-pro/uefi/apply.shsimilarity index 100%rename from devices/redwood/uefi/apply.shrename to devices/poco-x5-pro/uefi/apply.shdiff --git a/devices/redwood/uefi/export.sh b/devices/poco-x5-pro/uefi/export.shsimilarity index 100%rename from devices/redwood/uefi/export.shrename to devices/poco-x5-pro/uefi/export.shdiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/ArmGic/ArmGicDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/CpuDxe/CpuDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/ArmPkg/Drivers/TimerDxe/TimerDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/Ebl/Ebl.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/MetronomeDxe/MetronomeDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/FatPkg/EnhancedFatDxe/Fat.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/Dxe/DxeMain.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/PrintDxe/PrintDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/RscRtDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/SCHandlerRtDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/MiPkg/Protocol/MiToken/MiToken.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Application/QcomChargerApp/QcomChargerApp.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ASN1X509Dxe/ASN1X509Dxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.patched.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.patched.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.patched.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ButtonsDxe/ButtonsDxe.patched.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CPRDxe/CPRDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChargerExDxe/ChargerExDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ChipInfoDxe/ChipInfoDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ClockDxe/ClockDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/CmdDbDxe/CmdDbDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.patched.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.patched.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.patched.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DALSYSDxe/DALSYSDxe.patched.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DDRInfoDxe/DDRInfoDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/DisplayDxe/DisplayDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/EnvDxe/EnvDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FeatureEnablerDxe/FeatureEnablerDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FontDxe/FontDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/FvUtilsDxe/FvUtilsDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GLinkDxe/GLinkDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/GpiDxe/GpiDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HALIOMMUDxe/HALIOMMUDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/HWIODxe/HWIODxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/I2CDxe/I2CDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ICBDxe/ICBDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/IPCCDxe/IPCCDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/LimitsDxe/LimitsDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/MinidumpTADxe/MinidumpTADxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/NpaDxe/NpaDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILDxe/PILDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PILProxyDxe/PILProxyDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ParserDxe/ParserDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicDxe/PmicDxeLa.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PmicGlinkDxe/PmicGlinkDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ProjectInfoDxe/ProjectInfoDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/PwrUtilsDxe/PwrUtilsDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomBds/QcomBds.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomChargerDxe/QcomChargerDxeLA.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/QcomWDogDxe/QcomWDogDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RNGDxe/RngDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ResetRuntimeDxe/ResetRuntimeDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/RpmhDxe/RpmhDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPIDxe/SPIDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SPMIDxe/SPMIDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SdccDxe/SdccDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SecRSADxe/SecRSADxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SerialPortDxe/SerialPortDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ShmBridgeDxe/ShmBridgeDxeLA.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SimpleTextInOutSerialDxe/SimpleTextInOutSerial.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/SmemDxe/SmemDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TLMMDxe/TLMMDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TsensDxe/TsensDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/ScmDxeLA.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.patched.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.patched.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.patched.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/TzDxe/TzDxeLA.patched.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UCDxe/UCDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UFSDxe/UFSDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/ULogDxe/ULogDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbBusDxe/UsbBusDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.patched.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.patched.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.patched.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbConfigDxe/UsbConfigDxe.patched.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbDeviceDxe/UsbDeviceDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbInitDxe/UsbInitDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbKbDxe/UsbKbDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMassStorageDxe/UsbMassStorageDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.patched.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.patched.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.patched.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbMsdDxe/UsbMsdDxe.patched.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbPwrCtrlDxe/UsbPwrCtrlDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/UsbfnDwc3Dxe/UsbfnDwc3Dxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VariableDxe/VariableDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VcsDxe/VcsDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/VerifiedBootDxe/VerifiedBootDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciDxe/XhciDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.depex b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.depexsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.depexrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.depexdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.efi b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.efisimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.efirename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.efidiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/Drivers/XhciPciEmulationDxe/XhciPciEmulationDxe.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.inf b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.infsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.infrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.infdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.raw b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.rawsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.rawrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.rawdiff --git a/devices/redwood/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.te b/devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.tesimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.terename to devices/poco-x5-pro/uefi/files/Binaries/redwood/QcomPkg/XBLCore/XBLCore.tediff --git a/devices/redwood/uefi/files/Binaries/redwood/README.md b/devices/poco-x5-pro/uefi/files/Binaries/redwood/README.mdsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/README.mdrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/README.mddiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/BATTERY.PROVISION b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/BATTERY.PROVISIONsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/BATTERY.PROVISIONrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/BATTERY.PROVISIONdiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/BDS_Menu.cfg b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/BDS_Menu.cfgsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/BDS_Menu.cfgrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/BDS_Menu.cfgdiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9B_42_02_0a_amoled_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9B_42_02_0a_amoled_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9B_42_02_0a_amoled_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9B_42_02_0a_amoled_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_36_02_0a_amoled_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_36_02_0a_amoled_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_36_02_0a_amoled_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_36_02_0a_amoled_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_42_0d_0b_amoled_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_42_0d_0b_amoled_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_42_0d_0b_amoled_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9D_42_0d_0b_amoled_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_35_02_0b_amoled_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_35_02_0b_amoled_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_35_02_0b_amoled_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_35_02_0b_amoled_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_42_02_0a_amoled_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_42_02_0a_amoled_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_42_02_0a_amoled_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_K9E_42_02_0a_amoled_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_L9_36_02_0b_amoled_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_L9_36_02_0b_amoled_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_L9_36_02_0b_amoled_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_L9_36_02_0b_amoled_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_L9_42_02_0a_amoled_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_L9_42_02_0a_amoled_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_L9_42_02_0a_amoled_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_L9_42_02_0a_amoled_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_M20_36_02_0a_amoled_dsc_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_M20_36_02_0a_amoled_dsc_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_M20_36_02_0a_amoled_dsc_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_M20_36_02_0a_amoled_dsc_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_M20_42_0d_0b_amoled_dsc_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_M20_42_0d_0b_amoled_dsc_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_M20_42_0d_0b_amoled_dsc_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_M20_42_0d_0b_amoled_dsc_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_fhd_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_boe_amoled_wqhd_dsc_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_120hz_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_120hz_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_120hz_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_120hz_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_144hz_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_144hz_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_144hz_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_144hz_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_60hz_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_60hz_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_60hz_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36672e_fhd_plus_60hz_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_nt36860_wqhd_dsc_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_primary_sim_vdo.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_primary_sim_vdo.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_primary_sim_vdo.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_primary_sim_vdo.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_cphy.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_cphy.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_cphy.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_120hz_fhd_plus_dsc_cmd_cphy.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_r66451_144hz_fhd_plus_dsc_cmd_cphy.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_1080p_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_1080p_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_1080p_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_1080p_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_sharp_4k_dsc_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_1080p_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dsc_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_cmd.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_cmd.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_cmd.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_cmd.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_vid.xml b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_vid.xmlsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_vid.xmlrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/Panel_truly_wqxga_dual_vid.xmldiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/QcomChargerCfg.cfg b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/QcomChargerCfg.cfgsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/QcomChargerCfg.cfgrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/QcomChargerCfg.cfgdiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/SecParti.cfg b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/SecParti.cfgsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/SecParti.cfgrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/SecParti.cfgdiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/logo1.bmp b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/logo1.bmpsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/logo1.bmprename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/logo1.bmpdiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/uefipil.cfg b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/uefipil.cfgsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/uefipil.cfgrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/uefipil.cfgdiff --git a/devices/redwood/uefi/files/Binaries/redwood/RawFiles/uefiplat.cfg b/devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/uefiplat.cfgsimilarity index 100%rename from devices/redwood/uefi/files/Binaries/redwood/RawFiles/uefiplat.cfgrename to devices/poco-x5-pro/uefi/files/Binaries/redwood/RawFiles/uefiplat.cfgdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/DeviceBuild.py b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/DeviceBuild.pysimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/DeviceBuild.pyrename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/DeviceBuild.pydiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/APRIORI.inc b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/APRIORI.incsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/APRIORI.increname to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/APRIORI.incdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/DXE.inc b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/DXE.incsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/DXE.increname to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/DXE.incdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/RAW.inc b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/RAW.incsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/RAW.increname to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Include/RAW.incdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.c b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.csimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.crename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.cdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.inf b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.infsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.infrename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/ConfigurationMapLib/ConfigurationMapLib.infdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.c b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.csimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.crename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.cdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.inf b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.infsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.infrename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/Library/MemoryMapLib/MemoryMapLib.infdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.dec b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.decsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.decrename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.decdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.dsc b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.dscsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.dscrename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.dscdiff --git a/devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.fdf b/devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.fdfsimilarity index 100%rename from devices/redwood/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.fdfrename to devices/poco-x5-pro/uefi/files/Platforms/Xiaomi/redwoodPkg/redwood.fdfdiff --git a/devices/redwood/uefi/files/Resources/Configs/redwood.toml b/devices/poco-x5-pro/uefi/files/Resources/Configs/redwood.tomlsimilarity index 100%rename from devices/redwood/uefi/files/Resources/Configs/redwood.tomlrename to devices/poco-x5-pro/uefi/files/Resources/Configs/redwood.tomldiff --git a/devices/redwood/uefi/files/Resources/DTBs/redwood.dtb b/devices/poco-x5-pro/uefi/files/Resources/DTBs/redwood.dtbsimilarity index 100%rename from devices/redwood/uefi/files/Resources/DTBs/redwood.dtbrename to devices/poco-x5-pro/uefi/files/Resources/DTBs/redwood.dtbdiff --git a/devices/redwood/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.c b/devices/poco-x5-pro/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.csimilarity index 100%rename from devices/redwood/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.crename to devices/poco-x5-pro/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.cdiff --git a/devices/redwood/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.h b/devices/poco-x5-pro/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.hsimilarity index 100%rename from devices/redwood/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.hrename to devices/poco-x5-pro/uefi/files/Silicon/Silicium/SiliciumPkg/Library/BootManagerLib/XnuLoader.hdiff --git a/devices/redwood/uefi/mu-silicium.patch b/devices/poco-x5-pro/uefi/mu-silicium.patchsimilarity index 100%rename from devices/redwood/uefi/mu-silicium.patchrename to devices/poco-x5-pro/uefi/mu-silicium.patchdiff --git a/docs/air.md b/docs/air.mdindex 9fc1d2c..712bb1d 100644--- a/docs/air.md+++ b/docs/air.md@@ -510,8 +510,8 @@ figure to adjust.**Decision: a Mesa frontend in Mesa's tree, shaped like `src/compiler/spirv`.** Its entry pointis one function, `air_to_nir()` (`nir_air.h`), the analogue of `spirv_to_nir()`. In thisrepository the sources are `tools/mesa/air/`; `tools/mk-mesa.sh` and `tools/air/mk-host.sh` copy-them to `src/compiler/air/` of the pinned Mesa release, exactly as `tools/mesa/redwood-drm/` is-copied to `src/redwood-drm/`, and `tools/mesa/air.patch` adds the two lines of meson that build+them to `src/compiler/air/` of the pinned Mesa release, exactly as `tools/mesa/hakios-drm/` is+copied to `src/hakios-drm/`, and `tools/mesa/air.patch` adds the two lines of meson that buildit. The tree is the shape an upstream merge request would have.Why not a standalone library that Mesa links:@@ -1292,7 +1292,7 @@ the Mesa already on the phone rather than being built from nothing:- The port's Mesa **already creates a Gallium screen for the Adreno**:`osmesa_create_gpu_screen()` in `tools/mesa/freedreno-darwin.patch` opens the kernel's `msm`- driver through `tools/mesa/redwood-drm` and calls `fd_drm_screen_create_renderonly()`. It also+ driver through `tools/mesa/hakios-drm` and calls `fd_drm_screen_create_renderonly()`. It alsoalready has `osmesa_surface_resource()`, which wraps an IOSurface as a `pipe_resource`. So theGallium layer is reachable inside the library CoreAnimation already draws iOS through.- **freedreno takes NIR natively** (`PIPE_SHADER_CAP_SUPPORTED_IRS` includes@@ -1304,7 +1304,7 @@ the Mesa already on the phone rather than being built from nothing:**That is now built and in the image, and no export was needed.** `air_run` is built *inside* theMesa cross build (`AIR=1 tools/mk-mesa.sh`), so it links Gallium's own static libraries and opens-the Adreno itself — `drmOpenWithType("msm", …)` through `tools/mesa/redwood-drm`, then+the Adreno itself — `drmOpenWithType("msm", …)` through `tools/mesa/hakios-drm`, then`fd_drm_screen_create_renderonly()`, exactly as `osmesa_create_gpu_screen()` does. It needsnothing exported from `libOSMesa` and does not load it: a 9.8 MB arm64 Mach-O against libSystem,libz and IOKit alone. `userland/build.sh` puts it in `/redwood/bin`, and `rc.jobs.air` runs it.diff --git a/docs/cellular.md b/docs/cellular.mdindex 00dbca7..86bcfc0 100644--- a/docs/cellular.md+++ b/docs/cellular.md@@ -18,7 +18,7 @@ Where the modem stands (October 2026). The detailed, step-by-step diary in Russilogical slot 1 is pointed at it, the provisioning session is bound to its USIM, and NAS readsthe signal (-70 to -87 dBm on UMTS).- SpringBoard's status bar: the signal item is hooked (`userland/src/inject_sb.c`) and shows the- kernel's bars (`sysctl kern.redwood.cellular_bars`) once the modem is registered.+ kernel's bars (`sysctl kern.hakios.cellular_bars`) once the modem is registered.## Not yet@@ -34,7 +34,7 @@ XL_SB_DELAY=8 tools/modem-cycle.sh "modem=1 modem_again=1 modem_buffer=0xa800000`modem_step=N` runs the bring-up step by step and returns to the loader with the log;`modem=1` brings the modem up beside the system. Everything is in-`xnu/files/bsd/dev/redwood_mpss.c` (the modem), `redwood_nas.c` (NAS), `redwood_qmi.c` (QMI).+`xnu/files/bsd/dev/hakios.mpss.c` (the modem), `hakios.nas.c` (NAS), `hakios.qmi.c` (QMI).## Kernel argumentsdiff --git a/docs/ru/cellular.md b/docs/ru/cellular.mdindex 66bda4e..e2f9a6f 100644--- a/docs/ru/cellular.md+++ b/docs/ru/cellular.md@@ -1,8 +1,8 @@# Сотовая связь: состояние и план порта-Сейчас сотовая связь в HakiOS **не работает**, но модем уже запускается из XNU (см. «21 октября» ниже). Wi-Fi использует WPSS и свой GLINK/QRTR; модем MPSS — отдельный процессор с другим каналом. `redwood_qmi.c` кодирует сообщения QMI и теперь позволяет привязать клиент к заданному транспорту QRTR, но канал к MPSS ещё не реализован. У iOS также нет драйверов AppleBaseband и AppleIPAppender для этого аппаратного пути. Запуск `CommCenter` без них уже проверялся: он завершается аварийно (см. README, раздел «Телефония»).+Сейчас сотовая связь в HakiOS **не работает**, но модем уже запускается из XNU (см. «21 октября» ниже). Wi-Fi использует WPSS и свой GLINK/QRTR; модем MPSS — отдельный процессор с другим каналом. `hakios.qmi.c` кодирует сообщения QMI и теперь позволяет привязать клиент к заданному транспорту QRTR, но канал к MPSS ещё не реализован. У iOS также нет драйверов AppleBaseband и AppleIPAppender для этого аппаратного пути. Запуск `CommCenter` без них уже проверялся: он завершается аварийно (см. README, раздел «Телефония»).-Проверка `python3 devices/redwood/tools/modem_firmware.py --dtb devices/redwood/prebuilt/redwood.dtb --firmware-dir fw-modem --node /soc/qcom,mss@4080000` сопоставила 28 сегментов штатной прошивки с областью `mpss@8b800000` (PAS ID 4). `MODEM=1 SYSTEM=1 ... userland/build.sh` теперь может положить эти локальные файлы в системный APFS после проверки. Это только подготовка образа: наличие прошивки в `/fw` не запускает MPSS. Исходник `redwood_nas.c` содержит клиент QMI NAS для заданного транспорта QRTR: он ищет службу, запрашивает регистрацию и силу сигнала, разбирает ответы и сбрасывает состояние при исчезновении службы. Уровень `bars` остаётся нулевым без подтверждённой регистрации. MPSS-транспорта в XNU пока нет, поэтому этот клиент ещё не получает сообщения с телефона и не подключён к статус-бару iOS. Форматы NAS сверены с [описанием libqmi](https://github.com/linux-mobile-broadband/libqmi/blob/main/data/qmi-service-nas.json).+Проверка `python3 devices/poco-x5-pro/tools/modem_firmware.py --dtb devices/poco-x5-pro/prebuilt/device-tree.dtb --firmware-dir fw-modem --node /soc/qcom,mss@4080000` сопоставила 28 сегментов штатной прошивки с областью `mpss@8b800000` (PAS ID 4). `MODEM=1 SYSTEM=1 ... userland/build.sh` теперь может положить эти локальные файлы в системный APFS после проверки. Это только подготовка образа: наличие прошивки в `/fw` не запускает MPSS. Исходник `hakios.nas.c` содержит клиент QMI NAS для заданного транспорта QRTR: он ищет службу, запрашивает регистрацию и силу сигнала, разбирает ответы и сбрасывает состояние при исчезновении службы. Уровень `bars` остаётся нулевым без подтверждённой регистрации. MPSS-транспорта в XNU пока нет, поэтому этот клиент ещё не получает сообщения с телефона и не подключён к статус-бару iOS. Форматы NAS сверены с [описанием libqmi](https://github.com/linux-mobile-broadband/libqmi/blob/main/data/qmi-service-nas.json).## Проверка на телефоне, 20 октября 2026@@ -10,7 +10,7 @@## Что установлено по redwood-`devices/redwood/prebuilt/redwood.dtb` содержит зарезервированную память `mpss@8b800000`, `qcom,smp2p-modem`, `qcom,glink/modem/qcom,modem_qrtr`, `qcom,ipa@1e00000` и `qcom,rmnet-ipa`. Это разные части тракта: запуск прошивки модема, сигнализация, управляющий QMI-канал и передача IP-пакетов. Дерево Android [redwood](https://github.com/Redwood-AOSP/android_device_xiaomi_redwood) включает `full_base_telephony.mk`; его `init.qcom.rc` запускает `vendor.qcrild` и `vendor.qcrild2`. [Ветка araxys с ядром/DTB](https://github.com/Redwood-AOSP/android_device_xiaomi_redwood-kernel/tree/araxys) пригодна как аппаратный справочник. Бинарники Android RIL нельзя просто запустить в iOS: им нужны Android binder, HAL, службы и ABI.+`devices/poco-x5-pro/prebuilt/device-tree.dtb` содержит зарезервированную память `mpss@8b800000`, `qcom,smp2p-modem`, `qcom,glink/modem/qcom,modem_qrtr`, `qcom,ipa@1e00000` и `qcom,rmnet-ipa`. Это разные части тракта: запуск прошивки модема, сигнализация, управляющий QMI-канал и передача IP-пакетов. Дерево Android [redwood](https://github.com/Redwood-AOSP/android_device_xiaomi_redwood) включает `full_base_telephony.mk`; его `init.qcom.rc` запускает `vendor.qcrild` и `vendor.qcrild2`. [Ветка araxys с ядром/DTB](https://github.com/Redwood-AOSP/android_device_xiaomi_redwood-kernel/tree/araxys) пригодна как аппаратный справочник. Бинарники Android RIL нельзя просто запустить в iOS: им нужны Android binder, HAL, службы и ABI.Проверка по USB 20 октября 2026 года: fastboot определил продукт `redwood` и разблокированный загрузчик; Android сообщил `ro.boot.hardware.sku=redwood`, `ro.soc.model=SM7325`. Под Android подсистема `modem` и прошивка `yupik_ipa_fws` были `ONLINE`, `vendor.qcrild`, `vendor.qcrild2`, `vendor.qrtr-ns` — `running`; присутствовали `rmnet_ipa0` и `rmnet_data0`–`rmnet_data5`. Состояние SIM: `ABSENT,LOADED` для двух слотов. Временная загрузка `xnuloader` через `fastboot boot` и его `selftest` прошли (`selftest-ok`); это проверка загрузчика, а не сотовой связи в XNU.@@ -22,7 +22,7 @@ Android `dmesg` уточняет последовательность: сначПорядок доведения до работающей связи:-1. На подключённом Android собрать отчёт `python3 devices/redwood/tools/cellular_probe.py --adb` и сверить DTB, версию прошивки и активные службы. Скрипт читает только открытые свойства и не собирает IMEI, IMSI и номера SIM.+1. На подключённом Android собрать отчёт `python3 devices/poco-x5-pro/tools/cellular_probe.py --adb` и сверить DTB, версию прошивки и активные службы. Скрипт читает только открытые свойства и не собирает IMEI, IMSI и номера SIM.2. Поднять MPSS в XNU с собственным GLINK/QRTR-каналом, отдельным от WPSS; проверить обнаружение QMI-служб, не отправляя команд регистрации или передачи данных.3. Реализовать QMI DMS/UIM/NAS/WDS и состояние SIM/сети; отдельно включить путь IPA/rmnet для мобильных данных.4. Подключить эти возможности к CoreTelephony/CommCenter через совместимый сервис и аппаратный драйвер, затем проверить SIM, регистрацию, входящие/исходящие вызовы, SMS и мобильные данные на телефоне. VoLTE/IMS — отдельная работа.@@ -32,9 +32,9 @@ Android `dmesg` уточняет последовательность: снач## Команды до и после подключения```sh-python3 devices/redwood/tools/cellular_probe.py > modem-dtb.json+python3 devices/poco-x5-pro/tools/cellular_probe.py > modem-dtb.json# После подключения телефона с разрешённой USB-отладкой:-python3 devices/redwood/tools/cellular_probe.py --adb > modem-android.json+python3 devices/poco-x5-pro/tools/cellular_probe.py --adb > modem-android.json```Для другого устройства передать его DTB через `--dtb PATH`; прошивку на телефон инструмент не записывает.@@ -42,7 +42,7 @@ python3 devices/redwood/tools/cellular_probe.py --adb > modem-android.json## 21 октября 2026: модем запущен из XNUЯдро теперь собирается на этом Mac (см. `xnu/README.md`, «Сборка на macOS»), и драйвер-`bsd/dev/redwood_mpss.c` — копия пути аудио‑DSP (`redwood_adsp.c`) с числами модема — проверен+`bsd/dev/hakios.mpss.c` — копия пути аудио‑DSP (`hakios.adsp.c`) с числами модема — проверенна телефоне через `xl run` с `modem_step=11 modem_return=1`:- шаги 1–10 проходят: прошивка `modem.*` из `/fw` системного образа (85 МБ, 28 сегментов)@@ -59,7 +59,7 @@ python3 devices/redwood/tools/cellular_probe.py --adb > modem-android.jsonПричина отсутствия DMS/NAS — у модема нет доступа к своим файловым системам: на Android ихотдаёт демон `rmtfs` (служба QMI 14 поверх QRTR, [linux-msm/rmtfs](https://github.com/linux-msm/rmtfs)).В драйвер добавлена такая служба: четыре раздела (`modemst1`, `modemst2`, `fsc`, `fsg`)-читаются при старте шагов целиком в память ядра через `redwood_ufs_read_partition()`+читаются при старте шагов целиком в память ядра через `hakios_ufs_read_partition()`(нужен `ufs=2` в аргументах ядра — блочная служба загрузчика), модем открывает их по путям`/boot/modem_fs1` и т. д., получает буфер 2,5 МБ (`qcom,rmtfs_sharedmem@0`), в которыйTrustZone пускает модем вызовом `SCM MP ASSIGN` (HLOS + MSS_MSA, чтение и запись), и читает@@ -76,10 +76,10 @@ XL_CMDLINE="debug=0x8 rd=md0 hv_wdt_pet=1 bootcpu=7 cpus=8 cpufreq=1 sb_delay=60````modem=1` в обычной загрузке делает всё то же на своём потоке и оставляет модем включённым,-опрашивая NAS каждые две секунды; результат — в `sysctl kern.redwood.cellular_up`,+опрашивая NAS каждые две секунды; результат — в `sysctl kern.hakios.cellular_up`,`cellular_registered`, `cellular_bars`, `cellular_dbm`, `cellular_radio`. Палочки встатус‑баре iOS из этого ещё не получаются: нужна либо часть CommCenter, либо подмена-элемента статус‑бара в `libredwood-sb.dylib` по этим sysctl (следующий шаг).+элемента статус‑бара в `libhakios.sb.dylib` по этим sysctl (следующий шаг).## 23 октября 2026: буфер RMTFS и перезапуски телефона@@ -119,7 +119,7 @@ XL_CMDLINE="debug=0x8 rd=md0 hv_wdt_pet=1 bootcpu=7 cpus=8 cpufreq=1 sb_delay=60`/readonly/firmware/image/modem_pr/so/665_0_0.mbn` кусками (опции `rsize`, `seek`, `wsize`,`blksize`), просит `/readwrite/ota_firewall/ruleset` (нет — не страшно).-Обе службы теперь в `redwood_mpss.c` (разделы «TFTP over QRTR» и «the service registry's+Обе службы теперь в `hakios.mpss.c` (разделы «TFTP over QRTR» и «the service registry'slocator»): файлы берутся из `/fw/image` системного образа (`fw-modem/image` — копия`/vendor/firmware_mnt/image` телефона, снятая `adb pull`; `MODEM=1 SYSTEM=1 userland/build.sh`кладёт её в образ), записи модема хранятся в памяти ядра на время прогона. Сервер имён QRTR@@ -135,7 +135,7 @@ locator»): файлы берутся из `/fw/image` системного обПадение `enl2_dl` повторяется в каждом прогоне через несколько секунд после ONLINE. Гипотеза —модему нужен работающий IPA (пакетный ускоритель, через него идут данные LTE), и в-`redwood_mpss.c` появился его минимальный драйвер («the IPA» в файле), по образцу+`hakios.mpss.c` появился его минимальный драйвер («the IPA» в файле), по образцу`drivers/net/ipa` Linux (версия IPA 4.11, sc7280):- **такт**: без голоса RPMh за BCM `IP0` (`ipa_clock()`) TrustZone отвечает на@@ -182,7 +182,7 @@ Android телефона рутован (KernelSU), и его `dmesg`, debugfs (Источник раскладки и обработчиков: `techpack/dataipa/drivers/platform/msm/ipa/ipa_v3`(`ipa_utils.c: ipa_4_11_mem_part`, `ipa_qmi_service.c`), ядро-Atom-X-Devs/android_kernel_xiaomi_sm7325 (у MiCode ветка `redwood-s-oss`).+Atom-X-Devs/android_kernel_xiaomi_sm7325 (у MiCode ветка `hakios-s-oss`).### Прогон 23 (01:11): служба IPA модема отвечает — но не на INIT_DRIVER@@ -252,7 +252,7 @@ Register = `UIM_UNINITIALIZED`: SIM ще ініціалізується післСтатус-бар: у SpringBoard iOS 16.5 стільникові пункти заповнює `SBStatusBarStateAggregator`через `_updateSignalStrengthItem:withData:SIMInfo:barsGetter:barsSetter:` і `_setItem:enabled:`(селектори знайдені в кеші dyld). `inject_sb.c` тепер перехоплює цей метод: коли-`kern.redwood.cellular_registered`, виставляє палички через barsSetter і вмикає пункт; раз на 3 с+`kern.hakios.cellular_registered`, виставляє палички через barsSetter і вмикає пункт; раз на 3 спросить пункт оновитися, коли стан у ядрі змінюється; список методів агрегатора пишеться в лог.### Прогін 32 (25 жовтня): хук статус-бару живий; підписка ні до чого не прив'язанаdiff --git a/docs/ru/metal.md b/docs/ru/metal.mdindex a3f09de..d085136 100644--- a/docs/ru/metal.md+++ b/docs/ru/metal.md@@ -82,11 +82,11 @@ metal_test: IOAcceleratorES "sgx": MetalPluginName (none), MetalPluginClassNamполминуты, и нарочно без двух свойств, чтобы и Metal, и OpenGL ES прошли мимо. Цепочка из раздела 1обрывается не на шаге 1, а на шаге 2.-Adreno же отдаётся userland'у отдельно и под своим именем: `iokit/Kernel/RedwoodGPU.cpp`-(строки 289–307) регистрирует `RedwoodGPU : IOService`, `setName("RedwoodGPU")`,-`kIOUserClientClassKey = "RedwoodGPUUserClient"` — это то, с чем говорит freedreno из Mesa, и к-`IOAcceleratorES` оно отношения не имеет. Причём `RedwoodGPUStart()` зовётся из-`bsd/dev/redwood_adreno.c` (строка 3858) только когда GPU действительно поднялся, так что в QEMU+Adreno же отдаётся userland'у отдельно и под своим именем: `iokit/Kernel/hakios.gpu.cpp`+(строки 289–307) регистрирует `HakiosGPU : IOService`, `setName("HakiosGPU")`,+`kIOUserClientClassKey = "HakiosGPUUserClient"` — это то, с чем говорит freedreno из Mesa, и к+`IOAcceleratorES` оно отношения не имеет. Причём `HakiosGPUStart()` зовётся из+`bsd/dev/hakios.adreno.c` (строка 3858) только когда GPU действительно поднялся, так что в QEMU`metal_test` и не нашёл ничего (`what the registry has that is a GPU: none`).**Что из этого следует для раздела 4.** Границу стерегут не IOKit и не ядро: класс нужной службы в@@ -188,14 +188,14 @@ AGXA11FamilyDevice -> IOGPUMetalDevice (IOGPU.framework) -> _MTLDevice (Meta`IOGPUCommandQueueSubmitCommandBuffers`, разделяемая память, …). Для варианта (А) это и подарок, исчёт: подарок — что эти 711 методов писать не надо; счёт — что тогда **ядру порта придётсяреализовать ABI IOGPU** на клиенте `IOAcceleratorES`, то есть ещё один протокол поверх того, что-`RedwoodGPU` уже говорит на языке msm DRM для Mesa.+`HakiosGPU` уже говорит на языке msm DRM для Mesa.### Три пути и их цена**(А) Поверхность Metal над Mesa.** Дописать на уже существующую службу `IOAcceleratorES` (раздел 2)-два свойства, положить в образ `/System/Library/Extensions/RedwoodMetal.bundle`+два свойства, положить в образ `/System/Library/Extensions/HakiosMetal.bundle`(место открыто: `userland/build.sh` собирает корень из файлов iOS по их настоящим путям и уже-кладёт туда свои — например `/System/Library/Audio/Plug-Ins/HAL/RedwoodAudio.driver`) и реализовать+кладёт туда свои — например `/System/Library/Audio/Plug-Ins/HAL/HakiosAudio.driver`) и реализоватьграф объектов Metal на Mesa. Цена: ~53 класса и ~1 200 методов драйвера **плюс компиляторAIR→NIR**, которого не существует. В единицах этого проекта — не файл и не два, а ещё одна Mesa, ихудшая её половина — без апстрима.@@ -258,7 +258,7 @@ CoreAnimation — рендерер OpenGL ES, который порт уже и1. службы класса `IOAcceleratorES` и у каждой — `MetalPluginName` и `MetalPluginClassName`(сейчас: ни одной, и значит Metal не найдёт устройства вовсе);-2. что в реестре **есть** похожего на GPU — `RedwoodGPU`, `IOGPU`, `AGXAccelerator`,+2. что в реестре **есть** похожего на GPU — `HakiosGPU`, `IOGPU`, `AGXAccelerator`,`IOAccelerator` — и с каким `IOUserClientClass`: видно, что GPU поднят, но под другим именем;3. бандлы в `/System/Library/Extensions`: грузится ли принципиальный класс каждого и является ли онподклассом `_MTLDevice`, — то есть мог ли бы вообще загрузиться плагин в этом образе, и на каком@@ -310,7 +310,7 @@ XL_CMDLINE="... gpu=1" RC_JOBS=rc.jobs.metal ./xl run # на телефо```**Разница между QEMU и телефоном ровно одна**, и её стоит знать, читая вывод: пункт 2 показывает-`RedwoodGPU` только на телефоне. `RedwoodGPUStart()` зовётся из `bsd/dev/redwood_adreno.c` (строка+`HakiosGPU` только на телефоне. `HakiosGPUStart()` зовётся из `bsd/dev/hakios.adreno.c` (строка3858) лишь тогда, когда GPU действительно поднялся (`done >= 21 && core_runs`, то есть `gpu=1` ипрошивки из `fw-gpu/`); в QEMU GPU нет вовсе, и служб не будет никаких. Про само Metal ответодинаков: устройства нет ни там, ни там.@@ -443,7 +443,7 @@ OpenGL ES.стоит настоящий Adreno через freedreno:```-redwood-gl: an OpenGL ES 3 context for CoreAnimation, by Mesa, off-screen (OSMesa):+hakios-gl: an OpenGL ES 3 context for CoreAnimation, by Mesa, off-screen (OSMesa):OpenGL ES 3.2 Mesa 25.0.7; Adreno 7c+ Gen 3; shaders OpenGL ES GLSL ES 3.20metal_test: EAGLContext: EAGLContext, API 3metal_test: signal 11 at address 0x8@@ -482,10 +482,10 @@ CoreImage пошёл дальше:```$ /redwood/bin/metal_test ci-eagl-software-metal_test: /redwood/lib/libredwood-gl.dylib loaded; EAGLContext is ours now+metal_test: /redwood/lib/libhakios.gl.dylib loaded; EAGLContext is ours nowmetal_test: EAGLContext: EAGLContext, API 3-redwood-gl: -sharegroup asked for: none (nothing here shares a context)-redwood-gl: an OpenGL ES 3 context for CoreAnimation, by Mesa, off-screen (OSMesa): ...+hakios-gl: -sharegroup asked for: none (nothing here shares a context)+hakios-gl: an OpenGL ES 3 context for CoreAnimation, by Mesa, off-screen (OSMesa): ...metal_test: CIContext: CIContextmetal_test: backend: OpenGL ES (CI::GLContext)metal_test: the context's Metal device: nildiff --git a/docs/ru/notes.md b/docs/ru/notes.mdindex 60bd6df..f071254 100644--- a/docs/ru/notes.md+++ b/docs/ru/notes.md@@ -89,8 +89,8 @@ qemu/run-ios.sh 1200 -display gtk > logs/qemu.log # сеанс на 20 ми### Звук-Звуком в iOS заведует `mediaserverd`; в него встаёт наше устройство вывода (`RedwoodAudio.driver`), которое iOS-принимает за собственный динамик iPhone, и то, что она играет, приходит в ядро (`/dev/redwood-audio`):+Звуком в iOS заведует `mediaserverd`; в него встаёт наше устройство вывода (`HakiosAudio.driver`), которое iOS+принимает за собственный динамик iPhone, и то, что она играет, приходит в ядро (`/dev/hakios-audio`):```shREST=1 userland/build.sh@@ -106,16 +106,16 @@ AUDIO=pipewire qemu/run-ios.sh 1200 -display gtk > logs/qemu.log # или AUDустройства); после перезапуска показывает «Не исполняется» с кнопками.`RC_JOBS=rc.jobs.sound` добавляет в образ сценарий, который сам проигрывает тон и несколько системных звуков(`userland/src/sound_test.c`); когда звук смолкает, ядро пишет в журнал строку-`redwood-audio: N s written at R frames a second, M s of it sound, peak P% of full scale`.+`hakios-audio: N s written at R frames a second, M s of it sound, peak P% of full scale`.На телефоне с `adsp=1 sound=4` то, что играет iOS, звучит из обоих динамиков: через звуковой процессор (порт TDM,поток, путь к порту) и два усилителя Awinic, которые включаются, только пока есть звук (параметр `sound=N` ниже;`RC_JOBS=rc.jobs.speakers` проигрывает тон, звук блокировки, щелчки клавиатуры и фанфары). То, что iOS играет,можно и забрать: параметр ядра `rec_sound=N` сохраняет первые N секунд звука в памяти, после-сеанса `./xl sound out.wav` достаёт их (в QEMU — `pmemsave` по адресу из строки `redwood-audio: recording … at 0x…`,+сеанса `./xl sound out.wav` достаёт их (в QEMU — `pmemsave` по адресу из строки `hakios-audio: recording … at 0x…`,затем `tools/sound.py`); с `rec_sound_fed=1` — то, что ушло к усилителям. На телефоне звук проверен на слух.Защиты динамиков, которая у Android работает в звуковом процессоре (алгоритм Awinic с калибровкой), здесь нет;-вместо неё отсчёты по пути к усилителям проходят «сторож» ядра (`bsd/dev/redwood_guard.c`): сначала усиление+вместо неё отсчёты по пути к усилителям проходят «сторож» ядра (`bsd/dev/hakios.guard.c`): сначала усиление`sound_gain` (по умолчанию и самое большее 12 дБ: обработка самой iOS для динамика iPhone X держит даже полный тонна максимуме громкости на 12,6–14,3 дБ ниже полной шкалы), затем фильтр верхних частот 200 Гц, три средних мощностина динамике — за 0,2, 3 и 60 с, пределы на 3, 6 и 9 дБ ниже мощности синуса полной шкалы на уровне Android (громкость@@ -124,7 +124,7 @@ AUDIO=pipewire qemu/run-ios.sh 1200 -display gtk > logs/qemu.log # или AUDнапряжение батареи, как их видят сами усилители, и по таблице «монитора» драйвера Android из той же конфигурациигромкость снижается на холоде и при разряженной батарее. Проверка на телефоне: `sound_below=160` (−20 дБ) — сторож работает, у усилителей ни одной ошибки; −10 дБ иуровень Android — ещё впереди. По умолчанию, пока громче на слух не проверено, `sound_below=240` (−30 дБ).-`RC_JOBS=rc.jobs.loud` — самое тяжёлое: тон полной шкалы 60 с прямо в `/dev/redwood-audio` мимо обработки iOS, потом+`RC_JOBS=rc.jobs.loud` — самое тяжёлое: тон полной шкалы 60 с прямо в `/dev/hakios-audio` мимо обработки iOS, потомтон через iOS на максимуме громкости; `sound_guard_as=0` вместе с `sound_below=720` показывает в журнале и записи,что сторож делает на уровне Android, без единого звука. `tools/guard_test.c` — сторож на этой машине.@@ -132,7 +132,7 @@ AUDIO=pipewire qemu/run-ios.sh 1200 -display gtk > logs/qemu.log # или AUDего отсчёты идут по SoundWire (ведущий TX цифрового кодека LPASS) в дециматор 1 макроса TX, оттуда через портcodec DMA TX_CDC_DMA_TX_3 и звуковой процессор в поток, который ядро читает (48 кГц, 16 бит, один канал). Всё —как это делает Android при записи с микрофонов трубки: значения из живого дерева устройств, путей микшера Xiaomi и-ядра Xiaomi (`bsd/dev/redwood_mic.c`). Шина SoundWire — как у Android на пути «handset-mic»: там включены два АЦП+ядра Xiaomi (`bsd/dev/hakios.mic.c`). Шина SoundWire — как у Android на пути «handset-mic»: там включены два АЦП(ADC1 и ADC4), и шина идёт на 9,6 МГц; таблицы Android для одного ADC1 (шина 4,8 МГц) переносят только половинутого, что ADC1 выдаёт в режиме «low power», и вместо комнаты слышен громкий тон (`mic_main=1`). Уровень каждойсекунды идёт в журнал, а с `rec_sound=N rec_sound_mic=1` отсчёты попадают в запись для `./xl sound`. Проверено на@@ -186,7 +186,7 @@ codec DMA TX_CDC_DMA_TX_3 и звуковой процессор в поток,`GL=1 REST=1 userland/build.sh`, и к обычной командной строке сеанса добавляется одно слово:`XL_CMDLINE="touchscreen=1 cpufreq=1 bootcpu=7 cpus=8 gpu=1 wifi=1" ./xl run`. Радио поднимается рядом сзагрузкой системы и её не задерживает (сеть есть через 12 секунд после старта ядра), интерфейс — тот же `en0`;- настроить его просит configd задание `com.redwood.wifi`, которое есть в каждом образе и без `wifi=1` ничего не+ настроить его просит configd задание `com.hakios.wifi`, которое есть в каждом образе и без `wifi=1` ничего неделает. Без прошивки ядро говорит об этом одной строкой и идёт дальше; без файла сети радио поднимается, но ни кчему не подключается. В Safari при наборе встроке поиска появляются подсказки поисковика — они приходят уже по этой сети; страницы Safari открывает и рисует@@ -203,7 +203,7 @@ codec DMA TX_CDC_DMA_TX_3 и звуковой процессор в поток,`RC_JOBS=rc.jobs.fonts` (`font_test`: к какому шрифту система идёт за эмодзи, китайским, японским и корейским исколько точек он рисует, сколько из них цветных; с `wifi=1` — китайская Википедия и страница эмодзи в Safari).Настройки: в образе работает и wifid, служба Wi-Fi самой iOS, а ядро отвечает на её запросы- (`bsd/dev/redwood_apple80211.c`). Раньше его добавлял только `WIFID=1`; теперь он в образе по умолчанию, потому+ (`bsd/dev/hakios.apple80211.c`). Раньше его добавлял только `WIFID=1`; теперь он в образе по умолчанию, потомучто там, где радио нет вовсе, он ничего не стоит: в QEMU wifid поднимается, сам с собой разговаривает о кодахстран и сидит — 114 запущенных процессов против 119 без него, ни одной аварии, ни одного перезапуска, — а навопросы, которые система всё равно задаёт, отвечает: `com.apple.wifi.manager` (это имя wifid регистрирует сам,@@ -267,7 +267,7 @@ XL_SECS=900 XL_CMDLINE="touchscreen=1 cpufreq=1 bootcpu=7 cpus=8" ./xl run #`/sbin/launchd.ios: No such file or directory`; это означает именно несовпадение резидентного образа скомандной строкой (например, 4 МБ флеш-рутового `flashboot.apfs` там, где `root_apfs=` не задан иожидался `system.apfs` на 2,4 ГБ), а не плохой образ — заливать в ответ на это другой образ наугад значит-лечить симптом. Ни записка на `$XDG_RUNTIME_DIR/darwin-redwood-phone.note`, ни `flock` на `.run` этого+лечить симптом. Ни записка на `$XDG_RUNTIME_DIR/darwin-hakios-phone.note`, ни `flock` на `.run` этогосостояния не описывают: они отвечают «кто держит телефон» и «идёт ли прогон сейчас», а резидентный образпереживает и то и другое.@@ -379,18 +379,18 @@ XL_SECS=900 XL_CMDLINE="touchscreen=1 cpufreq=1 bootcpu=7 cpus=8" ./xl run #| `return_cpu=N`, `return_panic=1` | для проверки возврата в загрузчик с несколькими ядрами: вернуться по таймеру с процессора N (по номеру в ядре: 0 — загрузочный) и/или через панику || `gpu=1` | рисовать графическим процессором телефона (образ с `GL=1`, прошивки в `fw-gpu/`; см. раздел «GPU»). Без него, без прошивок и в QEMU всё рисует программный рендер CoreAnimation || `virtio_net=1` | (QEMU; `QEMU_NET=1` добавляет его сам) сетевой интерфейс `en0` на сетевой карте virtio. `net_names=1` — писать в журнал каждое имя, которое система спрашивает у DNS, и каждое начатое TCP-соединение; `net_trace=N` — строка о каждом из первых N кадров |-| `adreno=N` | опыт с GPU телефона: первые N шагов его пробуждения (питание, такты, первые регистры), каждый шаг пишет в журнал, что собирается тронуть и что прочёл; шаги и остальные параметры описаны в начале `bsd/dev/redwood_adreno.c` |+| `adreno=N` | опыт с GPU телефона: первые N шагов его пробуждения (питание, такты, первые регистры), каждый шаг пишет в журнал, что собирается тронуть и что прочёл; шаги и остальные параметры описаны в начале `bsd/dev/hakios.adreno.c` || `wifi=1` | Wi-Fi телефона, всё сразу (см. «Wi-Fi телефона» выше): процессор радио, драйвер, подключение к сети из `fw-wifi/network`, и так до конца сеанса; рядом с загрузкой системы, в журнале — только итог (`wifi_loud=1` — со всеми подробностями шагов) || `wifi_file=0` | с `wifi=1`: сеть из `fw-wifi/network` при старте не подключается, радио ждёт, пока сеть выберут в Настройках (wifid в образе есть по умолчанию) || `wifi_irq=0`, `wifi_ba=0`, `wifi_wide=0` | с `wifi=1`: без прерываний радио (его кольца опрашиваются раз в миллисекунду, как раньше), без блочных подтверждений (точка доступа шлёт кадры по одному — скорость впятеро ниже), без широкого канала (только 20 МГц) |-| `wifi_step=N` | то же по шагам, как это выяснялось: первые N шагов, и ядро ждёт, пока они пройдут. 1–5 только читают (общая память процессоров, почтовый ящик процессора питания, RPMh, шины питания, выводы), 6–11 кладут прошивку процессора Wi-Fi в его память, заводят в общей памяти нашу половину его сигнальных битов (SMP2P) и запускают его через TrustZone, 12–14 поднимают связь с ним (GLINK, канал IPCRTR) и QRTR поверх неё: процессор Wi-Fi объявляет свои службы, среди них службу прошивки Wi-Fi; 15 — разговор с этой службой, какой драйвер ведёт до того, как тронет радио (нужны описания сообщений из ath11k: `tools/mk-wlfw.sh`, затем пересобрать ядро): прошивка принимает сообщения ath11k, файл платы и базу регионов телефона, с `wifi_cal=1` калибруется и через 7 секунд говорит «готова»; с `wifi_mission=1` прошивка получает настройку и переходит в рабочий режим; 16 — чтение нескольких регистров радио (`wifi_radio_read=1`): в рабочем режиме они отвечают, вне его чтение кончается ошибкой шины, и шаг его не делает (`adb pull` файлов `wpss.mdt`, `wpss.b02`…`wpss.b07` из `/vendor/firmware_mnt/image` в каталог `fw-wifi/`; в git они не попадают, `userland/build.sh` кладёт их в малый образ). Каждый шаг пишет в журнал, что собирается тронуть и что прочёл. `wifi_keep=1` оставляет процессор Wi-Fi и связь с ним работать, пока идёт сеанс. С `wifi_lx=1` шаг 15 ведёт сам драйвер ath11k из Linux (см. «Драйвер Wi-Fi» ниже; ядро собирается после `tools/mk-ath11k.sh`): его `qmi.c` проходит весь разговор с прошивкой до рабочего режима, со своей настройкой и списком теневых регистров, а регистры радио не трогает. С `wifi_lx=2 wifi_smmu=2` потоку радио в SMMU даётся контекст с нашими таблицами страниц (`wifi_smmu=2` в одиночку — только это, с возвратом как было), `ce.c` и `hal.c` драйвера заводят в регистрах радио кольца его «копировальных машин», `htc.c` подключает по ним службу WMI, и прошивка по WMI рассказывает о радио (одно, две антенные цепи, 2,4 и 5 ГГц) и через четверть секунды после запуска шины сообщает, что готова к командам («unified ready»); собственного адреса у прошивки нет (нули). Прерываний при этом нет: кольца опрашиваются раз в миллисекунду. С `wifi_scan=1` драйвер после этого регистрирует радио, заводит интерфейс в режиме станции и просит прошивку просканировать эфир — только слушая, в эфир ничего не уходит: 26 каналов 2,4 и 5 ГГц за четыре секунды, и в журнале появляются точки доступа вокруг с каналами и уровнем сигнала (имена и адреса чужих сетей — только в журнале запуска на вашей машине). Адрес радио у прошивки свой не записан: он лежит одной строкой в `fw-wifi/mac` (в git не попадает), и `xl run` передаёт его ядру параметром `wifi_mac`. С `wifi_join=1` драйвер подключается к сети из `fw-wifi/network` (WPA2 с паролем): находит её точку доступа, проходит аутентификацию, ассоциацию и четырёхстороннее рукопожатие, отдаёт ключи прошивке и становится тем, что стоит за `en0`; с `wifi_keep=1` он остаётся работать, пока идёт сеанс, без него — сворачивается, когда шаги кончились (`wifi_hold=S` — на S секунд позже). Остановленный без спроса (ядро, которое до этого не дошло) второй раз без перезагрузки телефона не запускается — такой запуск сбрасывал телефон, и драйвер от него сам отказывается; шаги и остальные параметры описаны в начале `bsd/dev/redwood_wifi.c` |-| `adsp=1` | аудиопроцессор телефона (ADSP: звук, а у Xiaomi ещё и зарядка), шаг 1 звука: прошивка `adsp.mdt` и `adsp.b02`…`adsp.b36` с разделов телефона (`/vendor/firmware_mnt/image`, в каталог `fw-audio/`, в git не попадает; `userland/build.sh` кладёт её в образ системы в `/fw`, откуда ядро читает её, когда корень смонтирован, — после её появления образ системы пересобирается с `SYSTEM=1`; для `adsp_step=N`, который идёт до монтирования, — в малый образ с `ADSP=1`, и только без `GL=1`: вместе они не помещаются в 64 МБ, что берёт загрузчик) кладётся в его память, RPMh просят о его шинах питания LCX и LMX, пока он не попросит о них сам, TrustZone его запускает, через 41 мс он говорит «готов», поднимается GLINK (канал IPCRTR) и QRTR поверх него: процессор — узел 5 — объявляет 12 служб и открывает свои каналы, среди них `apr_audio_svc`; на нём — APR, протокол звуковых служб: служба ядра процессора отвечает, что звуковые службы готовы, и перечисляет их (9, среди них AFE, ASM, ADM — то, через что пойдёт звук). Рядом с загрузкой системы и рядом с `wifi=1`; в конце сеанса его просят остановиться и выключают. `adsp_step=N` — то же по шагам (первые N из 11, ядро ждёт), подробности в начале `bsd/dev/redwood_adsp.c` |-| `sound=N` | с `adsp=1`, шаг 3 звука, путь к динамикам, как его строит Android (числа — из живого дерева устройств телефона, его путей микшера и его ядра): `sound=1` — ножки TDM (GPIO 97–100) отданы интерфейсу, звуковой процессор включает его тактовую частоту (3,072 МГц), группу и порт 0x9000 (PRI_TDM_RX_0) и запускает его; по ножкам видно, что тактовый сигнал и синхронизация кадров идут. `sound=2` — ещё и поток: наша память видна процессору через SMMU (поток 0x1801), путь ADM к порту, поток ASM, и в него 3 с пишется тон 1 кГц −20 дБ полной шкалы; процессор забирает его с частотой 48 кГц. Усилители выключены. `sound=3` — ещё и усилители: настраиваются из профиля «Music» конфигурации Android (`/vendor/etc/aw882xx_acf.bin` телефона в `fw-audio/`, в git не попадает, `userland/build.sh` кладёт её в `/fw` образа системы), каждая запись читается обратно, при любом расхождении или сбое оба сразу выключаются; громкость плавно поднимается до `sound_below` восьмых долей дБ ниже уровня Android (по умолчанию 240, то есть на 30 дБ тише; выше уровня Android — никогда), тон звучит 3 с, потом всё затихает, выключается и возвращается как было. `sound=4` — то, что играет iOS (`/dev/redwood-audio`), до конца сеанса: порт и поток работают всё время (без звука в них идёт тишина), усилители настраиваются один раз и выключены, а когда в записи iOS появляется не тишина, включаются и быстро (как у драйвера Android) выводятся на `sound_below`; после трёх секунд тишины снова выключаются. Звук доходит до усилителей через 160 мс после записи, усилители готовы через 65 мс. У динамика в модуле HAL есть регулятор громкости, его значение уходит в ядро (`ioctl` `REDWOOD_AUDIO_SET_VOLUME`) и задаёт уровень усилителей ниже потолка (0 — усилители не включаются), но iOS ставит его только раз, на максимум, а громкость кнопок и Пункта управления применяет к самим отсчётам (программная громкость для динамика iPhone X в таблицах VirtualAudio); при громкости 0 iOS пишет тишину, и усилители тоже не включаются. Проверка — `RC_JOBS=rc.jobs.volume`. По пути к усилителям — сторож (см. выше): `sound_gain=N` (восьмые доли дБ, 0–96), `sound_guard_as=N` (для проверки: сторож считает усилители на N ниже уровня Android и сдерживает, как сдерживал бы там). `sound_secs=S` (не больше 3 с тоном), `sound_pause=MS`. Подробности в начале `bsd/dev/redwood_sound.c` и `bsd/dev/redwood_speaker.c` |-| `haptic=N` | моторчик вибрации: Awinic AW86927 на I2C (шина QUP SE9, GPIO 36/37, адрес 0x5a; сброс — GPIO 35), линейный мотор с резонансом 175,5 Гц; всё — из живого дерева устройств Android, его журнала и регистров (`bsd/dev/redwood_haptic.c`). `haptic=1` — только читать: из загрузчика Android сброс держит чип выключенным, он не отвечает. `haptic=2` — сброс отпущен, как это делает драйвер Android, регистры прочитаны и сравнены с Android. `haptic=3` — ещё и настройка Android (каждая запись читается обратно; аналоговые регистры — за разблокировкой 0x5b) и волновые формы Android (`/vendor/firmware/aw8697_haptic.bin` телефона в `fw-haptic/`, в git не попадает; `userland/build.sh` кладёт его в `fw/` малого образа) в ОЗУ чипа, с проверкой чтением. `haptic=4` — ещё и одна короткая форма (`haptic_effect=1…10`) один раз, с усилением Android. `haptic=5` — моторчик для iOS до конца сеанса: всё, что iOS играет на своём устройстве «Actuator» (системные отклики и вибрация звонка, CoreHaptics приложений, отклики UIKit — например, меню иконки по долгому нажатию), звуковой модуль HAL отдаёт в `/dev/redwood-haptic`, и ядро играет по нему формы Android: каждую волну iOS — коротким толчком (форма 1), а длинную — повтором формы 11, пока iOS играет, но не дольше 1 с, после чего мотор столько же отдыхает; усиление — по громкости волны iOS: от трети полной шкалы и выше — усиление Android (0x80), ниже — до пяти восьмых его у самых тихих, и никогда не выше Android (волны iOS для Taptic Engine почти всегда гораздо тише полной шкалы, и в прямой пропорции большинство откликов выходило на десятой доле усиления Android — их было не почувствовать). Проверка обычных касаний: `RC_JOBS=rc.jobs.haptic2` (долгое нажатие на иконку, переключатель в Настройках). Без `haptic=5` iOS играет на «Actuator» как обычно, но в мотор ничего не идёт. Проверка: `RC_JOBS=rc.jobs.haptic`. Любая неисправность, о которой говорит чип, несовпадение при чтении или неотвеченный байт — чип снова в сброс до конца сеанса; не дольше 1 с на эффект; в конце сеанса и при панике — сброс |-| `torch=N` | фонарик: светодиодный модуль вспышки PM8350C (SPMI, ведомый 2, регистры 0xee00; задний светодиод — канал 0), значения Android: его фонарик горит на 125 мА через канал 0 (прочитано у включённого фонарика Android), шаг тока 12,5 мА, порядок записей — драйвера Xiaomi `leds-qti-flash.c` (`bsd/dev/redwood_torch.c`). `torch=1` — только читать: канал арбитра, тип модуля, регистры, температурная тревога PMIC. `torch=2` — ещё и зажечь один раз на 125 мА на `torch_secs` (по умолчанию 2 с). `torch=3` — фонарик для iOS: `/dev/redwood-torch` принимает уровень 0…1000 (тысячные тока Android, не выше 125 мА); загрузчик с `torch=N` добавляет в дерево `/product/camera` со свойством `flash` айфона (кнопка фонарика в Пункте управления), а `libredwood-media.dylib` отдаёт FigFlashlight в mediaserverd своё «устройство» вместо отсутствующей камеры (`userland/src/inject_media.c`). Пределы: записи — только в шесть регистров этого модуля, каждая читается обратно, канал арбитра перепроверяется; не дольше `torch_max_s` подряд (по умолчанию 30 с, не больше 120), потом темно, пока iOS не попросит снова; 10 раз в секунду — флаги неисправности и перегрева модуля, температурная тревога PMIC и температура батареи (не выше 45 °C; из battmgr при `adsp=1` или из `battery=1`) — что-то не так, и фонарик гаснет до конца сеанса; в конце сеанса и при панике — погашен. Проверка: `RC_JOBS=rc.jobs.torch` (`torch_test` — как программа, через AVFlashlight; потом кнопка в Пункте управления) |-| `cam=N` | камеры: все четыре — макро, широкая, фронтальная и сверхширокая (`cam_sensor=macro|wide|front|ultra`, по умолчанию — макро, при `cam=5` — широкая); макрокамера — OmniVision OV02B10 (2 Мп, камера 2 Android, «redwood_aac_ov02b10_macro»); всё — из живого дерева устройств (cam-sensor2), файла модуля камеры Android (`/vendor/lib64/camera/com.qti.sensormodule.redwood_aac_ov02b10_macro.bin`: адрес, где и как читается ID чипа, порядок включения) и драйверов ядра Android (`bsd/dev/redwood_camera.c`). Датчик — на CCI 1, ведущий 0 (GPIO 73/74, здесь I2C вручную, как у других драйверов), адрес 0x3c; сброс — GPIO 77; MCLK — mclk2 camcc на 19,2 МГц на GPIO 66 (у Android эти 19,2 МГц — от PLL2 camcc, здесь — от самого кварца, без PLL); питание — LDO6 (1,8 В, DOVDD) и LDO7 (2,8 В, AVDD) PM8008i, который на I2C последовательного движка 1 (GPIO 4/5, адреса 0x08 и 0x09) и выходит из сброса по GPIO 3 PM8350C, как его выводит Android. `cam=1` — только смотреть: тактовые частоты и домен питания камеры, ножки, сброс PM8008i и, если он не в сбросе, сам PM8008i. `cam=2` — ещё и включить датчик в порядке файла модуля (у макрокамеры: сброс низкий, 1 мс; DOVDD; AVDD, 2 мс; верхний домен питания камеры и MCLK, 4 мс; сброс высокий, 9 мс), прочитать ID чипа так, как читает Android (16-битный регистр по 16-битному адресу 0x0203; ждёт 0x002b), и выключить в обратном порядке. Пределы: напряжения — только Android (1,8 и 2,8 В у макрокамеры, 1,0 и 1,8 В у широкой), записи — только в перечисленные регистры (у каждого устройства — список, проверяется при каждой записи), каждая читается обратно; неотвеченный байт, регулятор не готов вовремя или сообщает о перегрузке по току, запись не читается обратно — всё выключается и больше ничего не пишется; в конце сеанса и при панике включённое выключается, найденное включённым остаётся включённым. `cam_after=S` — через сколько секунд после старта (по умолчанию 20). `cam=3` — путь кадра без датчика: генератор тестовой картинки CSID-lite 0 (RAW10 1600×1200, цветные полосы) → его путь RDI 0 → IFE-lite 0, чей мастер записи 0 пишет кадр в память через SMMU (поток 0x800, маска 0x4e0, в свободный контекст с нашими таблицами); для этого — голоса RPMh за CX на SVS и MX на SVS_L1 (через вторую TCS DRV 2, в конце отдаются), PLL0 camcc (1,2 ГГц), RCG и ветви камеры на частотах уровня «svs» из дерева устройств (cphy_rx, CSID, IFE-lite — 400 МГц, таймер PHY — 300, camnoc — 150, slow_ahb — 80), всё — по драйверам Android (`camcc-yupik.c`, `cam_ife_csid_lite17x.h`, `cam_vfe_lite16x.h`, `cam_vfe_bus_ver2.c`). `cam=4` — кадры самого датчика: питание и ID, как при `cam=2`, его таблицы Android — инициализация (108 записей), режим (1600×1200 RAW10, одна линия, 665,6 Мбит/с, 30 кадров/с), «пуск», таблица экспозиции; CSIPHY 2 (v1.2.1, D-PHY, линия данных 0 и линия такта; число отсчётов установления — из файла модуля для этого режима, 20, `cam_settle=N` — своё), приёмник CSID-lite 0 от PHY 2 и тот же путь RDI 0 → IFE-lite 0 → SMMU → память; несколько кадров подряд в два места, последний остаётся; потом «стоп» и всё выключается. Таблицы читаются при запуске из `fw/camera-ov02b10.tab` малого образа: его делает `tools/camsensor.py` из файла модуля датчика Android (`fw-camera/com.qti.sensormodule.redwood_aac_ov02b10_macro.bin` с телефона; ни он, ни таблицы в git не попадают). `cam_pattern=1` — тестовые полосы самого датчика вместо изображения, `cam_frames=N` — сколько кадров (по умолчанию 8), `cam_shutter=СТРОК`, `cam_gain=N` — своя экспозиция и усиление. Память с кадрами загрузчик отдаёт после сеанса: `./xl camera [префикс]` забирает её и через `tools/camraw.py` делает картинки (`префикс-N.png` — по пикселю на ячейку 2×2 Байера, серый мир, гамма 2,2; `префикс-N-raw.png` — сырые значения; порядок Байера изображения датчика — BGGR (см. ниже); его собственные полосы читаются как GBRG; `--bayer N` — другой порядок; `cam_vblank=СТРОК` — удлинить кадр для выдержки длиннее 1200 строк). `cam_sensor=wide` — то же для основной широкоугольной камеры, Samsung S5KHM2SD (108 Мп, камера 0 Android, «redwood_sunny_s5khm2sd_wide», cam-sensor0): CCI 0, ведущий 1 (GPIO 71/72), адрес 0x20, ID чипа 0xfad2 по адресу 0x0000; сброс — GPIO 21; MCLK — mclk1 camcc (19,2 МГц, GPIO 65); питание — LDO1 (1,0 В, VDIG) и LDO5 (1,8 В, VIO) PM8008i и VANA 2,8 В от постоянного регулятора, который включает GPIO 106 (всё — напряжения дерева устройств); порядок включения и выключения, ID, таблицы и режимы — из её файла модуля (`fw-camera/com.qti.sensormodule.redwood_sunny_s5khm2sd_wide.bin` → `fw/camera-s5khm2sd.tab`, формат RWCTAB02 — все режимы, порядок питания, назначение линий; инициализация — 1441 запись; шесть режимов, от 12000×9000 до 1920×1080 на 240 кадрах/с). Кадры — по трём трио C-PHY в CSIPHY 1 (трёхфазные таблицы v1.2.1 Android и строка таблицы скоростей, покрывающая скорость трио; число отсчётов установления — из файла модуля, 34), CSID-lite 0 — в режиме C-PHY. `cam_mode=N` — режим из таблицы датчика (по умолчанию — с наименьшим числом пикселей: у широкой — 1920×1080 RAW10 на 120 кадрах/с, 3,11 Гбит/с на трио). Порядок Байера широкой — GRBG (см. ниже), заголовок кадра говорит его сам. Экспозиция широкой — регистры SMIA внутри group hold 0x0104: `cam_vblank` — длина кадра 0x0340, `cam_shutter` — выдержка 0x0202, `cam_gain` — аналоговое усиление 0x0204 (32 — 1×). `cam_sensor=front` — фронтальная камера, OmniVision OV16A1Q (16 Мп, cam-sensor1, «redwood_aac_ov16a1q_front»): CCI 0, ведущий 0 (GPIO 69/70), адрес 0x10, ID чипа 0x1641 по адресу 0x300b; сброс — GPIO 20; MCLK — mclk0 (19,2 МГц, GPIO 64); питание — LDO3 (2,8 В, VANA), LDO2 (1,2 В, VDIG), LDO5 (1,8 В, VIO) PM8008i; четыре линии D-PHY в CSIPHY 0 (по умолчанию — режим 1920×1080 на 120 кадрах/с, 1,44 Гбит/с на линию). `cam_sensor=ultra` — сверхширокая, Samsung S5K4H7 (8 Мп, cam-sensor3, «redwood_sunny_s5k4h7_ultra»): CCI 1, ведущий 1 (GPIO 75/76), адрес 0x2d, ID чипа 0x487b по адресу 0; сброс — GPIO 78; MCLK — mclk3 на 24 МГц, как просит её файл модуля: от PLL2 camcc (Zonda, 1440 МГц, настройки `cam_cc_pll2_config` Android, запуск — как `clk_zonda_pll_enable()`), делитель 10 и M/N 1/6 (`ftbl_cam_cc_mclk0_clk_src`); питание — LDO4 (2,8 В, VANA), LDO5 (1,8 В, VIO) и VDIG 1,2 В от постоянного регулятора (`camera_ultra_dvdd_ldo`, от PM7325 S8), который включает GPIO 108; четыре линии D-PHY в CSIPHY 3. Собственных цветных полос (таблицы «tpgon» в файле модуля) нет ни у широкой, ни у фронтальной, ни у сверхширокой — только у макрокамеры; `cam_pattern=1` для остальных даёт их изображение (при `cam=4`) или полосы CSID (при `cam=5`). Выдержка по `cam_shutter`/`cam_gain`/`cam_vblank` при `cam=4` — только у макро и широкой; фронтальная и сверхширокая при `cam=4` снимают с выдержкой своих таблиц. Порядок Байера: макро и фронтальная — BGGR, широкая и сверхширокая — GRBG. Так его задаёт файл модуля каждого датчика: первое слово элемента режима `resolutionData` — `colorFilterArrangement` в нумерации CamX (0 BGGR, 1 GBRG, 2 GRBG, 3 RGGB; `TranslateColorFilterArrangement` в `camera.qcom.so` переводит его в нумерацию Android таблицей 3, 2, 1, 0), `tools/camsensor.py` печатает его у каждого режима. Раньше красный против синего угадывался по сырым уровням при тёплом свете — наоборот, и у всех четырёх камер красный и синий были переставлены (в Camera.app бежевое выходило голубым); зелёные (два отсчёта ячейки, что идут друг за другом в снимке комнаты) были на месте. Память под два кадра `cam=3`/`cam=4` (до 12 МБ каждый) берётся одним куском при загрузке (`cam_keep_mb`). `cam=5` — широкая камера для iOS: устройство `/dev/redwood-camera` (`bsd/sys/redwood_camera.h`); первое чтение после открытия включает датчик и запускает кадры (режим — `cam_mode`, по умолчанию 1: 4000×3000 RAW10, 30 кадров/с), последнее закрытие, секунда без чтения или любая неисправность всё выключают (после неисправности — до конца сеанса). Кадры идут по кругу в три места памяти ядра (отображённые через SMMU постранично): одно пишет IFE, одно может копировать чтение, одно готово; в каждом начале кадра адрес места для следующего кадра уходит мастеру записи, который берёт его в следующем начале кадра (на это есть целый кадр, а не промежуток между кадрами); кадр, для которого адреса не оказалось, считается переписанным. Строка RAW10 у мастера записи выровнена на 16 байт (4000 пикселей — 5008 байт, а не 5000). `read()` отдаёт заголовок (номер, время, выдержка, усиление, длина кадра и строки) и сам кадр; `write()` принимает другой датчик (`REDWOOD_CAMERA_SENSOR`: кадры останавливаются, всё выключается, следующее чтение включает другой; номер датчика — в заголовке кадра; режим по умолчанию — самый крупный 4:3 не быстрее 30 кадров/с и не больше 13 Мп: широкая 4000×3000, фронтальная 2304×1728, сверхширокая 3264×2448, макро 1600×1200; выдержка из `write()` пишется каждому его способом в его group hold: SMIA у широкой и сверхширокой — 0x0340/0x0202/0x0204, у фронтальной OV16A1Q — 0x380e/0x380f, 0x3500…0x3502, 0x3508/0x3509 (0x100 — 1×), у макро OV02B10 — страница 1: 0x14/0x15, 0x0e/0x0f, 0x22 (16 — 1×); предел усиления — свой у каждого: 64× у широкой, 16× у сверхширокой, 15,5× у фронтальной и макро), выдержку и усиление (пишутся между кадрами в group hold, с пределами: усиление от 1× до предела датчика, кадр не длиннее 0xfff0 строк) или картинку для хоста (память под неё — `cam_keep_mb`, по умолчанию 24, берётся при загрузке одним куском; `./xl camera` её забирает, `tools/camraw.py` понимает NV12 и BGRA). Проверка всех четырёх по очереди — `RC_JOBS=rc.jobs.cameras` (`camera_test cycle`); `camera_test noise` — уровень чёрного и шум каждого датчика в темноте (временной, фиксированный, строк) при усилении 1×…максимум. `camera_test raw` — кадры через `src/camera_isp.c` (замер, автоэкспозиция, баланс белого, цветовая матрица, гамма, NV12 BT.601 с округлением до ближайшего: полосы CSID `cam_pattern=2` с `noae noawb` выходят основными цветами с точностью до шага — точнее 8-битный YCbCr красный и синий не передаёт); `full` — каждый пиксель (билинейная демозаика в размер датчика, 8 потоков; на резких цветовых границах — кайма в 1–2 пикселя от демозаики и общей цветности 2×2), `ccm M` — своя цветовая матрица (девять чисел через запятую; по умолчанию единичная: настоящей нужна цветовая мишень). Устройство появляется сразу при старте ядра (раньше mediaserverd, который ищет камеры один раз, при старте); чтения ждут, пока датчик не включится. `cam_pattern=1` — цветные полосы: собственные полосы датчика, если в файле модуля есть их таблица, иначе — генератора CSID (у широкой камеры таблица пустая, поэтому — CSID, как при `cam=3`, датчик тогда не включается вовсе); `cam_pattern=2` — всегда CSID. Для iOS: `libredwood-media.dylib` в mediaserverd даёт его `BWFigCaptureDeviceVendor` наше устройство захвата (`src/camera_device.c`: FigCaptureDevice и FigCaptureStream, производные объекты CoreMedia, как у H10ISP.mediacapture; форматы названы, как «Photo» и «Video-60» задней камеры в `D22/AVCaptureSession.plist`); AVFoundation перечисляет «Back Camera» с 16 форматами и «Front Camera» (`camera_avtest`; у фронтальной — «Photo» 3088×2320 и «Video-30» 3840×2160 фронтальной камеры iPhone X, порт `FrontFacingCamera`), а сама Camera.app показывает живой предпросмотр с обеих камер телефона, ровный и без перерывов (`RC_JOBS=rc.jobs.camera`). Камеры переключает кнопка Camera.app: поток одной камеры, начинаясь, останавливает поток другой, и ядру уходит `REDWOOD_CAMERA_SENSOR`; картинка фронтальной OV16A1Q повёрнута на 180° — так датчик стоит в телефоне. Чтобы граф захвата встал: узлу стабилизации (VIS) отказываем на уровне соединения — ему нужна сессия обработки ISP айфона, которой нет (`video_stabilization_method/_type` → 0 в `inject_media.c`); потоку отвечаем на чтение `VideoOutputsColorInfo` (без ответа сессия не запускается) и принимаем `TimeMachineSuspendNow`/`ResumeNow`; кадры отдаём не своей памятью, а из пула (`BufferPool` в настройках выхода), который даёт сам граф — ширины и высоты в настройках нет, только пул; отдавать их начинаем лишь после того, как граф запущен (раньше mediaserverd падал по SIGSEGV). Ровным предпросмотр стал после трёх починок: аудиовходу сессии (`BWAudioSourceNode start:`) отвечаем «запустился», глотая только ошибку `'nope'` отсутствующего аудио-HAL — иначе сессия слала приложению `AVCaptureSessionRuntimeError` и оно пересобирало её каждые 2 с; PM8008i остаётся поднятым между включениями камеры (возвращённый в сброс, он потом отвечал ревизией, но его регуляторы молчали) и приводится в исходное состояние только при выходе ядра; обе программные шины I2C повторяют посылку, оставшуюся без ответа (PMIC — 4 попытки, датчик — до 40 мс). Переключение камер — а через него проходит каждый сеанс, потому что mediaserverd при старте сам смотрит устройство и оставляет ядру фронтальную, — спотыкалось дважды. Датчик, остановленный между кадрами, держит линию данных своей шины прижатой (его цифровое питание остаётся включённым: драйвер застал его включённым и не трогает), и шина больше не приходит в покой — теперь мастер выщёлкивает её свободной линией, пока датчик не договорит байт, и закрывает стопом (`bus_take`, как `i2c_generic_scl_recovery` в Linux). А сразу после того, как сняты питания фронтальной камеры, PM8008i несколько раз отвечает байтом из одних единиц, в котором бит 5 — «перегрузка по току»: камера выключалась до конца сеанса — теперь такой ответ переспрашивают, и перегрузку тоже (`ldo_on`, как давно делает `healthy()` на ходу). Предпросмотр рвался поперёк, полосами двух кадров: пул графа отдаёт буфер обратно, едва передав его дальше, а тот ещё в пути к экрану (приёмник предпросмотра, очередь картинок Camera.app, копия оконного сервера) — теперь отданный буфер держат ещё три кадра (`HELD` в `camera_device.c`), одного не хватало. За сеанс Camera.app с широкой камеры пришло 910 кадров подряд, ни одного переписанного. Цвета — по тюнингу самих камер: `tools/camtuning.py` делает из файла тюнинга Android (`fw-camera/com.qti.tuned.redwood_*.bin`, Chromatix) `fw/camera-<датчик>.isp` малого образа (`build.sh` — сам, когда файлы есть; ни те, ни другие в git не попадают): цветовые матрицы (cc13) и затенение объектива (lsc34) по освещённости сцены (lux index) и цветовой температуре и десять опорных источников света баланса белого (refPtV1). Баланс белого (`src/camera_isp.c`) — серый мир по почти нейтральным ячейкам кадра после коррекции затенения, спроецированный на ломаную опорных источников; точка на ней даёт цветовую температуру, а температура и освещённость — матрицу и затенение (смесь двух соседних таблиц). U30 (тёплый свет без инфракрасного, как у белого светодиода) берёт таблицы TL84: затенение цвета широкой камеры под тёплым светодиодом, снятое на белом листе, совпало с таблицей TL84 до 3 %, а с таблицей 2550–2900 K расходится на 12 % в красном. Фокус (у широкой камеры): мотор объектива DW9800 на шине CCI её датчика (адрес 0x0c), питание — L9C PM8350C, 2,8 В, через RPMh (`bsd/dev/redwood_camera.c`); ядро включает его вместе с датчиком, положение принимает через `write()` (`REDWOOD_CAMERA_FOCUS`) и пишет в заголовок кадра. Непрерывный автофокус — восхождение по резкости кадра; касание (`AFWindowParams` и `AutoFocusNow`) — проход объектива по окну касания с остановкой за пиком и доводка мелкими шагами. Ход — не дальше 768 из 1023 (у дальнего конца стабилизатор LDO5 PM8008i сообщал о перегрузке по току, и камера останавливалась) и шагами не больше 48 (большие шаги щёлкали). Зум — `ZoomFactor` потока, до 16×: вырез из кадра датчика с билинейной интерполяцией между ячейками; кадр несёт `ZoomFactor` в метаданных (без него предпросмотр замирал на первом же увеличении). Снимок по кнопке затвора: `StillImageCaptureNow` — один полный кадр датчика в выход StillImage, собранный из каждого пикселя (билинейная демозаика, билинейная демозаика сразу в размер снимка: 4032×3024 из кадра датчика 4000×3000 за 271 мс на восьми потоках, `isp_render_still_nv12`). Чтобы он дошёл до файла: кадры несут метаданные, как у H10ISP (без них устройство захвата откладывало снимок на каждом кадре навсегда); приоритет качества — не выше «speed» (`qualityPrioritization` в `inject_media.c`: иначе устройство просит четыре кадра для SIS, которые здесь не сложить); шумоподавление `BWGNRNode` (процессор айфона) пропускается; HEIC кодирует программный кодировщик HEVC из `VCPHEVC.videocodec`, который iOS сама не регистрирует (`register_hevc_encoder`; без него — −12908). Двенадцать мегапикселей он кодирует 5,0 с в первый раз и 2,8 с во второй; сколько потоков брать, кодировщик читает из своего домена настроек (`var/mobile/Library/Preferences/com.apple.VideoProcessing.plist`, `max-threads`) — сам по себе он кодирует в один поток. Снимок доходит до библиотеки Photos и открывается там во весь экран. Пустые (NULL) сэмплы беззвучного аудиоисточника дальше не передаются: на них падал узел Live Photo `BWIrisStagingNode`. Сам Live Photo здесь не снять: его записи нужны видео и звук вокруг затвора, а микрофоны телефона молчат — `rc.jobs.photo` его выключает. Проверять: `RC_JOBS=rc.jobs.camera` (снимать самому), `RC_JOBS=rc.jobs.photo` (два снимка без Live Photo) |-| `mic=N` | с `adsp=1`, основной микрофон (`bsd/dev/redwood_mic.c`, значения Android). `mic=1` — только посмотреть: звуковой процессор голосует за блоки LPASS и даёт тактовые частоты макроса TX (19,2 МГц), регистры макросов TX и VA, ведущего SoundWire, ножек LPASS и сброса кодека читаются; без всех четырёх ни один регистр не трогается. `mic=2` — ещё и кодек поднят настолько, чтобы ответить по SoundWire: сброс (GPIO83) отпущен, как это делает Android, ножки ведущего (LPASS GPIO 0, 1, 2, 14) — в активное состояние Android, тактовые частоты макроса TX, ведущий запущен, устройство TX кодека перечислено и его номер прочитан. `mic=3` — ещё и запись с микрофона `mic_secs` секунд (по умолчанию 10, не больше 600): настройка кодека, как в `wcd938x_init_reg()`, смещение микрофона 2750 мВ, ADC1 в режиме «low power», «ADC1 Volume» 6, дециматор 1 и порт codec DMA, шина SoundWire как на пути Android «handset-mic» (выше). Каждая запись читается обратно, любое расхождение или отказ звукового процессора — всё останавливается. Для проверки: `mic_input=0` (дециматор слушает ноль — точная тишина), `mic_adc=0`, `mic_test=1` (без смещения), `mic_test=2` (вход ADC1 удержан), `mic_main=1`, `mic_tap=1` с `haptic=5`. `mic=4` — микрофон для iOS: путь до кодека поднимается, только пока iOS записывает (пока открыт `/dev/redwood-mic`, кольцо на 341 мс, чтение никогда не ждёт и держится в 40 мс за звуковым процессором), а в плагине звука `RedwoodAudio.driver` есть устройство «Codec» с одним входом и источником данных `imic` («Bottom»), из которого VirtualAudio, как на iPhone, делает «iPhone Microphone» (Built-In Microphone). Приложения записывают с него: «Диктофон» пишет и рисует волну (`RC_JOBS=rc.jobs.voicememos`), `record_test` (AVAudioRecorder) — 6,00 с из 6,00, на частоте мотора 175,5 Гц с `haptic=5` уровень растёт с −68 до −29 дБFS (`RC_JOBS=rc.jobs.mic`, с `sound=4 sound_below=720` — сначала беззвучная проверка динамиков). Программа без интерфейса, записывающая в фоне, получает оранжевую точку, но не плашку записи в строке состояния, и MediaSafetyNet в mediaserverd, как на iPhone, через девять секунд такой записи останавливает mediaserverd; записи `record_test` поэтому короче и с паузой между ними. В конце и при выключении звукового процессора всё возвращается как было: кодек снова в сбросе, ножки и регистры как были |-| `battmgr=0` | с `adsp=1` батарея не спрашивается. Без него (по умолчанию) ядро раз в 10 с спрашивает у звукового процессора, который у этого телефона и ведёт батарею с зарядкой (как Android — `qti_battery_charger`, Linux — `qcom_battmgr` поверх `pmic_glink`), по каналу `PMIC_RTR_ADSP_APPS` процент заряда, зарядку, напряжение, ток, температуру, заряд в мА·ч, ёмкость, циклы и что даёт порт USB — только читает, ни пределов, ни токов не задаёт — и показывает это iOS так же, как батарея iPhone: службой `RedwoodBattery` класса `IOPMPowerSource` (`iokit/Kernel/RedwoodBattery.cpp`). Её читает powerd, и дальше всё делает сама iOS: батарея с процентом и молнией в строке состояния, «58% Charged» на экране блокировки, виджет «Батареи», Настройки → Аккумулятор (переключатель «Заряд в процентах» работает; в образе он включён); перехваты батареи в SpringBoard при этой службе уступают iOS. Сверено с Android (`dumpsys battery` и `/sys/class/power_supply/battery` сразу после): 56 % и 58 %, «заряжается», напряжение, температура, заряд, ёмкость 3677 из 5000 мА·ч, 890 циклов совпадают. Номера свойств — этой прошивки: до 9-го как у Linux, дальше на один больше; `battmgr=2` пишет в журнал все. Те же числа — в `kern.redwood.battery_*`. С `battery=1` (путь загрузчика через UEFI) не включается. Историю заряда и расход по приложениям iOS 16 берёт из журнала энергии, который ведёт aggregated (`com.apple.powerlog.plxpclogger.xpc` и другие службы; база `CurrentPowerlog.PLSQL`); раньше он был в списке не запускаемых (`userland/mkjobs.py`), и страница «Аккумулятор» вечно крутила колёсико. Теперь она открывается сразу: в первые минуты — «As you use your iPhone, battery usage will be reported here» (так iOS говорит, пока данных о расходе нет), через час — график уровня заряда за 24 часа и список приложений («Connected to Charger», пока телефон на зарядке); экран всё это время iOS считала выключенным («Screen On 0m»), отчего — ещё не разобрано. Расход в процентах по приложениям iOS считает из энергии частей системы на кристалле, которую на iPhone сообщают счётчики IOReport («Energy Model»); их здесь нет. Не показывается износ в «Состоянии аккумулятора» (powerd ждёт серийный номер батареи, а его прошивка не даёт; вместо цифры колёсико). Проверка — `RC_JOBS=rc.jobs.battery` (`battery_test`), `RC_JOBS=rc.jobs.battery2` (страницы Настроек, в конце `battery_test powerlog`: что журнал энергии собрал — таблицы, строки, время), `RC_JOBS=rc.jobs.battery3` (то же после часа работы приложений) |+| `wifi_step=N` | то же по шагам, как это выяснялось: первые N шагов, и ядро ждёт, пока они пройдут. 1–5 только читают (общая память процессоров, почтовый ящик процессора питания, RPMh, шины питания, выводы), 6–11 кладут прошивку процессора Wi-Fi в его память, заводят в общей памяти нашу половину его сигнальных битов (SMP2P) и запускают его через TrustZone, 12–14 поднимают связь с ним (GLINK, канал IPCRTR) и QRTR поверх неё: процессор Wi-Fi объявляет свои службы, среди них службу прошивки Wi-Fi; 15 — разговор с этой службой, какой драйвер ведёт до того, как тронет радио (нужны описания сообщений из ath11k: `tools/mk-wlfw.sh`, затем пересобрать ядро): прошивка принимает сообщения ath11k, файл платы и базу регионов телефона, с `wifi_cal=1` калибруется и через 7 секунд говорит «готова»; с `wifi_mission=1` прошивка получает настройку и переходит в рабочий режим; 16 — чтение нескольких регистров радио (`wifi_radio_read=1`): в рабочем режиме они отвечают, вне его чтение кончается ошибкой шины, и шаг его не делает (`adb pull` файлов `wpss.mdt`, `wpss.b02`…`wpss.b07` из `/vendor/firmware_mnt/image` в каталог `fw-wifi/`; в git они не попадают, `userland/build.sh` кладёт их в малый образ). Каждый шаг пишет в журнал, что собирается тронуть и что прочёл. `wifi_keep=1` оставляет процессор Wi-Fi и связь с ним работать, пока идёт сеанс. С `wifi_lx=1` шаг 15 ведёт сам драйвер ath11k из Linux (см. «Драйвер Wi-Fi» ниже; ядро собирается после `tools/mk-ath11k.sh`): его `qmi.c` проходит весь разговор с прошивкой до рабочего режима, со своей настройкой и списком теневых регистров, а регистры радио не трогает. С `wifi_lx=2 wifi_smmu=2` потоку радио в SMMU даётся контекст с нашими таблицами страниц (`wifi_smmu=2` в одиночку — только это, с возвратом как было), `ce.c` и `hal.c` драйвера заводят в регистрах радио кольца его «копировальных машин», `htc.c` подключает по ним службу WMI, и прошивка по WMI рассказывает о радио (одно, две антенные цепи, 2,4 и 5 ГГц) и через четверть секунды после запуска шины сообщает, что готова к командам («unified ready»); собственного адреса у прошивки нет (нули). Прерываний при этом нет: кольца опрашиваются раз в миллисекунду. С `wifi_scan=1` драйвер после этого регистрирует радио, заводит интерфейс в режиме станции и просит прошивку просканировать эфир — только слушая, в эфир ничего не уходит: 26 каналов 2,4 и 5 ГГц за четыре секунды, и в журнале появляются точки доступа вокруг с каналами и уровнем сигнала (имена и адреса чужих сетей — только в журнале запуска на вашей машине). Адрес радио у прошивки свой не записан: он лежит одной строкой в `fw-wifi/mac` (в git не попадает), и `xl run` передаёт его ядру параметром `wifi_mac`. С `wifi_join=1` драйвер подключается к сети из `fw-wifi/network` (WPA2 с паролем): находит её точку доступа, проходит аутентификацию, ассоциацию и четырёхстороннее рукопожатие, отдаёт ключи прошивке и становится тем, что стоит за `en0`; с `wifi_keep=1` он остаётся работать, пока идёт сеанс, без него — сворачивается, когда шаги кончились (`wifi_hold=S` — на S секунд позже). Остановленный без спроса (ядро, которое до этого не дошло) второй раз без перезагрузки телефона не запускается — такой запуск сбрасывал телефон, и драйвер от него сам отказывается; шаги и остальные параметры описаны в начале `bsd/dev/hakios.wifi.c` |+| `adsp=1` | аудиопроцессор телефона (ADSP: звук, а у Xiaomi ещё и зарядка), шаг 1 звука: прошивка `adsp.mdt` и `adsp.b02`…`adsp.b36` с разделов телефона (`/vendor/firmware_mnt/image`, в каталог `fw-audio/`, в git не попадает; `userland/build.sh` кладёт её в образ системы в `/fw`, откуда ядро читает её, когда корень смонтирован, — после её появления образ системы пересобирается с `SYSTEM=1`; для `adsp_step=N`, который идёт до монтирования, — в малый образ с `ADSP=1`, и только без `GL=1`: вместе они не помещаются в 64 МБ, что берёт загрузчик) кладётся в его память, RPMh просят о его шинах питания LCX и LMX, пока он не попросит о них сам, TrustZone его запускает, через 41 мс он говорит «готов», поднимается GLINK (канал IPCRTR) и QRTR поверх него: процессор — узел 5 — объявляет 12 служб и открывает свои каналы, среди них `apr_audio_svc`; на нём — APR, протокол звуковых служб: служба ядра процессора отвечает, что звуковые службы готовы, и перечисляет их (9, среди них AFE, ASM, ADM — то, через что пойдёт звук). Рядом с загрузкой системы и рядом с `wifi=1`; в конце сеанса его просят остановиться и выключают. `adsp_step=N` — то же по шагам (первые N из 11, ядро ждёт), подробности в начале `bsd/dev/hakios.adsp.c` |+| `sound=N` | с `adsp=1`, шаг 3 звука, путь к динамикам, как его строит Android (числа — из живого дерева устройств телефона, его путей микшера и его ядра): `sound=1` — ножки TDM (GPIO 97–100) отданы интерфейсу, звуковой процессор включает его тактовую частоту (3,072 МГц), группу и порт 0x9000 (PRI_TDM_RX_0) и запускает его; по ножкам видно, что тактовый сигнал и синхронизация кадров идут. `sound=2` — ещё и поток: наша память видна процессору через SMMU (поток 0x1801), путь ADM к порту, поток ASM, и в него 3 с пишется тон 1 кГц −20 дБ полной шкалы; процессор забирает его с частотой 48 кГц. Усилители выключены. `sound=3` — ещё и усилители: настраиваются из профиля «Music» конфигурации Android (`/vendor/etc/aw882xx_acf.bin` телефона в `fw-audio/`, в git не попадает, `userland/build.sh` кладёт её в `/fw` образа системы), каждая запись читается обратно, при любом расхождении или сбое оба сразу выключаются; громкость плавно поднимается до `sound_below` восьмых долей дБ ниже уровня Android (по умолчанию 240, то есть на 30 дБ тише; выше уровня Android — никогда), тон звучит 3 с, потом всё затихает, выключается и возвращается как было. `sound=4` — то, что играет iOS (`/dev/hakios-audio`), до конца сеанса: порт и поток работают всё время (без звука в них идёт тишина), усилители настраиваются один раз и выключены, а когда в записи iOS появляется не тишина, включаются и быстро (как у драйвера Android) выводятся на `sound_below`; после трёх секунд тишины снова выключаются. Звук доходит до усилителей через 160 мс после записи, усилители готовы через 65 мс. У динамика в модуле HAL есть регулятор громкости, его значение уходит в ядро (`ioctl` `HAKIOS_AUDIO_SET_VOLUME`) и задаёт уровень усилителей ниже потолка (0 — усилители не включаются), но iOS ставит его только раз, на максимум, а громкость кнопок и Пункта управления применяет к самим отсчётам (программная громкость для динамика iPhone X в таблицах VirtualAudio); при громкости 0 iOS пишет тишину, и усилители тоже не включаются. Проверка — `RC_JOBS=rc.jobs.volume`. По пути к усилителям — сторож (см. выше): `sound_gain=N` (восьмые доли дБ, 0–96), `sound_guard_as=N` (для проверки: сторож считает усилители на N ниже уровня Android и сдерживает, как сдерживал бы там). `sound_secs=S` (не больше 3 с тоном), `sound_pause=MS`. Подробности в начале `bsd/dev/hakios.sound.c` и `bsd/dev/hakios.speaker.c` |+| `haptic=N` | моторчик вибрации: Awinic AW86927 на I2C (шина QUP SE9, GPIO 36/37, адрес 0x5a; сброс — GPIO 35), линейный мотор с резонансом 175,5 Гц; всё — из живого дерева устройств Android, его журнала и регистров (`bsd/dev/hakios.haptic.c`). `haptic=1` — только читать: из загрузчика Android сброс держит чип выключенным, он не отвечает. `haptic=2` — сброс отпущен, как это делает драйвер Android, регистры прочитаны и сравнены с Android. `haptic=3` — ещё и настройка Android (каждая запись читается обратно; аналоговые регистры — за разблокировкой 0x5b) и волновые формы Android (`/vendor/firmware/aw8697_haptic.bin` телефона в `fw-haptic/`, в git не попадает; `userland/build.sh` кладёт его в `fw/` малого образа) в ОЗУ чипа, с проверкой чтением. `haptic=4` — ещё и одна короткая форма (`haptic_effect=1…10`) один раз, с усилением Android. `haptic=5` — моторчик для iOS до конца сеанса: всё, что iOS играет на своём устройстве «Actuator» (системные отклики и вибрация звонка, CoreHaptics приложений, отклики UIKit — например, меню иконки по долгому нажатию), звуковой модуль HAL отдаёт в `/dev/hakios-haptic`, и ядро играет по нему формы Android: каждую волну iOS — коротким толчком (форма 1), а длинную — повтором формы 11, пока iOS играет, но не дольше 1 с, после чего мотор столько же отдыхает; усиление — по громкости волны iOS: от трети полной шкалы и выше — усиление Android (0x80), ниже — до пяти восьмых его у самых тихих, и никогда не выше Android (волны iOS для Taptic Engine почти всегда гораздо тише полной шкалы, и в прямой пропорции большинство откликов выходило на десятой доле усиления Android — их было не почувствовать). Проверка обычных касаний: `RC_JOBS=rc.jobs.haptic2` (долгое нажатие на иконку, переключатель в Настройках). Без `haptic=5` iOS играет на «Actuator» как обычно, но в мотор ничего не идёт. Проверка: `RC_JOBS=rc.jobs.haptic`. Любая неисправность, о которой говорит чип, несовпадение при чтении или неотвеченный байт — чип снова в сброс до конца сеанса; не дольше 1 с на эффект; в конце сеанса и при панике — сброс |+| `torch=N` | фонарик: светодиодный модуль вспышки PM8350C (SPMI, ведомый 2, регистры 0xee00; задний светодиод — канал 0), значения Android: его фонарик горит на 125 мА через канал 0 (прочитано у включённого фонарика Android), шаг тока 12,5 мА, порядок записей — драйвера Xiaomi `leds-qti-flash.c` (`bsd/dev/hakios.torch.c`). `torch=1` — только читать: канал арбитра, тип модуля, регистры, температурная тревога PMIC. `torch=2` — ещё и зажечь один раз на 125 мА на `torch_secs` (по умолчанию 2 с). `torch=3` — фонарик для iOS: `/dev/hakios-torch` принимает уровень 0…1000 (тысячные тока Android, не выше 125 мА); загрузчик с `torch=N` добавляет в дерево `/product/camera` со свойством `flash` айфона (кнопка фонарика в Пункте управления), а `libhakios.media.dylib` отдаёт FigFlashlight в mediaserverd своё «устройство» вместо отсутствующей камеры (`userland/src/inject_media.c`). Пределы: записи — только в шесть регистров этого модуля, каждая читается обратно, канал арбитра перепроверяется; не дольше `torch_max_s` подряд (по умолчанию 30 с, не больше 120), потом темно, пока iOS не попросит снова; 10 раз в секунду — флаги неисправности и перегрева модуля, температурная тревога PMIC и температура батареи (не выше 45 °C; из battmgr при `adsp=1` или из `battery=1`) — что-то не так, и фонарик гаснет до конца сеанса; в конце сеанса и при панике — погашен. Проверка: `RC_JOBS=rc.jobs.torch` (`torch_test` — как программа, через AVFlashlight; потом кнопка в Пункте управления) |+| `cam=N` | камеры: все четыре — макро, широкая, фронтальная и сверхширокая (`cam_sensor=macro|wide|front|ultra`, по умолчанию — макро, при `cam=5` — широкая); макрокамера — OmniVision OV02B10 (2 Мп, камера 2 Android, «hakios_aac_ov02b10_macro»); всё — из живого дерева устройств (cam-sensor2), файла модуля камеры Android (`/vendor/lib64/camera/com.qti.sensormodule.hakios_aac_ov02b10_macro.bin`: адрес, где и как читается ID чипа, порядок включения) и драйверов ядра Android (`bsd/dev/hakios.camera.c`). Датчик — на CCI 1, ведущий 0 (GPIO 73/74, здесь I2C вручную, как у других драйверов), адрес 0x3c; сброс — GPIO 77; MCLK — mclk2 camcc на 19,2 МГц на GPIO 66 (у Android эти 19,2 МГц — от PLL2 camcc, здесь — от самого кварца, без PLL); питание — LDO6 (1,8 В, DOVDD) и LDO7 (2,8 В, AVDD) PM8008i, который на I2C последовательного движка 1 (GPIO 4/5, адреса 0x08 и 0x09) и выходит из сброса по GPIO 3 PM8350C, как его выводит Android. `cam=1` — только смотреть: тактовые частоты и домен питания камеры, ножки, сброс PM8008i и, если он не в сбросе, сам PM8008i. `cam=2` — ещё и включить датчик в порядке файла модуля (у макрокамеры: сброс низкий, 1 мс; DOVDD; AVDD, 2 мс; верхний домен питания камеры и MCLK, 4 мс; сброс высокий, 9 мс), прочитать ID чипа так, как читает Android (16-битный регистр по 16-битному адресу 0x0203; ждёт 0x002b), и выключить в обратном порядке. Пределы: напряжения — только Android (1,8 и 2,8 В у макрокамеры, 1,0 и 1,8 В у широкой), записи — только в перечисленные регистры (у каждого устройства — список, проверяется при каждой записи), каждая читается обратно; неотвеченный байт, регулятор не готов вовремя или сообщает о перегрузке по току, запись не читается обратно — всё выключается и больше ничего не пишется; в конце сеанса и при панике включённое выключается, найденное включённым остаётся включённым. `cam_after=S` — через сколько секунд после старта (по умолчанию 20). `cam=3` — путь кадра без датчика: генератор тестовой картинки CSID-lite 0 (RAW10 1600×1200, цветные полосы) → его путь RDI 0 → IFE-lite 0, чей мастер записи 0 пишет кадр в память через SMMU (поток 0x800, маска 0x4e0, в свободный контекст с нашими таблицами); для этого — голоса RPMh за CX на SVS и MX на SVS_L1 (через вторую TCS DRV 2, в конце отдаются), PLL0 camcc (1,2 ГГц), RCG и ветви камеры на частотах уровня «svs» из дерева устройств (cphy_rx, CSID, IFE-lite — 400 МГц, таймер PHY — 300, camnoc — 150, slow_ahb — 80), всё — по драйверам Android (`camcc-yupik.c`, `cam_ife_csid_lite17x.h`, `cam_vfe_lite16x.h`, `cam_vfe_bus_ver2.c`). `cam=4` — кадры самого датчика: питание и ID, как при `cam=2`, его таблицы Android — инициализация (108 записей), режим (1600×1200 RAW10, одна линия, 665,6 Мбит/с, 30 кадров/с), «пуск», таблица экспозиции; CSIPHY 2 (v1.2.1, D-PHY, линия данных 0 и линия такта; число отсчётов установления — из файла модуля для этого режима, 20, `cam_settle=N` — своё), приёмник CSID-lite 0 от PHY 2 и тот же путь RDI 0 → IFE-lite 0 → SMMU → память; несколько кадров подряд в два места, последний остаётся; потом «стоп» и всё выключается. Таблицы читаются при запуске из `fw/camera-ov02b10.tab` малого образа: его делает `tools/camsensor.py` из файла модуля датчика Android (`fw-camera/com.qti.sensormodule.hakios_aac_ov02b10_macro.bin` с телефона; ни он, ни таблицы в git не попадают). `cam_pattern=1` — тестовые полосы самого датчика вместо изображения, `cam_frames=N` — сколько кадров (по умолчанию 8), `cam_shutter=СТРОК`, `cam_gain=N` — своя экспозиция и усиление. Память с кадрами загрузчик отдаёт после сеанса: `./xl camera [префикс]` забирает её и через `tools/camraw.py` делает картинки (`префикс-N.png` — по пикселю на ячейку 2×2 Байера, серый мир, гамма 2,2; `префикс-N-raw.png` — сырые значения; порядок Байера изображения датчика — BGGR (см. ниже); его собственные полосы читаются как GBRG; `--bayer N` — другой порядок; `cam_vblank=СТРОК` — удлинить кадр для выдержки длиннее 1200 строк). `cam_sensor=wide` — то же для основной широкоугольной камеры, Samsung S5KHM2SD (108 Мп, камера 0 Android, «hakios_sunny_s5khm2sd_wide», cam-sensor0): CCI 0, ведущий 1 (GPIO 71/72), адрес 0x20, ID чипа 0xfad2 по адресу 0x0000; сброс — GPIO 21; MCLK — mclk1 camcc (19,2 МГц, GPIO 65); питание — LDO1 (1,0 В, VDIG) и LDO5 (1,8 В, VIO) PM8008i и VANA 2,8 В от постоянного регулятора, который включает GPIO 106 (всё — напряжения дерева устройств); порядок включения и выключения, ID, таблицы и режимы — из её файла модуля (`fw-camera/com.qti.sensormodule.hakios_sunny_s5khm2sd_wide.bin` → `fw/camera-s5khm2sd.tab`, формат RWCTAB02 — все режимы, порядок питания, назначение линий; инициализация — 1441 запись; шесть режимов, от 12000×9000 до 1920×1080 на 240 кадрах/с). Кадры — по трём трио C-PHY в CSIPHY 1 (трёхфазные таблицы v1.2.1 Android и строка таблицы скоростей, покрывающая скорость трио; число отсчётов установления — из файла модуля, 34), CSID-lite 0 — в режиме C-PHY. `cam_mode=N` — режим из таблицы датчика (по умолчанию — с наименьшим числом пикселей: у широкой — 1920×1080 RAW10 на 120 кадрах/с, 3,11 Гбит/с на трио). Порядок Байера широкой — GRBG (см. ниже), заголовок кадра говорит его сам. Экспозиция широкой — регистры SMIA внутри group hold 0x0104: `cam_vblank` — длина кадра 0x0340, `cam_shutter` — выдержка 0x0202, `cam_gain` — аналоговое усиление 0x0204 (32 — 1×). `cam_sensor=front` — фронтальная камера, OmniVision OV16A1Q (16 Мп, cam-sensor1, «hakios_aac_ov16a1q_front»): CCI 0, ведущий 0 (GPIO 69/70), адрес 0x10, ID чипа 0x1641 по адресу 0x300b; сброс — GPIO 20; MCLK — mclk0 (19,2 МГц, GPIO 64); питание — LDO3 (2,8 В, VANA), LDO2 (1,2 В, VDIG), LDO5 (1,8 В, VIO) PM8008i; четыре линии D-PHY в CSIPHY 0 (по умолчанию — режим 1920×1080 на 120 кадрах/с, 1,44 Гбит/с на линию). `cam_sensor=ultra` — сверхширокая, Samsung S5K4H7 (8 Мп, cam-sensor3, «hakios_sunny_s5k4h7_ultra»): CCI 1, ведущий 1 (GPIO 75/76), адрес 0x2d, ID чипа 0x487b по адресу 0; сброс — GPIO 78; MCLK — mclk3 на 24 МГц, как просит её файл модуля: от PLL2 camcc (Zonda, 1440 МГц, настройки `cam_cc_pll2_config` Android, запуск — как `clk_zonda_pll_enable()`), делитель 10 и M/N 1/6 (`ftbl_cam_cc_mclk0_clk_src`); питание — LDO4 (2,8 В, VANA), LDO5 (1,8 В, VIO) и VDIG 1,2 В от постоянного регулятора (`camera_ultra_dvdd_ldo`, от PM7325 S8), который включает GPIO 108; четыре линии D-PHY в CSIPHY 3. Собственных цветных полос (таблицы «tpgon» в файле модуля) нет ни у широкой, ни у фронтальной, ни у сверхширокой — только у макрокамеры; `cam_pattern=1` для остальных даёт их изображение (при `cam=4`) или полосы CSID (при `cam=5`). Выдержка по `cam_shutter`/`cam_gain`/`cam_vblank` при `cam=4` — только у макро и широкой; фронтальная и сверхширокая при `cam=4` снимают с выдержкой своих таблиц. Порядок Байера: макро и фронтальная — BGGR, широкая и сверхширокая — GRBG. Так его задаёт файл модуля каждого датчика: первое слово элемента режима `resolutionData` — `colorFilterArrangement` в нумерации CamX (0 BGGR, 1 GBRG, 2 GRBG, 3 RGGB; `TranslateColorFilterArrangement` в `camera.qcom.so` переводит его в нумерацию Android таблицей 3, 2, 1, 0), `tools/camsensor.py` печатает его у каждого режима. Раньше красный против синего угадывался по сырым уровням при тёплом свете — наоборот, и у всех четырёх камер красный и синий были переставлены (в Camera.app бежевое выходило голубым); зелёные (два отсчёта ячейки, что идут друг за другом в снимке комнаты) были на месте. Память под два кадра `cam=3`/`cam=4` (до 12 МБ каждый) берётся одним куском при загрузке (`cam_keep_mb`). `cam=5` — широкая камера для iOS: устройство `/dev/hakios-camera` (`bsd/sys/hakios.camera.h`); первое чтение после открытия включает датчик и запускает кадры (режим — `cam_mode`, по умолчанию 1: 4000×3000 RAW10, 30 кадров/с), последнее закрытие, секунда без чтения или любая неисправность всё выключают (после неисправности — до конца сеанса). Кадры идут по кругу в три места памяти ядра (отображённые через SMMU постранично): одно пишет IFE, одно может копировать чтение, одно готово; в каждом начале кадра адрес места для следующего кадра уходит мастеру записи, который берёт его в следующем начале кадра (на это есть целый кадр, а не промежуток между кадрами); кадр, для которого адреса не оказалось, считается переписанным. Строка RAW10 у мастера записи выровнена на 16 байт (4000 пикселей — 5008 байт, а не 5000). `read()` отдаёт заголовок (номер, время, выдержка, усиление, длина кадра и строки) и сам кадр; `write()` принимает другой датчик (`HAKIOS_CAMERA_SENSOR`: кадры останавливаются, всё выключается, следующее чтение включает другой; номер датчика — в заголовке кадра; режим по умолчанию — самый крупный 4:3 не быстрее 30 кадров/с и не больше 13 Мп: широкая 4000×3000, фронтальная 2304×1728, сверхширокая 3264×2448, макро 1600×1200; выдержка из `write()` пишется каждому его способом в его group hold: SMIA у широкой и сверхширокой — 0x0340/0x0202/0x0204, у фронтальной OV16A1Q — 0x380e/0x380f, 0x3500…0x3502, 0x3508/0x3509 (0x100 — 1×), у макро OV02B10 — страница 1: 0x14/0x15, 0x0e/0x0f, 0x22 (16 — 1×); предел усиления — свой у каждого: 64× у широкой, 16× у сверхширокой, 15,5× у фронтальной и макро), выдержку и усиление (пишутся между кадрами в group hold, с пределами: усиление от 1× до предела датчика, кадр не длиннее 0xfff0 строк) или картинку для хоста (память под неё — `cam_keep_mb`, по умолчанию 24, берётся при загрузке одним куском; `./xl camera` её забирает, `tools/camraw.py` понимает NV12 и BGRA). Проверка всех четырёх по очереди — `RC_JOBS=rc.jobs.cameras` (`camera_test cycle`); `camera_test noise` — уровень чёрного и шум каждого датчика в темноте (временной, фиксированный, строк) при усилении 1×…максимум. `camera_test raw` — кадры через `src/camera_isp.c` (замер, автоэкспозиция, баланс белого, цветовая матрица, гамма, NV12 BT.601 с округлением до ближайшего: полосы CSID `cam_pattern=2` с `noae noawb` выходят основными цветами с точностью до шага — точнее 8-битный YCbCr красный и синий не передаёт); `full` — каждый пиксель (билинейная демозаика в размер датчика, 8 потоков; на резких цветовых границах — кайма в 1–2 пикселя от демозаики и общей цветности 2×2), `ccm M` — своя цветовая матрица (девять чисел через запятую; по умолчанию единичная: настоящей нужна цветовая мишень). Устройство появляется сразу при старте ядра (раньше mediaserverd, который ищет камеры один раз, при старте); чтения ждут, пока датчик не включится. `cam_pattern=1` — цветные полосы: собственные полосы датчика, если в файле модуля есть их таблица, иначе — генератора CSID (у широкой камеры таблица пустая, поэтому — CSID, как при `cam=3`, датчик тогда не включается вовсе); `cam_pattern=2` — всегда CSID. Для iOS: `libhakios.media.dylib` в mediaserverd даёт его `BWFigCaptureDeviceVendor` наше устройство захвата (`src/camera_device.c`: FigCaptureDevice и FigCaptureStream, производные объекты CoreMedia, как у H10ISP.mediacapture; форматы названы, как «Photo» и «Video-60» задней камеры в `D22/AVCaptureSession.plist`); AVFoundation перечисляет «Back Camera» с 16 форматами и «Front Camera» (`camera_avtest`; у фронтальной — «Photo» 3088×2320 и «Video-30» 3840×2160 фронтальной камеры iPhone X, порт `FrontFacingCamera`), а сама Camera.app показывает живой предпросмотр с обеих камер телефона, ровный и без перерывов (`RC_JOBS=rc.jobs.camera`). Камеры переключает кнопка Camera.app: поток одной камеры, начинаясь, останавливает поток другой, и ядру уходит `HAKIOS_CAMERA_SENSOR`; картинка фронтальной OV16A1Q повёрнута на 180° — так датчик стоит в телефоне. Чтобы граф захвата встал: узлу стабилизации (VIS) отказываем на уровне соединения — ему нужна сессия обработки ISP айфона, которой нет (`video_stabilization_method/_type` → 0 в `inject_media.c`); потоку отвечаем на чтение `VideoOutputsColorInfo` (без ответа сессия не запускается) и принимаем `TimeMachineSuspendNow`/`ResumeNow`; кадры отдаём не своей памятью, а из пула (`BufferPool` в настройках выхода), который даёт сам граф — ширины и высоты в настройках нет, только пул; отдавать их начинаем лишь после того, как граф запущен (раньше mediaserverd падал по SIGSEGV). Ровным предпросмотр стал после трёх починок: аудиовходу сессии (`BWAudioSourceNode start:`) отвечаем «запустился», глотая только ошибку `'nope'` отсутствующего аудио-HAL — иначе сессия слала приложению `AVCaptureSessionRuntimeError` и оно пересобирало её каждые 2 с; PM8008i остаётся поднятым между включениями камеры (возвращённый в сброс, он потом отвечал ревизией, но его регуляторы молчали) и приводится в исходное состояние только при выходе ядра; обе программные шины I2C повторяют посылку, оставшуюся без ответа (PMIC — 4 попытки, датчик — до 40 мс). Переключение камер — а через него проходит каждый сеанс, потому что mediaserverd при старте сам смотрит устройство и оставляет ядру фронтальную, — спотыкалось дважды. Датчик, остановленный между кадрами, держит линию данных своей шины прижатой (его цифровое питание остаётся включённым: драйвер застал его включённым и не трогает), и шина больше не приходит в покой — теперь мастер выщёлкивает её свободной линией, пока датчик не договорит байт, и закрывает стопом (`bus_take`, как `i2c_generic_scl_recovery` в Linux). А сразу после того, как сняты питания фронтальной камеры, PM8008i несколько раз отвечает байтом из одних единиц, в котором бит 5 — «перегрузка по току»: камера выключалась до конца сеанса — теперь такой ответ переспрашивают, и перегрузку тоже (`ldo_on`, как давно делает `healthy()` на ходу). Предпросмотр рвался поперёк, полосами двух кадров: пул графа отдаёт буфер обратно, едва передав его дальше, а тот ещё в пути к экрану (приёмник предпросмотра, очередь картинок Camera.app, копия оконного сервера) — теперь отданный буфер держат ещё три кадра (`HELD` в `camera_device.c`), одного не хватало. За сеанс Camera.app с широкой камеры пришло 910 кадров подряд, ни одного переписанного. Цвета — по тюнингу самих камер: `tools/camtuning.py` делает из файла тюнинга Android (`fw-camera/com.qti.tuned.hakios_*.bin`, Chromatix) `fw/camera-<датчик>.isp` малого образа (`build.sh` — сам, когда файлы есть; ни те, ни другие в git не попадают): цветовые матрицы (cc13) и затенение объектива (lsc34) по освещённости сцены (lux index) и цветовой температуре и десять опорных источников света баланса белого (refPtV1). Баланс белого (`src/camera_isp.c`) — серый мир по почти нейтральным ячейкам кадра после коррекции затенения, спроецированный на ломаную опорных источников; точка на ней даёт цветовую температуру, а температура и освещённость — матрицу и затенение (смесь двух соседних таблиц). U30 (тёплый свет без инфракрасного, как у белого светодиода) берёт таблицы TL84: затенение цвета широкой камеры под тёплым светодиодом, снятое на белом листе, совпало с таблицей TL84 до 3 %, а с таблицей 2550–2900 K расходится на 12 % в красном. Фокус (у широкой камеры): мотор объектива DW9800 на шине CCI её датчика (адрес 0x0c), питание — L9C PM8350C, 2,8 В, через RPMh (`bsd/dev/hakios.camera.c`); ядро включает его вместе с датчиком, положение принимает через `write()` (`HAKIOS_CAMERA_FOCUS`) и пишет в заголовок кадра. Непрерывный автофокус — восхождение по резкости кадра; касание (`AFWindowParams` и `AutoFocusNow`) — проход объектива по окну касания с остановкой за пиком и доводка мелкими шагами. Ход — не дальше 768 из 1023 (у дальнего конца стабилизатор LDO5 PM8008i сообщал о перегрузке по току, и камера останавливалась) и шагами не больше 48 (большие шаги щёлкали). Зум — `ZoomFactor` потока, до 16×: вырез из кадра датчика с билинейной интерполяцией между ячейками; кадр несёт `ZoomFactor` в метаданных (без него предпросмотр замирал на первом же увеличении). Снимок по кнопке затвора: `StillImageCaptureNow` — один полный кадр датчика в выход StillImage, собранный из каждого пикселя (билинейная демозаика, билинейная демозаика сразу в размер снимка: 4032×3024 из кадра датчика 4000×3000 за 271 мс на восьми потоках, `isp_render_still_nv12`). Чтобы он дошёл до файла: кадры несут метаданные, как у H10ISP (без них устройство захвата откладывало снимок на каждом кадре навсегда); приоритет качества — не выше «speed» (`qualityPrioritization` в `inject_media.c`: иначе устройство просит четыре кадра для SIS, которые здесь не сложить); шумоподавление `BWGNRNode` (процессор айфона) пропускается; HEIC кодирует программный кодировщик HEVC из `VCPHEVC.videocodec`, который iOS сама не регистрирует (`register_hevc_encoder`; без него — −12908). Двенадцать мегапикселей он кодирует 5,0 с в первый раз и 2,8 с во второй; сколько потоков брать, кодировщик читает из своего домена настроек (`var/mobile/Library/Preferences/com.apple.VideoProcessing.plist`, `max-threads`) — сам по себе он кодирует в один поток. Снимок доходит до библиотеки Photos и открывается там во весь экран. Пустые (NULL) сэмплы беззвучного аудиоисточника дальше не передаются: на них падал узел Live Photo `BWIrisStagingNode`. Сам Live Photo здесь не снять: его записи нужны видео и звук вокруг затвора, а микрофоны телефона молчат — `rc.jobs.photo` его выключает. Проверять: `RC_JOBS=rc.jobs.camera` (снимать самому), `RC_JOBS=rc.jobs.photo` (два снимка без Live Photo) |+| `mic=N` | с `adsp=1`, основной микрофон (`bsd/dev/hakios.mic.c`, значения Android). `mic=1` — только посмотреть: звуковой процессор голосует за блоки LPASS и даёт тактовые частоты макроса TX (19,2 МГц), регистры макросов TX и VA, ведущего SoundWire, ножек LPASS и сброса кодека читаются; без всех четырёх ни один регистр не трогается. `mic=2` — ещё и кодек поднят настолько, чтобы ответить по SoundWire: сброс (GPIO83) отпущен, как это делает Android, ножки ведущего (LPASS GPIO 0, 1, 2, 14) — в активное состояние Android, тактовые частоты макроса TX, ведущий запущен, устройство TX кодека перечислено и его номер прочитан. `mic=3` — ещё и запись с микрофона `mic_secs` секунд (по умолчанию 10, не больше 600): настройка кодека, как в `wcd938x_init_reg()`, смещение микрофона 2750 мВ, ADC1 в режиме «low power», «ADC1 Volume» 6, дециматор 1 и порт codec DMA, шина SoundWire как на пути Android «handset-mic» (выше). Каждая запись читается обратно, любое расхождение или отказ звукового процессора — всё останавливается. Для проверки: `mic_input=0` (дециматор слушает ноль — точная тишина), `mic_adc=0`, `mic_test=1` (без смещения), `mic_test=2` (вход ADC1 удержан), `mic_main=1`, `mic_tap=1` с `haptic=5`. `mic=4` — микрофон для iOS: путь до кодека поднимается, только пока iOS записывает (пока открыт `/dev/hakios-mic`, кольцо на 341 мс, чтение никогда не ждёт и держится в 40 мс за звуковым процессором), а в плагине звука `HakiosAudio.driver` есть устройство «Codec» с одним входом и источником данных `imic` («Bottom»), из которого VirtualAudio, как на iPhone, делает «iPhone Microphone» (Built-In Microphone). Приложения записывают с него: «Диктофон» пишет и рисует волну (`RC_JOBS=rc.jobs.voicememos`), `record_test` (AVAudioRecorder) — 6,00 с из 6,00, на частоте мотора 175,5 Гц с `haptic=5` уровень растёт с −68 до −29 дБFS (`RC_JOBS=rc.jobs.mic`, с `sound=4 sound_below=720` — сначала беззвучная проверка динамиков). Программа без интерфейса, записывающая в фоне, получает оранжевую точку, но не плашку записи в строке состояния, и MediaSafetyNet в mediaserverd, как на iPhone, через девять секунд такой записи останавливает mediaserverd; записи `record_test` поэтому короче и с паузой между ними. В конце и при выключении звукового процессора всё возвращается как было: кодек снова в сбросе, ножки и регистры как были |+| `battmgr=0` | с `adsp=1` батарея не спрашивается. Без него (по умолчанию) ядро раз в 10 с спрашивает у звукового процессора, который у этого телефона и ведёт батарею с зарядкой (как Android — `qti_battery_charger`, Linux — `qcom_battmgr` поверх `pmic_glink`), по каналу `PMIC_RTR_ADSP_APPS` процент заряда, зарядку, напряжение, ток, температуру, заряд в мА·ч, ёмкость, циклы и что даёт порт USB — только читает, ни пределов, ни токов не задаёт — и показывает это iOS так же, как батарея iPhone: службой `HakiosBattery` класса `IOPMPowerSource` (`iokit/Kernel/hakios.battery.cpp`). Её читает powerd, и дальше всё делает сама iOS: батарея с процентом и молнией в строке состояния, «58% Charged» на экране блокировки, виджет «Батареи», Настройки → Аккумулятор (переключатель «Заряд в процентах» работает; в образе он включён); перехваты батареи в SpringBoard при этой службе уступают iOS. Сверено с Android (`dumpsys battery` и `/sys/class/power_supply/battery` сразу после): 56 % и 58 %, «заряжается», напряжение, температура, заряд, ёмкость 3677 из 5000 мА·ч, 890 циклов совпадают. Номера свойств — этой прошивки: до 9-го как у Linux, дальше на один больше; `battmgr=2` пишет в журнал все. Те же числа — в `kern.hakios.battery_*`. С `battery=1` (путь загрузчика через UEFI) не включается. Историю заряда и расход по приложениям iOS 16 берёт из журнала энергии, который ведёт aggregated (`com.apple.powerlog.plxpclogger.xpc` и другие службы; база `CurrentPowerlog.PLSQL`); раньше он был в списке не запускаемых (`userland/mkjobs.py`), и страница «Аккумулятор» вечно крутила колёсико. Теперь она открывается сразу: в первые минуты — «As you use your iPhone, battery usage will be reported here» (так iOS говорит, пока данных о расходе нет), через час — график уровня заряда за 24 часа и список приложений («Connected to Charger», пока телефон на зарядке); экран всё это время iOS считала выключенным («Screen On 0m»), отчего — ещё не разобрано. Расход в процентах по приложениям iOS считает из энергии частей системы на кристалле, которую на iPhone сообщают счётчики IOReport («Energy Model»); их здесь нет. Не показывается износ в «Состоянии аккумулятора» (powerd ждёт серийный номер батареи, а его прошивка не даёт; вместо цифры колёсико). Проверка — `RC_JOBS=rc.jobs.battery` (`battery_test`), `RC_JOBS=rc.jobs.battery2` (страницы Настроек, в конце `battery_test powerlog`: что журнал энергии собрал — таблицы, строки, время), `RC_JOBS=rc.jobs.battery3` (то же после часа работы приложений) |Несколько ядер на телефоне проверены (2, 4 и 7 ядер запускаются и чисто возвращаются в загрузчик). На одном итом же сценарии `cpus=4` (четыре больших ядра: 7, 6, 5, 4) дал 929 кадров вместо 671 на одном ядре, пики 35@@ -411,7 +411,7 @@ XL_SECS=900 XL_CMDLINE="touchscreen=1 cpufreq=1 bootcpu=7 cpus=8" ./xl run #Как это устроено:-- ядро (`bsd/dev/redwood_adreno.c`, `iokit/Kernel/RedwoodGPU.cpp`) поднимает Adreno — прошивка управляющего+- ядро (`bsd/dev/hakios.adreno.c`, `iokit/Kernel/hakios.gpu.cpp`) поднимает Adreno — прошивка управляющегопроцессора (GMU), питание 3D-ядра, zap-шейдер через TrustZone, микрокод — и отдаёт его userland'у черезклиент IOKit с подмножеством интерфейса msm DRM (буферы, отправка команд, ожидание);- `tools/mk-mesa.sh` собирает Mesa 25.0.7 под userland iOS (freedreno и программный softpipe, минута сборки);@@ -767,9 +767,9 @@ Sileo работает от него и держит там свою базу.```shCRYPTEXES=flash FLASHBOOT=1 GL=1 REST=1 QUIET=1 RC_JOBS=rc.jobs.jb \- INJECT="$(printf '%s\n' '/redwood/lib/libredwood.dylib backboardd containermanagerd containermanagerd_system' \- '/redwood/lib/libredwood-sb.dylib SpringBoard' '/redwood/lib/libredwood-media.dylib mediaserverd' \- '/redwood/lib/libredwood-app.dylib Sileo')" userland/build.sh+ INJECT="$(printf '%s\n' '/redwood/lib/libhakios.dylib backboardd containermanagerd containermanagerd_system' \+ '/redwood/lib/libhakios.sb.dylib SpringBoard' '/redwood/lib/libhakios.media.dylib mediaserverd' \+ '/redwood/lib/libhakios.app.dylib Sileo')" userland/build.sh./xl ramdisk userland/flashboot.apfsXL_CMDLINE="root_apfs=ufs_darwin ufs=2 ufs_native=1 bootcpu=7 cpus=8 cpufreq=1 touchscreen=1 gpu=1 adsp=1 sound=4 wifi=1" XL_SECS=1800 ./xl run```@@ -791,7 +791,7 @@ mobilesubstrate` (а это почти все твики, и `preferenceloader`предоставляет `mobilesubstrate` и `org.coolstar.libhooker`, — это и есть зависимость почти всех твиков;а его `libellekit` (он же `libsubstrate`, `libhooker` и `CydiaSubstrate.framework`) — тот самый движок,который и выполняет перехват.-- **Загрузчик наш** (`src/inject_tweaks.c`, `libredwood-tweaks.dylib`): внутри программы он читает+- **Загрузчик наш** (`src/inject_tweaks.c`, `libhakios.tweaks.dylib`): внутри программы он читает`/var/jb/usr/lib/TweakInject`, берёт каждый список, чей `Filter` называет эту программу (`Bundles`,`Executables`, `Classes`, `Mode`), и открывает лежащий рядом твик, записывая в журнал, что открыл. УElleKit свой такой есть (`ellekit/libinjector.dylib`), но здесь он открывается и молча не грузит ничего,@@ -822,7 +822,7 @@ mobilesubstrate` (а это почти все твики, и `preferenceloader`обслуживает ядро порта (батарея). С `ufs=2` загрузчик выкладывает общую страницу (`ufs_shared_pa=`) с таблицейразделов, запросом и ответом и буфер на 4 МБ; ядро пишет запрос — какой раздел, какие блоки, — а ядро 0читает их через `ReadBlocks` этого драйвера (`xnuloader/loader.c`, `block_poll`; ядро —-`bsd/dev/redwood_ufs.c`). Каждый раздел — `/dev/ufs_ИМЯ` (блочное) и `/dev/rufs_ИМЯ` (символьное), имя — как в+`bsd/dev/hakios.ufs.c`). Каждый раздел — `/dev/ufs_ИМЯ` (блочное) и `/dev/rufs_ИМЯ` (символьное), имя — как втаблице разделов. Нужен `bootcpu=7`: служба живёт в цикле, которым ядро 0 следит за ядром порта, а он есть,только когда ядро порта работает на другом ядре.@@ -886,7 +886,7 @@ f2fs, файлы `/sdcard`) и то, как вернуть таблицу, —в ящик. И ядро порта копировало данные из некэшируемого отображения буфера со скоростью 870 МБ/с; теперь буферотображён кэшируемым, а то, что покрывает ответ, перед копированием выбрасывается из кэша (эта сторона в буфер непишет, ядро 0 после каждого чтения его чистит). Только чтение — по-прежнему по построению.-`kern.redwood.ufs_*` (и строки `ufs: … waiting … of it in ReadBlocks … copying` до и после обхода `apfs_check=6`)+`kern.hakios.ufs_*` (и строки `ufs: … waiting … of it in ReadBlocks … copying` до и после обхода `apfs_check=6`)говорят, куда ушло время. Остаётся сам `ReadBlocks`: около 25 мкс на запрос плюс около 1 мс на МБ, произвольноечтение 4 КБ — около 110 мкс, и в полёте всегда один запрос (драйвер Qualcomm через `BlockIo`).@@ -970,7 +970,7 @@ ramfs on /private/var (ramfs, local)- `init` (`flash_root`) монтирует том на `/flash`, кладёт поверх его каталогов (bindfs) наш список заданийlaunchd, пустые `NanoLaunchDaemons` и `LaunchAngels`, `xpc` без `launchd.plist` и только наш аудиоплагин,даёт `/Applications` 32 приложения, которые iOS ставит при первом запуске, и просит ядро сделать том корнем- (`sysctl kern.redwood_switch_root`, внутри — `vfs_switch_root`);+ (`sysctl kern.hakios_switch_root`, внутри — `vfs_switch_root`);- загрузочный том из памяти уезжает в `/private/preboot` тома, а `init` монтирует на его пустые `Cryptexes/OS` и`Cryptexes/App` криптексы — контейнеры 1 и 2 раздела `darwin` (`/dev/ufs_darwin,c=1`, `c=2`) или, если образ впамяти их несёт, его (`/dev/md0,c=1`, `c=2`); туда ведут `/System/Cryptexes/OS` и `App` самого тома, как на@@ -1008,7 +1008,7 @@ UEFI, а тот на ядре 0, пока работает ядро порта,### Свой драйвер контроллера UFS: свой список запросов на время сеанса-`ufs_native=1` (`bsd/dev/redwood_ufshc.c`, со стороны загрузчика — `hc_*` в `xnuloader/loader.c`) читает флеш+`ufs_native=1` (`bsd/dev/hakios.ufshc.c`, со стороны загрузчика — `hc_*` в `xnuloader/loader.c`) читает флешсамим ядром, многими запросами сразу, а не по одному через ядро 0. Контроллер остаётся у UEFI: ни сброса, нистарта линка, ни UIC-команд, ни прерываний, агрегации, тактов, питания; список задач управления не трогается,`IS` и `UTRLCNR` только читаются.@@ -1244,7 +1244,7 @@ XL_CMDLINE="root_apfs=ufs_darwin ufs=2 ufs_native=1 bootcpu=7 cpus=8 cpufreq=1 tхолодный и тёплый, отображение поверх того, что оставил `read(2)`, снова выбросить, отображение холодное итёплое, `read(2)` поверх страниц отображения. Каждый проход — со своей суммой (`3095b9e298a4df17`,`978ed0d4dda1a256`), и все они сошлись: страницы, заполненные `read(2)`, верны для отображения, и наоборот.-`kern.redwood_memory` — строка ядра о памяти.+`kern.hakios_memory` — строка ядра о памяти.| | старый путь (`apfs_ubc_read=0`) | через кеш страниц ||---|---|---|@@ -1295,7 +1295,7 @@ APFS, и все их читает тот же драйвер APFS ядра, чтодной транзакцией; раскладка объектов (контрольная точка, менеджер пространства, карта объектов, деревья тома) — каку `mkapfs` из apfsprogs. `-z` — zlib, как Apple сжимает корень: маленький файл целиком в атрибуте`com.apple.decmpfs` (тип 3), остальные кусками по 64 КБ в ресурсной вилке (тип 4) — там, где это экономит блоки;-`--plain fw` оставляет прошивки как есть, и драйверы ядра берут их прямо из памяти диска (`bsd/dev/redwood_image.c`;+`--plain fw` оставляет прошивки как есть, и драйверы ядра берут их прямо из памяти диска (`bsd/dev/hakios.image.c`;то, что лежит не одним куском, копируется). Манифест (`sysimage/system.manifest`) даёт владельцев и права. Хеш имёнкаталога — CRC-32C по NFD, как у Apple. Жёстких ссылок нет: имя — отдельный файл.@@ -1318,7 +1318,7 @@ APFS, и все их читает тот же драйвер APFS ядра, чтvnode;- общий кеш dyld ядро принимает (кроме корня) с тома, смонтированного в `/private/preboot/Cryptexes` — там, кудаiOS прививает криптекс OS (`bsd/vm/vm_unix.c`);-- `bsd/dev/redwood_image.c`: драйверы GPU, звукового процессора и Wi-Fi находят свои прошивки в образах APFS дисков+- `bsd/dev/hakios.image.c`: драйверы GPU, звукового процессора и Wi-Fi находят свои прошивки в образах APFS дисковв памяти.**Что проверено на телефоне** (`gpu=1 adsp=1`, образ `GL=1`; с корнем на флеше `root_apfs=ufs_darwin ufs=2@@ -1476,10 +1476,10 @@ inode встретился впервые. Не сохраняются сокелегли в то, что было выравнивающим зазором. Телефон один на несколько рабочих копий, и ядро, собранное дозаписи, читает через загрузчик, собранный после неё, и наоборот.-**Сохраняется само, просить не надо.** Задание `com.redwood.varstore` (`var_store watch`) остаётся на весь-прогон и объявляется ядру (`kern.redwood.var_save`). Когда прогон кончается по-хорошему — вышло время+**Сохраняется само, просить не надо.** Задание `com.hakios.varstore` (`var_store watch`) остаётся на весь+прогон и объявляется ядру (`kern.hakios.var_save`). Когда прогон кончается по-хорошему — вышло время`loader_return_after` или хозяин сказал `./xl stop`, — ядро в том самом потоке, который сейчас вернёт управление-загрузчику, просит том и ждёт ответа (`bsd/dev/redwood_ufs.c`, `redwood_var_save_on_return`), и только потом+загрузчику, просит том и ждёт ответа (`bsd/dev/hakios.ufs.c`, `hakios_var_save_on_return`), и только потомотдаёт GPU, процессоры звука и Wi-Fi и уходит. Чего при этом не должно случиться и как это не случается:- **Ждать некого.** Если никто не объявился, ядро не просит и не ждёт ни миллисекунды: прогон без хранителя@@ -1492,7 +1492,7 @@ inode встретился впервые. Не сохраняются сокесторожевой таймер ещё минуту после срока прогона, а хозяин ждёт ответа сто секунд после него, так что этисекунды с запасом внутри обоих. Упаковка и запись 120–160 МБ занимают 6–7 с.- **Два сохранения разом.** Запись в хранилище отказывается (`EPERM`), если пишущий не держит заявку- (`kern.redwood.var_busy`), а заявку держит один процесс; заявку, оставленную умершим процессом, следующий+ (`kern.hakios.var_busy`), а заявку держит один процесс; заявку, оставленную умершим процессом, следующийзабирает себе. Да и столкнувшись, двое испортили бы только тот слот, в который пишут, — а это никогда не тот, вкотором лежит последний хороший архив.- **Сохранение, прерванное на середине.** Заголовок слота сначала обнуляется, архив пишется, заголовок —@@ -1567,7 +1567,7 @@ XL_CMDLINE="root_apfs=ufs_darwin ufs=2 ufs_native=1 ufs_write=1 var_store=1 boot|---|---|---|---|| хранилище в начале загрузки | `no store yet` | слот 0, поколение 1, 15 580 записей, 157 749 256 байт | слот 1, поколение 2, 15 384 записи, 134 996 904 байта || распаковано | — | 6490 каталогов, 2401 файл (155 150 360 байт), 0 ссылок | 6419 каталогов, 2347 файлов (132 432 052 байта), 2 ссылки, ничего не потеряно |-| `/private/var/redwood-stamp` в начале | нет | `written by run of 1792410683` — метка прогона 1 | метки прогонов **1 и 2** (`1792410683`, `1792410962`) |+| `/private/var/hakios-stamp` в начале | нет | `written by run of 1792410683` — метка прогона 1 | метки прогонов **1 и 2** (`1792410683`, `1792410962`) || SpringBoard в начале | нет | `IconState.plist` 3630 байт, время 1792410708 — прогона 1 | `SBLastRestoreIdentifier` время **1792410692** и `TodayViewArchive.plist` **1792410708** — прогона 1, через два холодных сброса; `IconState.plist` — прогона 2 || сохранено в конце | поколение 1 в слот 0 | поколение 2 в слот 1 | поколение 3 в слот 0 || записей во флеш (со стороны загрузчика) | 40, 157 761 536 байт | 35, 135 008 256 байт | 31, 120 610 816 байт |@@ -1580,7 +1580,7 @@ XL_CMDLINE="root_apfs=ufs_darwin ufs=2 ufs_native=1 ufs_write=1 var_store=1 boot(`IconState.plist`), `TodayViewArchive.plist`, `SBLastRestoreIdentifier`, контейнеры приложений.**Что показали ещё два прогона**, уже с сохранением само собой: в сценарии (`rc.jobs.persist`) не осталось ни-одной команды, которая сохраняет, — том пишет задание `com.redwood.varstore`, когда ядро говорит, что прогон+одной команды, которая сохраняет, — том пишет задание `com.hakios.varstore`, когда ядро говорит, что прогонкончается. Между прогонами — холодный сброс, доведённый до Android и обратно (в журнале прогона видно, кактелефон пропал и поднялся в Android, после чего загрузчик поднят заново и 21 МБ загрузочного тома залиты снова).@@ -1589,7 +1589,7 @@ XL_CMDLINE="root_apfs=ufs_darwin ufs=2 ufs_native=1 ufs_write=1 var_store=1 boot| хранилище в начале загрузки | слот 0, поколение 3, 14 503 записи, 120 601 040 байт | слот 1, **поколение 4** — то, что прогон 4 записал сам, хотя его об этом не просили || распаковано | 6061 каталог, 2182 файла (118 295 215 байт), 2 ссылки | 6304 каталога, 2311 файлов (131 977 440 байт), 2 ссылки || не поместилось | **ничего** | **ничего** |-| `/private/var/redwood-stamp` в начале | метки прогонов 1–3 | метки прогонов **1–4**, последняя за 1519 с и один холодный сброс до начала этого |+| `/private/var/hakios-stamp` в начале | метки прогонов 1–3 | метки прогонов **1–4**, последняя за 1519 с и один холодный сброс до начала этого || `SBLastRestoreIdentifier` SpringBoard | время 1792410692 — прогона 1 | время **1792410692** — прогона 1, через пять загрузок и четыре холодных сброса || сценарий сохранял | нет | нет || ядро попросило том | на 224,9 с | на 225,0 с |@@ -1677,7 +1677,7 @@ device`, около 2,6 МБ), хотя место было: `vol_ls fs /private`ENOSPC` — страницы остаются грязными, и их предложат ещё раз. Ссылки в прогоне 2 не восстанавливались вовсе: имяуже было создано шаблоном, и `symlink` отказывал, — теперь имя шаблона уступает хранилищу.-`var_store=1` — `init` распаковывает хранилище при загрузке, а задание `com.redwood.varstore` сохраняет его в+`var_store=1` — `init` распаковывает хранилище при загрузке, а задание `com.hakios.varstore` сохраняет его вконце прогона; `ufs_write=1` — ядру и загрузчику разрешено писать, без него сохранить не получится, араспаковать — получится. Сам `var_store`: `save` — упаковать `/private/var` сейчас, `watch [N]` — остаться исохранять само, `load` — распаковать, `show` — что лежит в обоих слотах, `erase` — забыть оба слота,@@ -1835,7 +1835,7 @@ x-set-apple-store-front header» и адрес `https://bag.itunes.apple.com/bag842, 200 и 107 байт), а `trustd`, `geod`, `maild`, `gamed`, `cloudd`, `StocksWidget` и `nsurlsessiond`открывают TLS к Apple и Akamai (17.248.214.x, 17.253.39.x, 2.16.56.93, 23.11.40.157, 95.100.176.233).Строка «net_test: en0: flags 0x8802» читалась через 0,1 с после начала пользовательского пространства, до-того как configd настроил интерфейс: с `wifi=1` это делает само задание `com.redwood.wifi`, так что+того как configd настроил интерфейс: с `wifi=1` это делает само задание `com.hakios.wifi`, так чтопросить DHCP второй раз сценарию не нужно — довольно `waitaddr en0 60`.Измерение переделали по каналу, который теряет меньше: шаги сценария ждут, пока утихнет начальный поток@@ -2070,10 +2070,10 @@ appstored: task 0 COMPLETED status 200, 43713 байт, application/json, bag.ответ получен — и он снимает сразу три подозрения:```-redwood: AppStore: JETPACK processStream: in-redwood: AppStore: JETPACK processStream: out, a result, error (none)-redwood: AppStore: KEY brotli entered 0 returned 0, processStream entered 2 returned 2-redwood: appstored: KEY brotli entered 0 returned 0, processStream entered 0 returned 0+hakios: AppStore: JETPACK processStream: in+hakios: AppStore: JETPACK processStream: out, a result, error (none)+hakios: AppStore: KEY brotli entered 0 returned 0, processStream entered 2 returned 2+hakios: appstored: KEY brotli entered 0 returned 0, processStream entered 0 returned 0```Распаковывает и разбирает пакет не JetEngine, а образ **JetPack**:@@ -2259,7 +2259,7 @@ SpringBoard спрашивает десять тысяч раз за все сенесущие) и через 50 мс SIGSEGV, либо «Unable to communicate with AppleBaseband driver»(`com.apple.driver.AppleBasebandPCI`) и SIGABRT. 18 аварий за семиминутный сеанс противнуля у того же образа без него; загрузку это не задерживает (118 процессов против 119), но процесс, умирающий-каждые 15 секунд, того не стоит. Заглушить первый драйвер — работа того же рода, что `RedwoodBattery`; второй —+каждые 15 секунд, того не стоит. Заглушить первый драйвер — работа того же рода, что `HakiosBattery`; второй —это модем Apple на PCIe, а модем этого телефона сидит на самом кристалле и говорит по QMI с подсистемойQualcomm, так что за драйвером нет и того, к чему он ведёт.Текущий план подключения MPSS и проверка аппаратных ресурсов: [docs/cellular.md](docs/cellular.md).@@ -2308,7 +2308,7 @@ Qualcomm, так что за драйвером нет и того, к чему`GL=1 REST=1 userland/build.sh` — образ, в котором оконный сервер рисует через OpenGL ES, а не программнымрастеризатором CoreAnimation: за `EAGLContext` встаёт Mesa (прослойка — `userland/src/eagl.c`). На телефоне спараметром ядра `gpu=1` рисует сам Adreno: драйвер freedreno из Mesa говорит с ядром-(`iokit/Kernel/RedwoodGPU.cpp`) на языке линуксового msm DRM. Без него и в QEMU библиотека не загружается, и+(`iokit/Kernel/hakios.gpu.cpp`) на языке линуксового msm DRM. Без него и в QEMU библиотека не загружается, иобраз ведёт себя как собранный без `GL=1` (`gl=1` — всё же загрузить, с программным softpipe: для отладки прослойки).Mesa в репозитории нет: `tools/mk-mesa.sh` один раз скачивает и собирает её (нужны meson, ninja, bison, flex).`GL=test RC_JOBS=rc.jobs.gltest` — только библиотека и `gl_test`: один треугольник на экран.@@ -2317,8 +2317,8 @@ Mesa в репозитории нет: `tools/mk-mesa.sh` один раз ска### UEFI для телефона-См. `devices/redwood/uefi/README.md` (порт Project Silicium на redwood). Для запуска пересобирать не нужно: `mkxnuimg.py` берёт-готовое из `devices/redwood/prebuilt`.+См. `devices/poco-x5-pro/uefi/README.md` (порт Project Silicium на redwood). Для запуска пересобирать не нужно: `mkxnuimg.py` берёт+готовое из `devices/poco-x5-pro/prebuilt`.## Как это устроено@@ -2332,15 +2332,15 @@ fastboot boot ──► UEFI (Mu-Silicium, redwood) ──► xnuloader (EFI-п├─ APFS (образы в ОЗУ, том iOS на флеше), ramfs (/private/var, /tmp)├─ minicrypto вместо corecrypto, заглушки AMFI и Sandbox (MAC-политики)├─ замены драйверов: IOSurface, IOMobileFramebuffer, AppleKeyStore, IONetworkStack- ├─ ввод: /dev/redwood-touch ◄─ Goodix GT9916 (телефон) / virtio-input (QEMU)- └─ звук: /dev/redwood-audio ─► virtio-sound (QEMU) / запись в память (rec_sound)+ ├─ ввод: /dev/hakios-touch ◄─ Goodix GT9916 (телефон) / virtio-input (QEMU)+ └─ звук: /dev/hakios-audio ─► virtio-sound (QEMU) / запись в память (rec_sound)▼launchd iOS 16.5 → logd, notifyd, cfprefsd, runningboardd, backboardd, SpringBoard, приложения├─ в backboardd, SpringBoard и mediaserverd внедряются наши библиотеки│ (libredwood*.dylib): виртуальные HID-службы (сенсор, кнопки) и подмена│ нескольких ObjC-методов- └─ mediaserverd получает наше устройство вывода (RedwoodAudio.driver — подключаемый- модуль CoreAudio), которое пишет смикшированный звук в /dev/redwood-audio+ └─ mediaserverd получает наше устройство вывода (HakiosAudio.driver — подключаемый+ модуль CoreAudio), которое пишет смикшированный звук в /dev/hakios-audio```Программы и библиотеки iOS (исполняемые файлы, фреймворки, общий кэш dyld) не изменены ни в одном байте: всё, чего@@ -2494,7 +2494,7 @@ fastboot boot ──► UEFI (Mu-Silicium, redwood) ──► xnuloader (EFI-пзаголовки FreeBSD и компилирует файлы драйвера без единой правки, как код ядра FreeBSD. Чего заголовкам нехватает и всё, что под ними (блокировки, сон, очереди работ, таймеры, память для радио, буферы, файлы прошивки,шина радио), — наше, в `wifi/lx/`, и стоит на двух с небольшим десятках вызовов, которые даёт ядро-(`bsd/sys/redwood_lx.h`, `bsd/dev/redwood_lx.c`). Получается один объектный файл+(`bsd/sys/hakios.lx.h`, `bsd/dev/hakios.lx.c`). Получается один объектный файл`xnu-deps/build/ath11k/out/ath11k.o` с единственным видимым именем; `xnu-build.sh` линкует его в ядро, если онесть, а без него ядро собирается как раньше и на `wifi_lx` отвечает, что драйвера в нём нет.@@ -2505,9 +2505,9 @@ mac80211 из Linux стоит наша станция (`wifi/lx/src/lx_80211.c`интерфейс, сканирование и подключение к сети WPA2 с паролем; арифметика рукопожатия — отдельно, в`wifi/lx/src/lx_wpa.c`, и проверяется на компьютере (`tools/wpa-test/run.sh`: примеры из стандартов и целыерукопожатия против точки доступа, написанной на Python). Кому нужна сеть, тот просит станцию не напрямую, а-через ядро (`bsd/sys/redwood_sta.h`, `bsd/dev/redwood_sta.c`: один поток, по одному вызову за раз, и список+через ядро (`bsd/sys/hakios.sta.h`, `bsd/dev/hakios.sta.c`: один поток, по одному вызову за раз, и списоктого, что услышало последнее сканирование): так при старте подключается сеть из файла, и так же ядро отвечает-службе Wi-Fi iOS на запросы Apple80211 (`bsd/dev/redwood_apple80211.c`). Прерываний радио драйвер не получает: кольца+службе Wi-Fi iOS на запросы Apple80211 (`bsd/dev/hakios.apple80211.c`). Прерываний радио драйвер не получает: кольцаопрашивает поток, раз в миллисекунду и сразу снова, пока есть работа. Что это делает на телефоне, сказано встроке `wifi=N` таблицы параметров ядра.@@ -2592,8 +2592,8 @@ inode с `INODE_IS_SPARSE`), поэтому чтение дырок провер| | ||---|---|-| `bsd/dev/redwood_virtio_blk.c` | virtio-blk по шине virtio-mmio машины `virt` QEMU, в том же виде, что соседние драйверы ввода, сети и звука. `/dev/rvblk0`, только чтение, параметр ядра `virtio_blk=1`. По одному запросу за раз, опросом, без прерываний: запросы — это промахи кеша блоков самого APFS, а хост отвечает на них из своего страничного кеша |-| `bsd/dev/redwood_apfs_check.c` | монтирует `/dev/rvblk0` и обходит том через VFS (`vnode_lookup`, `vnode_getattr`, `VNOP_READDIR`, `VNOP_READLINK`, `vn_rdwr`), печатая на запись ту же строку, что `apfs-tool census` и `verify.py clines`. Параметры ядра: `apfs_check=1` — только итоги, `=2` — каждая строка, `apfs_subtree=/путь` — часть тома. 318 098 строк — это 47 МБ через последовательный порт, поэтому по умолчанию каждая строка хешируется отдельно, а хеши складываются: сложению всё равно, в каком порядке обход видел записи. `verify.py sum` считает то же самое на хосте |+| `bsd/dev/hakios.virtio_blk.c` | virtio-blk по шине virtio-mmio машины `virt` QEMU, в том же виде, что соседние драйверы ввода, сети и звука. `/dev/rvblk0`, только чтение, параметр ядра `virtio_blk=1`. По одному запросу за раз, опросом, без прерываний: запросы — это промахи кеша блоков самого APFS, а хост отвечает на них из своего страничного кеша |+| `bsd/dev/hakios.apfs_check.c` | монтирует `/dev/rvblk0` и обходит том через VFS (`vnode_lookup`, `vnode_getattr`, `VNOP_READDIR`, `VNOP_READLINK`, `vn_rdwr`), печатая на запись ту же строку, что `apfs-tool census` и `verify.py clines`. Параметры ядра: `apfs_check=1` — только итоги, `=2` — каждая строка, `apfs_subtree=/путь` — часть тома. 318 098 строк — это 47 МБ через последовательный порт, поэтому по умолчанию каждая строка хешируется отдельно, а хеши складываются: сложению всё равно, в каком порядке обход видел записи. `verify.py sum` считает то же самое на хосте |```shtools/apfs/dmg.py extract sysimage/rootfs.dmg /куда/rootfs.apfs --apfs@@ -2798,7 +2798,7 @@ python3 tools/apfs/verify.py sum /куда/ramdisk.apfs # с чем сраЦеликом том на телефон не помещается, но обход читает не все его блоки, а те, что читает, можно сложить отдельно.`tools/apfs/mksparse.py` проходит нужную часть тома читалкой на компьютере, записывает каждый тронутый блок и-выкладывает их вместе с таблицей «какой блок контейнера где»; `bsd/dev/redwood_sparse.c` (`/dev/rsp0`, параметр+выкладывает их вместе с таблицей «какой блок контейнера где»; `bsd/dev/hakios.sparse.c` (`/dev/rsp0`, параметр`apfs_sparse=<смещение>`) отдаёт их по их настоящим адресам, а драйвер APFS разницы не видит. Образ ехал в хвостерезидентного диска в памяти, за образом packfs, который был корнем (packfs читал ровно столько, сколько сказано вего суперблоке); `apfs_check=6` монтирует `/dev/rsp0` на каталог корня (`apfs_mnt=/lib`) и обходит его. Блок, которого@@ -3011,7 +3011,7 @@ APFS никогда не перезаписывает уже опубликов- блок вне контейнера или внутри блока 0, колец контрольной точки, карты объектов контейнера — граница, котораядержит даже если дерево прочитано неверно.-Границ, таким образом, три, как у записей на флеш (`bsd/dev/redwood_ufs.c`): экстенты файла говорят, какие блоки+Границ, таким образом, три, как у записей на флеш (`bsd/dev/hakios.ufs.c`): экстенты файла говорят, какие блокиего содержимое; дерево ссылок на экстенты говорит, что эти же блоки принадлежат этому потоку и больше никому;простая проверка диапазона отказывает всему вблизи собственных структур контейнера, что бы деревья ни сказали. Ипотом — чтение обратно.@@ -3096,7 +3096,7 @@ APFS никогда не перезаписывает уже опубликовВсё перечисленное — `apfs_write.c`, собранный программой для компьютера. Что так не проверить — обвязку ядра:устройство, открытое на запись, `buf_t` и `VNOP_STRATEGY` на каждый блок, `apfs_lib` под ядерным-распределителем памяти. Для этого есть `apfs_check=7` (`bsd/dev/redwood_apfs_check.c`): он ничего не монтирует и+распределителем памяти. Для этого есть `apfs_check=7` (`bsd/dev/hakios.apfs_check.c`): он ничего не монтирует иничего не обходит — заменяет байты в файле контейнера на `apfs_dev`, закрывает контейнер, открывает его заново снуля и читает файл обратно, так что сказанное относится к устройству, а не к кешу блоков `apfs_lib`; и хеш, скоторым он сравнивает, считается из файла, каким тот был **до** записи, а не из результата.@@ -3123,7 +3123,7 @@ apfs-write: read back from a container opened again: 65536 bytes, hash 1b1417058Куда это может дотянуться — и есть главное. Устройство открывается на запись только здесь: любое монтированиеэтого драйвера оставляет `dev.write` = NULL, а без него `apfs_write_in_place` отказывает во всём. И открыть можнотолько блочное устройство — флеш телефона под этим ядром не блочное (он читается через почтовый ящик загрузчика, а-там, где в него пишут, — через свой символьный с собственными границами, `bsd/dev/redwood_ufs.c` ветки `persist`),+там, где в него пишут, — через свой символьный с собственными границами, `bsd/dev/hakios.ufs.c` ветки `persist`),так что отсюда до флеша не добраться. И в QEMU, и на телефоне блочные устройства — только диски в памяти. Большетого: `md0` — смонтированный корень, и сама система не даёт открыть его на запись (`EBUSY`), так что подсмонтированным томом запись не пройдёт даже случайно; проба пишет в `md1`, который не смонтирован. Проверено и то,@@ -3134,7 +3134,7 @@ apfs-write: read back from a container opened again: 65536 bytes, hash 1b1417058Данные iOS переживают перезагрузку так: дерево `/private/var` пакуется в архив и пишется во флеш по числу,записанному в комментарии, — два слота по 2 ГиБ с байта 8 589 934 592 раздела `darwin`, прямо на символьное-устройство (ветка `persist`: `userland/src/var_store.c`, `bsd/dev/redwood_ufs.c`). Запись там надёжная: её+устройство (ветка `persist`: `userland/src/var_store.c`, `bsd/dev/hakios.ufs.c`). Запись там надёжная: еёограничивает ядро, ограничивает загрузчик, и загрузчик читает её обратно прежде чем ответить. Слабое место незапись, а адресация: на самом носителе ничто не говорит, что эти байты — хранилище, какой длины слот и что их незаймёт что-то другое. Говорит только константа, в двух местах, которые обязаны совпадать.@@ -3173,8 +3173,8 @@ apfs-write: read back from a container opened again: 65536 bytes, hash 1b1417058компьютере; выход из тупика в том, что он делается однажды.```sh-tools/apfs/mkstore.py -o store.apfs --slot-bytes 256M # том RedwoodStore, два слота-tools/apfs/check-image.sh store.apfs RedwoodStore=КАТАЛОГ # apfsck + чтение ядерной библиотекой+tools/apfs/mkstore.py -o store.apfs --slot-bytes 256M # том HakiosStore, два слота+tools/apfs/check-image.sh store.apfs HakiosStore=КАТАЛОГ # apfsck + чтение ядерной библиотекойapfs-work/apfs-tool store info store.apfs # что о нём скажет драйверapfs-work/apfs-tool store save store.apfs архив 42 # сохранить; load — прочитать свежий```@@ -3192,7 +3192,7 @@ apfs-work/apfs-tool store save store.apfs архив 42 # сохрани- пять сохранений по очереди: оба читателя сходятся каждый раз, `apfsck` чист после каждого, слоты чередуются0 1 0 1 0, и из всего тома меняются только блоки файлов слотов;- отказы, каждый собран таким, а не испорчен до такого, чтобы причина в отчёте была причиной в проверке: том не с- именем `RedwoodStore`, слоты разной длины, хранилище с одним слотом, слот короче заголовка, слот, который том+ именем `HakiosStore`, слоты разной длины, хранилище с одним слотом, слот короче заголовка, слот, который томсохранил сжатым (здесь сообщение называет ошибку: собрать том с `-z` — самый вероятный способ это испортить), исодержимое длиннее, чем слот вместит, — после которого слот, куда оно шло, по-прежнему не держит ничегохорошего;@@ -3206,7 +3206,7 @@ apfs-work/apfs-tool store save store.apfs архив 42 # сохранираспределителем памяти. В QEMU, на томе с слотами по 1 МБ:```-apfs-store: RedwoodStore: 2 slots of 1048576 bytes, 1044480 of payload; the newest good slot is -1 (none)+apfs-store: HakiosStore: 2 slots of 1048576 bytes, 1044480 of payload; the newest good slot is -1 (none)apfs-store: 40000 bytes into slot 0 as generation 1: saved; 12 blocksapfs-store: read back from a container opened again: slot 0, generation 1, 40000 bytes, note 7,sum 660557ccb6cba125; the payload is the one that was saved@@ -3255,5 +3255,5 @@ iOS, которого она ждёт, — это уже другое: создуведомления об авторских правах (они в заголовках файлов ath11k и в `COPYRIGHT` из архива FreeBSD);- `xnu-deps/build/lzbitmap/libzbitmap.*` — libzbitmap (Corellium, GPL-2.0+ OR MIT);`xnu-deps/hostinc/mach-o/{loader,nlist,fat}.h` — заголовки из XNU (APSL 2.0).-- `devices/redwood/uefi/files/Binaries/redwood` и `devices/redwood/prebuilt/SILICIUM_UEFI.fd` содержат драйверы UEFI из прошивки Xiaomi- (так же, как их распространяет Project Silicium для других устройств); `devices/redwood/prebuilt/mkbootimg.py` — AOSP, Apache-2.0.+- `devices/poco-x5-pro/uefi/files/Binaries/redwood` и `devices/poco-x5-pro/prebuilt/SILICIUM_UEFI.fd` содержат драйверы UEFI из прошивки Xiaomi+ (так же, как их распространяет Project Silicium для других устройств); `devices/poco-x5-pro/prebuilt/mkbootimg.py` — AOSP, Apache-2.0.diff --git a/mkxnuimg.py b/mkxnuimg.pyindex e99a324..719b1e2 100755--- a/mkxnuimg.py+++ b/mkxnuimg.py@@ -7,8 +7,8 @@ into an Android boot image for `fastboot boot`.The boot shim copies the FD to its base and the payload to PAYLOAD_BASE.-The UEFI pieces are taken from a Mu-Silicium tree built here (Mu-Silicium/, see devices/redwood/uefi/README.md)-or, when there is none, from devices/redwood/prebuilt/.+The UEFI pieces are taken from a Mu-Silicium tree built here (Mu-Silicium/, see devices/poco-x5-pro/uefi/README.md)+or, when there is none, from devices/poco-x5-pro/prebuilt/.usage: mkxnuimg.py [-p payload.bin] [-o out.img]"""@@ -40,7 +40,7 @@ if os.path.isfile(fd_path):'mkbootimg': os.path.join(MU, 'Resources/Scripts/mkbootimg.py')}else:parts = {'shim': os.path.join(PREBUILT, 'BootShim.bin'), 'fd': os.path.join(PREBUILT, 'SILICIUM_UEFI.fd'),- 'dtb': os.path.join(PREBUILT, 'redwood.dtb'), 'ramdisk': os.path.join(PREBUILT, 'ramdisk'),+ 'dtb': os.path.join(PREBUILT, 'device-tree.dtb'), 'ramdisk': os.path.join(PREBUILT, 'ramdisk'),'mkbootimg': os.path.join(PREBUILT, 'mkbootimg.py')}shim = open(parts['shim'], 'rb').read()fd = open(parts['fd'], 'rb').read()diff --git a/prebuilt/SHA256SUMS b/prebuilt/SHA256SUMSindex d9cc524..c353c44 100644--- a/prebuilt/SHA256SUMS+++ b/prebuilt/SHA256SUMS@@ -7,21 +7,21 @@ cab0c58744bd9e4490ef4b9aabfe25758838a35279d1384d382e60e8653c91c3 prebuilt/userldb564073effc31e7ab1679a7ffe0631ec22c3030ad347c927028f3e53c8583c3 prebuilt/userland/helloa8baa9ab38333280369b0824aafaf92c7aa6a85851ff0b2551a4c711dbe59cfd prebuilt/userland/hello_dyn0e2e63e737049a6b17e47f0edd55a8ef5bfe2d9881f4d0966bd2fd5b0c943185 prebuilt/userland/init-5ebffd6d90a36ab8ecf4d9f48cf1b2f1dbd5b33661546d913d83147c9c86710d prebuilt/userland/libredwood-app.dylib-e527b3425eeb56ab4e10ff503776758e89904af336984892fde46d5f0dc4f73d prebuilt/userland/libredwood.dylib-8df90a3426f2802cc063db2ad3548d85237140a678699c742bc1ba31552cd0d9 prebuilt/userland/libredwood-media.dylib-120b8da2663d1e405a7117d1776363ff1faf090bf9b9f8fe262153de587bf26a prebuilt/userland/libredwood-sb.dylib-1ad5f448b3790a42a246ec97d2db19ab79c08650eba7357f83b66e694f4427ef prebuilt/userland/libredwood-tweaks.dylib+5ebffd6d90a36ab8ecf4d9f48cf1b2f1dbd5b33661546d913d83147c9c86710d prebuilt/userland/libhakios.app.dylib+e527b3425eeb56ab4e10ff503776758e89904af336984892fde46d5f0dc4f73d prebuilt/userland/libhakios.dylib+8df90a3426f2802cc063db2ad3548d85237140a678699c742bc1ba31552cd0d9 prebuilt/userland/libhakios.media.dylib+120b8da2663d1e405a7117d1776363ff1faf090bf9b9f8fe262153de587bf26a prebuilt/userland/libhakios.sb.dylib+1ad5f448b3790a42a246ec97d2db19ab79c08650eba7357f83b66e694f4427ef prebuilt/userland/libhakios.tweaks.dylib07642c790f9a9d12274f11471a33e16cb5d81232052efa37c8069b64f16aa10a prebuilt/userland/mg_testa753963432c090491e4dced4229f0d2bda76c8938f0c8579c779987fffe3e5f3 prebuilt/userland/net_test-40a44d0c39a9d768b5acf39b78b36f68bf33aa998cacb429655d54dab6616eae prebuilt/userland/RedwoodAudio+40a44d0c39a9d768b5acf39b78b36f68bf33aa998cacb429655d54dab6616eae prebuilt/userland/HakiosAudio2bcbda7590caa1c12cfdc165a99f4f2e427a8d4fa4f0b40fceea87ba8365e3bc prebuilt/userland/rwtoucha7bd8279e8e0effd4094ab8369556a51899401d8e32a9fd3aefc451db445e0b6 prebuilt/userland/sound_test02629167d9126f59d8f7ac86b30617e175a321819d3cf9fa7a89414656579a57 prebuilt/userland/stage0143a06695cf54273b39a74a979c690715b7ba171dd408400084eac3ca78db3da prebuilt/userland/surf_test879d6d554758905cdd17795e7049267bc516452cb6264c20ef11f680d25de5dd prebuilt/userland/svc_test-c25b95de00e4b2dffa5e1ede1810ff80e29b61f6cc39dc1ae2286620902acd20 devices/redwood/prebuilt/BootShim.bin-55037fd1a6d6cd861add76c2083d5d4321373bf714acae3f6a40deb004c27d47 devices/redwood/prebuilt/mkbootimg.py-b5a2c96250612366ea272ffac6d9744aaf4b45aacd96aa7cfcb931ee3b558259 devices/redwood/prebuilt/ramdisk-ee93220116d7f59664edf41f43dfae69d036f26faa21e55f9e5ba3c1187f6cef devices/redwood/prebuilt/redwood.dtb-d1c0c4a33fb10cda3e034b09e082fdd8fd68465405c883143f21286972ac21ec devices/redwood/prebuilt/SILICIUM_UEFI.fd+c25b95de00e4b2dffa5e1ede1810ff80e29b61f6cc39dc1ae2286620902acd20 devices/poco-x5-pro/prebuilt/BootShim.bin+55037fd1a6d6cd861add76c2083d5d4321373bf714acae3f6a40deb004c27d47 devices/poco-x5-pro/prebuilt/mkbootimg.py+b5a2c96250612366ea272ffac6d9744aaf4b45aacd96aa7cfcb931ee3b558259 devices/poco-x5-pro/prebuilt/ramdisk+ee93220116d7f59664edf41f43dfae69d036f26faa21e55f9e5ba3c1187f6cef devices/poco-x5-pro/prebuilt/device-tree.dtb+d1c0c4a33fb10cda3e034b09e082fdd8fd68465405c883143f21286972ac21ec devices/poco-x5-pro/prebuilt/SILICIUM_UEFI.fddiff --git a/prebuilt/userland/RedwoodAudio b/prebuilt/userland/HakiosAudiosimilarity index 100%rename from prebuilt/userland/RedwoodAudiorename to prebuilt/userland/HakiosAudiodiff --git a/prebuilt/userland/libredwood-app.dylib b/prebuilt/userland/libhakios.app.dylibsimilarity index 100%rename from prebuilt/userland/libredwood-app.dylibrename to prebuilt/userland/libhakios.app.dylibdiff --git a/prebuilt/userland/libredwood.dylib b/prebuilt/userland/libhakios.dylibsimilarity index 100%rename from prebuilt/userland/libredwood.dylibrename to prebuilt/userland/libhakios.dylibdiff --git a/prebuilt/userland/libredwood-media.dylib b/prebuilt/userland/libhakios.media.dylibsimilarity index 100%rename from prebuilt/userland/libredwood-media.dylibrename to prebuilt/userland/libhakios.media.dylibdiff --git a/prebuilt/userland/libredwood-sb.dylib b/prebuilt/userland/libhakios.sb.dylibsimilarity index 100%rename from prebuilt/userland/libredwood-sb.dylibrename to prebuilt/userland/libhakios.sb.dylibdiff --git a/prebuilt/userland/libredwood-tweaks.dylib b/prebuilt/userland/libhakios.tweaks.dylibsimilarity index 100%rename from prebuilt/userland/libredwood-tweaks.dylibrename to prebuilt/userland/libhakios.tweaks.dylibdiff --git a/qemu/run-ios.sh b/qemu/run-ios.shindex 558865e..60d5b87 100755--- a/qemu/run-ios.sh+++ b/qemu/run-ios.sh@@ -68,7 +68,7 @@ if [ -n "$QEMU_NET" ] && [ "$QEMU_NET" != 0 ]; thenNET=(-netdev user,id=net0 -device virtio-net-device,netdev=net0)CMDLINE="virtio_net=1 $CMDLINE"fi-# the sound device (QEMU 8.2 or newer has one for this machine): the kernel's sink for /dev/redwood-audio+# the sound device (QEMU 8.2 or newer has one for this machine): the kernel's sink for /dev/hakios-audioSOUND=()if qemu-system-aarch64 -device help 2>/dev/null | grep -q '"virtio-sound-device"'; thencase "${AUDIO:-none}" indiff --git a/tools/air/intrincheck.py b/tools/air/intrincheck.pyindex abb494d..099141b 100755--- a/tools/air/intrincheck.py+++ b/tools/air/intrincheck.py@@ -968,7 +968,7 @@ done"""-JOBS_HEAD = """# Commands run by the launchd job com.redwood.demo, generated by+JOBS_HEAD = """# Commands run by the launchd job com.hakios.demo, generated by# tools/air/intrincheck.py --emit. Do not edit: regenerate it.## %(n)d modules over %(decls)d air.* declarations. Each one calls a single operation ondiff --git a/tools/apfs/mksparse.py b/tools/apfs/mksparse.pyindex a108515..08fbfd2 100755--- a/tools/apfs/mksparse.py+++ b/tools/apfs/mksparse.py@@ -13,7 +13,7 @@# touches. A cache of a different size only changes how often a block is re-read, not# which blocks are needed, so the set is safe to hand to the kernel.#-# Layout of what comes out (little-endian), as bsd/dev/redwood_sparse.c reads it:+# Layout of what comes out (little-endian), as bsd/dev/hakios.sparse.c reads it:## header, one block: "REDWOODSPARSE1\0\0", block size, block count of the container,# how many blocks are present, the offsets of the table and the datadiff --git a/tools/apfs/mkstore.py b/tools/apfs/mkstore.pyindex 5cefe91..61ed0c7 100644--- a/tools/apfs/mkstore.py+++ b/tools/apfs/mkstore.py@@ -26,7 +26,7 @@ partition darwin, past the blocks the loader and the kernel both refuse to writeAndroid with tools/darwin-write.py and it destroys whatever the store held before, so the imageis made once and kept.-Check it as any other image is checked: tools/apfs/check-image.sh IMAGE RedwoodStore=DIR, and+Check it as any other image is checked: tools/apfs/check-image.sh IMAGE HakiosStore=DIR, and`apfs-tool store info IMAGE` says whether the driver will have it."""import argparse@@ -37,7 +37,7 @@ import sysimport tempfileHERE = os.path.dirname(os.path.abspath(__file__))-VOLUME = 'RedwoodStore' # apfs_store.h: the name is a gate, not decoration+VOLUME = 'HakiosStore' # apfs_store.h: the name is a gate, not decorationHEAD = 4096 # APFS_STORE_PAYLOAD: the header block at the frontdiff --git a/tools/apfs/write-tests.py b/tools/apfs/write-tests.pyindex a18ef67..1226786 100755--- a/tools/apfs/write-tests.py+++ b/tools/apfs/write-tests.py@@ -403,7 +403,7 @@ def test_store_refusals():# a volume that is not the store: the name is the gatebase, img = fresh('store-notstore')rc, out = store_save(img, b'x' * 100)- say(rc != 0 and 'not named' in out, 'refused: a volume that is not named RedwoodStore' ++ say(rc != 0 and 'not named' in out, 'refused: a volume that is not named HakiosStore' +('' if rc != 0 else ':\n' + out.strip()))say(changed_blocks(base, img) == [], ' and nothing in it was written')@@ -442,7 +442,7 @@ def test_store_refusals():argv = [sys.executable, os.path.join(HERE, 'mkapfs.py'), '-o', img]if compress:argv.append('-z')- argv.append('RedwoodStore=' + tree)+ argv.append('HakiosStore=' + tree)rc, out = run(*argv)if rc != 0:say(False, '%s: the image could not be made:\n%s' % (what, out))diff --git a/tools/buttons-session.sh b/tools/buttons-session.shindex 5be07a3..c167b75 100755--- a/tools/buttons-session.sh+++ b/tools/buttons-session.sh@@ -16,7 +16,7 @@# Environment: XL_CMDLINE_MORE="..." more boot-args (gpu=1, -v, ...); RAMDISK=1 upload the system# image even if the phone is already in the loader; RECORD=0 no screen recording.cd "$(dirname "$(readlink -f "$0")")/.." || exit 1-PHONE=${XDG_RUNTIME_DIR:-/tmp}/darwin-redwood-phone+PHONE=${XDG_RUNTIME_DIR:-/tmp}/darwin-hakios-phonesecs=${1:-120}out=logs/buttons-$(date +%H%M%S)mkdir -p "$out"diff --git a/tools/buttons-watch.sh b/tools/buttons-watch.shindex e1030e7..1318534 100755--- a/tools/buttons-watch.sh+++ b/tools/buttons-watch.sh@@ -13,7 +13,7 @@# the loader for travels the same way as the run's own log, and must not be in its place when# the run fetches that.cd "$(dirname "$(readlink -f "$0")")/.." || exit 1-PHONE=${XDG_RUNTIME_DIR:-/tmp}/darwin-redwood-phone+PHONE=${XDG_RUNTIME_DIR:-/tmp}/darwin-hakios-phoneout=${1:-logs/buttons-$(date +%H%M%S)}mkdir -p "$out"pattern='^buttons: |\[Button\] [A-Za-z]+ page|^\$ /redwood/bin/rwtouch .*button |Set Blanked'diff --git a/tools/camraw.py b/tools/camraw.pyindex 5dad503..7a49028 100755--- a/tools/camraw.py+++ b/tools/camraw.py@@ -1,6 +1,6 @@#!/usr/bin/env python3"""Make pictures of the frames the kernel's camera driver left in memory (boot-arg cam=3 and up;-bsd/dev/redwood_camera.c), as the loader hands them over ("xl camera").+bsd/dev/hakios.camera.c), as the loader hands them over ("xl camera").usage: camraw.py CAMERA.raw PREFIX [--bayer N]diff --git a/tools/camsensor.py b/tools/camsensor.pyindex 3849b01..a0b23c1 100755--- a/tools/camsensor.py+++ b/tools/camsensor.py@@ -1,6 +1,6 @@#!/usr/bin/env python3"""Make the register tables of a camera sensor, as the kernel's camera driver reads them-(bsd/dev/redwood_camera.c, boot-arg cam=2 and up), out of the sensor's module file of Android's camera+(bsd/dev/hakios.camera.c, boot-arg cam=2 and up), out of the sensor's module file of Android's camerastack (/vendor/lib64/camera/com.qti.sensormodule.<name>.bin of the phone: the vendor's, kept infw-camera/ and never in the repository; so is what this makes of it).@@ -30,7 +30,7 @@ u32 }. The modes' own tables are res0, res1, ...The listing also gives each mode's colour filter order: the first word of its resolution element,colorFilterArrangement in CamX's order (0 BGGR, 1 GBRG, 2 GRBG, 3 RGGB, 4 mono; camera.qcom.so'sTranslateColorFilterArrangement makes Android's of it by the table 3, 2, 1, 0, 5). It is not in the-table: the kernel's sensors[] carries it (bsd/dev/redwood_camera.c).+table: the kernel's sensors[] carries it (bsd/dev/hakios.camera.c)."""import structimport sysdiff --git a/tools/camtuning.py b/tools/camtuning.pyindex 800744f..c9e78f4 100755--- a/tools/camtuning.py+++ b/tools/camtuning.py@@ -1,5 +1,5 @@#!/usr/bin/env python3-"""Make a camera's colour tuning, as libredwood-media's processor reads it (userland/src/camera_isp.c,+"""Make a camera's colour tuning, as libhakios.media's processor reads it (userland/src/camera_isp.c,isp_load_tuning), out of the camera's tuning file of Android's camera stack(/vendor/lib64/camera/com.qti.tuned.<name>.bin of the phone: the vendor's, kept in fw-camera/ and never inthe repository; so is what this makes of it).diff --git a/tools/guard-test.sh b/tools/guard-test.shindex c6653a0..ebbbebf 100755--- a/tools/guard-test.sh+++ b/tools/guard-test.sh@@ -1,5 +1,5 @@#!/bin/sh-# The speakers' guard (bsd/dev/redwood_guard.c) on this machine: tools/guard_test.c built against it and run.+# The speakers' guard (bsd/dev/hakios.guard.c) on this machine: tools/guard_test.c built against it and run.# The kernel's header is all it needs, and an empty sys/ioccom.h beside it (the ioctl numbers are not used).set -ecd "$(dirname "$0")/.."@@ -7,7 +7,7 @@ SRC=xnu-src/xnu-8796.121.2/bsdtmp=$(mktemp -d)trap 'rm -rf "$tmp"' EXITmkdir -p "$tmp/sys"-cp $SRC/sys/redwood_audio.h "$tmp/sys/"+cp $SRC/sys/hakios.audio.h "$tmp/sys/"printf '#define _IOW(g, n, t) 0\n' > "$tmp/sys/ioccom.h"-cc -O2 -Wall -DKERNEL -I"$tmp" tools/guard_test.c $SRC/dev/redwood_guard.c -lm -o "$tmp/guard_test"+cc -O2 -Wall -DKERNEL -I"$tmp" tools/guard_test.c $SRC/dev/hakios.guard.c -lm -o "$tmp/guard_test""$tmp/guard_test"diff --git a/tools/guard_test.c b/tools/guard_test.cindex fb272e7..d6492ef 100644--- a/tools/guard_test.c+++ b/tools/guard_test.c@@ -1,10 +1,10 @@/*- * The speakers' guard (bsd/dev/redwood_guard.c) on this machine, with signals made up for it:+ * The speakers' guard (bsd/dev/hakios.guard.c) on this machine, with signals made up for it:* what comes out, second by second, for a sustained full-scale tone at the amplifiers' levels that* are tried on the phone, for music-like noise, and for the tone once it stops (the cooling).*- * cc -O2 -DKERNEL -I<a directory with sys/redwood_audio.h and a sys/ioccom.h> tools/guard_test.c \- * xnu-src/xnu-8796.121.2/bsd/dev/redwood_guard.c -lm -o guard_test && ./guard_test+ * cc -O2 -DKERNEL -I<a directory with sys/hakios.audio.h and a sys/ioccom.h> tools/guard_test.c \+ * xnu-src/xnu-8796.121.2/bsd/dev/hakios.guard.c -lm -o guard_test && ./guard_test* (tools/guard-test.sh does that.)*/#include <math.h>@@ -12,7 +12,7 @@#include <stdint.h>#include <stdio.h>#include <stdlib.h>-#include <sys/redwood_audio.h>+#include <sys/hakios.audio.h>#define RATE 48000#define BLOCK 960@@ -71,7 +71,7 @@ static voidrun(const char *what, uint32_t attenuation, int kind, double level, double hz, int seconds, int every){int16_t frames[2 * BLOCK];- bool silent = attenuation == REDWOOD_GUARD_SILENT;+ bool silent = attenuation == HAKIOS_GUARD_SILENT;double at_speaker = silent ? 0 : pow(10, -(double)attenuation / 80.0); /* power */if (silent) {@@ -79,17 +79,17 @@ run(const char *what, uint32_t attenuation, int kind, double level, double hz, i} else {printf("-- %s, the amplifiers %.1f dB under Android's level\n", what, attenuation / 8.0);}- redwood_guard_attenuation(attenuation);+ hakios_guard_attenuation(attenuation);for (int s = 0; s < seconds; s++) {double sum = 0, peak = 0, in_sum = 0;- struct redwood_guard_report r;+ struct hakios_guard_report r;for (int b = 0; b < RATE / BLOCK; b++) {make(frames, kind, level, hz);for (int i = 0; i < 2 * BLOCK; i++) {in_sum += (double)frames[i] * frames[i];}- redwood_guard_process(frames, BLOCK);+ hakios_guard_process(frames, BLOCK);for (int i = 0; i < 2 * BLOCK; i++) {double v = frames[i] / 32768.0;@@ -97,15 +97,15 @@ run(const char *what, uint32_t attenuation, int kind, double level, double hz, ipeak = fabs(v) > peak ? fabs(v) : peak;}}- redwood_guard_take_report(&r);+ hakios_guard_take_report(&r);if ((s + 1) % every == 0 || s == 0) {/* at the speaker: relative to a full-scale square wave at Android's level */printf("%4d s: in %6.1f dB, out %6.1f dB (peak %6.1f dB) at the speaker; guard %5.1f dB (%u rms, %u fast, %u slow ""blocks), peaks limited in %u frames; averages %.1f %.1f %.1f dB\n", s + 1,decibels(in_sum / (2.0 * RATE) / (32768.0 * 32768.0) * at_speaker), decibels(sum / (2.0 * RATE) * at_speaker),- silent ? -99 : 20 * log10(peak > 0 ? peak : 1e-9) - attenuation / 8.0, redwood_guard_decibels(r.gain * r.gain >> 30) / 10.0,- r.rms_blocks, r.fast_blocks, r.slow_blocks, r.limited_frames, redwood_guard_decibels(r.rms) / 10.0,- redwood_guard_decibels(r.fast) / 10.0, redwood_guard_decibels(r.slow) / 10.0);+ silent ? -99 : 20 * log10(peak > 0 ? peak : 1e-9) - attenuation / 8.0, hakios_guard_decibels(r.gain * r.gain >> 30) / 10.0,+ r.rms_blocks, r.fast_blocks, r.slow_blocks, r.limited_frames, hakios_guard_decibels(r.rms) / 10.0,+ hakios_guard_decibels(r.fast) / 10.0, hakios_guard_decibels(r.slow) / 10.0);}}}@@ -125,24 +125,24 @@ main(void)}}pink_scale = 1.0 / sqrt(sum / (500.0 * BLOCK));- redwood_guard_configure(true, 0);+ hakios_guard_configure(true, 0);run("a full-scale 1 kHz sine", 160, 1, 1.0, 1000, 10, 5);run("a full-scale 1 kHz sine", 80, 1, 1.0, 1000, 10, 5);run("a full-scale 1 kHz sine", 0, 1, 1.0, 1000, 120, 10);- run("silence, the speakers cooling", REDWOOD_GUARD_SILENT, 0, 0, 0, 120, 20);+ run("silence, the speakers cooling", HAKIOS_GUARD_SILENT, 0, 0, 0, 120, 20);run("the same sine again", 0, 1, 1.0, 1000, 5, 1);- run("silence", REDWOOD_GUARD_SILENT, 0, 0, 0, 300, 300);+ run("silence", HAKIOS_GUARD_SILENT, 0, 0, 0, 300, 300);run("a 100 Hz sine at full scale (the high-pass filter)", 0, 1, 1.0, 100, 4, 2);- run("silence", REDWOOD_GUARD_SILENT, 0, 0, 0, 300, 300);+ run("silence", HAKIOS_GUARD_SILENT, 0, 0, 0, 300, 300);run("pink noise at -15 dB RMS (loud music)", 0, 2, pow(10, -15 / 20.0), 0, 60, 10);run("pink noise at -9 dB RMS (music mastered as loud as it goes)", 0, 2, pow(10, -9 / 20.0), 0, 120, 20);- run("silence", REDWOOD_GUARD_SILENT, 0, 0, 0, 300, 300);+ run("silence", HAKIOS_GUARD_SILENT, 0, 0, 0, 300, 300);/* iOS at its top: a tone 12.6 dB under full scale, then 12 dB of gain before the guard */- redwood_guard_configure(true, 96);+ hakios_guard_configure(true, 96);run("iOS's top (a 440 Hz sine at -12.6 dB) with 12 dB of gain", 0, 1, pow(10, -12.6 / 20), 440, 90, 10);- run("silence", REDWOOD_GUARD_SILENT, 0, 0, 0, 600, 600);+ run("silence", HAKIOS_GUARD_SILENT, 0, 0, 0, 600, 600);run("pink noise at -24 dB RMS (loud music as iOS leaves it) with 12 dB of gain", 0, 2, pow(10, -24 / 20.0), 0, 60, 20);- run("silence", REDWOOD_GUARD_SILENT, 0, 0, 0, 600, 600);+ run("silence", HAKIOS_GUARD_SILENT, 0, 0, 0, 600, 600);run("the same with the amplifiers 90 dB under (sound_below=720)", 720, 2, pow(10, -24 / 20.0), 0, 10, 5);return 0;}diff --git a/tools/latency.py b/tools/latency.pyindex 5d8e5cc..1a680f9 100644--- a/tools/latency.py+++ b/tools/latency.py@@ -6,9 +6,9 @@ latency.py RUN.log [MORE.log ...] [RECORDING.raw]: how far behind the finger theA run with boot-arg touch_lat=1 writes a line at every stage a touch passes on its way to the panel,all in microseconds of mach_absolute_time (the kernel's clock, which user space reads too):- tl: p TYPE FINGER X Y at US the kernel posts a sample (bsd/dev/redwood_input.c)+ tl: p TYPE FINGER X Y at US the kernel posts a sample (bsd/dev/hakios.input.c)tl: c before US seen US read US the touch driver finds the interrupt line low and reads the- report (bsd/dev/redwood_goodix.c; only for a real finger)+ report (bsd/dev/hakios.goodix.c; only for a real finger)tl: i TYPE posted US read US sent US the window server reads it and hands it to the event system(userland/src/inject.c)tl: g FRAME began US ended US DRAWS the window server draws a frame (userland/src/eagl.c)diff --git a/tools/mesa/freedreno-darwin.patch b/tools/mesa/freedreno-darwin.patchindex 93353ca..4d29a6f 100644--- a/tools/mesa/freedreno-darwin.patch+++ b/tools/mesa/freedreno-darwin.patch@@ -7,10 +7,10 @@-if dep_libdrm.found()+if host_machine.system() == 'darwin' and with_gallium_freedreno+ # No DRM on this system: freedreno's requests go to the kernel's driver through a stand-in-+ # for libdrm (src/redwood-drm, put there by Darwin on redwood's tools/mk-mesa.sh; its one++ # for libdrm (src/hakios-drm, put there by Darwin on redwood's tools/mk-mesa.sh; its one+ # source file is built with freedreno's drm layer, src/freedreno/drm).+ dep_libdrm = declare_dependency(-+ include_directories : include_directories('src/redwood-drm'),++ include_directories : include_directories('src/hakios-drm'),+ link_args : ['-framework', 'IOKit', '-framework', 'CoreFoundation'],+ )+elif dep_libdrm.found()@@ -25,8 +25,8 @@+#ifdef __APPLE__+ /* (what comes in here is an IOSurface, and the "file descriptor" its ID) */-+ struct redwood_drm_surface surface = { .surface = fd };-+ size = redwood_drm_surface(dev->fd, &surface) ? 0 : surface.size;++ struct hakios_drm_surface surface = { .surface = fd };++ size = hakios_drm_surface(dev->fd, &surface) ? 0 : surface.size;+#else/* lseek() to get bo size */size = lseek(fd, 0, SEEK_END);@@ -40,7 +40,7 @@if (bo->map)+#ifdef __APPLE__-+ redwood_drm_unmap(bo->dev->fd, bo->handle, bo->map);++ hakios_drm_unmap(bo->dev->fd, bo->handle, bo->map);+#elseos_munmap(bo->map, bo->size);+#endif@@ -52,8 +52,8 @@return NULL;}+#ifdef __APPLE__-+ /* no mmap() on a device here: the kernel's driver maps the buffer (src/redwood-drm) */-+ return redwood_drm_map(bo->dev->fd, bo->handle, bo->size);++ /* no mmap() on a device here: the kernel's driver maps the buffer (src/hakios-drm) */++ return hakios_drm_map(bo->dev->fd, bo->handle, bo->size);+#elsereturn os_mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED,bo->dev->fd, offset);@@ -68,7 +68,7 @@)libfreedreno_drm_files += libfreedreno_drm_msm_files+if host_machine.system() == 'darwin'-+ libfreedreno_drm_files += files('../../redwood-drm/redwood_drm.c')++ libfreedreno_drm_files += files('../../hakios-drm/hakios.drm.c')+endiflibfreedreno_drm_virtio_files = files(@@ -140,7 +140,7 @@DRAW == DRAW_INDIRECT_OP_INDIRECT_COUNT)ctx->batch->barrier |= FD6_WAIT_FOR_ME;-+ /* Darwin on redwood: a draw that reads the framebuffer reads it through++ /* Darwin on hakios: a draw that reads the framebuffer reads it through+ * UCHE. Among primitives drawn with FLUSH_PER_OVERLAP the hardware sees+ * to it that they read what the ones before them wrote, but it knows+ * nothing of what was drawn before that mode was on: the first triangle@@ -320,7 +320,7 @@+osmesa_surface_resource(struct pipe_screen *screen, uint32_t surface)+{+#ifdef GALLIUM_FREEDRENO-+ struct redwood_drm_surface s = { .surface = surface };++ struct hakios_drm_surface s = { .surface = surface };+ struct pipe_resource templ = {+ .target = PIPE_TEXTURE_2D,+ .format = PIPE_FORMAT_B8G8R8A8_UNORM,@@ -330,11 +330,11 @@+ };+ struct winsys_handle handle = { .type = WINSYS_HANDLE_TYPE_FD };+-+ if (gpu_fd < 0 || redwood_drm_surface(gpu_fd, &s) != 0)++ if (gpu_fd < 0 || hakios_drm_surface(gpu_fd, &s) != 0)+ return NULL;+ if (s.pixel_format != 0x42475241 /* 'BGRA' */ || s.planes != 0)+ return NULL;-+ /* (the surface comes in as Linux's buffers come in by file descriptor: see redwood-drm) */++ /* (the surface comes in as Linux's buffers come in by file descriptor: see hakios-drm) */+ templ.width0 = s.width;+ templ.height0 = s.height;+ handle.handle = surface;diff --git a/tools/mesa/redwood-drm/redwood_drm.c b/tools/mesa/hakios-drm/hakios.drm.csimilarity index 88%rename from tools/mesa/redwood-drm/redwood_drm.crename to tools/mesa/hakios-drm/hakios.drm.cindex 6a09c89..2fb23b1 100644--- a/tools/mesa/redwood-drm/redwood_drm.c+++ b/tools/mesa/hakios-drm/hakios.drm.c@@ -16,9 +16,9 @@#include "xf86drm.h"-#define REDWOOD_GPU_SERVICE "RedwoodGPU"-#define REDWOOD_GPU_SURFACE 0x7e /* the request that is not Linux's */-#define REDWOOD_GPU_DESCRIBE 0xffffffffu /* ... asked only what the buffer would be like */+#define HAKIOS_GPU_SERVICE "HakiosGPU"+#define HAKIOS_GPU_SURFACE 0x7e /* the request that is not Linux's */+#define HAKIOS_GPU_DESCRIBE 0xffffffffu /* ... asked only what the buffer would be like */static io_connect_t connection;static int connection_fd = -1;@@ -36,7 +36,7 @@ drmOpenWithType(const char *name, const char *busid, int type)if (connection_fd >= 0) {return dup(connection_fd);}- service = IOServiceGetMatchingService(0, IOServiceMatching(REDWOOD_GPU_SERVICE));+ service = IOServiceGetMatchingService(0, IOServiceMatching(HAKIOS_GPU_SERVICE));if (service == 0) {return -1;}@@ -145,7 +145,7 @@ drmGetCap(int fd, uint64_t capability, uint64_t *value)}void *-redwood_drm_map(int fd, uint32_t handle, uint64_t size)+hakios_drm_map(int fd, uint32_t handle, uint64_t size){mach_vm_address_t address = 0;mach_vm_size_t mapped = 0;@@ -164,20 +164,20 @@ redwood_drm_map(int fd, uint32_t handle, uint64_t size)}void-redwood_drm_unmap(int fd, uint32_t handle, void *address)+hakios_drm_unmap(int fd, uint32_t handle, void *address){(void)fd;IOConnectUnmapMemory64(connection, handle, mach_task_self(), (mach_vm_address_t)(uintptr_t)address);}int-redwood_drm_surface(int fd, struct redwood_drm_surface *surface)+hakios_drm_surface(int fd, struct hakios_drm_surface *surface){int error;(void)fd;- surface->handle = REDWOOD_GPU_DESCRIBE;- error = call(REDWOOD_GPU_SURFACE, surface, sizeof(*surface));+ surface->handle = HAKIOS_GPU_DESCRIBE;+ error = call(HAKIOS_GPU_SURFACE, surface, sizeof(*surface));if (error != 0) {errno = error;return -1;@@ -188,8 +188,8 @@ redwood_drm_surface(int fd, struct redwood_drm_surface *surface)intdrmPrimeFDToHandle(int fd, int surface, uint32_t *handle){- struct redwood_drm_surface request = { .surface = (uint32_t)surface };- int error = call(REDWOOD_GPU_SURFACE, &request, sizeof(request));+ struct hakios_drm_surface request = { .surface = (uint32_t)surface };+ int error = call(HAKIOS_GPU_SURFACE, &request, sizeof(request));(void)fd;if (error != 0) {diff --git a/tools/mesa/redwood-drm/xf86drm.h b/tools/mesa/hakios-drm/xf86drm.hsimilarity index 81%rename from tools/mesa/redwood-drm/xf86drm.hrename to tools/mesa/hakios-drm/xf86drm.hindex 9ef2bea..a0e3e98 100644--- a/tools/mesa/redwood-drm/xf86drm.h+++ b/tools/mesa/hakios-drm/xf86drm.h@@ -1,12 +1,12 @@/** What Mesa's freedreno takes from libdrm's xf86drm.h, for a system without Linux's DRM: the- * declarations here, the functions in redwood_drm.c, which carry the requests to the kernel's- * GPU driver (the service RedwoodGPU; iokit/Kernel/RedwoodGPU.cpp) as calls of its user client.+ * declarations here, the functions in hakios.drm.c, which carry the requests to the kernel's+ * GPU driver (the service HakiosGPU; iokit/Kernel/hakios.gpu.cpp) as calls of its user client.* tools/mk-mesa.sh puts both into Mesa's tree, where they are the "libdrm" freedreno is built* against. The request numbers and their structures are Linux's (Mesa's include/drm-uapi).*/-#ifndef REDWOOD_XF86DRM_H-#define REDWOOD_XF86DRM_H+#ifndef HAKIOS_XF86DRM_H+#define HAKIOS_XF86DRM_H#include <fcntl.h>#include <stddef.h>@@ -41,7 +41,7 @@ int drmGetCap(int fd, uint64_t capability, uint64_t *value);/** Buffers and fences as file descriptors: there are none here. But memory that somebody else* has made does come in, as Linux's comes in by file descriptor: an IOSurface, by its ID, where- * freedreno expects the descriptor (see redwood_drm_surface() below).+ * freedreno expects the descriptor (see hakios_drm_surface() below).*/int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd);int drmPrimeFDToHandle(int fd, int surface, uint32_t *handle);@@ -54,23 +54,23 @@ int drmSyncobjImportSyncFile(int fd, uint32_t handle, int sync_file_fd);int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd);/* Not libdrm's: a buffer's memory in this process, in place of mmap() on the device (freedreno_bo.c is patched to call these). */-void *redwood_drm_map(int fd, uint32_t handle, uint64_t size);-void redwood_drm_unmap(int fd, uint32_t handle, void *address);+void *hakios_drm_map(int fd, uint32_t handle, uint64_t size);+void hakios_drm_unmap(int fd, uint32_t handle, void *address);/** Not libdrm's either: what the memory of an IOSurface would be like as a buffer (the kernel's- * request and its answer: struct redwood_surface in iokit/Kernel/RedwoodGPU.cpp); 0, or -1 with+ * request and its answer: struct hakios_surface in iokit/Kernel/hakios.gpu.cpp); 0, or -1 with* errno. The buffer itself is made by drmPrimeFDToHandle(), which freedreno calls with its* table of buffers locked, so that a buffer on its way out and the same surface on its way in* cannot pass each other.*/-struct redwood_drm_surface {+struct hakios_drm_surface {uint32_t surface; /* the IOSurface's ID */uint32_t handle; /* (the kernel's: which of the two is asked) */uint64_t size; /* back: how big the buffer is, */uint32_t offset, row_bytes; /* where the pixels start in it and how long a row of them is, */uint32_t width, height, pixel_format, planes; /* and what they are */};-int redwood_drm_surface(int fd, struct redwood_drm_surface *surface);+int hakios_drm_surface(int fd, struct hakios_drm_surface *surface);#endifdiff --git a/tools/mk-ath11k.sh b/tools/mk-ath11k.shindex f06a33b..b9f30e7 100755--- a/tools/mk-ath11k.sh+++ b/tools/mk-ath11k.sh@@ -13,7 +13,7 @@# headers of FreeBSD that cannot serve under XNU as they are, and the# functions underneath (locks, sleeping, work, memory, firmware, the# radio's bus) written on the handful of calls that the kernel's-# bsd/dev/redwood_lx.c offers (bsd/sys/redwood_lx.h of the kernel tree).+# bsd/dev/hakios.lx.c offers (bsd/sys/hakios.lx.h of the kernel tree).## Not all of the driver is built yet: DRIVER below lists the files that are. What they call in# the files that are not becomes a function that says its name in the log and answers 0@@ -129,9 +129,9 @@ DFLAGS="-Isrc/ath11k -Isrc -include $W/include/lx_prelude.h -DCONFIG_ATH11K_AHB# helpers (wifi/lx/include/linux/soc/qcom/qmi.h)source "$ROOT/xnu-env.sh"for h in lx qmi; do- [ -f "$XNU_SRC/bsd/sys/redwood_$h.h" ] || { echo "mk-ath11k.sh: the kernel tree has no bsd/sys/redwood_$h.h" >&2; exit 1; }+ [ -f "$XNU_SRC/bsd/sys/hakios.$h.h" ] || { echo "mk-ath11k.sh: the kernel tree has no bsd/sys/hakios.$h.h" >&2; exit 1; }done-DFLAGS="$DFLAGS -DLX_REDWOOD_LX_H=\"$XNU_SRC/bsd/sys/redwood_lx.h\" -DLX_REDWOOD_QMI_H=\"$XNU_SRC/bsd/sys/redwood_qmi.h\""+DFLAGS="$DFLAGS -DLX_HAKIOS_LX_H=\"$XNU_SRC/bsd/sys/hakios.lx.h\" -DLX_HAKIOS_QMI_H=\"$XNU_SRC/bsd/sys/hakios.qmi.h\""mkdir -p obj outrm -f obj/*.errcompile() { # compile SOURCE OBJECT [FLAGS]: only when the object is older than anything it was made of@@ -153,7 +153,7 @@ doneOBJECTS=$(for f in $DRIVER; do echo obj/ath11k_$f.o; done; for f in "$W"/src/*.c; do echo obj/lx_$(basename "$f" .c).o; done)# --- tie it all into one object. What it then still wants is one of three things: a call of the-# kernel's (redwood_lx.h; the QMI helpers; the handful of C library functions XNU has under the same+# kernel's (hakios.lx.h; the QMI helpers; the handful of C library functions XNU has under the same# names with the same meaning), a function of a part of the driver that is not built yet, or a# mistake. The second kind gets a stub each that says its name and answers 0; anything else# missing ends the build.@@ -167,7 +167,7 @@ missing=for s in $(cat out/undefined.txt); docase " $(echo $KERNEL) " in *" $s "*) continue ;; esaccase $s in- lx_os_*|qmi_*|redwood_qmi_*|section\$*) continue ;;+ lx_os_*|qmi_*|hakios_qmi_*|section\$*) continue ;;ath11k_*|__ath11k_*) ;;*) echo "mk-ath11k.sh: nothing defines $s" >&2; missing=1; continue ;;esac@@ -177,7 +177,7 @@ for s in $(cat out/undefined.txt); dodone[ -z "$missing" ] || exit 1$CC -c out/stubs.s -o out/stubs.o-# four names are shown: where the kernel enters (lx_prepare(), lx_start(), lx_stop() and lx_transmit() of redwood_lx.h)+# four names are shown: where the kernel enters (lx_prepare(), lx_start(), lx_stop() and lx_transmit() of hakios.lx.h)printf '_lx_prepare\n_lx_start\n_lx_stop\n_lx_transmit\n' > out/exported.txt$LD -r -arch arm64 -exported_symbols_list out/exported.txt out/all.o out/stubs.o -o out/ath11k.o 2> out/ld.err ||{ cat out/ld.err; exit 1; }diff --git a/tools/mk-mesa.sh b/tools/mk-mesa.shindex f944572..7d67b11 100755--- a/tools/mk-mesa.sh+++ b/tools/mk-mesa.sh@@ -7,8 +7,8 @@# DRIVERS="softpipe,freedreno"# the gallium drivers to build. softpipe: a rasterizer in plain C; it needs no# LLVM and nothing of the machine but its processor. freedreno: the Adreno's;-# it talks to the kernel's GPU driver (the service RedwoodGPU) through-# tools/mesa/redwood-drm, which stands in for libdrm (tools/mesa/freedreno-darwin.patch+# it talks to the kernel's GPU driver (the service HakiosGPU) through+# tools/mesa/hakios-drm, which stands in for libdrm (tools/mesa/freedreno-darwin.patch# makes Mesa build it where there is no DRM). The library takes the GPU when the# kernel has one and the environment does not say OSMESA_SOFTWARE=1.#@@ -53,17 +53,17 @@ cd "$B"# patched with the earlier ones is of no use (and builds without a word into a library that does not match# the rest): the sources are taken from the archive again and everything is built anew, about a minute.PATCHES=$(cat "$ROOT"/tools/mesa/*.patch | sha256sum | cut -d' ' -f1)-if [ ! -d mesa-$VERSION ] || [ "$(cat mesa-$VERSION/.redwood-patches 2>/dev/null)" != "$PATCHES" ]; then+if [ ! -d mesa-$VERSION ] || [ "$(cat mesa-$VERSION/.hakios-patches 2>/dev/null)" != "$PATCHES" ]; then[ -f mesa-$VERSION.tar.xz ] || curl -sL --fail -o mesa-$VERSION.tar.xz https://archive.mesa3d.org/mesa-$VERSION.tar.xzecho "$SHA256 mesa-$VERSION.tar.xz" | sha256sum -c --quietrm -rf mesa-$VERSION build-*tar xJf mesa-$VERSION.tar.xzfor p in "$ROOT"/tools/mesa/*.patch; do patch -s --no-backup-if-mismatch -d mesa-$VERSION -p1 < "$p"; done- echo "$PATCHES" > mesa-$VERSION/.redwood-patches+ echo "$PATCHES" > mesa-$VERSION/.hakios-patchesfi# ours, kept in the repository: always the current ones-rm -rf mesa-$VERSION/src/redwood-drm-cp -r "$ROOT/tools/mesa/redwood-drm" mesa-$VERSION/src/redwood-drm+rm -rf mesa-$VERSION/src/hakios-drm+cp -r "$ROOT/tools/mesa/hakios-drm" mesa-$VERSION/src/hakios-drm# the AIR frontend (docs/air.md): the Metal runtime will call it in this# library's own process, and tools/mesa/air-frontend.patch is the meson that# reaches it. Copied rather than linked, because this tree is cross-built.@@ -120,6 +120,6 @@ install_name_tool -id /redwood/lib/libOSMesa.8.dylib out/libOSMesa.8.dylibnm -gU out/libOSMesa.8.dylib | awk '$3 ~ /^_gl/ { print substr($3, 2) }' > out/exported-gl.txtcp mesa-$VERSION/src/mapi/glapi/registry/gl.xml out/gl.xml# (userland/build.sh comes here again when this no longer matches)-cat "$ROOT"/tools/mesa/*.patch "$ROOT"/tools/mesa/redwood-drm/* | sha256sum > out/built-from+cat "$ROOT"/tools/mesa/*.patch "$ROOT"/tools/mesa/hakios-drm/* | sha256sum > out/built-fromecho "mk-mesa.sh: Mesa $VERSION ($DRIVERS): $B/out/libOSMesa.8.dylib, $(stat -c %s out/libOSMesa.8.dylib) bytes," \"$(wc -l < out/exported-gl.txt) gl* functions"diff --git a/tools/mk-wlfw.sh b/tools/mk-wlfw.shindex 059092e..59301fb 100755--- a/tools/mk-wlfw.sh+++ b/tools/mk-wlfw.sh@@ -1,10 +1,10 @@#!/bin/bash# Give the kernel's build ath11k's descriptions of the messages a WCN6750's firmware speaks, for-# bsd/dev/redwood_wlfw.c (a stand-in for ath11k's own qmi.c: see there). They are taken out of+# bsd/dev/hakios.wlfw.c (a stand-in for ath11k's own qmi.c: see there). They are taken out of# the driver's sources as they are -- the structures of its qmi.h and the tables of its qmi.c --# and written as one header into the kernel's build directory, where the compiler finds it and# git does not: ath11k's text is BSD-3-Clause-Clear and is not kept in the repository.-# Without that header redwood_wlfw.c compiles to a line that says so.+# Without that header hakios.wlfw.c compiles to a line that says so.## usage: tools/mk-wlfw.sh then build the kernel (./xnu-build.sh); again after a clean buildset -e@@ -14,7 +14,7 @@ ATH=$ROOT/xnu-deps/build/ath11k/src/ath11k[ -f "$ATH/qmi.c" ] || "$ROOT/tools/mk-ath11k.sh"OUT=$XNU_SRC/BUILD/obj/DEVELOPMENT_ARM64_${MACHINE:-BCM2837}/bsd/DEVELOPMENT[ -d "$OUT" ] || { echo "mk-wlfw.sh: no build directory $OUT: build the kernel once first" >&2; exit 1; }-python3 - "$ATH" "$(cat "$ATH/../.release" | cut -d' ' -f1)" > "$OUT/redwood_wlfw_ath11k.h.new" <<'PY'+python3 - "$ATH" "$(cat "$ATH/../.release" | cut -d' ' -f1)" > "$OUT/hakios.wlfw_ath11k.h.new" <<'PY'import reimport sys@@ -74,6 +74,6 @@ print('#define WLFW_SERVICES\t\t%s\n#define WLFW_SERVICE_COUNT\t%s' % (of('svc_tprint('#define WLFW_SENDS_INI\t\t%d\t/* fw_wmi_diag_event */' % (of('fw_wmi_diag_event') == 'true'))print('#define WLFW_SHADOW_REGISTERS\t%d\t/* supports_shadow_regs */' % (of('supports_shadow_regs') == 'true'))PY-cmp -s "$OUT/redwood_wlfw_ath11k.h.new" "$OUT/redwood_wlfw_ath11k.h" 2>/dev/null && rm "$OUT/redwood_wlfw_ath11k.h.new" ||- mv "$OUT/redwood_wlfw_ath11k.h.new" "$OUT/redwood_wlfw_ath11k.h"-echo "mk-wlfw.sh: $OUT/redwood_wlfw_ath11k.h ($(grep -c 'qmi_elem_info .*\[\] = {' "$OUT/redwood_wlfw_ath11k.h") tables)"+cmp -s "$OUT/hakios.wlfw_ath11k.h.new" "$OUT/hakios.wlfw_ath11k.h" 2>/dev/null && rm "$OUT/hakios.wlfw_ath11k.h.new" ||+ mv "$OUT/hakios.wlfw_ath11k.h.new" "$OUT/hakios.wlfw_ath11k.h"+echo "mk-wlfw.sh: $OUT/hakios.wlfw_ath11k.h ($(grep -c 'qmi_elem_info .*\[\] = {' "$OUT/hakios.wlfw_ath11k.h") tables)"diff --git a/tools/new-workspace.sh b/tools/new-workspace.shindex 458d3e4..2567025 100755--- a/tools/new-workspace.sh+++ b/tools/new-workspace.sh@@ -5,7 +5,7 @@# (btrfs or xfs), so a workspace costs about 0.5 GB, most of it the kernel's build output.## usage: tools/new-workspace.sh NAME INSTANCE [DIR]-# NAME the branch, and the directory ../darwin-redwood-NAME unless DIR is given+# NAME the branch, and the directory ../hakios-NAME unless DIR is given# INSTANCE the QEMU instance number of the copy (1, 2, ...; see qemu/run-ios.sh)## The kernel tree is copied as it is now, uncommitted work included, and that state is recorded@@ -17,7 +17,7 @@ set -eROOT=$(cd "$(dirname "$(readlink -f "$0")")/.." && pwd)NAME=${1:?usage: new-workspace.sh NAME INSTANCE [DIR]}INSTANCE=${2:?usage: new-workspace.sh NAME INSTANCE [DIR]}-WS=${3:-$(dirname "$ROOT")/darwin-redwood-$NAME}+WS=${3:-$(dirname "$ROOT")/hakios-$NAME}[ -e "$WS" ] && { echo "new-workspace.sh: $WS already exists"; exit 1; }git -C "$ROOT" worktree add -q -b "$NAME" "$WS"diff --git a/tools/qmi-test/run-nas.sh b/tools/qmi-test/run-nas.shindex 482b750..4054ac9 100755--- a/tools/qmi-test/run-nas.sh+++ b/tools/qmi-test/run-nas.sh@@ -5,5 +5,5 @@ out="$root/xnu-deps/build/qmi-test/nas-test"mkdir -p "$(dirname "$out")"${CC:-cc} -std=c11 -O1 -g -Wall -Wextra -Werror -fsanitize=address,undefined \-I"$root/xnu/files/bsd" -o "$out" \- "$root/tools/qmi-test/test_nas.c" "$root/xnu/files/bsd/dev/redwood_nas.c"+ "$root/tools/qmi-test/test_nas.c" "$root/xnu/files/bsd/dev/hakios.nas.c""$out"diff --git a/tools/qmi-test/run.sh b/tools/qmi-test/run.shindex f55d6c6..283f33e 100755--- a/tools/qmi-test/run.sh+++ b/tools/qmi-test/run.sh@@ -1,5 +1,5 @@#!/bin/bash-# Build and run the tests of the QMI helpers (bsd/dev/redwood_qmi.c of the kernel tree) on this+# Build and run the tests of the QMI helpers (bsd/dev/hakios.qmi.c of the kernel tree) on this# machine, under the address and undefined-behaviour sanitizers.## With ath11k's sources at hand (tools/mk-ath11k.sh fetches them; ATH11K=<directory> to say where@@ -9,19 +9,19 @@ set -eHERE=$(cd "$(dirname "$(readlink -f "$0")")" && pwd)ROOT=$(cd "$HERE/../.." && pwd)K=$ROOT/xnu-src/xnu-8796.121.2 # the kernel tree being worked in, or else the copies that are in git-[ -f "$K/bsd/dev/redwood_qmi.c" ] || K=$ROOT/xnu/files+[ -f "$K/bsd/dev/hakios.qmi.c" ] || K=$ROOT/xnu/filesATH=${ATH11K:-$ROOT/xnu-deps/build/ath11k/src/ath11k}B=$ROOT/xnu-deps/build/qmi-testrm -rf "$B"mkdir -p "$B/inc/sys"-ln -s "$K/bsd/sys/redwood_qmi.h" "$K/bsd/sys/redwood_qrtr.h" "$B/inc/sys/"+ln -s "$K/bsd/sys/hakios.qmi.h" "$K/bsd/sys/hakios.qrtr.h" "$B/inc/sys/"FLAGS="-std=gnu11 -O1 -g -Wall -Wextra -Werror -fsanitize=address,undefined -fno-sanitize-recover=all -pthread"if [ -f "$ATH/qmi.c" ]; then"$HERE/extract.py" "$ATH" > "$B/tables.inc"- ${CC:-cc} $FLAGS -I"$B/inc" -I"$B" -I"$HERE/shim" -I"$ATH" -o "$B/test" "$HERE/test_qmi.c" "$K/bsd/dev/redwood_qmi.c"+ ${CC:-cc} $FLAGS -I"$B/inc" -I"$B" -I"$HERE/shim" -I"$ATH" -o "$B/test" "$HERE/test_qmi.c" "$K/bsd/dev/hakios.qmi.c"echo "qmi-test: with ath11k's tables from $ATH ($(cat "$ATH/../.release" 2>/dev/null | cut -d' ' -f1))"elseecho "qmi-test: no ath11k sources in $ATH: only the tests that need none"- ${CC:-cc} $FLAGS -DNO_ATH11K -I"$B/inc" -o "$B/test" "$HERE/test_qmi.c" "$K/bsd/dev/redwood_qmi.c"+ ${CC:-cc} $FLAGS -DNO_ATH11K -I"$B/inc" -o "$B/test" "$HERE/test_qmi.c" "$K/bsd/dev/hakios.qmi.c"fi"$B/test"diff --git a/tools/qmi-test/shim/linux/soc/qcom/qmi.h b/tools/qmi-test/shim/linux/soc/qcom/qmi.hindex 420baa3..af27f87 100644--- a/tools/qmi-test/shim/linux/soc/qcom/qmi.h+++ b/tools/qmi-test/shim/linux/soc/qcom/qmi.h@@ -1,2 +1,2 @@/* What the driver's compatibility headers will have in this place: one line. */-#include <sys/redwood_qmi.h>+#include <sys/hakios.qmi.h>diff --git a/tools/qmi-test/test_nas.c b/tools/qmi-test/test_nas.cindex 7c3f24a..ed48b5b 100644--- a/tools/qmi-test/test_nas.c+++ b/tools/qmi-test/test_nas.c@@ -1,7 +1,7 @@#include <assert.h>#include <stdio.h>-#include <sys/redwood_nas.h>-#include <sys/redwood_qrtr.h>+#include <sys/hakios.nas.h>+#include <sys/hakios.qrtr.h>/* Literal NAS frames using the public QMI TLV layout. */static const unsigned char registered[] = {@@ -24,17 +24,17 @@ static const unsigned char failed_signal[] = {0x14, 6, 0, 0xba, 0xf6, 0xa1, 0xff, 0x64, 0};-static redwood_qrtr_receive_t received;-static redwood_qrtr_server_t server;+static hakios_qrtr_receive_t received;+static hakios_qrtr_server_t server;static void *callback_context;static int requests, updates;-static struct redwood_qrtr_port *open_port(redwood_qrtr_receive_t receive, redwood_qrtr_server_t on_server, void *context)+static struct hakios_qrtr_port *open_port(hakios_qrtr_receive_t receive, hakios_qrtr_server_t on_server, void *context){received = receive; server = on_server; callback_context = context;- return (struct redwood_qrtr_port *)(uintptr_t)1;+ return (struct hakios_qrtr_port *)(uintptr_t)1;}-static int send_packet(struct redwood_qrtr_port *port, uint32_t node, uint32_t peer,+static int send_packet(struct hakios_qrtr_port *port, uint32_t node, uint32_t peer,const void *data, size_t length){const unsigned char *bytes = data;@@ -43,41 +43,41 @@ static int send_packet(struct redwood_qrtr_port *port, uint32_t node, uint32_t prequests++;return 0;}-static int lookup_port(struct redwood_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance)+static int lookup_port(struct hakios_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance){assert(port && service == 3 && version == 0 && instance == 0);server(callback_context, true, 3, 1, 0, 7, 9);return 0;}-static void close_port(struct redwood_qrtr_port *port) { assert(port); }-static void changed(void *context, const struct redwood_nas_state *state)+static void close_port(struct hakios_qrtr_port *port) { assert(port); }+static void changed(void *context, const struct hakios_nas_state *state){assert(context && state);updates++;}-static const struct redwood_qrtr_ops transport = {+static const struct hakios_qrtr_ops transport = {.open = open_port, .send = send_packet, .lookup = lookup_port, .close = close_port};int main(void){- struct redwood_nas_state state = {0};- assert(redwood_nas_apply(&state, lte_signal, sizeof(lte_signal)) == 1);+ struct hakios_nas_state state = {0};+ assert(hakios_nas_apply(&state, lte_signal, sizeof(lte_signal)) == 1);assert(state.has_signal && !state.registered && state.bars == 0);- assert(redwood_nas_apply(&state, registered, sizeof(registered)) == 1);+ assert(hakios_nas_apply(&state, registered, sizeof(registered)) == 1);assert(state.registered && state.bars == 0);- assert(redwood_nas_apply(&state, lte_signal, sizeof(lte_signal)) == 1);+ assert(hakios_nas_apply(&state, lte_signal, sizeof(lte_signal)) == 1);assert(state.radio_interface == 8 && state.dbm == -95 && state.bars == 4);- assert(redwood_nas_apply(&state, failed_signal, sizeof(failed_signal)) == 0);+ assert(hakios_nas_apply(&state, failed_signal, sizeof(failed_signal)) == 0);assert(state.bars == 4);for (size_t n = 0; n < sizeof(lte_signal); n++) {- assert(redwood_nas_apply(&state, lte_signal, n) == -1);+ assert(hakios_nas_apply(&state, lte_signal, n) == -1);assert(state.bars == 4);}- assert(redwood_nas_apply(&state, disconnected, sizeof(disconnected)) == 1);+ assert(hakios_nas_apply(&state, disconnected, sizeof(disconnected)) == 1);assert(!state.registered && !state.has_signal && state.bars == 0);- struct redwood_nas_client client;- assert(redwood_nas_client_open(&client, &transport, changed, &client) == 0);+ struct hakios_nas_client client;+ assert(hakios_nas_client_open(&client, &transport, changed, &client) == 0);assert(requests == 2);received(callback_context, 7, 9, registered, sizeof(registered));received(callback_context, 7, 9, lte_signal, sizeof(lte_signal));@@ -86,7 +86,7 @@ int main(void)assert(client.state.registered && updates == 2);server(callback_context, false, 3, 1, 0, 7, 9);assert(!client.state.registered && client.state.bars == 0 && updates == 3);- redwood_nas_client_close(&client);+ hakios_nas_client_close(&client);puts("nas-test: registration gates bars; QRTR lookup, polling and disconnect verified");return 0;}diff --git a/tools/qmi-test/test_qmi.c b/tools/qmi-test/test_qmi.cindex 9021950..80f65d7 100644--- a/tools/qmi-test/test_qmi.c+++ b/tools/qmi-test/test_qmi.c@@ -1,5 +1,5 @@/*- * Tests of the QMI helpers (bsd/dev/redwood_qmi.c in the kernel tree) on the machine that builds+ * Tests of the QMI helpers (bsd/dev/hakios.qmi.c in the kernel tree) on the machine that builds* them; tools/qmi-test/run.sh compiles and runs this.** Three kinds:@@ -10,7 +10,7 @@* tables filled at random, encoded, decoded and compared; filled to the brim and the length* compared with the ..._MAX_LEN its header gives; a hundred thousand damaged messages decoded* under the address sanitizer;- * 3. the helpers over a router made up here (struct redwood_qrtr_ops): lookup, a server coming+ * 3. the helpers over a router made up here (struct hakios_qrtr_ops): lookup, a server coming* and going, requests and replies as transactions (in time, late, never, crossed, undecodable),* indications to handlers, and the whole exchange a WCN6750's firmware and ath11k have up to* "firmware ready", played by a firmware made up here.@@ -25,8 +25,8 @@#include <time.h>#include <unistd.h>-#include <sys/redwood_qmi.h>-#include <sys/redwood_qrtr.h>+#include <sys/hakios.qmi.h>+#include <sys/hakios.qrtr.h>#define HZ 250 /* what a Linux might have: qmi_txn_wait() must take it from here */#define msecs_to_jiffies(ms) ((unsigned long)(ms) * HZ / 1000)@@ -206,11 +206,11 @@ test_own_tables(void)o.big_valid = 1;strcpy(o.big.name, "xyz");o.big.n = 42;- n = redwood_qmi_encode(QMI_REQUEST, 0xabcd, 0x1234, outer_ei, &o, buffer, sizeof(buffer));+ n = hakios_qmi_encode(QMI_REQUEST, 0xabcd, 0x1234, outer_ei, &o, buffer, sizeof(buffer));check_bytes(buffer, n, full, sizeof(full), "own table, everything there");memset(&back, 0, sizeof(back));- n = redwood_qmi_decode(full, sizeof(full), outer_ei, &back);+ n = hakios_qmi_decode(full, sizeof(full), outer_ei, &back);check(n == (int)sizeof(full), "own table: decoding gives %d, not the message's %zu bytes", n, sizeof(full));check(back.first == 0x7f && back.second_valid == 1 && back.second == 0x12345678 && back.list_valid == 1 &&back.list_len == 2 && back.list[0] == 1 && back.list[1] == 0xffff && back.fixed[0] == 0x0102030405060708ULL &&@@ -225,13 +225,13 @@ test_own_tables(void)o.kind = 5;o.second = 77; /* not valid: must not be sent */o.list_len = 3;- n = redwood_qmi_encode(QMI_INDICATION, 1, 0, outer_ei, &o, buffer, sizeof(buffer));+ n = hakios_qmi_encode(QMI_INDICATION, 1, 0, outer_ei, &o, buffer, sizeof(buffer));check_bytes(buffer, n, bare, sizeof(bare), "own table, nothing optional");memset(&back, 0xee, sizeof(back));memset(&back, 0, offsetof(struct outer, fixed));back.inners_valid = back.text_valid = back.big_valid = 0;- n = redwood_qmi_decode(shuffled, sizeof(shuffled), outer_ei, &back);+ n = hakios_qmi_decode(shuffled, sizeof(shuffled), outer_ei, &back);check(n == (int)sizeof(shuffled) && back.kind == 9 && back.first == 0x11 && back.second_valid == 1 && back.second == 2 &&back.list_valid == 1 && back.list_len == 0 && back.inners_valid == 0 && back.text_valid == 0 && back.big_valid == 0,"own table: TLVs out of order, unknown ones and a repeated one (%d)", n);@@ -239,15 +239,15 @@ test_own_tables(void)/* what must be refused */memset(&o, 0, sizeof(o));- check(redwood_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, 34) == -EMSGSIZE, "a buffer one byte too small is not refused");- check(redwood_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, 35) == 35, "a buffer of exactly the size is refused");+ check(hakios_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, 34) == -EMSGSIZE, "a buffer one byte too small is not refused");+ check(hakios_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, 35) == 35, "a buffer of exactly the size is refused");o.list_valid = 1;o.list_len = 6;- check(redwood_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, sizeof(buffer)) == -EINVAL, "a count over the array's size is encoded");+ check(hakios_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, sizeof(buffer)) == -EINVAL, "a count over the array's size is encoded");o.list_len = 0;o.text_valid = 1;memset(o.text, 'a', sizeof(o.text));- check(redwood_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, sizeof(buffer)) == -EINVAL, "a string with no end is encoded");+ check(hakios_qmi_encode(QMI_REQUEST, 1, 1, outer_ei, &o, buffer, sizeof(buffer)) == -EINVAL, "a string with no end is encoded");{static const uint8_t count_too_big[] = { 0, 0, 0, 0, 0, 0x0f, 0, 0x11, 0x0c, 0, 0x06, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0 };static const uint8_t tlv_past_end[] = { 0, 0, 0, 0, 0, 0x04, 0, 0x01, 0x05, 0, 0x01 };@@ -258,18 +258,18 @@ test_own_tables(void)uint8_t long_string[7 + 3 + 300];memset(&back, 0, sizeof(back));- check(redwood_qmi_decode(count_too_big, sizeof(count_too_big), outer_ei, &back) == -EINVAL, "a count over the array's size is decoded");- check(redwood_qmi_decode(tlv_past_end, sizeof(tlv_past_end), outer_ei, &back) == -EINVAL, "a TLV longer than the message is decoded");- check(redwood_qmi_decode(value_past_tlv, sizeof(value_past_tlv), outer_ei, &back) == -EINVAL, "a number longer than its TLV is decoded");- check(redwood_qmi_decode(length_lies, sizeof(length_lies), outer_ei, &back) == -EINVAL, "a header that says more than there is, is believed");- check(redwood_qmi_decode(stray_byte, sizeof(stray_byte), outer_ei, &back) == -EINVAL, "a stray byte after the last TLV is let pass");- check(redwood_qmi_decode(inner_short, sizeof(inner_short), outer_ei, &back) == -EINVAL, "a structure cut short is decoded");+ check(hakios_qmi_decode(count_too_big, sizeof(count_too_big), outer_ei, &back) == -EINVAL, "a count over the array's size is decoded");+ check(hakios_qmi_decode(tlv_past_end, sizeof(tlv_past_end), outer_ei, &back) == -EINVAL, "a TLV longer than the message is decoded");+ check(hakios_qmi_decode(value_past_tlv, sizeof(value_past_tlv), outer_ei, &back) == -EINVAL, "a number longer than its TLV is decoded");+ check(hakios_qmi_decode(length_lies, sizeof(length_lies), outer_ei, &back) == -EINVAL, "a header that says more than there is, is believed");+ check(hakios_qmi_decode(stray_byte, sizeof(stray_byte), outer_ei, &back) == -EINVAL, "a stray byte after the last TLV is let pass");+ check(hakios_qmi_decode(inner_short, sizeof(inner_short), outer_ei, &back) == -EINVAL, "a structure cut short is decoded");memset(long_string, 'b', sizeof(long_string));memcpy(long_string, "\0\0\0\0\0\x2f\x01\x13\x2c\x01", 10); /* a string of exactly 300 */- check(redwood_qmi_decode(long_string, sizeof(long_string), outer_ei, &back) == -EINVAL, "a string that fills its buffer is decoded");+ check(hakios_qmi_decode(long_string, sizeof(long_string), outer_ei, &back) == -EINVAL, "a string that fills its buffer is decoded");long_string[5] = 0x2e;long_string[8] = 0x2b; /* 299: fits, with its zero */- check(redwood_qmi_decode(long_string, sizeof(long_string) - 1, outer_ei, &back) == 7 + 3 + 299 && strlen(back.text) == 299,+ check(hakios_qmi_decode(long_string, sizeof(long_string) - 1, outer_ei, &back) == 7 + 3 + 299 && strlen(back.text) == 299,"a string one short of its buffer is not decoded");}/* the reply every response starts with */@@ -282,11 +282,11 @@ test_own_tables(void)};struct qmi_response_type_v01 r = { 0xffff, 0xffff };- check(redwood_qmi_decode(ok, sizeof(ok), reply_ei, &r) == 14 && r.result == QMI_RESULT_SUCCESS_V01 && r.error == QMI_ERR_NONE_V01,+ check(hakios_qmi_decode(ok, sizeof(ok), reply_ei, &r) == 14 && r.result == QMI_RESULT_SUCCESS_V01 && r.error == QMI_ERR_NONE_V01,"the common reply, success");- check(redwood_qmi_decode(no, sizeof(no), reply_ei, &r) == 14 && r.result == QMI_RESULT_FAILURE_V01 &&+ check(hakios_qmi_decode(no, sizeof(no), reply_ei, &r) == 14 && r.result == QMI_RESULT_FAILURE_V01 &&r.error == QMI_ERR_NOT_SUPPORTED_V01, "the common reply, failure");- check_bytes(buffer, redwood_qmi_encode(QMI_RESPONSE, 0x22, 7, reply_ei, &r, buffer, sizeof(buffer)), no, sizeof(no), "the common reply");+ check_bytes(buffer, hakios_qmi_encode(QMI_RESPONSE, 0x22, 7, reply_ei, &r, buffer, sizeof(buffer)), no, sizeof(no), "the common reply");}/* a request with nothing in it */{@@ -294,8 +294,8 @@ test_own_tables(void)static const struct qmi_elem_info none_ei[] = { { QMI_EOTI, 0, 0, NO_ARRAY, 0, 0, NULL } };uint8_t nothing = 0;- check_bytes(buffer, redwood_qmi_encode(QMI_REQUEST, 0x24, 9, none_ei, ¬hing, buffer, sizeof(buffer)), empty, sizeof(empty), "an empty request");- check_bytes(buffer, redwood_qmi_encode(QMI_REQUEST, 0x24, 9, NULL, NULL, buffer, sizeof(buffer)), empty, sizeof(empty), "a request with no table");+ check_bytes(buffer, hakios_qmi_encode(QMI_REQUEST, 0x24, 9, none_ei, ¬hing, buffer, sizeof(buffer)), empty, sizeof(empty), "an empty request");+ check_bytes(buffer, hakios_qmi_encode(QMI_REQUEST, 0x24, 9, NULL, NULL, buffer, sizeof(buffer)), empty, sizeof(empty), "a request with no table");}}@@ -335,7 +335,7 @@ test_wlfw_by_hand(void)req.cal_done_enable_valid = 1;req.cal_done_enable = 1;req.pin_connect_result_enable = 1; /* (not valid: stays out) */- check_bytes(buffer, redwood_qmi_encode(QMI_REQUEST, 0x20, 5, qmi_wlanfw_ind_register_req_msg_v01_ei, &req, buffer,+ check_bytes(buffer, hakios_qmi_encode(QMI_REQUEST, 0x20, 5, qmi_wlanfw_ind_register_req_msg_v01_ei, &req, buffer,sizeof(buffer)), want, sizeof(want), "WLFW indication register request");}/* the mode: one number that is always there, one byte that may be */@@ -348,10 +348,10 @@ test_wlfw_by_hand(void)struct qmi_wlanfw_wlan_mode_req_msg_v01 req = { .mode = 7, .hw_debug_valid = 1, .hw_debug = 0 };struct qmi_wlanfw_wlan_mode_req_msg_v01 back;- check_bytes(buffer, redwood_qmi_encode(QMI_REQUEST, 0x22, 9, qmi_wlanfw_wlan_mode_req_msg_v01_ei, &req, buffer,+ check_bytes(buffer, hakios_qmi_encode(QMI_REQUEST, 0x22, 9, qmi_wlanfw_wlan_mode_req_msg_v01_ei, &req, buffer,sizeof(buffer)), want, sizeof(want), "WLFW mode request");memset(&back, 0, sizeof(back));- check(redwood_qmi_decode(want, sizeof(want), qmi_wlanfw_wlan_mode_req_msg_v01_ei, &back) == (int)sizeof(want) &&+ check(hakios_qmi_decode(want, sizeof(want), qmi_wlanfw_wlan_mode_req_msg_v01_ei, &back) == (int)sizeof(want) &&back.mode == 7 && back.hw_debug_valid == 1 && back.hw_debug == 0, "WLFW mode request, decoded");}/* a piece of the board file: an array of bytes with a 2-byte count */@@ -383,10 +383,10 @@ test_wlfw_by_hand(void)req.end = 1;req.bdf_type_valid = 1;req.bdf_type = 1;- check_bytes(buffer, redwood_qmi_encode(QMI_REQUEST, 0x25, 0x0102, qmi_wlanfw_bdf_download_req_msg_v01_ei, &req, buffer,+ check_bytes(buffer, hakios_qmi_encode(QMI_REQUEST, 0x25, 0x0102, qmi_wlanfw_bdf_download_req_msg_v01_ei, &req, buffer,sizeof(buffer)), want, sizeof(want), "WLFW board data request");memset(&back, 0, sizeof(back));- check(redwood_qmi_decode(want, sizeof(want), qmi_wlanfw_bdf_download_req_msg_v01_ei, &back) == (int)sizeof(want) &&+ check(hakios_qmi_decode(want, sizeof(want), qmi_wlanfw_bdf_download_req_msg_v01_ei, &back) == (int)sizeof(want) &&back.data_valid == 1 && back.data_len == 5 && memcmp(back.data, "\xde\xad\xbe\xef\x01", 5) == 0 && back.seg_id == 2 &&back.end == 1 && back.bdf_type == 1, "WLFW board data request, decoded");}@@ -408,7 +408,7 @@ test_wlfw_by_hand(void)static struct qmi_wlanfw_cap_resp_msg_v01 cap;memset(&cap, 0, sizeof(cap));- check(redwood_qmi_decode(reply, sizeof(reply), qmi_wlanfw_cap_resp_msg_v01_ei, &cap) == (int)sizeof(reply),+ check(hakios_qmi_decode(reply, sizeof(reply), qmi_wlanfw_cap_resp_msg_v01_ei, &cap) == (int)sizeof(reply),"WLFW capabilities reply is not decoded");check(cap.resp.result == 0 && cap.chip_info_valid == 1 && cap.chip_info.chip_id == 0x18 && cap.chip_info.chip_family == 0x0b &&cap.board_info_valid == 1 && cap.board_info.board_id == 0xff && cap.soc_info_valid == 1 && cap.soc_info.soc_id == 0x40020320 &&@@ -416,7 +416,7 @@ test_wlfw_by_hand(void)strcmp(cap.fw_version_info.fw_build_timestamp, "2023-04-15 01:27") == 0 && cap.fw_build_id_valid == 1 &&strcmp(cap.fw_build_id, "WLAN.MSL.1.0.1-01277-QCAMSLSWCBT-1") == 0 && cap.num_macs_valid == 1 && cap.num_macs == 2 &&cap.voltage_mv_valid == 0, "WLFW capabilities reply: the fields are not what the bytes say");- check_bytes(buffer, redwood_qmi_encode(QMI_RESPONSE, 0x24, 3, qmi_wlanfw_cap_resp_msg_v01_ei, &cap, buffer, sizeof(buffer)),+ check_bytes(buffer, hakios_qmi_encode(QMI_RESPONSE, 0x24, 3, qmi_wlanfw_cap_resp_msg_v01_ei, &cap, buffer, sizeof(buffer)),reply, sizeof(reply), "WLFW capabilities reply, encoded again");}/* "give me memory": an array of structures, each with an array of structures in it */@@ -432,7 +432,7 @@ test_wlfw_by_hand(void)static struct qmi_wlanfw_request_mem_ind_msg_v01 ind;memset(&ind, 0, sizeof(ind));- check(redwood_qmi_decode(indication, sizeof(indication), qmi_wlanfw_request_mem_ind_msg_v01_ei, &ind) == (int)sizeof(indication),+ check(hakios_qmi_decode(indication, sizeof(indication), qmi_wlanfw_request_mem_ind_msg_v01_ei, &ind) == (int)sizeof(indication),"WLFW memory request is not decoded");check(ind.mem_seg_len == 2 && ind.mem_seg[0].size == 0x400000 && ind.mem_seg[0].type == 1 && ind.mem_seg[0].mem_cfg_len == 1 &&ind.mem_seg[1].size == 0x80000 && ind.mem_seg[1].type == 4 && ind.mem_seg[1].mem_cfg_len == 0,@@ -597,7 +597,7 @@ test_ath11k_tables(void)/* filled to the brim: as long as ath11k's header says the message can get */fill(m->ei, a, true, FILL_MOST);- length = redwood_qmi_encode(QMI_REQUEST, 1, 1, m->ei, a, message, sizeof(message));+ length = hakios_qmi_encode(QMI_REQUEST, 1, 1, m->ei, a, message, sizeof(message));check(length >= QMI_HEADER_SIZE, "%s: cannot be encoded when full (%d)", m->name, length);if (m->limit >= 0) {/*@@ -614,7 +614,7 @@ test_ath11k_tables(void)check(length - QMI_HEADER_SIZE == expected, "%s: full, it encodes to %d bytes, not %d (ath11k's header says %d at most)",m->name, length - QMI_HEADER_SIZE, expected, m->limit);}- check(redwood_qmi_decode(message, (size_t)length, m->ei, b) == length && same(m->ei, a, b, true), "%s: full, it does not come back the same",+ check(hakios_qmi_decode(message, (size_t)length, m->ei, b) == length && same(m->ei, a, b, true), "%s: full, it does not come back the same",m->name);/* (the bytes after a structure are guard bytes: nothing may have been written there) */check(memcmp(b + m->size, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) == 0, "%s: decoding wrote past the structure", m->name);@@ -624,12 +624,12 @@ test_ath11k_tables(void)memset(a, 0, m->size);memset(b, 0, m->size);fill(m->ei, a, true, FILL_RANDOM);- length = redwood_qmi_encode(QMI_INDICATION, (uint16_t)rnd(), (uint16_t)rnd(), m->ei, a, message, sizeof(message));- if (length < 0 || redwood_qmi_decode(message, (size_t)length, m->ei, b) != length || !same(m->ei, a, b, true)) {+ length = hakios_qmi_encode(QMI_INDICATION, (uint16_t)rnd(), (uint16_t)rnd(), m->ei, a, message, sizeof(message));+ if (length < 0 || hakios_qmi_decode(message, (size_t)length, m->ei, b) != length || !same(m->ei, a, b, true)) {check(false, "%s: round %d: does not come back the same (%d)", m->name, round, length);break;}- second = redwood_qmi_encode(message[0], (uint16_t)(message[3] | message[4] << 8), (uint16_t)(message[1] | message[2] << 8),+ second = hakios_qmi_encode(message[0], (uint16_t)(message[3] | message[4] << 8), (uint16_t)(message[1] | message[2] << 8),m->ei, b, again, sizeof(again));if (second != length || memcmp(message, again, (size_t)length) != 0) {check(false, "%s: round %d: encoded again, the bytes differ", m->name, round);@@ -653,7 +653,7 @@ test_ath11k_tables(void)uint8_t *exact = malloc(cut ? cut : 1);memcpy(exact, damaged, cut);- (void)redwood_qmi_decode(exact, cut, m->ei, b);+ (void)hakios_qmi_decode(exact, cut, m->ei, b);free(exact);}checks++;@@ -674,9 +674,9 @@ test_ath11k_tables(void)#define SERVER_NODE 7#define SERVER_PORT 0x4001-struct redwood_qrtr_port {- redwood_qrtr_receive_t receive;- redwood_qrtr_server_t server;+struct hakios_qrtr_port {+ hakios_qrtr_receive_t receive;+ hakios_qrtr_server_t server;void *context;bool open;unsigned lookups, sent, closed;@@ -686,12 +686,12 @@ struct redwood_qrtr_port {size_t last_length;int send_error; /* what send answers *//* what the other side does with a datagram: called from send (as a router that delivers at once would) */- void (*peer)(struct redwood_qrtr_port *port, const uint8_t *data, size_t length);+ void (*peer)(struct hakios_qrtr_port *port, const uint8_t *data, size_t length);};-static struct redwood_qrtr_port router;+static struct hakios_qrtr_port router;-static struct redwood_qrtr_port *-router_open(redwood_qrtr_receive_t receive, redwood_qrtr_server_t server, void *context)+static struct hakios_qrtr_port *+router_open(hakios_qrtr_receive_t receive, hakios_qrtr_server_t server, void *context){memset(&router, 0, sizeof(router));router.receive = receive;@@ -702,7 +702,7 @@ router_open(redwood_qrtr_receive_t receive, redwood_qrtr_server_t server, void *}static int-router_send(struct redwood_qrtr_port *port, uint32_t node, uint32_t to_port, const void *data, size_t length)+router_send(struct hakios_qrtr_port *port, uint32_t node, uint32_t to_port, const void *data, size_t length){if (port->send_error) {return port->send_error;@@ -719,7 +719,7 @@ router_send(struct redwood_qrtr_port *port, uint32_t node, uint32_t to_port, con}static int-router_lookup(struct redwood_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance)+router_lookup(struct hakios_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance){port->lookups++;port->looked_service = service;@@ -729,13 +729,13 @@ router_lookup(struct redwood_qrtr_port *port, uint32_t service, uint32_t version}static void-router_close(struct redwood_qrtr_port *port)+router_close(struct hakios_qrtr_port *port){port->open = false;port->closed++;}-static const struct redwood_qrtr_ops router_ops = { router_open, router_send, router_lookup, router_close };+static const struct hakios_qrtr_ops router_ops = { router_open, router_send, router_lookup, router_close };/* A datagram from the server to the handle, as the router's thread would bring it. */static void@@ -883,7 +883,7 @@ static const struct qmi_msg_handler handle_handlers[] = {/* The peer of the simplest kind: answers "ask" with twice the number, at once. */static void-doubling_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t length)+doubling_peer(struct hakios_qrtr_port *port, const uint8_t *data, size_t length){uint8_t reply[32];size_t n;@@ -924,7 +924,7 @@ asker_thread(void *argument)a->id = (uint16_t)qmi_txn_init(a->qmi, &txn, answer_ei, &a->answer);a->result = qmi_send_request(a->qmi, NULL, &txn, MESSAGE_ASK, 16, ask_ei, &ask);if (a->result == 0) {- a->result = redwood_qmi_txn_wait_ms(&txn, 3000);+ a->result = hakios_qmi_txn_wait_ms(&txn, 3000);}return NULL;}@@ -942,13 +942,13 @@ test_helpers(void)int id, result;/* no router: no handle */- redwood_qmi_set_transport(NULL);+ hakios_qmi_set_transport(NULL);check(qmi_handle_init(&qmi, 8192, &handle_ops, handle_handlers) == -ENXIO && qmi.sock == NULL, "a handle is made with no router there");- check(redwood_qmi_handle_init_transport(&qmi, 8192, &handle_ops, handle_handlers, &router_ops) == 0 &&+ check(hakios_qmi_handle_init_transport(&qmi, 8192, &handle_ops, handle_handlers, &router_ops) == 0 &&qmi.sock != NULL, "an explicit transport cannot be used without the default router");qmi_handle_release(&qmi);- redwood_qmi_set_transport(&router_ops);+ hakios_qmi_set_transport(&router_ops);memset(&seen, 0, sizeof(seen));check(qmi_handle_init(&qmi, 8192, &handle_ops, handle_handlers) == 0 && qmi.sock != NULL && router.open, "no handle with a router there");@@ -978,7 +978,7 @@ test_helpers(void)check_bytes(router.last, (int)router.last_length, want, sizeof(want), "the request as the router got it");check(router.last_node == SERVER_NODE && router.last_port == SERVER_PORT, "the request goes to %u:%u", router.last_node, router.last_port);}- result = redwood_qmi_txn_wait_ms(&txn, 1000);+ result = hakios_qmi_txn_wait_ms(&txn, 1000);check(result == 21 && answer.resp.result == 0 && answer.twice_valid == 1 && answer.twice == 42, "the reply does not arrive (%d, %u)", result,answer.twice);@@ -1029,7 +1029,7 @@ test_helpers(void)reply[1] ^= 0x40;reply[8] = 9; /* the TLV says more than the message has */deliver(reply, n);- result = redwood_qmi_txn_wait_ms(&txn, 200);+ result = hakios_qmi_txn_wait_ms(&txn, 200);check(result == -EINVAL, "a reply that cannot be decoded gives %d", result);/* three at once have three numbers; two threads ask, the replies come in the other order */@@ -1124,7 +1124,7 @@ test_helpers(void)qmi_handle_release(&qmi);check(router.closed == 1 && !router.open && qmi.sock == NULL, "release does not close the port");- redwood_qmi_set_transport(NULL);+ hakios_qmi_set_transport(NULL);}#ifndef NO_ATH11K@@ -1158,7 +1158,7 @@ firmware_indicates(uint16_t message, unsigned ms)}static void-firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t length)+firmware_peer(struct hakios_qrtr_port *port, const uint8_t *data, size_t length){static uint8_t reply[512];uint16_t message = (uint16_t)(data[3] | data[4] << 8);@@ -1177,9 +1177,9 @@ firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t lengthstruct qmi_wlanfw_ind_register_resp_msg_v01 resp = { .fw_status_valid = 1, .fw_status = 0 };memset(&req, 0, sizeof(req));- firmware.bad |= redwood_qmi_decode(data, length, qmi_wlanfw_ind_register_req_msg_v01_ei, &req) < 0 || !req.fw_ready_enable ||+ firmware.bad |= hakios_qmi_decode(data, length, qmi_wlanfw_ind_register_req_msg_v01_ei, &req) < 0 || !req.fw_ready_enable ||!req.fw_init_done_enable || !req.cal_done_enable || req.request_mem_enable_valid;- n = redwood_qmi_encode(QMI_RESPONSE, message, (uint16_t)(data[1] | data[2] << 8), qmi_wlanfw_ind_register_resp_msg_v01_ei, &resp,+ n = hakios_qmi_encode(QMI_RESPONSE, message, (uint16_t)(data[1] | data[2] << 8), qmi_wlanfw_ind_register_resp_msg_v01_ei, &resp,reply, sizeof(reply));break;}@@ -1187,7 +1187,7 @@ firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t lengthstatic struct qmi_wlanfw_host_cap_req_msg_v01 req;memset(&req, 0, sizeof(req));- firmware.bad |= redwood_qmi_decode(data, length, qmi_wlanfw_host_cap_req_msg_v01_ei, &req) < 0 || !req.num_clients_valid ||+ firmware.bad |= hakios_qmi_decode(data, length, qmi_wlanfw_host_cap_req_msg_v01_ei, &req) < 0 || !req.num_clients_valid ||req.num_clients != 1 || !req.mem_cfg_mode_valid || req.m3_support != 0;break;}@@ -1208,7 +1208,7 @@ firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t lengthresp.fw_build_id_valid = 1;strcpy(resp.fw_build_id, "WLAN.MSL.1.0.1-01277-QCAMSLSWCBT-1");firmware.bad |= length != QMI_HEADER_SIZE;- n = redwood_qmi_encode(QMI_RESPONSE, message, (uint16_t)(data[1] | data[2] << 8), qmi_wlanfw_cap_resp_msg_v01_ei, &resp, reply,+ n = hakios_qmi_encode(QMI_RESPONSE, message, (uint16_t)(data[1] | data[2] << 8), qmi_wlanfw_cap_resp_msg_v01_ei, &resp, reply,sizeof(reply));break;}@@ -1216,7 +1216,7 @@ firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t lengthstruct qmi_wlanfw_device_info_resp_msg_v01 resp = { .bar_addr = 0x17a00000, .bar_size = 0x200000, .bar_addr_valid = 1,.bar_size_valid = 1 };- n = redwood_qmi_encode(QMI_RESPONSE, message, (uint16_t)(data[1] | data[2] << 8), qmi_wlfw_device_info_resp_msg_v01_ei, &resp,+ n = hakios_qmi_encode(QMI_RESPONSE, message, (uint16_t)(data[1] | data[2] << 8), qmi_wlfw_device_info_resp_msg_v01_ei, &resp,reply, sizeof(reply));break;}@@ -1224,7 +1224,7 @@ firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t lengthstatic struct qmi_wlanfw_bdf_download_req_msg_v01 req;memset(&req, 0, sizeof(req));- if (redwood_qmi_decode(data, length, qmi_wlanfw_bdf_download_req_msg_v01_ei, &req) < 0 || !req.valid || !req.data_valid ||+ if (hakios_qmi_decode(data, length, qmi_wlanfw_bdf_download_req_msg_v01_ei, &req) < 0 || !req.valid || !req.data_valid ||req.seg_id != firmware.segments || req.total_size != sizeof(firmware.file) ||firmware.got_length + req.data_len > sizeof(firmware.got)) {firmware.bad = true;@@ -1242,7 +1242,7 @@ firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t lengthcase 0x22: { /* mode */struct qmi_wlanfw_wlan_mode_req_msg_v01 req = { 0 };- firmware.bad |= redwood_qmi_decode(data, length, qmi_wlanfw_wlan_mode_req_msg_v01_ei, &req) < 0 || firmware.modes >= 4;+ firmware.bad |= hakios_qmi_decode(data, length, qmi_wlanfw_wlan_mode_req_msg_v01_ei, &req) < 0 || firmware.modes >= 4;firmware.mode[firmware.modes++ & 3] = req.mode;if (req.mode == 7) { /* cold boot calibration: done after a while, then ready */firmware_indicates(QMI_WLFW_COLD_BOOT_CAL_DONE_IND_V01, 30);@@ -1254,7 +1254,7 @@ firmware_peer(struct redwood_qrtr_port *port, const uint8_t *data, size_t lengthstatic struct qmi_wlanfw_wlan_cfg_req_msg_v01 req;memset(&req, 0, sizeof(req));- firmware.bad |= redwood_qmi_decode(data, length, qmi_wlanfw_wlan_cfg_req_msg_v01_ei, &req) < 0 || !req.tgt_cfg_valid ||+ firmware.bad |= hakios_qmi_decode(data, length, qmi_wlanfw_wlan_cfg_req_msg_v01_ei, &req) < 0 || !req.tgt_cfg_valid ||req.tgt_cfg_len != 9 || req.tgt_cfg[8].pipe_num != 8 || !req.svc_cfg_valid || req.svc_cfg_len != 20 ||strcmp(req.host_version, "WIN") != 0;break;@@ -1394,7 +1394,7 @@ test_conversation(void)for (size_t i = 0; i < sizeof(firmware.file); i++) {firmware.file[i] = (unsigned char)(rnd() >> 11);}- redwood_qmi_set_transport(&router_ops);+ hakios_qmi_set_transport(&router_ops);check(qmi_handle_init(&qmi, ATH11K_QMI_RESP_LEN_MAX, &host_ops, host_handlers) == 0, "conversation: no handle");router.peer = firmware_peer;check(qmi_add_lookup(&qmi, ATH11K_QMI_WLFW_SERVICE_ID_V01, ATH11K_QMI_WLFW_SERVICE_VERS_V01,@@ -1527,7 +1527,7 @@ test_conversation(void)pthread_join(firmware.threads[i], NULL);}qmi_handle_release(&qmi);- redwood_qmi_set_transport(NULL);+ hakios_qmi_set_transport(NULL);}#endif /* !NO_ATH11K */diff --git a/tools/sound.py b/tools/sound.pyindex 585ad23..a75cb81 100755--- a/tools/sound.py+++ b/tools/sound.py@@ -4,8 +4,8 @@usage: sound.py RECORDING OUT.wavRECORDING is the piece of memory as the loader hands it over ("xl sound"; under QEMU, the-monitor's pmemsave at the address in the kernel's line "redwood-audio: recording ... at 0x..."):-a header { "RWSND001", rate, channels, blocks }, then for every write to /dev/redwood-audio the+monitor's pmemsave at the address in the kernel's line "hakios-audio: recording ... at 0x..."):+a header { "RWSND001", rate, channels, blocks }, then for every write to /dev/hakios-audio thetime it was made (nanoseconds since the kernel started), the number of frames and the framesthemselves, 16-bit samples. iOS writes only while something plays, so the recording holds nosilence: here the blocks are put back where they were in time, with silence in betweendiff --git a/tools/ufs-survey.py b/tools/ufs-survey.pyindex 6202187..566234c 100644--- a/tools/ufs-survey.py+++ b/tools/ufs-survey.py@@ -11,7 +11,7 @@ of in the ROM's firmware-update/ it prints an FNV-1a hash of exactly as many bythas. This computes the same hash from the images and says, partition by partition, whether thetwo agree: where they do, reading through that driver gives the bytes that are on the flash.With ufs=2 ufs_check=1 the kernel then reads the same partitions through the loader's page-(bsd/dev/redwood_ufs.c) and prints the same hashes: those are shown as kernel:NAME.+(bsd/dev/hakios.ufs.c) and prints the same hashes: those are shown as kernel:NAME.Nothing is read from the phone here; it only reads the log."""import rediff --git a/tools/update-prebuilt.sh b/tools/update-prebuilt.shindex a1d455b..a5478ff 100755--- a/tools/update-prebuilt.sh+++ b/tools/update-prebuilt.sh@@ -7,21 +7,21 @@ cd "$(dirname "$(readlink -f "$0")")/.."# KERNEL=... to take the kernel from a tree built elsewhere (xnu/apply.sh makes one anywhere)K=${KERNEL:-xnu-src/xnu-8796.121.2/BUILD/obj/DEVELOPMENT_ARM64_BCM2837/mach.development.bcm2837}MU=Mu-Silicium-mkdir -p prebuilt/userland devices/redwood/prebuilt+mkdir -p prebuilt/userland devices/poco-x5-pro/prebuiltcp $K prebuilt/mach.development.bcm2837cp xnuloader/loader.efi prebuilt/loader.eficp userland/hello prebuilt/userland/-for f in init child stage0 hello_dyn svc_test surf_test rwtouch mg_test cpu_test sound_test libredwood.dylib libredwood-sb.dylib \- libredwood-media.dylib libredwood-app.dylib libredwood-tweaks.dylib RedwoodAudio net_test; do+for f in init child stage0 hello_dyn svc_test surf_test rwtouch mg_test cpu_test sound_test libhakios.dylib libhakios.sb.dylib \+ libhakios.media.dylib libhakios.app.dylib libhakios.tweaks.dylib HakiosAudio net_test; docp userland/obj/$f prebuilt/userland/doneif [ -f $MU/Build/redwoodPkg/RELEASE_CLANGPDB/FV/SILICIUM_UEFI.fd ]; thencp $MU/Build/redwoodPkg/RELEASE_CLANGPDB/FV/SILICIUM_UEFI.fd $MU/BootShim/BootShim.bin $MU/Resources/DTBs/redwood.dtb \- $MU/Resources/ramdisk $MU/Resources/Scripts/mkbootimg.py devices/redwood/prebuilt/+ $MU/Resources/ramdisk $MU/Resources/Scripts/mkbootimg.py devices/poco-x5-pro/prebuilt/fi{echo "Built $(date '+%Y-%m-%d %H:%M') from this tree."echo- sha256sum prebuilt/mach.development.bcm2837 prebuilt/loader.efi prebuilt/userland/* devices/redwood/prebuilt/* 2>/dev/null+ sha256sum prebuilt/mach.development.bcm2837 prebuilt/loader.efi prebuilt/userland/* devices/poco-x5-pro/prebuilt/* 2>/dev/null} > prebuilt/SHA256SUMS-ls -la prebuilt prebuilt/userland devices/redwood/prebuilt+ls -la prebuilt prebuilt/userland devices/poco-x5-pro/prebuiltdiff --git a/userland/build.sh b/userland/build.shindex e278ad5..94b77c9 100755--- a/userland/build.sh+++ b/userland/build.sh@@ -27,7 +27,7 @@# a directory). This goes into the boot volume, which every recipe# carries and which the flash recipe puts in RAM, so its size is paid# for at every boot -- a few megabytes, not more-# RC_JOBS=<file> what the job com.redwood.demo runs: rc.jobs (default), or+# RC_JOBS=<file> what the job com.hakios.demo runs: rc.jobs (default), or# rc.jobs.unlock, which also swipes the lock screen away (for the phone,# where nothing else can touch the screen yet).# A job list cannot assume a shell. iOS 16.5's own root has none at all@@ -42,7 +42,7 @@# air_run grew --buffer.# GL=1 with an OpenGL ES implementation for the window server: Mesa# (tools/mk-mesa.sh fetches and builds it) behind src/eagl.c, as-# lib/libOSMesa.8.dylib (15 MB) and lib/libredwood-gl.dylib. Where the+# lib/libOSMesa.8.dylib (15 MB) and lib/libhakios.gl.dylib. Where the# kernel has started the phone's GPU, CoreAnimation then draws with its# OpenGL ES renderer, by that GPU (boot-arg gpu=1); anywhere else -- QEMU,# no boot-arg, no firmware in ../fw-gpu -- the library is not even loaded@@ -50,7 +50,7 @@# GL=test: only the library and bin/gl_test (a triangle, src/gl_test.c;# RC_JOBS=rc.jobs.gltest runs it); the window server stays as it is.# ADSP=1 with the audio DSP's firmware from ../fw-audio in fw/ (20 MB; for the-# kernel's adsp_step=N, bsd/dev/redwood_adsp.c, which runs before the root is+# kernel's adsp_step=N, bsd/dev/hakios.adsp.c, which runs before the root is# mounted). Not beside GL=1: the two do not fit the 64 MB the loader takes with# the kernel. adsp=1 needs none of it: the system image has the firmware in /fw.# MODEM=1 stage checked local MPSS firmware from ../fw-modem in system.apfs /fw.@@ -108,7 +108,7 @@ IOS_JOBS=${JOBS-"com.apple.SpringBoard"}# iOS's own Wi-Fi daemon, for Settings to have a Wi-Fi to show: the kernel answers it in-# bsd/dev/redwood_apple80211.c. With the radio (wifi=1) Settings then shows Wi-Fi on, the network joined and the+# bsd/dev/hakios.apple80211.c. With the radio (wifi=1) Settings then shows Wi-Fi on, the network joined and the# networks the radio hears. NOT FINISHED: a network cannot be joined from Settings yet.# It is in by default now, because it costs nothing where there is no radio at all: in QEMU it comes up, talks# to itself about country codes and sits there -- 114 processes started against 119 without it, no crash, never@@ -119,27 +119,27 @@ IOS_JOBS=${JOBS-"# WIFID=0 leaves it out.[ "${WIFID-1}" != 0 ] && IOS_JOBS="$IOS_JOBS com.apple.wifid"# The programs (file names) started with a library of ours inside them: "LIBRARY NAME..." per line-# (src/inject.c is libredwood.dylib, src/inject_sb.c is libredwood-sb.dylib, src/inject_media.c is-# libredwood-media.dylib).+# (src/inject.c is libhakios.dylib, src/inject_sb.c is libhakios.sb.dylib, src/inject_media.c is+# libhakios.media.dylib).# What Sileo runs from /bin (see the package manager's prefix below): the system image's /bin, or the# boot volume's bin, bound over the iOS volume's /bin when that is the root (src/init.c, flash_root).SILEO_BIN="chmod cp mkdir mv rm"-# (libredwood-tweaks is the tweak loader of the package manager's prefix, src/inject_tweaks.c: in+# (libhakios.tweaks is the tweak loader of the package manager's prefix, src/inject_tweaks.c: in# SpringBoard the library above opens it, here it is named for the programs that have no library of# ours -- Settings, where a tweak's own pane belongs. Add a program's name to have tweaks in it.)-INJECT=${INJECT-"/redwood/lib/libredwood.dylib backboardd containermanagerd containermanagerd_system-/redwood/lib/libredwood-sb.dylib SpringBoard-/redwood/lib/libredwood-media.dylib mediaserverd-/redwood/lib/libredwood-app.dylib Sileo-/redwood/lib/libredwood-tweaks.dylib Preferences"}+INJECT=${INJECT-"/redwood/lib/libhakios.dylib backboardd containermanagerd containermanagerd_system+/redwood/lib/libhakios.sb.dylib SpringBoard+/redwood/lib/libhakios.media.dylib mediaserverd+/redwood/lib/libhakios.app.dylib Sileo+/redwood/lib/libhakios.tweaks.dylib Preferences"}# STOREFRONT=1: and a library of ours inside appstored as well (src/inject_store.c). It is not in the# list above because it changes what the daemon believes: AMS's account is made to answer with the# storefront Apple's bag server returned for this device, which is how the App Store is asked whether# a storefront is the only thing it is missing. It also writes down whether a bag request is ever# built at all. For an experiment, not for an image anybody else boots.[ -n "$STOREFRONT" ] && INJECT="$INJECT-/redwood/lib/libredwood-store.dylib appstored AppStore-/redwood/lib/libredwood-fairplay.dylib fairplayd.H2"+/redwood/lib/libhakios.store.dylib appstored AppStore+/redwood/lib/libhakios.fairplay.dylib fairplayd.H2"mkdir -p objif [ -z "$PREBUILT" ] && ! command -v ld64 >/dev/null; then PREBUILT=1; fi@@ -170,8 +170,8 @@ cp obj/child root/bin/child# ends: the program and its job together, away from the iOS job list below, which several working# copies are editing at once.[ -f obj/var_store ] && cp obj/var_store root/bin/-cp com.redwood.varstore.plist root/LaunchDaemons/-echo "Darwin on redwood: image built $(date '+%Y-%m-%d %H:%M')" > root/etc/motd+cp com.hakios.varstore.plist root/LaunchDaemons/+echo "Darwin on hakios: image built $(date '+%Y-%m-%d %H:%M')" > root/etc/motd# 300000 bytes, byte i = (i*31 + (i>>8)) & 0xff; init verifies it through read() and mmap()python3 -c "import sys; sys.stdout.buffer.write(bytes((i*31 + (i>>8)) & 0xff for i in range(300000)))" > root/share/pattern.bin# EXTRA_SHARE: whole directories of data for a one-off diagnostic, each under its own name. Here and@@ -230,42 +230,42 @@ if [ -d $IOS/rootfs/usr/lib ]; then{ ${LDID:-ldid} -Ssrc/wifipw_test.entitlements obj/wifipw_test 2>/dev/null ||echo "build.sh: no ldid: wifipw_test is unsigned, and the keychain will refuse it (-34018)"; }# our library for inside stock iOS programs (the jobs in INJECT are started with it)- $DYN -dynamiclib -install_name /redwood/lib/libredwood.dylib -framework CoreFoundation -framework IOKit -lobjc \- -o obj/libredwood.dylib src/inject.c- $DYN -dynamiclib -install_name /redwood/lib/libredwood-sb.dylib -framework CoreFoundation -framework IOKit -lobjc \- -o obj/libredwood-sb.dylib src/inject_sb.c+ $DYN -dynamiclib -install_name /redwood/lib/libhakios.dylib -framework CoreFoundation -framework IOKit -lobjc \+ -o obj/libhakios.dylib src/inject.c+ $DYN -dynamiclib -install_name /redwood/lib/libhakios.sb.dylib -framework CoreFoundation -framework IOKit -lobjc \+ -o obj/libhakios.sb.dylib src/inject_sb.c# ... the tweak loader of the package manager's prefix (src/inject_tweaks.c): it goes into a# program either as the one library the kernel inserts or opened by a library of ours- $DYN -dynamiclib -install_name /redwood/lib/libredwood-tweaks.dylib -framework CoreFoundation -lobjc \- -o obj/libredwood-tweaks.dylib src/inject_tweaks.c+ $DYN -dynamiclib -install_name /redwood/lib/libhakios.tweaks.dylib -framework CoreFoundation -lobjc \+ -o obj/libhakios.tweaks.dylib src/inject_tweaks.c# ... and inside an application, to say what killed it (src/inject_app.c)- $DYN -dynamiclib -install_name /redwood/lib/libredwood-app.dylib -lobjc \- -o obj/libredwood-app.dylib src/inject_app.c- $DYN -O2 -dynamiclib -install_name /redwood/lib/libredwood-media.dylib -framework CoreFoundation -framework CoreMedia \+ $DYN -dynamiclib -install_name /redwood/lib/libhakios.app.dylib -lobjc \+ -o obj/libhakios.app.dylib src/inject_app.c+ $DYN -O2 -dynamiclib -install_name /redwood/lib/libhakios.media.dylib -framework CoreFoundation -framework CoreMedia \-framework CoreVideo -framework IOSurface -lobjc \- -o obj/libredwood-media.dylib src/inject_media.c src/camera_device.c src/camera_isp.c+ -o obj/libhakios.media.dylib src/inject_media.c src/camera_device.c src/camera_isp.c# ... and inside appstored (STOREFRONT=1), which answers with a storefront and watches for a bag# request being built (src/inject_store.c)# (-lc++abi for __cxa_throw: every C++ exception thrown in the process is watched, which is how# the jetpack parser's rejections are seen -- a throw somebody catches logs nothing of itself)- $DYN -O2 -dynamiclib -install_name /redwood/lib/libredwood-store.dylib -framework CoreFoundation -lobjc \- -lc++abi -o obj/libredwood-store.dylib src/inject_store.c+ $DYN -O2 -dynamiclib -install_name /redwood/lib/libhakios.store.dylib -framework CoreFoundation -lobjc \+ -lc++abi -o obj/libhakios.store.dylib src/inject_store.c# ... and inside fairplayd.H2, which starts and leaves at once: what it looks for, and where it# gives up (src/inject_fairplay.c; watches only, replaces nothing)- $DYN -O2 -dynamiclib -install_name /redwood/lib/libredwood-fairplay.dylib -framework CoreFoundation \+ $DYN -O2 -dynamiclib -install_name /redwood/lib/libhakios.fairplay.dylib -framework CoreFoundation \-framework IOKit -framework Security -lMobileGestalt \- -o obj/libredwood-fairplay.dylib src/inject_fairplay.c+ -o obj/libhakios.fairplay.dylib src/inject_fairplay.c# the output device of the audio server: a plug-in for CoreAudio's HAL- $DYN -bundle -framework CoreFoundation -o obj/RedwoodAudio src/audio_plugin.c+ $DYN -bundle -framework CoreFoundation -o obj/HakiosAudio src/audio_plugin.cif [ -n "$GL" ]; then# the OpenGL ES library, and the table of functions that hands CoreAnimation's calls to it# (Mesa says beside the library what it was built from: one from other patches is built again)M=../xnu-deps/build/mesa/out- [ "$(cat $M/built-from 2>/dev/null)" = "$(cat ../tools/mesa/*.patch ../tools/mesa/redwood-drm/* | sha256sum)" ] ||+ [ "$(cat $M/built-from 2>/dev/null)" = "$(cat ../tools/mesa/*.patch ../tools/mesa/hakios-drm/* | sha256sum)" ] ||../tools/mk-mesa.sh./mkeagl.py src/eagl_slots.txt $M/gl.xml $M/exported-gl.txt src/eagl.c > obj/eagl_gen.h- $DYN -dynamiclib -install_name /redwood/lib/libredwood-gl.dylib -Iobj -framework CoreFoundation \- -framework IOKit -framework IOSurface -lobjc $M/libOSMesa.8.dylib -o obj/libredwood-gl.dylib \+ $DYN -dynamiclib -install_name /redwood/lib/libhakios.gl.dylib -Iobj -framework CoreFoundation \+ -framework IOKit -framework IOSurface -lobjc $M/libOSMesa.8.dylib -o obj/libhakios.gl.dylib \src/eagl.c src/gl_osmesa.c$DYN -framework CoreFoundation -framework IOKit $M/libOSMesa.8.dylib -o obj/gl_test src/gl_test.c# ... and what this GPU makes of an unsigned integer turned into a float (src/u2f_test.c)@@ -304,23 +304,23 @@ if [ -d $IOS/rootfs/usr/lib ]; then# devfs is mounted on /dev, and init puts a ramfs on /private/varmkdir -p root/dev root/private/varmkdir -p root/lib- cp obj/libredwood.dylib obj/libredwood-sb.dylib root/lib/- [ -f obj/libredwood-media.dylib ] && cp obj/libredwood-media.dylib root/lib/ # (as with cpu_test)- [ -f obj/libredwood-store.dylib ] && cp obj/libredwood-store.dylib root/lib/- [ -f obj/libredwood-fairplay.dylib ] && cp obj/libredwood-fairplay.dylib root/lib/- [ -f obj/libredwood-app.dylib ] && cp obj/libredwood-app.dylib root/lib/- [ -f obj/libredwood-tweaks.dylib ] && cp obj/libredwood-tweaks.dylib root/lib/- if [ -f obj/RedwoodAudio ]; then- mkdir -p root/lib/RedwoodAudio.driver- cp obj/RedwoodAudio root/lib/RedwoodAudio.driver/- cp src/audio_plugin.plist root/lib/RedwoodAudio.driver/Info.plist+ cp obj/libhakios.dylib obj/libhakios.sb.dylib root/lib/+ [ -f obj/libhakios.media.dylib ] && cp obj/libhakios.media.dylib root/lib/ # (as with cpu_test)+ [ -f obj/libhakios.store.dylib ] && cp obj/libhakios.store.dylib root/lib/+ [ -f obj/libhakios.fairplay.dylib ] && cp obj/libhakios.fairplay.dylib root/lib/+ [ -f obj/libhakios.app.dylib ] && cp obj/libhakios.app.dylib root/lib/+ [ -f obj/libhakios.tweaks.dylib ] && cp obj/libhakios.tweaks.dylib root/lib/+ if [ -f obj/HakiosAudio ]; then+ mkdir -p root/lib/HakiosAudio.driver+ cp obj/HakiosAudio root/lib/HakiosAudio.driver/+ cp src/audio_plugin.plist root/lib/HakiosAudio.driver/Info.plistfiif [ -n "$GL" ]; thencp obj/libOSMesa.8.dylib root/lib/cp obj/gl_test root/bin/if [ -f obj/u2f_test ]; then cp obj/u2f_test root/bin/; fi # an "if": see the inject.conf loop below[ -f obj/air_run ] && cp obj/air_run root/bin/- [ "$GL" = test ] || cp obj/libredwood-gl.dylib root/lib/+ [ "$GL" = test ] || cp obj/libhakios.gl.dylib root/lib/fi# a program is not started with a library that is not there: it would not start at allecho "$INJECT" | while read -r library names; do@@ -385,19 +385,19 @@ if [ -d $IOS/rootfs/usr/lib ]; then# the system image, so mkjobs.py judges "is this daemon's program there" by the listing of the volume# and not by what select-system.py extracted here (--root-volume; seven jobs turn on the difference,# fairplayd among them).- cp com.redwood.demo.plist com.redwood.wifi.plist root/LaunchDaemons/+ cp com.hakios.demo.plist com.hakios.wifi.plist root/LaunchDaemons/VOLUME=""[ -n "$FLASHBOOT" ] && [ -f $IOS/rootfs.slt ] && VOLUME="--root-volume $IOS/rootfs.slt"[ -n "$IOS_JOBS" ] && OSLOG=${OSLOG-com.apple.backboardd} ./mkjobs.py ${REST:+--rest} $VOLUME $IOS/rootfs root/LaunchDaemons $IOS_JOBSfi# firmware of the phone's own hardware, where somebody has pulled it from the phone's Android into ../fw-gpu-# (it is the vendor's and never in the repository): the kernel's GPU bring-up, bsd/dev/redwood_adreno.c, finds it in fw/+# (it is the vendor's and never in the repository): the kernel's GPU bring-up, bsd/dev/hakios.adreno.c, finds it in fw/if [ -d ../fw-gpu ]; thenmkdir -p root/fwcp ../fw-gpu/* root/fw/fi# ... and the image of the Wi-Fi DSP, from /vendor/firmware_mnt/image of the same Android into ../fw-wifi-# (bsd/dev/redwood_wifi.c; 7.6 MB), with what the radio's firmware is sent once it runs: this phone's+# (bsd/dev/hakios.wifi.c; 7.6 MB), with what the radio's firmware is sent once it runs: this phone's# board data and the regulatory database (image/qca6750 there; 60 and 24 KB)if [ -f ../fw-wifi/wpss.mdt ]; thenmkdir -p root/fw@@ -412,30 +412,30 @@ if [ -f ../fw-wifi/wpss.mdt ]; thenif [ -z "$SHARE" ] && [ -f ../fw-wifi/network ]; then install -m 0600 ../fw-wifi/network root/fw/network; fifi# ... and the vibration motor's waveforms, the phone's /vendor/firmware/aw8697_haptic.bin, from ../fw-haptic-# (bsd/dev/redwood_haptic.c, haptic=3; 3.6 KB, the vendor's and not in the repository either)+# (bsd/dev/hakios.haptic.c, haptic=3; 3.6 KB, the vendor's and not in the repository either)if [ -f ../fw-haptic/aw8697_haptic.bin ]; thenmkdir -p root/fwinstall -m 0644 ../fw-haptic/aw8697_haptic.bin root/fw/fi-# ... and the cameras' register tables (bsd/dev/redwood_camera.c, cam=2 and up), made by tools/camsensor.py out of+# ... and the cameras' register tables (bsd/dev/hakios.camera.c, cam=2 and up), made by tools/camsensor.py out of# the sensors' module files of Android's camera stack, the phone's /vendor/lib64/camera/com.qti.sensormodule.-# redwood_<maker>_<sensor>_<camera>.bin, in ../fw-camera (the vendor's: neither they nor the tables are in the+# hakios_<maker>_<sensor>_<camera>.bin, in ../fw-camera (the vendor's: neither they nor the tables are in the# repository): camera-<sensor>.tab-for module in ../fw-camera/com.qti.sensormodule.redwood_*.bin; do+for module in ../fw-camera/com.qti.sensormodule.hakios_*.bin; do[ -f "$module" ] || continue- sensor=$(basename "$module" .bin | sed 's/^com\.qti\.sensormodule\.redwood_[a-z]*_\([a-z0-9]*\)_.*/\1/')+ sensor=$(basename "$module" .bin | sed 's/^com\.qti\.sensormodule\.hakios_[a-z]*_\([a-z0-9]*\)_.*/\1/')mkdir -p root/fw../tools/camsensor.py "$module" "root/fw/camera-$sensor.tab" >/dev/nulldone-# ... and their colour tuning (libredwood-media's processor, src/camera_isp.c), made by tools/camtuning.py out of the-# cameras' tuning files beside them, com.qti.tuned.redwood_<maker>_<sensor>_<camera>.bin: camera-<sensor>.isp-for tuned in ../fw-camera/com.qti.tuned.redwood_*.bin; do+# ... and their colour tuning (libhakios.media's processor, src/camera_isp.c), made by tools/camtuning.py out of the+# cameras' tuning files beside them, com.qti.tuned.hakios_<maker>_<sensor>_<camera>.bin: camera-<sensor>.isp+for tuned in ../fw-camera/com.qti.tuned.hakios_*.bin; do[ -f "$tuned" ] || continue- sensor=$(basename "$tuned" .bin | sed 's/^com\.qti\.tuned\.redwood_[a-z]*_\([a-z0-9]*\)_.*/\1/')+ sensor=$(basename "$tuned" .bin | sed 's/^com\.qti\.tuned\.hakios_[a-z]*_\([a-z0-9]*\)_.*/\1/')mkdir -p root/fw../tools/camtuning.py "$tuned" "root/fw/camera-$sensor.isp" >/dev/nulldone-# ... and with ADSP=1 the image of the audio DSP, from the same place into ../fw-audio (bsd/dev/redwood_adsp.c):+# ... and with ADSP=1 the image of the audio DSP, from the same place into ../fw-audio (bsd/dev/hakios.adsp.c):# adsp.mdt and adsp.b02 to adsp.b36, 20 MB. Only when asked for: beside GL=1 the payload would be more than the 64 MB# the loader takes.if [ -n "$ADSP" ] && [ -f ../fw-audio/adsp.mdt ]; then@@ -472,9 +472,9 @@ mkdir -p root/empty root/xpc root/halfor f in extensions.plist extensions.plist.sig; do[ -f $IOS/rootfs/System/Library/xpc/$f ] && cp $IOS/rootfs/System/Library/xpc/$f root/xpc/done-[ -d root/lib/RedwoodAudio.driver ] && ln -s /redwood/lib/RedwoodAudio.driver root/hal/RedwoodAudio.driver+[ -d root/lib/HakiosAudio.driver ] && ln -s /redwood/lib/HakiosAudio.driver root/hal/HakiosAudio.driver# the image: zlib where it saves room (a small file whole in its attribute, as Apple keeps them); fw/-# as it is, which the kernel's drivers use where it lies in memory (bsd/dev/redwood_image.c)+# as it is, which the kernel's drivers use where it lies in memory (bsd/dev/hakios.image.c)python3 ../tools/apfs/mkapfs.py -z --plain fw -o root.apfs redwood=root | tail -1[ -z "$CHECK" ] || ../tools/apfs/check-image.sh root.apfs redwood=root@@ -584,7 +584,7 @@ if [ -f $IOS/system.manifest ] && [ -f $CACHE/dyld_shared_cache_arm64 ] &&mv sysroot/sbin/launchd sysroot/sbin/launchd.ioscp obj/stage0 sysroot/sbin/launchd# the audio DSP's firmware, the phone's own from ../fw-audio (never in the repository), where the kernel reads- # it once the root is mounted (bsd/dev/redwood_adsp.c, adsp=1): 20 MB that do not fit beside GL=1 in the small image+ # it once the root is mounted (bsd/dev/hakios.adsp.c, adsp=1): 20 MB that do not fit beside GL=1 in the small imageif [ -f ../fw-audio/adsp.mdt ]; thenmkdir -p sysroot/fwcp ../fw-audio/adsp.mdt ../fw-audio/adsp.b0[2-9] ../fw-audio/adsp.b[1-9][0-9] sysroot/fw/@@ -594,17 +594,17 @@ if [ -f $IOS/system.manifest ] && [ -f $CACHE/dyld_shared_cache_arm64 ] &&# This stages the files; a separate XNU MPSS driver is still required to start the modem.if [ -n "$MODEM" ]; then[ -f ../fw-modem/modem.mdt ] || { echo "build.sh: MODEM=1 needs ../fw-modem/modem.mdt" >&2; exit 1; }- ../devices/redwood/tools/modem_firmware.py --dtb ../devices/redwood/prebuilt/redwood.dtb --firmware-dir ../fw-modem \+ ../devices/poco-x5-pro/tools/modem_firmware.py --dtb ../devices/poco-x5-pro/prebuilt/device-tree.dtb --firmware-dir ../fw-modem \--node /soc/qcom,mss@4080000 >/dev/nullmkdir -p sysroot/fwcp ../fw-modem/modem.mdt ../fw-modem/modem.b[0-9][0-9] sysroot/fw/# ... and the firmware partition's image/ (its mcfg configurations and the registry's *.jsn, pulled from- # the phone's /vendor/firmware_mnt/image into ../fw-modem/image), which the modem reads over TFTP (redwood_mpss.c)+ # the phone's /vendor/firmware_mnt/image into ../fw-modem/image), which the modem reads over TFTP (hakios.mpss.c)if [ -d ../fw-modem/image ]; thenrm -rf sysroot/fw/image && cp -R ../fw-modem/image sysroot/fw/imagefifi- # ... and the speaker amplifiers' configuration, the phone's /vendor/etc/aw882xx_acf.bin (bsd/dev/redwood_speaker.c,+ # ... and the speaker amplifiers' configuration, the phone's /vendor/etc/aw882xx_acf.bin (bsd/dev/hakios.speaker.c,# for sound=3): Android's own register values, which are not in the repository eitherif [ -f ../fw-audio/aw882xx_acf.bin ]; thenmkdir -p sysroot/fw@@ -632,7 +632,7 @@ if [ -f $IOS/system.manifest ] && [ -f $CACHE/dyld_shared_cache_arm64 ] &&fi# our audio device, where the audio server looks for such plug-ins (and for no others: Apple's are left out)mkdir -p sysroot/System/Library/Audio/Plug-Ins/HAL- ln -s /redwood/lib/RedwoodAudio.driver sysroot/System/Library/Audio/Plug-Ins/HAL/RedwoodAudio.driver+ ln -s /redwood/lib/HakiosAudio.driver sysroot/System/Library/Audio/Plug-Ins/HAL/HakiosAudio.driver# the OS cryptex: on a device a separate volume grafted at /System/Cryptexes/OS. It holds the dyld# shared cache (dyld looks there first) and a few libraries and resources outside the cache.mkdir -p sysroot/System/Cryptexesdiff --git a/userland/com.redwood.demo.plist b/userland/com.hakios.demo.plistsimilarity index 95%rename from userland/com.redwood.demo.plistrename to userland/com.hakios.demo.plistindex eca91e4..005362d 100644--- a/userland/com.redwood.demo.plist+++ b/userland/com.hakios.demo.plist@@ -3,7 +3,7 @@<plist version="1.0"><dict><key>Label</key>- <string>com.redwood.demo</string>+ <string>com.hakios.demo</string><key>ProgramArguments</key><array><string>/redwood/sbin/init</string>diff --git a/userland/com.redwood.varstore.plist b/userland/com.hakios.varstore.plistsimilarity index 95%rename from userland/com.redwood.varstore.plistrename to userland/com.hakios.varstore.plistindex 42f6c3f..ac4f392 100644--- a/userland/com.redwood.varstore.plist+++ b/userland/com.hakios.varstore.plist@@ -3,7 +3,7 @@<plist version="1.0"><dict><key>Label</key>- <string>com.redwood.varstore</string>+ <string>com.hakios.varstore</string><!-- with var_store=1 among the kernel's arguments: stays for the run and writes /private/var intothe flash when the kernel says the run is ending (src/var_store.c, watch); without, it ends atonce. An argument after "watch" is seconds between saves of its own accord as well; there isdiff --git a/userland/com.redwood.wifi.plist b/userland/com.hakios.wifi.plistsimilarity index 94%rename from userland/com.redwood.wifi.plistrename to userland/com.hakios.wifi.plistindex ae1b6a4..a79f5b9 100644--- a/userland/com.redwood.wifi.plist+++ b/userland/com.hakios.wifi.plist@@ -3,7 +3,7 @@<plist version="1.0"><dict><key>Label</key>- <string>com.redwood.wifi</string>+ <string>com.hakios.wifi</string><!-- with wifi=1 among the kernel's arguments: has configd configure the radio's interface (src/net_test.m,"wifi"); without, it ends at once --><key>ProgramArguments</key>diff --git a/userland/mkjobs.py b/userland/mkjobs.pyindex f9acbc9..cc41251 100755--- a/userland/mkjobs.py+++ b/userland/mkjobs.py@@ -82,7 +82,7 @@ import sys# It respawns and does it again: 18 crashes in a seven-minute session where the same image without it has# none. The boot is not held up -- it reaches the same 118 processes against 119 -- so the trade is 103# failed lookups a session against a process dying every fifteen seconds for ever, which is a bad one.-# Stubbing the first driver is the kind of work RedwoodBattery already is, but the second is an Apple+# Stubbing the first driver is the kind of work HakiosBattery already is, but the second is an Apple# baseband on PCIe, and this phone's modem is on the SoC and speaks QMI to a Qualcomm subsystem -- so what# is behind the driver is missing too, not just the driver.# cloudd and appstored are IN, and getting there was the most instructive thing in this file.@@ -130,7 +130,7 @@ import sys# (four queries, answers of 159, 842, 200 and 107 bytes), and trustd, geod, maild, gamed, cloudd,# StocksWidget and nsurlsessiond all open TLS to Apple and Akamai (17.248.214.x, 17.253.39.x,# 2.16.56.93, 23.11.40.157, 95.100.176.233). "net_test: en0: flags 0x8802" was read 0.1 s into user-# space, before configd had configured it: com.redwood.wifi does that by itself with wifi=1, so a+# space, before configd had configured it: com.hakios.wifi does that by itself with wifi=1, so a# scenario must not ask for DHCP again -- only "waitaddr en0 60".# The storefront question is therefore OPEN, and the next measurement has to be made over a channel# that does not drop: ssh to the phone (rc.jobs.ssh) and fetch the bag by hand.diff --git a/userland/rc.jobs b/userland/rc.jobsindex 4c9530c..336f1fd 100644--- a/userland/rc.jobs+++ b/userland/rc.jobs@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist)./redwood/bin/hello_dyn started by launchd/redwood/bin/svc_test/redwood/bin/surf_testdiff --git a/userland/rc.jobs.air b/userland/rc.jobs.airindex a94e193..3d4799c 100644--- a/userland/rc.jobs.air+++ b/userland/rc.jobs.air@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).## The first draw on this GPU by a shader Apple compiled for Metal (RC_JOBS=rc.jobs.air).# /redwood/bin/air_run translates one function of a .metallib with the AIR frontenddiff --git a/userland/rc.jobs.airkernels b/userland/rc.jobs.airkernelsindex 391d02d..0fe1178 100644--- a/userland/rc.jobs.airkernels+++ b/userland/rc.jobs.airkernels@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (RC_JOBS=rc.jobs.airkernels).+# Commands run by the launchd job com.hakios.demo (RC_JOBS=rc.jobs.airkernels).## Every compute kernel of the corpus, dispatched on the Adreno. This is the question softpipe# cannot answer and has been deferred twice: of the 47, six dispatch on software and 38 stop indiff --git a/userland/rc.jobs.airtex b/userland/rc.jobs.airtexindex 882c1df..a25bb8f 100644--- a/userland/rc.jobs.airtex+++ b/userland/rc.jobs.airtex@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).## The six texture shaders that return the exact texel on softpipe, run on the real Adreno# (RC_JOBS=rc.jobs.airtex). This is the question softpipe cannot answer: it takes adiff --git a/userland/rc.jobs.apfs b/userland/rc.jobs.apfsindex a02d78b..2ce2ca6 100644--- a/userland/rc.jobs.apfs+++ b/userland/rc.jobs.apfs@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Reading the APFS volume the kernel mounted on /private/var/apfs-check (boot-arg# apfs_check=3), from user space. The three roads, over one fixed set of files# (/usr/sbin: 32 files, 47.8 MB) so that two kernels can be compared on equal terms:diff --git a/userland/rc.jobs.bake b/userland/rc.jobs.bakeindex bb9d553..3029d86 100644--- a/userland/rc.jobs.bake+++ b/userland/rc.jobs.bake@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Does iOS ever bake the wallpaper here (RC_JOBS=rc.jobs.bake, gpu=1)? The bottom layer of every# frosted material is a blurred copy of the wallpaper, which PaperBoardUI takes from a snapshot# source; on a phone that copy is made once, when a wallpaper is set, and kept on the data volume.diff --git a/userland/rc.jobs.battery b/userland/rc.jobs.batteryindex ae3c41a..5792137 100644--- a/userland/rc.jobs.battery+++ b/userland/rc.jobs.battery@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The battery (RC_JOBS=rc.jobs.battery, with adsp=1): what the kernel's power source says and what# powerd and IOPS have made of it (src/battery_test.c); then the places that show it, for screenshots:# the home screen's status bar, the Today view with its widgets (Batteries among them), Settings >diff --git a/userland/rc.jobs.battery2 b/userland/rc.jobs.battery2index 54049cc..4738825 100644--- a/userland/rc.jobs.battery2+++ b/userland/rc.jobs.battery2@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Settings > Battery and its usage pages (with adsp=1): opened, left 15 s for its data, scrolled down to the usage# charts, then Battery Health & Charging; for a screen recording and the logs of Settings and of the power log, and# at the end what the power log has collected (battery_test powerlog).diff --git a/userland/rc.jobs.battery3 b/userland/rc.jobs.battery3index c2fc2b0..608fd23 100644--- a/userland/rc.jobs.battery3+++ b/userland/rc.jobs.battery3@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# An hour of use before Settings > Battery is opened (with adsp=1): applications opened in turn -- Settings, Notes,# Calendar -- so that the power log has an hour of their use to show; then the battery page, scrolled, and Battery# Health & Charging, for screenshots; at the end what the power log has collected (battery_test powerlog).diff --git a/userland/rc.jobs.buttons b/userland/rc.jobs.buttonsindex accd4f8..6a28931 100644--- a/userland/rc.jobs.buttons+++ b/userland/rc.jobs.buttons@@ -1,6 +1,6 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The buttons, pressed by a script (RC_JOBS=rc.jobs.buttons): button records written to-# /dev/redwood-touch, which is where a driver's presses go too. Unlock, volume up, volume down,+# /dev/hakios-touch, which is where a driver's presses go too. Unlock, volume up, volume down,# the side button to turn the screen off, the side button to wake it, unlock again.# tools/buttons-watch.sh, run on the host meanwhile, takes a picture of the screen after each press./redwood/bin/rwtouch wait 32 swipe 0.5 0.985 0.5 0.3 250 wait 6diff --git a/userland/rc.jobs.calendar b/userland/rc.jobs.calendarindex 9d8a1c2..531dc86 100644--- a/userland/rc.jobs.calendar+++ b/userland/rc.jobs.calendar@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The Calendar icon (RC_JOBS=rc.jobs.calendar, gpu=1, a run of about two and a half minutes): the home# screen, and SignificantTimeChangeNotification posted every three seconds, 26 times. Each makes# SpringBoard draw the Calendar's icon anew, for a date that may have changed (with wifi=1 the networkdiff --git a/userland/rc.jobs.camera b/userland/rc.jobs.cameraindex c307750..bfed1ed 100644--- a/userland/rc.jobs.camera+++ b/userland/rc.jobs.camera@@ -1,11 +1,11 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The cameras for iOS (RC_JOBS=rc.jobs.camera, with cam=5; with cam_pattern=1 its frames are colour bars):-# first what AVFoundation lists (camera_avtest: the device is libredwood-media.dylib's in mediaserverd,-# camera_device.c, whose frames come from the kernel's /dev/redwood-camera), then Camera.app opened from the home+# first what AVFoundation lists (camera_avtest: the device is libhakios.media.dylib's in mediaserverd,+# camera_device.c, whose frames come from the kernel's /dev/hakios-camera), then Camera.app opened from the home# screen as a finger opens it (with cam=5 the loader's /arm-io/isp node puts its icon on the first page, top right),# its preview left running for 40 seconds (xl screenshot meanwhile), and then the camera is the hand's: the shutter,# the front camera, zoom, a tap to focus. The kernel's "camera:" lines say when the frames came and why they-# stopped; mediaserverd's "redwood: camera:" lines what the capture stack asked of the device.+# stopped; mediaserverd's "hakios: camera:" lines what the capture stack asked of the device./redwood/bin/sound_test springboard/redwood/bin/camera_avtest/redwood/bin/rwtouch wait 10 swipe 0.5 0.985 0.5 0.3 200 wait 6 tap 0.845 0.36 wait 40diff --git a/userland/rc.jobs.cameras b/userland/rc.jobs.camerasindex 1ae79ba..4933de5 100644--- a/userland/rc.jobs.cameras+++ b/userland/rc.jobs.cameras@@ -1,6 +1,6 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The four cameras, one after the other (RC_JOBS=rc.jobs.cameras, with cam=5): camera_test cycle asks the kernel's-# /dev/redwood-camera for the macro, the wide, the front and the ultra-wide camera in turn (REDWOOD_CAMERA_SENSOR),+# /dev/hakios-camera for the macro, the wide, the front and the ultra-wide camera in turn (HAKIOS_CAMERA_SENSOR),# 30 frames of each, and says what came of each and how long each change took; twice over. The kernel's "camera:"# lines say each sensor's packets and errors at the end of its frames./redwood/bin/sound_test springboarddiff --git a/userland/rc.jobs.cc b/userland/rc.jobs.ccindex bc70433..08e6808 100644--- a/userland/rc.jobs.cc+++ b/userland/rc.jobs.cc@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Control Center pulled down from the top right corner and closed (home button), three times, three seconds open# and three closed: for a screen recording (rec_secs=N rec_start=S) and glframes=1, to see in which frame each of# its parts appears.diff --git a/userland/rc.jobs.cow b/userland/rc.jobs.cowindex 179b656..e099def 100644--- a/userland/rc.jobs.cow+++ b/userland/rc.jobs.cow@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Copies and file writes in the kernel (RC_JOBS=rc.jobs.cow, a run of a minute): see src/cow_test.c. Every line# it writes should end with no page wrong./redwood/bin/cow_testdiff --git a/userland/rc.jobs.demo b/userland/rc.jobs.demoindex 419960f..6198e10 100644--- a/userland/rc.jobs.demo+++ b/userland/rc.jobs.demo@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist)./redwood/bin/hello_dyn started by launchd/redwood/bin/svc_test/redwood/bin/surf_testdiff --git a/userland/rc.jobs.fairplay b/userland/rc.jobs.fairplayindex 17123a4..e6d4b88 100644--- a/userland/rc.jobs.fairplay+++ b/userland/rc.jobs.fairplay@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# What fairplayd changes (RC_JOBS=rc.jobs.fairplay, the iOS volume on the flash as the root, where the# program exists: FLASHBOOT=1, mkjobs.py --root-volume). Two questions, in this order.#diff --git a/userland/rc.jobs.flashcache b/userland/rc.jobs.flashcacheindex 5b6d103..515c513 100644--- a/userland/rc.jobs.flashcache+++ b/userland/rc.jobs.flashcache@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The iOS root volume on the phone's flash as the root (flashboot.apfs resident, root_apfs=ufs_darwin# ufs=2 ufs_native=1), read(2) through the page cache. The driver's numbers and the kernel's line about# memory for the boot (until 25 s after this list began: nothing of ours meanwhile) and the next 30 s;@@ -7,10 +7,10 @@# there -- every pass with its sum (3095b9e298a4df17, 978ed0d4dda1a256), only the totals printed.# The results go to a file and are shown at the end, where the kernel's log keeps them.sleep 25-/redwood/bin/vol_ls sysctl kern.apfs_stats kern.redwood_memory >> /private/var/results+/redwood/bin/vol_ls sysctl kern.apfs_stats kern.hakios_memory >> /private/var/results/redwood/bin/vol_ls zero kern.apfs_statssleep 30-/redwood/bin/vol_ls sysctl kern.apfs_stats kern.redwood_memory >> /private/var/results+/redwood/bin/vol_ls sysctl kern.apfs_stats kern.hakios_memory >> /private/var/results/redwood/bin/apfs_mmap_test -q drop /usr/sbin >> /private/var/results/redwood/bin/apfs_mmap_test -q read /usr/sbin 65536 >> /private/var/results/redwood/bin/apfs_mmap_test -q read /usr/sbin 65536 >> /private/var/results@@ -27,6 +27,6 @@ sleep 30/redwood/bin/apfs_mmap_test -q mmap /usr/libexec >> /private/var/results/redwood/bin/apfs_mmap_test -q mmap /usr/libexec >> /private/var/results/redwood/bin/apfs_mmap_test -q read /usr/libexec 65536 >> /private/var/results-/redwood/bin/vol_ls sysctl kern.redwood_memory >> /private/var/results+/redwood/bin/vol_ls sysctl kern.hakios_memory >> /private/var/results/bin/ps -A >> /private/var/results/redwood/bin/vol_ls cat /private/var/results 262144diff --git a/userland/rc.jobs.flashcheck b/userland/rc.jobs.flashcheckindex b080b80..760f085 100644--- a/userland/rc.jobs.flashcheck+++ b/userland/rc.jobs.flashcheck@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The iOS root volume on the phone's flash as the root, everything in RAM as APFS (flashboot.apfs resident,# root.apfs with the kernel, built with GL=1; root_apfs=ufs_darwin ufs=2 ufs_native=1 gpu=1 adsp=1 sound=4# rec_sound=12 wifi=1, and no battery=1, which keeps the battery from the audio DSP off): what is mounted@@ -18,6 +18,6 @@/redwood/bin/battery_test open https://example.com/redwood/bin/rwtouch wait 20/redwood/bin/battery_test 1 >> /private/var/results-/redwood/bin/vol_ls sysctl kern.redwood_memory >> /private/var/results+/redwood/bin/vol_ls sysctl kern.hakios_memory >> /private/var/results/bin/ps -A/redwood/bin/vol_ls cat /private/var/results 262144diff --git a/userland/rc.jobs.flashlock b/userland/rc.jobs.flashlockindex fdb9d9b..5db33b7 100644--- a/userland/rc.jobs.flashlock+++ b/userland/rc.jobs.flashlock@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The iOS root volume on the phone's flash as the root (flashboot.apfs resident, root_apfs=ufs_darwin# ufs=2 ufs_native=1). The APFS driver's numbers (kern.apfs_stats: the volume's lock by who takes it) for# three stretches: the boot, until 25 s after this list began (nothing of ours meanwhile, so thatdiff --git a/userland/rc.jobs.flashroot b/userland/rc.jobs.flashrootindex 4949342..c81a18e 100644--- a/userland/rc.jobs.flashroot+++ b/userland/rc.jobs.flashroot@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The iOS root volume on the phone's flash as the root (flashboot.apfs resident,# root_apfs=ufs_darwin ufs=2 bootcpu=7; src/init.c, flash_root), seen from user space: what# is mounted where, the root's own files read through read(2) and through a mapping.diff --git a/userland/rc.jobs.flashsound b/userland/rc.jobs.flashsoundindex 811ac6b..13c1962 100644--- a/userland/rc.jobs.flashsound+++ b/userland/rc.jobs.flashsound@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The iOS root volume on the phone's flash as the root (flashboot.apfs resident, root_apfs=ufs_darwin# ufs=2 [ufs_native=1] adsp=1 sound=4): what is mounted, the firmware on /fw, reading files through# read(2) and through a mapping (page-in) with the APFS driver's numbers before and after, thendiff --git a/userland/rc.jobs.fonts b/userland/rc.jobs.fontsindex ab6aaee..805fb2b 100644--- a/userland/rc.jobs.fonts+++ b/userland/rc.jobs.fonts@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Text in scripts other than Latin: font_test says which font the system font falls back to for emoji, Chinese,# Japanese and Korean and how many pixels drawing them paints (and in colour); then, with wifi=1, Safari opens the# Chinese Wikipedia and a page of emoji as text, for screenshots.diff --git a/userland/rc.jobs.fps b/userland/rc.jobs.fpsindex d1b46b8..dd4cac6 100644--- a/userland/rc.jobs.fps+++ b/userland/rc.jobs.fps@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The everyday cases for frame pacing (boot-arg touch_lat=1; tools/frames.py): unlock, then 100 s for the# start-up's background work to be over, then home-screen page swipes both ways, Search pulled down and# closed, Control Center from the top right corner and closed, Settings opened (the zoom), its list flungdiff --git a/userland/rc.jobs.gfx b/userland/rc.jobs.gfxindex 8bd7ec3..0fe8e3b 100644--- a/userland/rc.jobs.gfx+++ b/userland/rc.jobs.gfx@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The moments with a blur or a fresh window, for the screen recording (rec_secs=N rec_start=S): once SpringBoard is# up, Control Center pulled down from the top right corner and closed, Notification Center pulled down from the# top left and closed, Search pulled down on the home screen and closed, Settings opened and closed with the homediff --git a/userland/rc.jobs.gltest b/userland/rc.jobs.gltestindex b016aac..267d3ee 100644--- a/userland/rc.jobs.gltest+++ b/userland/rc.jobs.gltest@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# A triangle by the OpenGL ES library of the image (build.sh GL=test or GL=1), once the lock screen# is up and has stopped drawing over the panel; see src/gl_test.c./redwood/bin/rwtouch wait 14diff --git a/userland/rc.jobs.haptic b/userland/rc.jobs.hapticindex 1a9bfd7..d6fbebb 100644--- a/userland/rc.jobs.haptic+++ b/userland/rc.jobs.haptic@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The vibration motor for iOS (RC_JOBS=rc.jobs.haptic, with haptic=5): the system's haptic feedbacks -- peek (1519),# pop (1520), "nope" (1521: three short ones) -- and the vibration of the ringer (4095), each played the way a program# plays a system sound; then haptics the way an application plays them (CoreHaptics: a tap, a vibration, three taps),diff --git a/userland/rc.jobs.haptic2 b/userland/rc.jobs.haptic2index d414248..e05b733 100644--- a/userland/rc.jobs.haptic2+++ b/userland/rc.jobs.haptic2@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Everyday touches that give a haptic on an iPhone (with haptic=5, the kernel's "haptic:" lines and the plug-in's# "the actuator plays" say which did): a long press on an icon of the home screen (its menu), dismissed; Settings# opened and its Airplane Mode switch turned on and off; Settings closed; Control Center opened, a long press on itsdiff --git a/userland/rc.jobs.ios b/userland/rc.jobs.iosindex 54967c9..739c959 100644--- a/userland/rc.jobs.ios+++ b/userland/rc.jobs.ios@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The iOS root container on the phone's flash, which the kernel mounts read only on# /System/Volumes/iOS at boot (ufs=2 apfs_volume=ufs_darwin, with bootcpu=7): what user space# sees of it, in an ordinary session. iOS's own mount and df first, then ours (vol_ls: ls, cat,diff --git a/userland/rc.jobs.jb b/userland/rc.jobs.jbindex 02cc92d..a4582ac 100644--- a/userland/rc.jobs.jb+++ b/userland/rc.jobs.jb@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The package manager for a person to use (RC_JOBS=rc.jobs.jb): nothing pressed by a script -- the# preparation the bootstrap wants once per boot, the network, a fresh index, and the phone is yours# for the session (XL_SECS). What is installed lives in memory, as all of /private/var: gone at thediff --git a/userland/rc.jobs.jbreg b/userland/rc.jobs.jbregindex 0087943..e0d3441 100644--- a/userland/rc.jobs.jbreg+++ b/userland/rc.jobs.jbreg@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Whether LaunchServices registers an application that a package puts in /var/jb/Applications -- the# memory filesystem the package manager's prefix is grafted on -- with the root on the flash# (RC_JOBS=rc.jobs.jbreg, FLASHBOOT=1 CRYPTEXES=flash, EXTRA=<a package with an application>.deb; withdiff --git a/userland/rc.jobs.jiggle b/userland/rc.jobs.jiggleindex 728edd3..ac4295a 100644--- a/userland/rc.jobs.jiggle+++ b/userland/rc.jobs.jiggle@@ -1,8 +1,8 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The home screen in edit mode (RC_JOBS=rc.jobs.jiggle, gpu=1): a long press on an empty place makes# the icons jiggle and puts the translucent minus on each of them. Then SpringBoard writes down the-# layers it has on the screen (com.redwood.layers, see inject_sb.c), which names the badge's views.+# layers it has on the screen (com.hakios.layers, see inject_sb.c), which names the badge's views./redwood/bin/sound_test springboard/redwood/bin/rwtouch wait 25 swipe 0.5 0.985 0.5 0.3 200 wait 8/redwood/bin/rwtouch hold 0.5 0.62 2000-/redwood/bin/rwtouch wait 6 notify com.redwood.layers wait 10+/redwood/bin/rwtouch wait 6 notify com.hakios.layers wait 10diff --git a/userland/rc.jobs.latency b/userland/rc.jobs.latencyindex ab824ff..6b61ba0 100644--- a/userland/rc.jobs.latency+++ b/userland/rc.jobs.latency@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# How far behind the finger the screen is (boot-arg touch_lat=1, with rec_secs/rec_ring for the frames;# tools/latency.py): unlock, Settings, then a wait of 100 seconds -- for the first minutes after a start the# widget extensions, searchd and the rest keep all four processors busy, and the touch waits for them --, thediff --git a/userland/rc.jobs.launch b/userland/rc.jobs.launchindex 67e32a5..21bcd0b 100644--- a/userland/rc.jobs.launch+++ b/userland/rc.jobs.launch@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The first launch of an application (RC_JOBS=rc.jobs.launch, a run of about a minute and a half):# Settings opened and left, then the pictures SpringBoard keeps of it looked at as files (snap_test:# its launch images, light and dark, upright and on its side, and the snapshot it took on the way out),diff --git a/userland/rc.jobs.loud b/userland/rc.jobs.loudindex 277711f..718dfc0 100644--- a/userland/rc.jobs.loud+++ b/userland/rc.jobs.loud@@ -1,6 +1,6 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The speakers at their loudest (RC_JOBS=rc.jobs.loud, with adsp=1 sound=4 and the sound_below being tried). First a-# tone at full scale (1 kHz left, 440 Hz right) for 60 seconds written straight to /dev/redwood-audio, past iOS's+# tone at full scale (1 kHz left, 440 Hz right) for 60 seconds written straight to /dev/hakios-audio, past iOS's# own processing, which never lets a tone come near full scale: the hardest thing the speakers can be given, for# the guard to hold back (the kernel's "sound: the guard" lines; its "speaker:" lines are the amplifiers' status,# temperature and battery voltage). Then the same tone through iOS for 30 seconds, with its volume pressed up to thediff --git a/userland/rc.jobs.metal b/userland/rc.jobs.metalindex 022a7eb..b5fe1d4 100644--- a/userland/rc.jobs.metal+++ b/userland/rc.jobs.metal@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# What iOS here believes about Metal (RC_JOBS=rc.jobs.metal, a run of half a minute): the services Metal# looks for and does not find, the GPU the registry does have under another name, whether a plug-in bundle# of this image would load at all, the nil a program gets, what MobileGestalt still says about graphics,diff --git a/userland/rc.jobs.mic b/userland/rc.jobs.micindex cd1023f..19df673 100644--- a/userland/rc.jobs.mic+++ b/userland/rc.jobs.mic@@ -1,9 +1,9 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The microphone for iOS (RC_JOBS=rc.jobs.mic, with adsp=1 mic=4, haptic=5 and sound=4): first the speakers' path# as a check (a tone of two seconds and a keyboard click; with sound_below=720 the amplifiers play it 90 dB under# Android's level, which is silence), then two recordings the way an application makes them (record_test:-# AVAudioRecorder through the built-in microphone, which the virtual audio device makes of RedwoodAudio.driver's-# "Codec", whose samples come from the kernel's /dev/redwood-mic): six seconds with the vibration motor running+# AVAudioRecorder through the built-in microphone, which the virtual audio device makes of HakiosAudio.driver's+# "Codec", whose samples come from the kernel's /dev/hakios-mic): six seconds with the vibration motor running# from the third to the fourth (its 175.5 Hz is what the microphone should hear), then four seconds of the room. The# kernel's "mic:" lines say when the microphone listened, and the end of the run repeats them. (A pause between# the two: a program in the background that records shows the orange dot but not the status bar's recording pill, anddiff --git a/userland/rc.jobs.net b/userland/rc.jobs.netindex ab3b9e7..27da4ab 100644--- a/userland/rc.jobs.net+++ b/userland/rc.jobs.net@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The network (RC_JOBS=rc.jobs.net, with a kernel that has en0: under QEMU, QEMU_NET=1): the# interface as the kernel has it, then configured by configd's IPConfiguration over DHCP, a name# resolved, a page fetched over plain TCP and over CFNetwork's HTTPS. See src/net_test.m.diff --git a/userland/rc.jobs.persist b/userland/rc.jobs.persistindex 8d82b55..3311ba9 100644--- a/userland/rc.jobs.persist+++ b/userland/rc.jobs.persist@@ -1,22 +1,22 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The data volume of iOS kept between boots (var_store=1 ufs_write=1; src/var_store.c): what the# store held when this boot began, how much room the volume has, the line every run before this one# left in /private/var and the names SpringBoard had made by then with the seconds they were# written; then this run's own line, and after two and a half minutes of iOS left to itself the# same names again.-# Nothing here saves. The job com.redwood.varstore stays for the run and writes the volume into the+# Nothing here saves. The job com.hakios.varstore stays for the run and writes the volume into the# flash when the kernel says the run is ending -- which is the point: a run that was never told to# save keeps what it wrote all the same. Run it twice over, with ./xl reboot in between; the second# run's output holds the first run's line and the first run's seconds./redwood/bin/var_store show/redwood/bin/vol_ls fs /private/var-/redwood/bin/vol_ls cat /private/var/redwood-stamp 4096+/redwood/bin/vol_ls cat /private/var/hakios-stamp 4096/redwood/bin/vol_ls ls /private/var/mobile/Library/SpringBoard-/redwood/bin/var_store stamp /private/var/redwood-stamp+/redwood/bin/var_store stamp /private/var/hakios-stampsleep 150/redwood/bin/vol_ls ls /private/var/mobile/Library/SpringBoard/redwood/bin/vol_ls ls /private/var/mobile/Library-/redwood/bin/vol_ls cat /private/var/redwood-stamp 4096+/redwood/bin/vol_ls cat /private/var/hakios-stamp 4096/redwood/bin/var_store show# (what the saver then did, and how many writes went into darwin, is at the end of the run: the# kernel's "var_store: the run is ending" and the loader's "ufs: N writes into darwin ... readdiff --git a/userland/rc.jobs.persist0 b/userland/rc.jobs.persist0index 7e29b6c..d02a81b 100644--- a/userland/rc.jobs.persist0+++ b/userland/rc.jobs.persist0@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The boot before the series of rc.jobs.persist5: the store is forgotten first, so that what# follows starts from a volume as empty as every boot of this port used to be. Run this one# WITHOUT var_store=1 -- nothing is restored and nothing saved, and it doubles as the measure of@@ -6,13 +6,13 @@/redwood/bin/var_store erase/redwood/bin/var_store show/redwood/bin/vol_ls fs /private/var-/redwood/bin/vol_ls cat /private/var/redwood-stamp 4096+/redwood/bin/vol_ls cat /private/var/hakios-stamp 4096/redwood/bin/keychain_test keep/redwood/bin/vol_ls ls /private/var/mobile/Library/SpringBoard/redwood/bin/vol_ls hash /private/var/mobile/Library/SpringBoard/IconState.plist/redwood/bin/vol_ls ls /private/var/mobile/Containers/Data/Application/redwood/bin/vol_ls ls /private/var/mobile/Containers/Shared/AppGroup-/redwood/bin/var_store stamp /private/var/redwood-stamp+/redwood/bin/var_store stamp /private/var/hakios-stampsleep 120/bin/ps -A/redwood/bin/vol_ls ls /private/var/mobile/Library/SpringBoarddiff --git a/userland/rc.jobs.persist1 b/userland/rc.jobs.persist1index e9e5c77..27af1c8 100644--- a/userland/rc.jobs.persist1+++ b/userland/rc.jobs.persist1@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Boot 1 of the series of rc.jobs.persist5, which is this list with its two minutes of quiet in# place of the three lines below: an icon of the home screen picked up and carried to the right# (a long press and then a drag, all of it one touch -- rwtouch drag ... GRAB), then home. Whether@@ -6,13 +6,13 @@# run shows it./redwood/bin/var_store show/redwood/bin/vol_ls fs /private/var-/redwood/bin/vol_ls cat /private/var/redwood-stamp 4096+/redwood/bin/vol_ls cat /private/var/hakios-stamp 4096/redwood/bin/keychain_test keep/redwood/bin/vol_ls ls /private/var/mobile/Library/SpringBoard/redwood/bin/vol_ls hash /private/var/mobile/Library/SpringBoard/IconState.plist/redwood/bin/vol_ls ls /private/var/mobile/Containers/Data/Application/redwood/bin/vol_ls ls /private/var/mobile/Containers/Shared/AppGroup-/redwood/bin/var_store stamp /private/var/redwood-stamp+/redwood/bin/var_store stamp /private/var/hakios-stamp/redwood/bin/rwtouch wait 55 drag 0.151 0.358 0.847 0.710 900 700 900/redwood/bin/rwtouch wait 3 button homesleep 55diff --git a/userland/rc.jobs.persist5 b/userland/rc.jobs.persist5index 2833212..c336243 100644--- a/userland/rc.jobs.persist5+++ b/userland/rc.jobs.persist5@@ -1,7 +1,7 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# What persistence buys, boot after boot (var_store=1 ufs_write=1; see rc.jobs.persist0 and# rc.jobs.persist1, which are this list with a little before it). Everything here is a measurement,-# nothing here saves: the job com.redwood.varstore writes the volume when the kernel says the run is+# nothing here saves: the job com.hakios.varstore writes the volume when the kernel says the run is# ending. Boot it five times over and compare the boots:# the store at the start, and how much room the volume has;# the line every run before this one left, and the keychain item an earlier boot wrote ("keep"@@ -11,13 +11,13 @@# and, after two minutes of iOS left to itself, the same again, with the process list./redwood/bin/var_store show/redwood/bin/vol_ls fs /private/var-/redwood/bin/vol_ls cat /private/var/redwood-stamp 4096+/redwood/bin/vol_ls cat /private/var/hakios-stamp 4096/redwood/bin/keychain_test keep/redwood/bin/vol_ls ls /private/var/mobile/Library/SpringBoard/redwood/bin/vol_ls hash /private/var/mobile/Library/SpringBoard/IconState.plist/redwood/bin/vol_ls ls /private/var/mobile/Containers/Data/Application/redwood/bin/vol_ls ls /private/var/mobile/Containers/Shared/AppGroup-/redwood/bin/var_store stamp /private/var/redwood-stamp+/redwood/bin/var_store stamp /private/var/hakios-stampsleep 120/bin/ps -A/redwood/bin/vol_ls ls /private/var/mobile/Library/SpringBoarddiff --git a/userland/rc.jobs.persist6 b/userland/rc.jobs.persist6index 42d98ae..d3a7b28 100644--- a/userland/rc.jobs.persist6+++ b/userland/rc.jobs.persist6@@ -1,8 +1,8 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# What a save every so often would cost, and how much of one is new (var_store=1 ufs_write=1).# Three saves a minute apart, each saying how long it took, how big it is and how much of it was# written since the save before -- which is what decides whether saving only the difference is-# worth building. The job com.redwood.varstore saves once more at the end of the run.+# worth building. The job com.hakios.varstore saves once more at the end of the run./redwood/bin/var_store showsleep 60/redwood/bin/var_store savediff --git a/userland/rc.jobs.photo b/userland/rc.jobs.photoindex a4f0f90..9584724 100644--- a/userland/rc.jobs.photo+++ b/userland/rc.jobs.photo@@ -1,7 +1,7 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# A photograph (RC_JOBS=rc.jobs.photo, with cam=5): Camera.app is opened as a finger opens it, Live# Photo is switched off (its capture wants a video and sound around the shutter), the preview is left# to settle, and the shutter is pressed twice. The kernel's "camera:" lines say what the sensor did;-# mediaserverd's "redwood: camera:" lines what the capture stack asked of the device.+# mediaserverd's "hakios: camera:" lines what the capture stack asked of the device./redwood/bin/sound_test springboard/redwood/bin/rwtouch wait 10 swipe 0.5 0.985 0.5 0.3 200 wait 6 tap 0.845 0.36 wait 22 tap 0.352 0.067 wait 4 tap 0.5 0.86 wait 12 tap 0.5 0.86 wait 25diff --git a/userland/rc.jobs.pl b/userland/rc.jobs.plindex 11b7442..c655961 100644--- a/userland/rc.jobs.pl+++ b/userland/rc.jobs.pl@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# preferenceloader, the package nearly every tweak with a settings pane depends on# (RC_JOBS=rc.jobs.pl): it wants "mobilesubstrate", which ElleKit Provides, so apt can take it at# all now; then Settings is opened, and the tweak loader says whether PreferenceLoader went into it.diff --git a/userland/rc.jobs.preinstalled b/userland/rc.jobs.preinstalledindex dda59ab..aaad9bc 100644--- a/userland/rc.jobs.preinstalled+++ b/userland/rc.jobs.preinstalled@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# What the prefix brings with it before anything is installed over the network# (RC_JOBS=rc.jobs.preinstalled): the versions in dpkg's database, that launchctl and preferenceloader# are really there, and that the tweak loader finds PreferenceLoader and puts it into Settings.diff --git a/userland/rc.jobs.safari b/userland/rc.jobs.safariindex 21edd2a..9d1563f 100644--- a/userland/rc.jobs.safari+++ b/userland/rc.jobs.safari@@ -1,14 +1,14 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Safari (RC_JOBS=rc.jobs.safari, with wifi=1): whether iOS takes the screen for one of extended colour (it must# not: WebKit then draws into surfaces of ten bits a colour that come out black), then yandex.ru and example.com# opened the way a link opens them (battery_test open URL: SpringBoard is asked to open it), for screenshots of what-# Safari shows; Safari's layers, application state and web views are said in between (com.redwood.layers, when-# libredwood-sb.dylib is in it: INJECT with MobileSafari on its line).+# Safari shows; Safari's layers, application state and web views are said in between (com.hakios.layers, when+# libhakios.sb.dylib is in it: INJECT with MobileSafari on its line)./redwood/bin/mg_test HasExtendedColorDisplay/redwood/bin/sound_test springboard/redwood/bin/rwtouch wait 10/redwood/bin/battery_test open https://yandex.ru-/redwood/bin/rwtouch wait 8 notify com.redwood.layers wait 15 notify com.redwood.layers wait 7+/redwood/bin/rwtouch wait 8 notify com.hakios.layers wait 15 notify com.hakios.layers wait 7/bin/ps -A/redwood/bin/battery_test open https://example.com/redwood/bin/rwtouch wait 25diff --git a/userland/rc.jobs.sileo b/userland/rc.jobs.sileoindex 7a3c20d..702bc56 100644--- a/userland/rc.jobs.sileo+++ b/userland/rc.jobs.sileo@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Sileo, the package manager (RC_JOBS=rc.jobs.sileo): the prefix is grafted onto /var/jb by init# (tools/mk-jb.sh puts it in the image). The preparation the bootstrap wants once per boot, the# network (Wi-Fi has an address and a name resolves: before that, apt finds no repository), a freshdiff --git a/userland/rc.jobs.snaps b/userland/rc.jobs.snapsindex db594d3..b65c7c2 100644--- a/userland/rc.jobs.snaps+++ b/userland/rc.jobs.snaps@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# What PosterBoard leaves on the data volume (RC_JOBS=rc.jobs.snaps, gpu=1). The wash of wallpaper# that the switcher puts over a card behind the front one -- PaperBoardUI's "fake wallpaper", the# layer whose animation is AlignFakeWallpaperToLayer -- comes out as one flat magenta here, anddiff --git a/userland/rc.jobs.sound b/userland/rc.jobs.soundindex f994b21..f8aaa77 100644--- a/userland/rc.jobs.sound+++ b/userland/rc.jobs.sound@@ -1,7 +1,7 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Something to hear (RC_JOBS=rc.jobs.sound): once SpringBoard is up, a tone of three seconds (1000 Hz on the# left, 440 Hz on the right), then the lock sound, a keyboard click and a fanfare, as SpringBoard would play-# them. What comes out of /dev/redwood-audio shows whether it worked: the kernel's "redwood-audio:" lines,+# them. What comes out of /dev/hakios-audio shows whether it worked: the kernel's "hakios-audio:" lines,# a recording (boot-arg rec_sound=N), QEMU's sound device./redwood/bin/sound_test springboard wait 5 tone 3 wait 3 system 1100 wait 3 system 1104 wait 3 file /System/Library/Audio/UISounds/New/Fanfare.caf/bin/ps -Adiff --git a/userland/rc.jobs.speakers b/userland/rc.jobs.speakersindex 4cc734c..848a108 100644--- a/userland/rc.jobs.speakers+++ b/userland/rc.jobs.speakers@@ -1,5 +1,5 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).-# The phone's speakers (boot-arg sound=4 with adsp=1, bsd/dev/redwood_sound.c): once SpringBoard is up, what iOS+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).+# The phone's speakers (boot-arg sound=4 with adsp=1, bsd/dev/hakios.sound.c): once SpringBoard is up, what iOS# plays in the ways that matter to the amplifiers, which are on only while there is sound -- a tone of three# seconds (1000 Hz left, 440 Hz right), the lock sound, keyboard clicks four seconds apart (each one starts the# amplifiers anew: after three seconds of silence they are stopped), three clicks half a second apart (theydiff --git a/userland/rc.jobs.speed b/userland/rc.jobs.speedindex 5318833..ef466f6 100644--- a/userland/rc.jobs.speed+++ b/userland/rc.jobs.speed@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The network's rate (RC_JOBS=rc.jobs.speed, with wifi=1 on the phone or QEMU_NET=1): once there is# an address, three downloads of 20 MB over HTTPS one after the other, the way the radio's rate has# been measured since 13 October (15 Mbit/s with one processor, 17 to 19 with four, polling).diff --git a/userland/rc.jobs.ssh b/userland/rc.jobs.sshindex e689a12..dbf6bd6 100644--- a/userland/rc.jobs.ssh+++ b/userland/rc.jobs.ssh@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# A way in over the network (RC_JOBS=rc.jobs.ssh, with wifi=1 among XL_CMDLINE and a long XL_SECS):# the phone's radio joins the network named in fw-wifi/network, configd gives en0 an address, and# OpenSSH from the package manager's prefix lets us log in as root with the key indiff --git a/userland/rc.jobs.store b/userland/rc.jobs.storeindex 827b5aa..81a029c 100644--- a/userland/rc.jobs.store+++ b/userland/rc.jobs.store@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The App Store and the thing it is actually waiting for (RC_JOBS=rc.jobs.store, built with# FLASHBOOT=1 so that the root is the iOS volume on the flash, QUIET=1, and wifi=1 among XL_CMDLINE).#@@ -17,7 +17,7 @@# times" -- pushes everything else off /dev/console, and the scenario's output disappears while the# scenario itself goes on running. A fetch that printed nothing could not be told from one that never# happened, and a whole conclusion was built on exactly that.-# And no second DHCP: configd configures en0 by itself here (the job com.redwood.wifi, with wifi=1),+# And no second DHCP: configd configures en0 by itself here (the job com.hakios.wifi, with wifi=1),# so "dhcp en0" asks IPConfiguration for a service that is already being made. Wait for the address.## Two things are asked at once here, because one window answers both. The storefront is put on thediff --git a/userland/rc.jobs.strip b/userland/rc.jobs.stripindex 8cdadfc..fe65a78 100644--- a/userland/rc.jobs.strip+++ b/userland/rc.jobs.strip@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The dark strip in Search, on demand (RC_JOBS=rc.jobs.strip, a run of about a minute and a half;# the way the user found): Search pulled down, then the gesture from the bottom edge begun and let# go after half a centimetre, eight times. Each time the strip under the status bar used to darkendiff --git a/userland/rc.jobs.switcher b/userland/rc.jobs.switcherindex bce7526..05e3430 100644--- a/userland/rc.jobs.switcher+++ b/userland/rc.jobs.switcher@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The switcher of running applications (RC_JOBS=rc.jobs.switcher, gpu=1): three applications are# started one after another (ones that ask nothing: an application that puts up a question of its# own -- Photos asks about notifications -- leaves a modal alert on the screen, and with one of@@ -16,7 +16,7 @@/redwood/bin/rwtouch tap 0.383 0.358 wait 20 button home wait 8/redwood/bin/rwtouch tap 0.614 0.481 wait 20/redwood/bin/rwtouch drag 0.5 0.995 0.5 0.62 600 2500 wait 8-/redwood/bin/rwtouch notify com.redwood.layers wait 30+/redwood/bin/rwtouch notify com.hakios.layers wait 30# And what the wallpaper left on the volume for the frosted materials to take their bottom layer# from: PaperBoardUI asks its source for a snapshot or a blurred copy, by image or by file name./var/jb/usr/bin/find /var -maxdepth 7 -iname "*allpaper*" -lsdiff --git a/userland/rc.jobs.torch b/userland/rc.jobs.torchindex bd2747a..d78bb7c 100644--- a/userland/rc.jobs.torch+++ b/userland/rc.jobs.torch@@ -1,6 +1,6 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The flashlight for iOS (RC_JOBS=rc.jobs.torch, with torch=3): as a program works it (torch_test: AVFlashlight, i.e.-# mediaserverd's FigFlashlight, i.e. the kernel's /dev/redwood-torch) at full and at a quarter, then off; then from+# mediaserverd's FigFlashlight, i.e. the kernel's /dev/hakios-torch) at full and at a quarter, then off; then from# Control Center, as a finger works it: opened from the top right corner, its flashlight button pressed, pressed again# 5 s later, Control Center closed (a tap below its buttons); then on for 8 s, which the kernel cuts with torch_max_s=5# (and leaves alone at its default of 30). The kernel's "torch:" lines say what was lit, and the end of the run repeatsdiff --git a/userland/rc.jobs.tour b/userland/rc.jobs.tourindex 7d62cbc..444e6fe 100644--- a/userland/rc.jobs.tour+++ b/userland/rc.jobs.tour@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# A tour for exercising memory and stability (RC_JOBS=rc.jobs.tour, a run of about 9 minutes): unlock,# then every application of the first home-screen page and of the dock for 20 seconds each, and a# look at who is still alive at the end. The kernel's "memory:" lines tell the rest.diff --git a/userland/rc.jobs.tweakinstall b/userland/rc.jobs.tweakinstallindex 3e1b1d6..4d84504 100644--- a/userland/rc.jobs.tweakinstall+++ b/userland/rc.jobs.tweakinstall@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# Installing a tweak the way Sileo does it (RC_JOBS=rc.jobs.tweakinstall): a package whose trigger# runs uicache, which rebuilds the database of applications -- the moment a running Sileo used to be# killed ("uninstalling app") instead of offering a respring. Afterwards: is Sileo still registered,diff --git a/userland/rc.jobs.u2f b/userland/rc.jobs.u2findex fbbc3a9..e1d2a85 100644--- a/userland/rc.jobs.u2f+++ b/userland/rc.jobs.u2f@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# What this GPU makes of an unsigned 32-bit integer turned into a float (src/u2f_test.c), through# OpenGL ES and none of our AIR work: with gpu=1 adreno_keep=1 it is the phone's Adreno that# answers, through the same Mesa and the same ir3 that the window server draws with. The lockdiff --git a/userland/rc.jobs.uib b/userland/rc.jobs.uibindex ac9486b..e1be85f 100644--- a/userland/rc.jobs.uib+++ b/userland/rc.jobs.uib@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The UI bugs (RC_JOBS=rc.jobs.uib, a run of about four minutes): Search, pulled down from the home# screen, before and after an application is left with the gesture from the bottom edge (the strip# under the status bar used to come out black from one of these on); then the side button twice, todiff --git a/userland/rc.jobs.unlock b/userland/rc.jobs.unlockindex 24dae6b..3dab256 100644--- a/userland/rc.jobs.unlock+++ b/userland/rc.jobs.unlock@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist)./redwood/bin/hello_dyn started by launchd/redwood/bin/svc_test/redwood/bin/surf_testdiff --git a/userland/rc.jobs.users b/userland/rc.jobs.usersindex a2913ff..f001a54 100644--- a/userland/rc.jobs.users+++ b/userland/rc.jobs.users@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The user database (RC_JOBS=rc.jobs.users). iOS has no flat-file user lookup left: getpwuid and# getpwnam go over Mach to com.apple.system.libinfo.muser, which usermanagerd serves, and a program# that cannot reach it sees every user as missing ("No user exists for uid 0" is what OpenSSH says).diff --git a/userland/rc.jobs.vblur b/userland/rc.jobs.vblurindex 8b5da0e..f99e791 100644--- a/userland/rc.jobs.vblur+++ b/userland/rc.jobs.vblur@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The blur whose radius varies (RC_JOBS=rc.jobs.vblur, a run of about two and a half minutes): the# strip under the status bar in Search; the widgets of the Today view and the folders of the App# Library held up under it (the higher, the more blurred, where vblur=0 leaves them sharp); then Maps,diff --git a/userland/rc.jobs.voicememos b/userland/rc.jobs.voicememosindex 401ce5b..d1dd491 100644--- a/userland/rc.jobs.voicememos+++ b/userland/rc.jobs.voicememos@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The microphone in an application (with adsp=1 mic=4): Voice Memos opened (voicememos://), past its welcome sheet# (Continue), and its record button pressed; it records until the run ends. For screenshots: the time running, the# waveform of what the microphone hears, the orange dot of a microphone in use.diff --git a/userland/rc.jobs.volume b/userland/rc.jobs.volumeindex 95267ee..549618d 100644--- a/userland/rc.jobs.volume+++ b/userland/rc.jobs.volume@@ -1,8 +1,8 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# The speakers' volume (boot-arg sound=4 with adsp=1): once SpringBoard is up, a tone of two seconds at# iOS's volume as it is, then after every few presses of the volume buttons another one -- four steps down,# eight up (to the top), sixteen down (to 0: the amplifiers stay off), four up. Every setting of the-# plug-in's volume control is in the log ("redwood: audio: the volume is ..."), and the kernel's "sound:" and+# plug-in's volume control is in the log ("hakios: audio: the volume is ..."), and the kernel's "sound:" and# "speaker:" lines say what the amplifiers did with it (register 0x05)./redwood/bin/sound_test springboard route wait 2 tone 2 wait 4/redwood/bin/rwtouch button voldown wait 0.5 button voldown wait 0.5 button voldown wait 0.5 button voldown wait 1diff --git a/userland/rc.jobs.wifipw b/userland/rc.jobs.wifipwindex 0806a6c..242855a 100644--- a/userland/rc.jobs.wifipw+++ b/userland/rc.jobs.wifipw@@ -1,4 +1,4 @@-# Commands run by the launchd job com.redwood.demo (see com.redwood.demo.plist).+# Commands run by the launchd job com.hakios.demo (see com.hakios.demo.plist).# wifid's way of keeping a network's password (RC_JOBS=rc.jobs.wifipw, with WIFID=1 and# OSLOG="com.apple.wifid com.apple.securityd" for their side): once the system has settled, a made-up# network's password into the keychain the way wifid puts it there, back, and away again; thendiff --git a/userland/src/audio_plugin.c b/userland/src/audio_plugin.cindex 4bef2dd..af13bec 100644--- a/userland/src/audio_plugin.c+++ b/userland/src/audio_plugin.c@@ -1,5 +1,5 @@/*- * RedwoodAudio.driver: the output device of iOS on this machine.+ * HakiosAudio.driver: the output device of iOS on this machine.** Audio devices reach the audio server's hardware layer (the "HAL" of CoreAudio, inside* mediaserverd) in two ways: kernel drivers through IOAudio2 -- that is how an iPhone's own@@ -16,8 +16,8 @@* with nothing plugged in plays through, with a volume, the volume display and the place in* Control Center that go with it. So this presents four devices under those names:*- * "Speaker" a stereo output whose samples are written to /dev/redwood-audio, where the- * kernel takes them to whatever can play them (see sys/redwood_audio.h), and a+ * "Speaker" a stereo output whose samples are written to /dev/hakios-audio, where the+ * kernel takes them to whatever can play them (see sys/hakios.audio.h), and a* stereo input that is always silent (on an iPhone: what the amplifiers measure)* "Hawking" one silent input and nothing else. The virtual audio device will not build the* speaker route without a second virtual device of its own (its type 'vhaw', a@@ -25,10 +25,10 @@* only port is this input; without it everything stays on the null port.* "Actuator" one output of one channel: the iPhone's Taptic Engine, on which iOS plays its* haptics as waveforms (through the chain 'd22_actuator_general'); its samples go to- * the kernel's motor driver, /dev/redwood-haptic (see actuator_write())+ * the kernel's motor driver, /dev/hakios-haptic (see actuator_write())* "Codec" one input of one channel: on an iPhone, the audio codec that the built-in* microphones are on, of which the virtual audio device makes the built-in microphone- * port; its samples come from the kernel, /dev/redwood-mic (the phone's main+ * port; its samples come from the kernel, /dev/hakios-mic (the phone's main* microphone, boot-arg mic=4), which listens only while this input runs (see codec_read())** CoreAudio's own null device ("Null_Device", described in the framework's Info.plist, playing@@ -39,11 +39,11 @@* speakers first ('d22_speaker_general', from /Library/Audio/Tunings/D22: equalisers,* compressors, speaker protection), at the volume iOS has set.*- * The device has no clock but the system's: it claims to play exactly REDWOOD_AUDIO_RATE frames+ * The device has no clock but the system's: it claims to play exactly HAKIOS_AUDIO_RATE frames* a second of mach_absolute_time(), and the HAL's I/O thread paces itself by that.** The speaker's output has a volume control, as the iPhone's own speaker has: what is set on it- * goes to the kernel (ioctl REDWOOD_AUDIO_SET_VOLUME), which sets the amplifiers' level by it -- on+ * goes to the kernel (ioctl HAKIOS_AUDIO_SET_VOLUME), which sets the amplifiers' level by it -- on* the phone, so far under the loudest it allows. Its scale is 48 dB in a straight line of* decibels, 3 dB for each of iOS's sixteen steps; 0 is silence. What iOS does with it (the phone,* 15 October): the virtual audio device sets it once, to its top (0 dB), when it takes the@@ -65,7 +65,7 @@#include <string.h>#include <unistd.h>-#include "redwood_audio.h"+#include "hakios.audio.h"/* ---- the AudioServerPlugIn interface (macOS: CoreAudio/AudioServerPlugIn.h, AudioHardwareBase.h) ---- */@@ -215,7 +215,7 @@ struct device {static struct device devices[] = {{ .object = OBJECT_SPEAKER, .uid = CFSTR("Speaker"), .output = OBJECT_SPEAKER_OUTPUT, .input = OBJECT_SPEAKER_INPUT,- .output_channels = REDWOOD_AUDIO_CHANNELS, .input_channels = 2 },+ .output_channels = HAKIOS_AUDIO_CHANNELS, .input_channels = 2 },{ .object = OBJECT_HAWKING, .uid = CFSTR("Hawking"), .input = OBJECT_HAWKING_INPUT, .input_channels = 1 },{ .object = OBJECT_ACTUATOR, .uid = CFSTR("Actuator"), .output = OBJECT_ACTUATOR_OUTPUT, .output_channels = 1 },{ .object = OBJECT_CODEC, .uid = CFSTR("Codec"), .input = OBJECT_CODEC_INPUT, .input_channels = 1 },@@ -237,7 +237,7 @@ static struct device devices[] = {static AudioServerPlugInHostRef host;static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;-static int sink = -1; /* /dev/redwood-audio */+static int sink = -1; /* /dev/hakios-audio */static Float64 ticks_per_frame;static UInt64 written, refused; /* frames since the speaker's I/O started */static Boolean inactive[OBJECT_LAST + 1]; /* streams the HAL has switched off */@@ -279,13 +279,13 @@ db_to_scalar(Float32 db)static voidvolume_to_kernel(void){- struct redwood_audio_volume v = { (uint32_t)lround(-scalar_to_db(volume) * 8), volume <= 0 };+ struct hakios_audio_volume v = { (uint32_t)lround(-scalar_to_db(volume) * 8), volume <= 0 };- if (sink < 0 || ioctl(sink, REDWOOD_AUDIO_SET_VOLUME, &v) < 0) {- say("redwood: audio: the volume %.3f could not be given to the kernel (%s)\n", volume, strerror(errno));+ if (sink < 0 || ioctl(sink, HAKIOS_AUDIO_SET_VOLUME, &v) < 0) {+ say("hakios: audio: the volume %.3f could not be given to the kernel (%s)\n", volume, strerror(errno));return;}- say("redwood: audio: the volume is %.3f: %s%.1f dB under the loudest\n", volume, v.muted ? "silence, " : "",+ say("hakios: audio: the volume is %.3f: %s%.1f dB under the loudest\n", volume, v.muted ? "silence, " : "",v.below / 8.0);}@@ -301,7 +301,7 @@ device_of(AudioObjectID object)return NULL;}-/* The one format of a stream: 16-bit samples at REDWOOD_AUDIO_RATE, so many channels. */+/* The one format of a stream: 16-bit samples at HAKIOS_AUDIO_RATE, so many channels. */static AudioStreamBasicDescriptionformat_of(AudioObjectID stream){@@ -309,7 +309,7 @@ format_of(AudioObjectID stream)UInt32 channels = stream == d->output ? d->output_channels : d->input_channels;return (AudioStreamBasicDescription) {- .mSampleRate = REDWOOD_AUDIO_RATE, .mFormatID = kAudioFormatLinearPCM,+ .mSampleRate = HAKIOS_AUDIO_RATE, .mFormatID = kAudioFormatLinearPCM,.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked,.mBytesPerPacket = 2 * channels, .mFramesPerPacket = 1, .mBytesPerFrame = 2 * channels,.mChannelsPerFrame = channels, .mBitsPerChannel = 16,@@ -349,9 +349,9 @@ initialize(__unused AudioServerPlugInDriverRef driver, AudioServerPlugInHostRefhost = the_host;mach_timebase_info(&timebase);- ticks_per_frame = 1e9 * timebase.denom / timebase.numer / REDWOOD_AUDIO_RATE;- sink = open(REDWOOD_AUDIO_DEVICE, O_WRONLY);- say("redwood: audio: the speaker is with the HAL (%s: %s)\n", REDWOOD_AUDIO_DEVICE, sink < 0 ? strerror(errno) : "open");+ ticks_per_frame = 1e9 * timebase.denom / timebase.numer / HAKIOS_AUDIO_RATE;+ sink = open(HAKIOS_AUDIO_DEVICE, O_WRONLY);+ say("hakios: audio: the speaker is with the HAL (%s: %s)\n", HAKIOS_AUDIO_DEVICE, sink < 0 ? strerror(errno) : "open");return 0;}@@ -585,11 +585,11 @@ property(AudioObjectID object, const AudioObjectPropertyAddress *address, UInt32v.empty = v.size == 0;break;case kAudioDevicePropertyNominalSampleRate:- v.u.number = REDWOOD_AUDIO_RATE;+ v.u.number = HAKIOS_AUDIO_RATE;v.size = sizeof(Float64);break;case kAudioDevicePropertyAvailableNominalSampleRates:- v.u.range.mMinimum = v.u.range.mMaximum = REDWOOD_AUDIO_RATE;+ v.u.range.mMinimum = v.u.range.mMaximum = HAKIOS_AUDIO_RATE;v.size = sizeof(AudioValueRange);break;case kAudioDevicePropertyPreferredChannelsForStereo:@@ -626,7 +626,7 @@ property(AudioObjectID object, const AudioObjectPropertyAddress *address, UInt32case kAudioStreamPropertyAvailableVirtualFormats:case kAudioStreamPropertyAvailablePhysicalFormats:v.u.ranged.mFormat = format_of(object);- v.u.ranged.mSampleRateRange.mMinimum = v.u.ranged.mSampleRateRange.mMaximum = REDWOOD_AUDIO_RATE;+ v.u.ranged.mSampleRateRange.mMinimum = v.u.ranged.mSampleRateRange.mMaximum = HAKIOS_AUDIO_RATE;v.size = sizeof(AudioStreamRangedDescription);break;}@@ -663,7 +663,7 @@ unknown(AudioObjectID object, const AudioObjectPropertyAddress *address)unknown_told[unknown_count][1] = s;unknown_told[unknown_count][2] = c;unknown_count++;- say("redwood: audio: asked of object %u (%s) what it does not have: '%c%c%c%c' (%#x), scope '%c%c%c%c', element %u\n",+ say("hakios: audio: asked of object %u (%s) what it does not have: '%c%c%c%c' (%#x), scope '%c%c%c%c', element %u\n",(unsigned)object, device_of(object) ? CFStringGetCStringPtr(device_of(object)->uid, kCFStringEncodingUTF8) : "-",(int)(s >> 24 & 0xff), (int)(s >> 16 & 0xff), (int)(s >> 8 & 0xff), (int)(s & 0xff), (unsigned)s,(int)(c >> 24 & 0xff), (int)(c >> 16 & 0xff), (int)(c >> 8 & 0xff), (int)(c & 0xff), (unsigned)address->mElement);@@ -812,7 +812,7 @@ set_property_data(AudioServerPlugInDriverRef driver, AudioObjectID object, pid_treturn 0;}if (address->mSelector == kAudioDevicePropertyNominalSampleRate) {- return size == sizeof(Float64) && *(const Float64 *)data == REDWOOD_AUDIO_RATE ? 0 : kAudioDeviceUnsupportedFormatError;+ return size == sizeof(Float64) && *(const Float64 *)data == HAKIOS_AUDIO_RATE ? 0 : kAudioDeviceUnsupportedFormatError;}/* a format: the one we have, or nothing */if (size != sizeof(AudioStreamBasicDescription)) {@@ -827,7 +827,7 @@ set_property_data(AudioServerPlugInDriverRef driver, AudioObjectID object, pid_t}/*- * The microphone (the device "Codec"): /dev/redwood-mic is open while the input runs, and the kernel+ * The microphone (the device "Codec"): /dev/hakios-mic is open while the input runs, and the kernel* listens only while it is open. A read gives what has come and never waits; what it does not* give is silence. Said when it starts and stops, with how much came.*/@@ -838,18 +838,18 @@ static int mic_peak;static voidcodec_open(void){- mic = open("/dev/redwood-mic", O_RDONLY | O_NONBLOCK);+ mic = open("/dev/hakios-mic", O_RDONLY | O_NONBLOCK);mic_frames = mic_heard = mic_short = 0;mic_peak = 0;- say("redwood: audio: the microphone is listened to (/dev/redwood-mic: %s)\n", mic < 0 ? strerror(errno) : "open");+ say("hakios: audio: the microphone is listened to (/dev/hakios-mic: %s)\n", mic < 0 ? strerror(errno) : "open");}static voidcodec_close(void){- say("redwood: audio: the microphone stops: %llu.%02llu s asked for, %llu.%02llu s of it from the kernel (peak %d of 32768), "- "%llu reads short\n", mic_frames / REDWOOD_AUDIO_RATE, mic_frames % REDWOOD_AUDIO_RATE * 100 / REDWOOD_AUDIO_RATE,- mic_heard / REDWOOD_AUDIO_RATE, mic_heard % REDWOOD_AUDIO_RATE * 100 / REDWOOD_AUDIO_RATE, mic_peak, mic_short);+ say("hakios: audio: the microphone stops: %llu.%02llu s asked for, %llu.%02llu s of it from the kernel (peak %d of 32768), "+ "%llu reads short\n", mic_frames / HAKIOS_AUDIO_RATE, mic_frames % HAKIOS_AUDIO_RATE * 100 / HAKIOS_AUDIO_RATE,+ mic_heard / HAKIOS_AUDIO_RATE, mic_heard % HAKIOS_AUDIO_RATE * 100 / HAKIOS_AUDIO_RATE, mic_peak, mic_short);if (mic >= 0) {close(mic);}@@ -863,8 +863,8 @@ codec_read(int16_t *samples, UInt32 frames)UInt32 have = got > 0 ? (UInt32)got / 2 : 0;if (have > 0 && mic_heard == 0) {- say("redwood: audio: the microphone's first samples, %llu.%02llu s after the input started\n",- mic_frames / REDWOOD_AUDIO_RATE, mic_frames % REDWOOD_AUDIO_RATE * 100 / REDWOOD_AUDIO_RATE);+ say("hakios: audio: the microphone's first samples, %llu.%02llu s after the input started\n",+ mic_frames / HAKIOS_AUDIO_RATE, mic_frames % HAKIOS_AUDIO_RATE * 100 / HAKIOS_AUDIO_RATE);}for (UInt32 i = 0; i < have; i++) {int v = samples[i] < 0 ? -samples[i] : samples[i];@@ -893,7 +893,7 @@ start_io(__unused AudioServerPlugInDriverRef driver, AudioObjectID object, __unud->periods = 0;if (d->output != 0) {written = refused = 0;- say("redwood: audio: playing\n");+ say("hakios: audio: playing\n");}if (d->object == OBJECT_CODEC) {codec_open();@@ -916,8 +916,8 @@ stop_io(__unused AudioServerPlugInDriverRef driver, AudioObjectID object, __unusif (d->object == OBJECT_CODEC) {codec_close();} else if (d->output != 0) {- say("redwood: audio: stopped after %llu.%02llu s (%llu frames not taken by %s)\n", written / REDWOOD_AUDIO_RATE,- written % REDWOOD_AUDIO_RATE * 100 / REDWOOD_AUDIO_RATE, refused, REDWOOD_AUDIO_DEVICE);+ say("hakios: audio: stopped after %llu.%02llu s (%llu frames not taken by %s)\n", written / HAKIOS_AUDIO_RATE,+ written % HAKIOS_AUDIO_RATE * 100 / HAKIOS_AUDIO_RATE, refused, HAKIOS_AUDIO_DEVICE);}}pthread_mutex_unlock(&lock);@@ -966,7 +966,7 @@ begin_end_io_operation(__unused AudioServerPlugInDriverRef driver, __unused Audi/** What iOS plays on the actuator -- the haptics: the system's feedbacks and the ringer's vibration,* CoreHaptics' patterns, UIKit's feedbacks, as waveforms of one channel -- goes to the kernel's motor- * driver (/dev/redwood-haptic, bsd/dev/redwood_haptic.c, haptic=5), which plays Android's own+ * driver (/dev/hakios-haptic, bsd/dev/hakios.haptic.c, haptic=5), which plays Android's own* waveforms on the phone's motor by it. (iOS plays on this device at all only because the device* tree says the phone's haptics are "closed-loop": see mkidentity.py.) Said the first times, with* how loud.@@ -985,7 +985,7 @@ actuator_write(const int16_t *samples, UInt32 frames)peak = v > peak ? v : peak;}if (haptic == -1) {- haptic = open("/dev/redwood-haptic", O_WRONLY | O_NONBLOCK);+ haptic = open("/dev/hakios-haptic", O_WRONLY | O_NONBLOCK);haptic = haptic >= 0 ? haptic : -2;}if (haptic >= 0) {@@ -993,8 +993,8 @@ actuator_write(const int16_t *samples, UInt32 frames)}if (peak > 0 && haptic_said < 12) {haptic_said++;- say("redwood: audio: the actuator plays: %u frames, peak %d of 32768%s\n", (unsigned)frames, peak,- haptic >= 0 ? "" : " (no /dev/redwood-haptic: not felt)");+ say("hakios: audio: the actuator plays: %u frames, peak %d of 32768%s\n", (unsigned)frames, peak,+ haptic >= 0 ? "" : " (no /dev/hakios-haptic: not felt)");}}@@ -1017,7 +1017,7 @@ do_io_operation(__unused AudioServerPlugInDriverRef driver, __unused AudioObjectactuator_write(buffer, frames);} else if (operation == kAudioServerPlugInIOOperationWriteMix && stream == d->output) {/* the kernel takes it all or leaves it: this thread must not wait */- if (sink < 0 || write(sink, buffer, (size_t)frames * REDWOOD_AUDIO_FRAME) < 0) {+ if (sink < 0 || write(sink, buffer, (size_t)frames * HAKIOS_AUDIO_FRAME) < 0) {refused += frames;}written += frames;@@ -1035,7 +1035,7 @@ static AudioServerPlugInDriverInterface *driver = &interface;/* The factory named in the bundle's Info.plist. */void *-RedwoodAudio_Create(__unused CFAllocatorRef allocator, CFUUIDRef type)+HakiosAudio_Create(__unused CFAllocatorRef allocator, CFUUIDRef type){return CFEqual(type, kAudioServerPlugInTypeUUID) ? &driver : NULL;}diff --git a/userland/src/audio_plugin.plist b/userland/src/audio_plugin.plistindex a2eff0c..f3ee86a 100644--- a/userland/src/audio_plugin.plist+++ b/userland/src/audio_plugin.plist@@ -3,11 +3,11 @@<plist version="1.0"><dict><key>CFBundleIdentifier</key>- <string>com.redwood.audio</string>+ <string>com.hakios.audio</string><key>CFBundleName</key>- <string>RedwoodAudio</string>+ <string>HakiosAudio</string><key>CFBundleExecutable</key>- <string>RedwoodAudio</string>+ <string>HakiosAudio</string><key>CFBundlePackageType</key><string>BNDL</string><key>CFBundleInfoDictionaryVersion</key>@@ -29,7 +29,7 @@<key>CFPlugInFactories</key><dict><key>7C3E5B0A-52D4-4F6B-9E0D-6B1A2D7F0C51</key>- <string>RedwoodAudio_Create</string>+ <string>HakiosAudio_Create</string></dict></dict></plist>diff --git a/userland/src/battery_test.c b/userland/src/battery_test.cindex 29ec908..3fe8ad7 100644--- a/userland/src/battery_test.c+++ b/userland/src/battery_test.c@@ -1,8 +1,8 @@/** The battery as iOS sees it: the kernel's power source (the IOPMPowerSource that powerd reads,- * iokit/Kernel/RedwoodBattery.cpp) and what powerd has made of it (the power sources list that+ * iokit/Kernel/hakios.battery.cpp) and what powerd has made of it (the power sources list that* the status bar, the lock screen and Settings get through IOPS), side by side with the kernel's- * own numbers (kern.redwood.battery_*).+ * own numbers (kern.hakios.battery_*).** battery_test once* battery_test N S N times, S seconds apart@@ -112,10 +112,10 @@ once(void)int got = IOPSGetPercentRemaining(&percent, &charging, &full);printf("battery_test: the kernel says %d%%, %d mV, %d mA, %d C, battery %d, charger %d, charging %d, from the DSP %d\n",- kernel("kern.redwood.battery_soc"), kernel("kern.redwood.battery_voltage_mv"), kernel("kern.redwood.battery_current_ma"),- kernel("kern.redwood.battery_temperature_c"), kernel("kern.redwood.battery_present"),- kernel("kern.redwood.battery_charger_present"), kernel("kern.redwood.battery_charging"),- kernel("kern.redwood.battery_from_dsp"));+ kernel("kern.hakios.battery_soc"), kernel("kern.hakios.battery_voltage_mv"), kernel("kern.hakios.battery_current_ma"),+ kernel("kern.hakios.battery_temperature_c"), kernel("kern.hakios.battery_present"),+ kernel("kern.hakios.battery_charger_present"), kernel("kern.hakios.battery_charging"),+ kernel("kern.hakios.battery_from_dsp"));if (service != 0) {CFMutableDictionaryRef properties = NULL;io_name_t name = "";diff --git a/userland/src/camera_avtest.m b/userland/src/camera_avtest.mindex a768051..118c5bd 100644--- a/userland/src/camera_avtest.m+++ b/userland/src/camera_avtest.m@@ -1,7 +1,7 @@/** camera_avtest: what cameras iOS lists for applications, as AVFoundation gives them: the video- * devices, and every format of the default one (on this machine the device is libredwood-media.dylib's- * in mediaserverd: camera_device.c, the kernel's /dev/redwood-camera, cam=5).+ * devices, and every format of the default one (on this machine the device is libhakios.media.dylib's+ * in mediaserverd: camera_device.c, the kernel's /dev/hakios-camera, cam=5).** usage: camera_avtest*diff --git a/userland/src/camera_device.c b/userland/src/camera_device.cindex 65bcb29..24b1d6b 100644--- a/userland/src/camera_device.c+++ b/userland/src/camera_device.c@@ -2,7 +2,7 @@* The phone's cameras as iOS's capture stack wants them: a FigCaptureDevice with two FigCaptureStreams,* the wide camera as the back camera and the front one as the front camera, made for mediaserverd's* BWFigCaptureDeviceVendor in place of the device Apple's H10ISP.mediacapture makes of the iPhone's ISP- * (part of libredwood-media.dylib; inject_media.c gives the vendor our device's create function when+ * (part of libhakios.media.dylib; inject_media.c gives the vendor our device's create function when* the kernel has a camera: cam=5).** Both are CoreMedia "derived objects" (CMDerivedObjectCreate): a table of functions for the base@@ -12,7 +12,7 @@* A stream's frames go to the capture graph through the blocks it is given in its property* "VideoOutputHandlers" ({ output: { PixelBufferHandler: ^(CVPixelBufferRef, CMTime) } }), for the* outputs "VideoOutputConfigurations" describes (the graph's own buffer pools) and "VideoOutputsEnabled"- * switches on. A frame: read from the kernel's /dev/redwood-camera (RAW10), made into a picture by+ * switches on. A frame: read from the kernel's /dev/hakios-camera (RAW10), made into a picture by* camera_isp.c (exposure, white balance kept to the sensor's reference lights, the colour matrix and* lens shading of the camera's own tuning, gamma, zoom), one pixel buffer for each output, with the* metadata the graph keeps its frame statistics and its zoom by. The kernel gives one sensor's frames@@ -28,7 +28,7 @@* a lens motor (the wide camera's): by contrast, continuous, and on the window a tap gives (af_frame()).** Everything asked of the device and the streams that is not answered here is said in mediaserverd's- * log ("redwood: camera: ..."), once per property.+ * log ("hakios: camera: ..."), once per property.*/#include <CoreFoundation/CoreFoundation.h>#include <CoreMedia/CoreMedia.h>@@ -48,14 +48,14 @@#include <unistd.h>#include "camera_isp.h"-void redwood_camera_say(const char *format, ...) __attribute__((format(printf, 1, 2)));+void hakios_camera_say(const char *format, ...) __attribute__((format(printf, 1, 2)));void-redwood_camera_say(const char *format, ...)+hakios_camera_say(const char *format, ...){char line[400];va_list ap;- int n = snprintf(line, sizeof(line), "redwood: camera: ");+ int n = snprintf(line, sizeof(line), "hakios: camera: ");va_start(ap, format);n += vsnprintf(line + n, sizeof(line) - (size_t)n, format, ap);@@ -66,7 +66,7 @@ redwood_camera_say(const char *format, ...)line[n++] = '\n';write(2, line, (size_t)n);}-#define say redwood_camera_say+#define say hakios_camera_say/* ---- CoreMedia's derived objects, as iOS 16.5 lays them out ---------------------------------------- */@@ -425,7 +425,7 @@ static const char *const output_names[OUTPUTS] = { "PrimaryScaler", "SecondarySc* gives one sensor's frames at a time; a stream's frames start with its own sensor's (see worker()).*/static const struct camera {- uint32_t sensor; /* the kernel's (the frames' sensor, REDWOOD_CAMERA_SENSOR) */+ uint32_t sensor; /* the kernel's (the frames' sensor, HAKIOS_CAMERA_SENSOR) */const char *name, *unique_id;bool turned; /* its sensor the other way up from the iPhone's: the pictures turned half round */double focal_length, f_number, pixel_size, fov;@@ -785,7 +785,7 @@ stream_set_property(CMBaseObjectRef o, CFStringRef key, CFTypeRef value)return 0;}-/* the flashlight: TorchLevel (0 to 1) as thousandths to the kernel's /dev/redwood-torch (torch=3) */+/* the flashlight: TorchLevel (0 to 1) as thousandths to the kernel's /dev/hakios-torch (torch=3) */static voidtorch_set(struct stream *s, CFTypeRef value){@@ -798,10 +798,10 @@ torch_set(struct stream *s, CFTypeRef value)level = level < 0 ? 0 : level > 1 ? 1 : level;thousandths = (uint32_t)(level * 1000 + 0.5f);if (s->torch < 0) {- s->torch = open("/dev/redwood-torch", O_WRONLY);+ s->torch = open("/dev/hakios-torch", O_WRONLY);}if (s->torch < 0 || write(s->torch, &thousandths, sizeof(thousandths)) != (ssize_t)sizeof(thousandths)) {- say("the flashlight at %u of 1000 NOT TAKEN (no /dev/redwood-torch)", thousandths);+ say("the flashlight at %u of 1000 NOT TAKEN (no /dev/hakios-torch)", thousandths);} else {say("the flashlight at %u of 1000", thousandths);}@@ -811,7 +811,7 @@ torch_set(struct stream *s, CFTypeRef value)struct render_job {const struct isp *isp;- const struct redwood_camera_frame *f;+ const struct hakios_camera_frame *f;const uint8_t *raw;CVPixelBufferRef pb;uint32_t format, width, height, pieces;@@ -918,7 +918,7 @@ md_put(CFMutableDictionaryRef m, int key, CFTypeRef value)/* the frame's metadata, as H10ISP's stream gives them (see md_names) */static CFDictionaryRef-frame_metadata(const struct isp *isp, const struct redwood_camera_frame *f, const struct isp_stats *st, CFStringRef port)+frame_metadata(const struct isp *isp, const struct hakios_camera_frame *f, const struct isp_stats *st, CFStringRef port){CFMutableDictionaryRef m;double exposure = f->exposure_lines * (double)f->line_ns / 1e9, analog = f->gain_unity ? (double)f->gain / f->gain_unity : 1;@@ -957,7 +957,7 @@ frame_metadata(const struct isp *isp, const struct redwood_camera_frame *f, cons}static void-deliver(struct stream *s, struct output *out, const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw,+deliver(struct stream *s, struct output *out, const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw,CFDictionaryRef metadata){CVPixelBufferRef pb = output_buffer(out);@@ -1039,7 +1039,7 @@ deliver(struct stream *s, struct output *out, const struct isp *isp, const struc* 15.9-16x, at the longest exposure a frame at 30 a second allows.*/static float-lux_index(const struct isp *isp, const struct redwood_camera_frame *f)+lux_index(const struct isp *isp, const struct hakios_camera_frame *f){double exposure = f->exposure_lines * (double)f->line_ns / 1e9 * f->gain / f->gain_unity * isp->digital;@@ -1076,7 +1076,7 @@ colour_temperature(const struct isp *isp)}/*- * Focus, where the camera has a lens motor (the frames' focus is a position, not REDWOOD_CAMERA_NO_FOCUS:+ * Focus, where the camera has a lens motor (the frames' focus is a position, not HAKIOS_CAMERA_NO_FOCUS:* the wide camera's): by contrast, as there is nothing else to go by -- the sensor's phase-detection* pixels are not read. A search climbs from where the lens is: a step of AF_STEP one way, on that way* while the middle of the picture gets sharper, back the other way if the first step was not, until@@ -1119,7 +1119,7 @@ struct af {static voidaf_go(int device, struct af *af, uint32_t target){- struct redwood_camera_command c = { .command = REDWOOD_CAMERA_FOCUS };+ struct hakios_camera_command c = { .command = HAKIOS_CAMERA_FOCUS };af->target = target < AF_NEAR ? AF_NEAR : target > AF_FAR ? AF_FAR : target;c.a = af->at < af->target ? (af->target - af->at > AF_STEP ? af->at + AF_STEP : af->target) :@@ -1138,12 +1138,12 @@ af_go(int device, struct af *af, uint32_t target)}static void-af_frame(int device, struct af *af, const struct redwood_camera_frame *f, const uint8_t *raw, const float window[4], bool locked)+af_frame(int device, struct af *af, const struct hakios_camera_frame *f, const uint8_t *raw, const float window[4], bool locked){float level, sharpness;unsigned needed = f->gain >= 16 * f->gain_unity ? 2 : 1; /* (in the dark, two frames to a measurement) */- if (f->focus == REDWOOD_CAMERA_NO_FOCUS) {+ if (f->focus == HAKIOS_CAMERA_NO_FOCUS) {return;}if (af->at == 0 && af->target == 0) {@@ -1307,7 +1307,7 @@ worker(void *context){CMBaseObjectRef o = context;struct stream *s = stream_of(o);- struct redwood_camera_frame head;+ struct hakios_camera_frame head;struct isp isp;struct isp_stats st;uint8_t *buffer = NULL;@@ -1316,11 +1316,11 @@ worker(void *context)bool switched = false;float lux = -1, cct = -1;struct af af = { 0 };- int device = open(REDWOOD_CAMERA_DEVICE, O_RDWR), failures = 0;+ int device = open(HAKIOS_CAMERA_DEVICE, O_RDWR), failures = 0;- pthread_setname_np("redwood-camera");+ pthread_setname_np("hakios-camera");if (device < 0) {- say("no %s (%s): no frames", REDWOOD_CAMERA_DEVICE, strerror(errno));+ say("no %s (%s): no frames", HAKIOS_CAMERA_DEVICE, strerror(errno));return NULL;}isp_init(&isp);@@ -1340,7 +1340,7 @@ worker(void *context)if (head.sensor != s->camera->sensor) {/* another camera's frames (the kernel's last sensor): changed, and the next ones are this one's */if (!switched) {- struct redwood_camera_command c = { .command = REDWOOD_CAMERA_SENSOR, .a = s->camera->sensor, .b = ~0u };+ struct hakios_camera_command c = { .command = HAKIOS_CAMERA_SENSOR, .a = s->camera->sensor, .b = ~0u };switched = true;say("the kernel's frames are camera %u's: to %u, the %s", head.sensor, s->camera->sensor, s->camera->name);@@ -1364,9 +1364,9 @@ worker(void *context)}failures = 0;- const struct redwood_camera_frame *f = (const void *)buffer;+ const struct hakios_camera_frame *f = (const void *)buffer;const uint8_t *raw = buffer + f->header_bytes;- struct redwood_camera_command c;+ struct hakios_camera_command c;isp_measure(&isp, f, raw, &st);isp_awb(&isp, &st);@@ -1619,7 +1619,7 @@ static CFStringRefstream_description(CMBaseObjectRef o){(void)o;- return CFRetain(CFSTR("<RedwoodCaptureStream: the wide camera>"));+ return CFRetain(CFSTR("<HakiosCaptureStream: the wide camera>"));}static const struct base_class stream_base = {@@ -1773,7 +1773,7 @@ static CFStringRefdevice_description(CMBaseObjectRef o){(void)o;- return CFRetain(CFSTR("<RedwoodCaptureDevice: the POCO X5 Pro's wide camera>"));+ return CFRetain(CFSTR("<HakiosCaptureDevice: the POCO X5 Pro's wide camera>"));}static const struct base_class device_base = {@@ -1784,10 +1784,10 @@ static const struct device_class device_derived = { 3, NULL, device_request_strestatic const struct vtable device_vtable = { NULL, &device_base, &device_derived };/* The vendor's device create function (as H10ISPCaptureDeviceCreate is called). */-OSStatus redwood_camera_device_create(CFAllocatorRef allocator, CFDictionaryRef options, CMBaseObjectRef *out);+OSStatus hakios_camera_device_create(CFAllocatorRef allocator, CFDictionaryRef options, CMBaseObjectRef *out);OSStatus-redwood_camera_device_create(CFAllocatorRef allocator, CFDictionaryRef options, CMBaseObjectRef *out)+hakios_camera_device_create(CFAllocatorRef allocator, CFDictionaryRef options, CMBaseObjectRef *out){static bool found, usable;CMBaseObjectRef device = NULL, stream[2];diff --git a/userland/src/camera_isp.c b/userland/src/camera_isp.cindex d570427..16cbcae 100644--- a/userland/src/camera_isp.c+++ b/userland/src/camera_isp.c@@ -62,7 +62,7 @@ cell(const uint8_t *top, size_t stride, uint32_t cx, int v[4])}float-isp_sharpness(const struct redwood_camera_frame *f, const uint8_t *raw, float x0, float y0, float x1, float y1, float *level)+isp_sharpness(const struct hakios_camera_frame *f, const uint8_t *raw, float x0, float y0, float x1, float y1, float *level){enum { BLOCK = 4, MAX_BLOCKS = 512 };uint32_t cells_w = f->width / 2, cells_h = f->height / 2;@@ -123,7 +123,7 @@ isp_sharpness(const struct redwood_camera_frame *f, const uint8_t *raw, float x0static inline void lsc_at(const struct isp *isp, float u, float v, float g[3]);void-isp_measure(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, struct isp_stats *s)+isp_measure(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, struct isp_stats *s){uint32_t cells_w = f->width / 2, cells_h = f->height / 2;double sum[3] = { 0, 0, 0 }, grey[2] = { 0, 0 }, neutral[2] = { 0, 0 };@@ -215,7 +215,7 @@ isp_measure(const struct isp *isp, const struct redwood_camera_frame *f, const u* to max_frame_lines, then gain to the most; beyond that, digital gain (up to 4x).*/bool-isp_ae(struct isp *isp, const struct redwood_camera_frame *f, const struct isp_stats *s, struct redwood_camera_command *c)+isp_ae(struct isp *isp, const struct hakios_camera_frame *f, const struct isp_stats *s, struct hakios_camera_command *c){double now = (double)f->exposure_lines * f->gain / f->gain_unity * isp->digital, ratio, want;double target = 0.15 * WHITE, mean = s->mean[1] * isp->digital > 0.5 ? s->mean[1] * isp->digital : 0.5;@@ -262,7 +262,7 @@ isp_ae(struct isp *isp, const struct redwood_camera_frame *f, const struct isp_sisp->asked_frame_lines = frame_lines;isp->asked = true;memset(c, 0, sizeof(*c));- c->command = REDWOOD_CAMERA_EXPOSURE;+ c->command = HAKIOS_CAMERA_EXPOSURE;c->a = lines;c->b = gain;c->c = frame_lines;@@ -355,7 +355,7 @@ isp_awb(struct isp *isp, const struct isp_stats *s)/* the part of the sensor's cells the picture shows: its middle, in the picture's proportions, 1/zoom of it each way */static void-crop(const struct isp *isp, const struct redwood_camera_frame *f, uint32_t width, uint32_t height, uint32_t *x0, uint32_t *y0,+crop(const struct isp *isp, const struct hakios_camera_frame *f, uint32_t width, uint32_t height, uint32_t *x0, uint32_t *y0,uint32_t *cw, uint32_t *ch){uint32_t w = f->width / 2, h = f->height / 2;@@ -445,7 +445,7 @@ lsc_at(const struct isp *isp, float u, float v, float g[3])/* one line of the picture as 8-bit R, G, B */static void-render_line(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint32_t width, uint32_t height,+render_line(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint32_t width, uint32_t height,uint32_t row, uint8_t *rgb){uint32_t x0, y0, cw, ch, cells_w = f->width / 2, cells_h = f->height / 2;@@ -561,7 +561,7 @@ nv12_pair(const uint8_t *rgb0, const uint8_t *rgb1, uint32_t width, uint8_t *y0,}void-isp_render_nv12(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,+isp_render_nv12(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,uint8_t *uv, size_t uv_stride, uint32_t width, uint32_t height, uint32_t first_row, uint32_t end_row, bool video_range){uint8_t line[2][3 * 8192];@@ -580,7 +580,7 @@ isp_render_nv12(const struct isp *isp, const struct redwood_camera_frame *f, con}void-isp_render_bgra(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *out, size_t stride,+isp_render_bgra(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *out, size_t stride,uint32_t width, uint32_t height, uint32_t first_row, uint32_t end_row){uint8_t line[3 * 8192];@@ -617,7 +617,7 @@ cfa(uint32_t bayer, int colour[4])/* line y of the frame as values above black (y clamped into the frame) */static void-unpack_line(const struct redwood_camera_frame *f, const uint8_t *raw, int y, int *out)+unpack_line(const struct hakios_camera_frame *f, const uint8_t *raw, int y, int *out){y = y < 0 ? 0 : y >= (int)f->height ? (int)f->height - 1 : y;const uint8_t *line = raw + (size_t)y * f->stride;@@ -635,7 +635,7 @@ unpack_line(const struct redwood_camera_frame *f, const uint8_t *raw, int y, int/* one line (y) at full size as 8-bit R, G, B, from the lines y - 1, y, y + 1 (l[0..2]) */static void-full_line(const struct isp *isp, const struct redwood_camera_frame *f, const int *const l[3], uint32_t y, const int colour[4],+full_line(const struct isp *isp, const struct hakios_camera_frame *f, const int *const l[3], uint32_t y, const int colour[4],const struct pipe *p, uint8_t *rgb){int w = (int)f->width;@@ -673,7 +673,7 @@ full_line(const struct isp *isp, const struct redwood_camera_frame *f, const int}void-isp_render_full_nv12(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,+isp_render_full_nv12(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,uint8_t *uv, size_t uv_stride, uint32_t first_row, uint32_t end_row, bool video_range){uint32_t width = f->width;@@ -713,7 +713,7 @@ isp_render_full_nv12(const struct isp *isp, const struct redwood_camera_frame *f/* one line (y) of the sensor demosaiced, as 8-bit R, G, B (the unpacked lines around it in this thread's l) */static void-demosaic_row(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint32_t row, const int colour[4],+demosaic_row(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint32_t row, const int colour[4],const struct pipe *p, int *const l[3], uint8_t *rgb){for (int i = 0; i < 3; i++) {@@ -723,7 +723,7 @@ demosaic_row(const struct isp *isp, const struct redwood_camera_frame *f, const}void-isp_render_still_nv12(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,+isp_render_still_nv12(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,uint8_t *uv, size_t uv_stride, uint32_t width, uint32_t height, uint32_t first_row, uint32_t end_row, bool video_range){uint32_t x0, y0, cw, ch, fw = f->width;@@ -812,7 +812,7 @@ isp_render_still_nv12(const struct isp *isp, const struct redwood_camera_frame */* ---- lens shading from a flat field --------------------------------------------------------------------- */bool-isp_lsc_from_flat(struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, float *min_ratio)+isp_lsc_from_flat(struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, float *min_ratio){uint32_t cells_w = f->width / 2, cells_h = f->height / 2, half_w = cells_w / (LSC_W - 1) / 2, half_h = cells_h / (LSC_H - 1) / 2;float level[3][LSC_H][LSC_W], top[3] = { 0, 0, 0 };diff --git a/userland/src/camera_isp.h b/userland/src/camera_isp.hindex 13e5c89..673c0ae 100644--- a/userland/src/camera_isp.h+++ b/userland/src/camera_isp.h@@ -12,7 +12,7 @@#include <stdbool.h>#include <stddef.h>#include <stdint.h>-#include "redwood_camera.h"+#include "hakios.camera.h"struct isp_stats {double mean[3]; /* R, G, B above black, in 10-bit steps */@@ -88,11 +88,11 @@ void isp_init(struct isp *isp);* green's steps between neighbouring blocks of 4x4 cells, over green's level squared -- higher is sharper,* the same scene at any exposure the same; and green's mean level there (level, may be NULL).*/-float isp_sharpness(const struct redwood_camera_frame *f, const uint8_t *raw, float x0, float y0, float x1, float y1, float *level);+float isp_sharpness(const struct hakios_camera_frame *f, const uint8_t *raw, float x0, float y0, float x1, float y1, float *level);/* the levels, from every 4th cell of every 4th pair of lines (with the processor's lens shading and white balance, if isp) */-void isp_measure(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, struct isp_stats *s);+void isp_measure(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, struct isp_stats *s);/* the exposure for the frames to come: true, and the command filled in, when it should change */-bool isp_ae(struct isp *isp, const struct redwood_camera_frame *f, const struct isp_stats *s, struct redwood_camera_command *c);+bool isp_ae(struct isp *isp, const struct hakios_camera_frame *f, const struct isp_stats *s, struct hakios_camera_command *c);/** The white balance: grey world -- of the nearly grey, when enough is -- kept to the line of the* tuning's reference lights when there is one, a little of the way at a time.@@ -103,9 +103,9 @@ void isp_awb(struct isp *isp, const struct isp_stats *s);* (rows from first_row to end_row only, for doing it in pieces). NV12: y and uv planes, full range (420f) or video* range (420v); BGRA: y only.*/-void isp_render_nv12(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,+void isp_render_nv12(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,uint8_t *uv, size_t uv_stride, uint32_t width, uint32_t height, uint32_t first_row, uint32_t end_row, bool video_range);-void isp_render_bgra(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *out, size_t stride,+void isp_render_bgra(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *out, size_t stride,uint32_t width, uint32_t height, uint32_t first_row, uint32_t end_row);/** Every pixel at the sensor's own size (f->width x f->height): the two colours a site does not have@@ -116,17 +116,17 @@ void isp_render_bgra(const struct isp *isp, const struct redwood_camera_frame *f* moving pictures are) demosaiced as isp_render_full_nv12() does, and scaled to the picture between the* two nearest lines and pixels; rows from first_row to end_row (even), NV12.*/-void isp_render_still_nv12(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *y,+void isp_render_still_nv12(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *y,size_t y_stride, uint8_t *uv, size_t uv_stride, uint32_t width, uint32_t height, uint32_t first_row, uint32_t end_row,bool video_range);-void isp_render_full_nv12(const struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,+void isp_render_full_nv12(const struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, uint8_t *y, size_t y_stride,uint8_t *uv, size_t uv_stride, uint32_t first_row, uint32_t end_row, bool video_range);/** Lens shading measured from a frame of a flat field (a white sheet held over the lens, evenly lit):* each colour's level at each grid point (a block's mean) over the brightest of its own; false if* the frame is too dark or clipped for it. min_ratio: the darkest point's level over the brightest's.*/-bool isp_lsc_from_flat(struct isp *isp, const struct redwood_camera_frame *f, const uint8_t *raw, float *min_ratio);+bool isp_lsc_from_flat(struct isp *isp, const struct hakios_camera_frame *f, const uint8_t *raw, float *min_ratio);void isp_set_ccm(struct isp *isp, const float m[9]);/* the tuning in PATH (tools/camtuning.py's) in place of the one there was: false, and none, if it is not one */bool isp_load_tuning(struct isp *isp, const char *path);diff --git a/userland/src/camera_test.c b/userland/src/camera_test.cindex 42b07f4..0b452d7 100644--- a/userland/src/camera_test.c+++ b/userland/src/camera_test.c@@ -4,7 +4,7 @@* usage: camera_test raw [FRAMES] [noae] [noawb] [keepraw|full] [ccm M] [sensor N]* camera_test cycle [FRAMES]* camera_test noise [SENSOR|all]- * raw: reads FRAMES frames (default 150) from the kernel's /dev/redwood-camera, with src/camera_isp.c's+ * raw: reads FRAMES frames (default 150) from the kernel's /dev/hakios-camera, with src/camera_isp.c's* exposure (unless noae: the kernel's, boot-args cam_shutter and cam_gain) and white balance working* on them, says what came and how fast, and leaves the last one as a picture for the host (xl* camera: logs/, never the repository): one pixel a cell, NV12, or with full every pixel (bilinear@@ -56,11 +56,11 @@ ticks_ms(uint64_t ticks)static const char *const sensor_names[4] = { "macro", "wide", "front", "ultra-wide" };-/* REDWOOD_CAMERA_SENSOR: the kernel changes to that sensor (its usual mode) before the next frames */+/* HAKIOS_CAMERA_SENSOR: the kernel changes to that sensor (its usual mode) before the next frames */static boolchoose_sensor(int device, unsigned n){- struct redwood_camera_command c = { .command = REDWOOD_CAMERA_SENSOR, .a = n, .b = ~0u };+ struct hakios_camera_command c = { .command = HAKIOS_CAMERA_SENSOR, .a = n, .b = ~0u };if (write(device, &c, sizeof(c)) != (ssize_t)sizeof(c)) {printf("camera_test: the %s camera cannot be chosen: %s\n", n < 4 ? sensor_names[n] : "?", strerror(errno));@@ -72,16 +72,16 @@ choose_sensor(int device, unsigned n)static intcycle(int frames){- int device = open(REDWOOD_CAMERA_DEVICE, O_RDWR), failures = 0;+ int device = open(HAKIOS_CAMERA_DEVICE, O_RDWR), failures = 0;uint8_t *buffer = NULL;size_t size = 0;if (device < 0) {- perror("camera_test: " REDWOOD_CAMERA_DEVICE);+ perror("camera_test: " HAKIOS_CAMERA_DEVICE);return 1;}for (unsigned n = 0; n < 4; n++) {- struct redwood_camera_frame head, *f = &head;+ struct hakios_camera_frame head, *f = &head;uint64_t asked = mach_absolute_time(), first = 0, last_seq = 0, first_seq = 0;int got = 0;ssize_t r;@@ -92,7 +92,7 @@ cycle(int frames)}for (int tries = 0; (r = read(device, &head, sizeof(head))) < 0 && errno == EAGAIN && tries < 3; tries++) {}- if (r != (ssize_t)sizeof(head) || memcmp(head.magic, REDWOOD_CAMERA_MAGIC, 8) != 0 || head.sensor != n) {+ if (r != (ssize_t)sizeof(head) || memcmp(head.magic, HAKIOS_CAMERA_MAGIC, 8) != 0 || head.sensor != n) {printf("camera_test: the %s camera: no frames (%s, header of sensor %u)\n", sensor_names[n],r < 0 ? strerror(errno) : "short", r == (ssize_t)sizeof(head) ? head.sensor : 99);failures++;@@ -118,7 +118,7 @@ cycle(int frames)r < 0 ? strerror(errno) : "short");break;}- f = (struct redwood_camera_frame *)buffer;+ f = (struct hakios_camera_frame *)buffer;got++;first = first ? first : f->time;first_seq = first_seq ? first_seq : f->sequence;@@ -141,7 +141,7 @@ cycle(int frames)/* the value of pixel x of line y of a RAW10 frame */static inline int-raw10(const struct redwood_camera_frame *f, const uint8_t *raw, uint32_t x, uint32_t y)+raw10(const struct hakios_camera_frame *f, const uint8_t *raw, uint32_t x, uint32_t y){const uint8_t *g = raw + (size_t)y * f->stride + (size_t)(x >> 2) * 5;@@ -153,7 +153,7 @@ static boolread_settled(int device, uint8_t *buffer, size_t bytes, uint32_t lines, uint32_t gain){for (int tries = 0; tries < 12; tries++) {- const struct redwood_camera_frame *f = (const void *)buffer;+ const struct hakios_camera_frame *f = (const void *)buffer;if (read(device, buffer, bytes) != (ssize_t)bytes) {return false;@@ -168,7 +168,7 @@ read_settled(int device, uint8_t *buffer, size_t bytes, uint32_t lines, uint32_tstatic intnoise_one(int device, unsigned n){- struct redwood_camera_frame head;+ struct hakios_camera_frame head;uint8_t *a, *b;size_t bytes;ssize_t r;@@ -192,7 +192,7 @@ noise_one(int device, unsigned n)head.width, head.height, head.black, lines * (double)head.line_ns / 1e6, lines);for (int k = 0; k < 5; k++) {uint32_t gain = gains[k] ? gains[k] * head.gain_unity : head.gain_max;- struct redwood_camera_command c = { .command = REDWOOD_CAMERA_EXPOSURE, .a = lines, .b = gain, .c = 0 };+ struct hakios_camera_command c = { .command = HAKIOS_CAMERA_EXPOSURE, .a = lines, .b = gain, .c = 0 };if (gain > head.gain_max) {continue;@@ -202,7 +202,7 @@ noise_one(int device, unsigned n)printf("camera_test: noise: the %s camera at gain %u: no frames with that exposure\n", sensor_names[n], gain);continue;}- const struct redwood_camera_frame *f = (const void *)a;+ const struct hakios_camera_frame *f = (const void *)a;const uint8_t *ra = a + f->header_bytes, *rb = b + f->header_bytes;double sum[4] = { 0 }, sumd2[4] = { 0 }, sumd[4] = { 0 }, summ2[4] = { 0 }, cnt[4] = { 0 };double rows = 0, rows2 = 0, nrows = 0;@@ -254,10 +254,10 @@ noise_one(int device, unsigned n)static intnoise(const char *which){- int device = open(REDWOOD_CAMERA_DEVICE, O_RDWR), failures = 0;+ int device = open(HAKIOS_CAMERA_DEVICE, O_RDWR), failures = 0;if (device < 0) {- perror("camera_test: " REDWOOD_CAMERA_DEVICE);+ perror("camera_test: " HAKIOS_CAMERA_DEVICE);return 1;}for (unsigned n = 0; n < 4; n++) {@@ -272,7 +272,7 @@ noise(const char *which)/* a piece of a picture of every pixel (one of 8 bands of lines, each an even number of them) */struct full_job {const struct isp *isp;- const struct redwood_camera_frame *f;+ const struct hakios_camera_frame *f;const uint8_t *raw;uint8_t *y, *uv;uint32_t width;@@ -292,16 +292,16 @@ static float ccm[9] = { 1, 0, 0, 0, 1, 0, 0, 0, 1 };static intraw(int frames, bool ae, bool awb, bool keep_raw, bool full, int sensor){- struct redwood_camera_frame head, *f;+ struct hakios_camera_frame head, *f;struct isp isp;struct isp_stats s;uint64_t started = mach_absolute_time(), previous = 0, first_seq = 0;size_t bytes;- int device = open(REDWOOD_CAMERA_DEVICE, O_RDWR), got = 0, failures = 0;+ int device = open(HAKIOS_CAMERA_DEVICE, O_RDWR), got = 0, failures = 0;ssize_t n;if (device < 0) {- perror("camera_test: " REDWOOD_CAMERA_DEVICE);+ perror("camera_test: " HAKIOS_CAMERA_DEVICE);return 1;}if (sensor >= 0 && !choose_sensor(device, (unsigned)sensor)) {@@ -309,7 +309,7 @@ raw(int frames, bool ae, bool awb, bool keep_raw, bool full, int sensor)}for (int tries = 0; (n = read(device, &head, sizeof(head))) < 0 && errno == EAGAIN && tries < 3; tries++) {}- if (n != (ssize_t)sizeof(head) || memcmp(head.magic, REDWOOD_CAMERA_MAGIC, 8) != 0) {+ if (n != (ssize_t)sizeof(head) || memcmp(head.magic, HAKIOS_CAMERA_MAGIC, 8) != 0) {perror("camera_test: the first frame's header");return 1;}@@ -322,7 +322,7 @@ raw(int frames, bool ae, bool awb, bool keep_raw, bool full, int sensor)isp_init(&isp);isp_set_ccm(&isp, ccm);while (got < frames && failures < 5) {- struct redwood_camera_command c;+ struct hakios_camera_command c;uint64_t t0 = mach_absolute_time();n = read(device, f, bytes);@@ -359,12 +359,12 @@ raw(int frames, bool ae, bool awb, bool keep_raw, bool full, int sensor)f->sequence - first_seq + 1 - got, ms_since(started) / 1000);if (keep_raw) {- struct redwood_camera_command *k = (struct redwood_camera_command *)((uint8_t *)f + f->header_bytes) - 1;+ struct hakios_camera_command *k = (struct hakios_camera_command *)((uint8_t *)f + f->header_bytes) - 1;uint32_t frame_bytes = f->stride * f->height, w = f->width, h = f->height, stride = f->stride;/* (the command goes over the end of the header, just before the frame's bytes) */memset(k, 0, sizeof(*k));- k->command = REDWOOD_CAMERA_KEEP;+ k->command = HAKIOS_CAMERA_KEEP;k->bytes = frame_bytes;k->a = w;k->b = h;@@ -381,7 +381,7 @@ raw(int frames, bool ae, bool awb, bool keep_raw, bool full, int sensor)/* the last one, as a picture for the host: one pixel per cell, or every pixel; NV12 */uint32_t w = full ? f->width : f->width / 2, h = full ? f->height : f->height / 2;size_t picture = (size_t)w * h * 3 / 2;- struct redwood_camera_command *keep = malloc(sizeof(*keep) + picture);+ struct hakios_camera_command *keep = malloc(sizeof(*keep) + picture);uint8_t *y = (uint8_t *)(keep + 1);uint64_t t0 = mach_absolute_time();@@ -394,7 +394,7 @@ raw(int frames, bool ae, bool awb, bool keep_raw, bool full, int sensor)}printf("camera_test: the picture (%ux%u NV12%s) made in %.1f ms\n", w, h, full ? ", every pixel" : "", ms_since(t0));memset(keep, 0, sizeof(*keep));- keep->command = REDWOOD_CAMERA_KEEP;+ keep->command = HAKIOS_CAMERA_KEEP;keep->bytes = (uint32_t)picture;keep->a = w;keep->b = h;diff --git a/userland/src/eagl.c b/userland/src/eagl.cindex 5f76b63..0a525ec 100644--- a/userland/src/eagl.c+++ b/userland/src/eagl.c@@ -1,6 +1,6 @@/*- * libredwood-gl.dylib: an OpenGL ES implementation behind iOS's EAGLContext, inside the window- * server (backboardd; libredwood.dylib loads this when the image has it: build.sh GL=1).+ * libhakios.gl.dylib: an OpenGL ES implementation behind iOS's EAGLContext, inside the window+ * server (backboardd; libhakios.dylib loads this when the image has it: build.sh GL=1).** CoreAnimation's render server draws with Metal, or else with OpenGL ES, or else with its own* software rasterizer (CA::WindowServer::EAGLServer::renderer()). For OpenGL ES it makes an@@ -21,19 +21,19 @@* attachment) is the screen; or it is a picture to be shown** A GPU's driver does the last two by using the IOSurface's memory as the texture's, and so it- * is done here where the library can (redwood_gl_surface_texture(); surface_shared()): nothing+ * is done here where the library can (hakios_gl_surface_texture(); surface_shared()): nothing* is copied, and a frame's end waits for the GPU. Where it cannot (a software driver, a surface* the GPU cannot address, a picture to be turned over) the texture is an ordinary one, filled* from the IOSurface when that has changed (its seed) and read back into it when a frame ends* (glFlush, glFinish), with nothing but OpenGL ES calls. Either way this file does not know- * what draws: the library is reached through its gl* functions and the functions of redwood_gl.h.+ * what draws: the library is reached through its gl* functions and the functions of hakios.gl.h.** Where CoreAnimation relies on iOS's library being what it is, this stands in between:* blue-first pixels into a texture called GL_RGBA (internal_format()), shaders that read* textures at coordinates in pixels (my_glShaderSource()), and draws made with no program* (plain_draw_begin()).*- * What CoreAnimation asks of OpenGL ES is written down as it goes (the log lines "redwood-gl:"):+ * What CoreAnimation asks of OpenGL ES is written down as it goes (the log lines "hakios-gl:"):* strings and limits it reads, texture formats and sizes, calls and triangles per frame. More* with the kernel's boot-args: gltrace=FIRST-LAST writes down every call of those frames (lines* "gl:"; with each draw what it is made of -- the texture, the first corners -- and after it a@@ -73,7 +73,7 @@#include <sys/sysctl.h>#include <unistd.h>-#include "redwood_gl.h"+#include "hakios.gl.h"/* ---- OpenGL ES: the types, the few names used here, the library's functions --------------------- */@@ -242,7 +242,7 @@ struct image {struct eagl {void *table[SLOTS]; /* [0] is the context itself: what every entry gets as its first argument */id object; /* the EAGLContext */- struct redwood_gl *gl;+ struct hakios_gl *gl;unsigned long api;struct image images[256];unsigned image_count;@@ -350,7 +350,7 @@ static int blit_targets = 1;/** A frame that is handed to the display must have been drawn. The display's driver waits for* the GPU itself before it puts a surface on the panel, on a thread of its own, and says so in- * the registry ("RedwoodWaitsForGPU"); the window server is then at its next frame meanwhile.+ * the registry ("HakiosWaitsForGPU"); the window server is then at its next frame meanwhile.* With a driver that does not, the frame is waited for here (glFinish). Boot-arg glwait=1:* here in any case; glwait=0: nowhere, to see what the waiting costs (and frames half drawn).*/@@ -383,8 +383,8 @@ static voideagl_enter(struct eagl *e, unsigned offset){if (current != e) {- if (!redwood_gl_make_current(e->gl)) {- say("redwood-gl: the context cannot be made this thread's\n");+ if (!hakios_gl_make_current(e->gl)) {+ say("hakios-gl: the context cannot be made this thread's\n");}current = e;}@@ -402,7 +402,7 @@ eagl_leave(struct eagl *e, unsigned offset)if (check_errors && offset != 0x338 && (error = glGetError()) != 0) {if (e->errors++ < 60) {- say("redwood-gl: %s: error %#x\n", eagl_slot_name(offset), error);+ say("hakios-gl: %s: error %#x\n", eagl_slot_name(offset), error);}}if (slow_calls_us != 0) {@@ -424,7 +424,7 @@ eagl_missing(void *context, unsigned offset)eagl_enter(e, offset);if (slot_calls[offset / 8] == 1) {- say("redwood-gl: CALLED AND NOT THERE: entry %#x, %s\n", offset, eagl_slot_name(offset));+ say("hakios-gl: CALLED AND NOT THERE: entry %#x, %s\n", offset, eagl_slot_name(offset));}return 0;}@@ -476,7 +476,7 @@ note_format(const char *how, GLenum internal, GLenum format, GLenum type, GLsizeuse->internal = internal;use->format = format;use->type = type;- say("redwood-gl: a new kind of texture: %s, internal format %#x, format %#x, type %#x, %d x %d\n", how, internal,+ say("hakios-gl: a new kind of texture: %s, internal format %#x, format %#x, type %#x, %d x %d\n", how, internal,format, type, width, height);}if ((unsigned)width > use->widest) {@@ -492,7 +492,7 @@ summary(struct eagl *e){unsigned frames = e->frames ? e->frames : 1;- say("redwood-gl: after %u frames: %llu calls, %llu draws and %llu triangles a frame on average; the most in one: "+ say("hakios-gl: after %u frames: %llu calls, %llu draws and %llu triangles a frame on average; the most in one: ""%u calls, %u triangles; %llu us a frame, of which %llu handing the commands on, %llu waiting for the picture ""to be drawn and %llu copying it out, and before each %llu making textures of IOSurfaces; %u IOSurfaces were ""the textures' memory, %u had to be copied; %u shaders, %u programs; biggest texture %u x %u; %u errors\n",@@ -500,12 +500,12 @@ summary(struct eagl *e)e->most_triangles, e->frame_us / frames, e->flush_us / frames, e->wait_us / frames, e->readback_us / frames,e->attach_us / frames, e->shared, e->refused, e->shaders, e->programs, widest_texture, tallest_texture, e->errors);for (unsigned i = 0; i < sizeof(formats) / sizeof(formats[0]) && formats[i].count; i++) {- say("redwood-gl: textures: %s %#x/%#x/%#x: %u times, up to %u x %u\n", formats[i].how, formats[i].internal,+ say("hakios-gl: textures: %s %#x/%#x/%#x: %u times, up to %u x %u\n", formats[i].how, formats[i].internal,formats[i].format, formats[i].type, formats[i].count, formats[i].widest, formats[i].tallest);}for (unsigned offset = 8; offset < SLOTS * 8; offset += 8) {if (slot_calls[offset / 8]) {- say("redwood-gl: %-28s %u\n", eagl_slot_name(offset), slot_calls[offset / 8]);+ say("hakios-gl: %-28s %u\n", eagl_slot_name(offset), slot_calls[offset / 8]);}}}@@ -530,7 +530,7 @@ image_new(struct eagl *e, GLuint texture, IOSurfaceRef surface)if (image == NULL) {if (e->image_count == sizeof(e->images) / sizeof(e->images[0])) {- say("redwood-gl: more textures with IOSurfaces than there is room for\n");+ say("hakios-gl: more textures with IOSurfaces than there is room for\n");return NULL;}image = &e->images[e->image_count++];@@ -606,7 +606,7 @@ surface_mirrored(struct eagl *e, struct image *image)glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound);glGenTextures(1, &image->mirror);glBindTexture(GL_TEXTURE_2D, image->mirror);- if (!redwood_gl_surface_texture(e->gl, IOSurfaceGetID(surface))) {+ if (!hakios_gl_surface_texture(e->gl, IOSurfaceGetID(surface))) {glBindTexture(GL_TEXTURE_2D, (GLuint)bound);glDeleteTextures(1, &image->mirror);image->mirror = 0;@@ -629,7 +629,7 @@ surface_shared(struct eagl *e, struct image *image)if (!share_surfaces || image->invert || image->alpha_first || image->format != GL_BGRA || image->type != GL_UNSIGNED_BYTE ||image->plane != 0 || (size_t)image->width != IOSurfaceGetWidth(surface) ||(size_t)image->height != IOSurfaceGetHeight(surface) ||- !redwood_gl_surface_texture(e->gl, IOSurfaceGetID(surface))) {+ !hakios_gl_surface_texture(e->gl, IOSurfaceGetID(surface))) {e->refused++;return false;}@@ -687,7 +687,7 @@ surface_to_texture(struct eagl *e, struct image *image)return;}if (IOSurfaceLock(surface, kIOSurfaceLockReadOnly, NULL) != 0) {- say("redwood-gl: an IOSurface cannot be locked\n");+ say("hakios-gl: an IOSurface cannot be locked\n");return;}base = planar ? IOSurfaceGetBaseAddressOfPlane(surface, image->plane) : IOSurfaceGetBaseAddress(surface);@@ -849,7 +849,7 @@ skip_draw(struct eagl *e)if (telling < sizeof(told) / sizeof(told[0])) {told[telling++] = e->program;}- say("redwood-gl: the draws of program %u are left out\n", e->program);+ say("hakios-gl: the draws of program %u are left out\n", e->program);return true;}}@@ -883,7 +883,7 @@ say_sizes(void)used += (size_t)snprintf(line + used, sizeof(line) - used, " %u:%dx%d", name, width, height);}glBindTexture(GL_TEXTURE_2D, (GLuint)bound);- say("redwood-gl: glshow: the textures there are:%s\n", line);+ say("hakios-gl: glshow: the textures there are:%s\n", line);}/* glshow=WxH: the first texture of that size there is (names are handed out afresh every run). */@@ -924,14 +924,14 @@ show_texture(struct eagl *e, struct image *image)static unsigned said;if (said++ == 0) {- say("redwood-gl: glshow: there is no texture of %d x %d\n", shown_wanted[0], shown_wanted[1]);+ say("hakios-gl: glshow: there is no texture of %d x %d\n", shown_wanted[0], shown_wanted[1]);say_sizes();}return;}if (shown_told != texture) {shown_told = texture;- say("redwood-gl: glshow: the texture %u, %d of it by %d, every pixel a square of %d\n", texture,+ say("hakios-gl: glshow: the texture %u, %d of it by %d, every pixel a square of %d\n", texture,shown_part[0] > 0 ? shown_part[0] : -1, shown_part[1] > 0 ? shown_part[1] : -1, shown_zoom);}glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound);@@ -1088,7 +1088,7 @@ frame_end(struct eagl *e, bool finished)* scissor box -- CoreAnimation draws only what has changed, inside that box, and leaves the* rest of the surface as it was --; and the draws of the blur whose radius varies.*/- say("redwood-gl: f %u at %llu.%03llu s: %u draws, %u clears; display surface %u, %u draws into it, box %s %d,%d %dx%d; "+ say("hakios-gl: f %u at %llu.%03llu s: %u draws, %u clears; display surface %u, %u draws into it, box %s %d,%d %dx%d; ""vrd %u vrb %u; %u in place, %u copied; spans %u solid %u blended, ends %u %u; other %u %u\n", e->frames,after / 1000000, after / 1000 % 1000, e->draws, e->clears, e->line.surface, e->line.into_display, e->line.boxed ? "on" : "off", e->line.box[0], e->line.box[1],e->line.box[2], e->line.box[3], e->line.vrd, e->line.vrb, in_place, copied, e->line.solid_spans, e->line.blended_spans,@@ -1099,7 +1099,7 @@ frame_end(struct eagl *e, bool finished)if (in_place == 0 && copied == 0 && e->draws != 0 && unfollowed < 8) {/* (whatever it was drawn into is shown as it is, drawn or not: this is to be seen in the log) */unfollowed++;- say("redwood-gl: frame %u: %u draws, and none into an IOSurface that is known here (framebuffer %u, texture %u)\n",+ say("hakios-gl: frame %u: %u draws, and none into an IOSurface that is known here (framebuffer %u, texture %u)\n",e->frames, e->draws, e->framebuffer, e->colour);}e->all_calls += e->calls;@@ -1117,7 +1117,7 @@ frame_end(struct eagl *e, bool finished)e->most_triangles = e->triangles;}if (e->frames <= 40 || e->frames % 20 == 0) {- say("redwood-gl: frame %u: %u GL calls, %u draws, %u triangles, %u clears; %u textures refilled from IOSurfaces "+ say("hakios-gl: frame %u: %u GL calls, %u draws, %u triangles, %u clears; %u textures refilled from IOSurfaces ""(%llu KB); %u picture%s copied out, %u drawn in place; %llu us (%llu handing on, %llu waiting, %llu copying ""out), %llu before it for the IOSurfaces\n", e->frames, e->calls, e->draws, e->triangles, e->clears, e->uploads,e->upload_bytes >> 10, copied, copied == 1 ? "" : "s", in_place, after - e->began, e->flushing, waited - before,@@ -1682,7 +1682,7 @@ static const char table_fragment[] =/** Two more are told apart by the "function" itself, which CoreAnimation's context has in a known* place while it draws (and which our library in the window server hands over with the context:- * redwood_gl_function_values() below, called from inject.c). Both take a colour matrix, four+ * hakios_gl_function_values() below, called from inject.c). Both take a colour matrix, four* columns and what is added, the numbers function_values[] keeps.** "vcm" (45), the filter vibrantColorMatrix: the layer is not drawn, it says how much of the@@ -1817,7 +1817,7 @@ static uint8_t function_given[90];/* From inject.c, at every GLContext::function_uniform(): the numbers a function is given, which no shader of CoreAnimation's takes. */void-redwood_gl_function_values(void *context, unsigned function, unsigned index, size_t components, size_t count, const float *values)+hakios_gl_function_values(void *context, unsigned function, unsigned index, size_t components, size_t count, const float *values){static uint8_t said[90];@@ -1830,7 +1830,7 @@ redwood_gl_function_values(void *context, unsigned function, unsigned index, sizif (!said[function] || (function_numbers && said[function] < 12 &&memcmp(function_values[function], values, components * count * sizeof(values[0])) != 0)) {said[function]++;- say("redwood-gl: CoreAnimation gives its function %u numbers: %zu of %zu:%s%s%s%s%s%s%s%s%s%s\n", function, count,+ say("hakios-gl: CoreAnimation gives its function %u numbers: %zu of %zu:%s%s%s%s%s%s%s%s%s%s\n", function, count,components, number_text(values, 0, components * count), number_text(values, 4, components * count),number_text(values, 8, components * count), number_text(values, 12, components * count),number_text(values, 16, components * count), "", "", "", "", "");@@ -2009,7 +2009,7 @@ vblur_program(const char *vertex, const char *fragment, const char *what)glBindAttribLocation(program, 3, "vertex_texcoord1");glLinkProgram(program);glGetProgramiv(program, GL_LINK_STATUS, &good);- say("redwood-gl: a program of ours for the blur whose radius varies (%s): %s %s\n", what, good ? "made" : "NOT MADE", said);+ say("hakios-gl: a program of ours for the blur whose radius varies (%s): %s %s\n", what, good ? "made" : "NOT MADE", said);return good ? program : 0;}@@ -2196,7 +2196,7 @@ plain_program(const char *fragment, const char *what)glBindAttribLocation(program, 2, "vertex_texcoord0");glLinkProgram(program);glGetProgramiv(program, GL_LINK_STATUS, &good);- say("redwood-gl: a program of ours for the draws CoreAnimation makes with none (%s): %s\n", what, good ? "made" : "NOT MADE");+ say("hakios-gl: a program of ours for the draws CoreAnimation makes with none (%s): %s\n", what, good ? "made" : "NOT MADE");return program;}@@ -2232,7 +2232,7 @@ static uint64_t census_told;static const char *census_name(unsigned function){- static const char names[] = REDWOOD_CA_FUNCTIONS;+ static const char names[] = HAKIOS_CA_FUNCTIONS;static char name[4];memcpy(name, function < 90 ? names + 4 * function : "? ", 3);@@ -2243,7 +2243,7 @@ census_name(unsigned function)static uint16_t frame_refused[90], frame_noprog[90][CENSUS_KINDS]; /* (glframes=1) this frame's, by function */void-redwood_gl_function_refused(unsigned function)+hakios_gl_function_refused(unsigned function){if (frame_lines && function < 90) {frame_refused[function]++;@@ -2305,7 +2305,7 @@ census_draw(struct eagl *e, unsigned function, unsigned kind)glGetIntegerv(GL_BLEND_SRC_RGB, &source);glGetIntegerv(GL_BLEND_DST_RGB, &destination);glGetIntegerv(GL_VIEWPORT, viewport);- say("redwood-gl: census: function %u (\"%s\") with no program, %s: first at %g,%g to %g,%g of framebuffer %u (%d x %d); "+ say("hakios-gl: census: function %u (\"%s\") with no program, %s: first at %g,%g to %g,%g of framebuffer %u (%d x %d); ""textures%s; blending %s (%#x, %#x); its numbers:%s\n", function, census_name(function), census_kinds[kind], (double)low[0],(double)low[1], (double)high[0], (double)high[1], e->framebuffer, viewport[2], viewport[3], textures[0] ? textures : " none",glIsEnabled(GL_BLEND) ? "on" : "off", (unsigned)source, (unsigned)destination, numbers[0] ? numbers : " none");@@ -2341,7 +2341,7 @@ frame_functions(struct eagl *e)}group_covered = group_laid = group_flattened = 0;if (used != 0 && strcmp(text, said) != 0) {- say("redwood-gl: f %u functions:%s\n", e->frames, text);+ say("hakios-gl: f %u functions:%s\n", e->frames, text);}memcpy(said, text, used + 1);bzero(frame_refused, sizeof(frame_refused));@@ -2387,8 +2387,8 @@ census_report(void)c->refused_lately = 0;}if (lately[0] != 0) {- say("redwood-gl: census: in the last ten seconds:%s\n", lately);- say("redwood-gl: census: since the start:%s\n", all);+ say("hakios-gl: census: in the last ten seconds:%s\n", lately);+ say("hakios-gl: census: since the start:%s\n", all);}}@@ -2446,7 +2446,7 @@ vblur_draw_begin(struct eagl *e, struct vblur_chain *chain, GLint enabled[4])if (at != NULL && e->arrays[3].type == GL_FLOAT) {memcpy(first, at, sizeof(first));}- say("redwood-gl: a blur whose radius varies, read by its mask: %d levels of texture %u (%d x %d), radius %g, numbers %g %g "+ say("hakios-gl: a blur whose radius varies, read by its mask: %d levels of texture %u (%d x %d), radius %g, numbers %g %g ""%g; the mask's coordinates at the first corner %g %g\n", levels, chain->picture, chain->width, chain->height,(double)function_values[FUNCTION_VARIABLE_BLUR][0], (double)function_values[FUNCTION_VARIABLE_BLUR][1],(double)function_values[FUNCTION_VARIABLE_BLUR][2], (double)function_values[FUNCTION_VARIABLE_BLUR][3],@@ -2476,7 +2476,7 @@ vblur_draw_begin(struct eagl *e, struct vblur_chain *chain, GLint enabled[4])used += (size_t)snprintf(said + used, sizeof(said) - used, " %d:%u,%u,%u,%u", y, column[4 * y], column[4 * y + 1],column[4 * y + 2], column[4 * y + 3]);}- say("redwood-gl: the mask of the blur whose radius varies (texture %u, 1 x %d), from its first row:%s (error %#x)\n",+ say("hakios-gl: the mask of the blur whose radius varies (texture %u, 1 x %d), from its first row:%s (error %#x)\n",e->bound[1], height, said, glGetError());}}@@ -2738,7 +2738,7 @@ group_draw_begin(struct eagl *e, GLint enabled[4])if (function < 90 && !said[function]) {said[function] = 1;- say("redwood-gl: a group that holds a vibrant layer is drawn with CoreAnimation's function %u (\"%s\"): %s\n",+ say("hakios-gl: a group that holds a vibrant layer is drawn with CoreAnimation's function %u (\"%s\"): %s\n",function, census_name(function), laid ? "the layer over what is behind it" : "made what it would have been");}if (!laid || !group_uniform(e, "vertex_matrix", matrix)) {@@ -2853,7 +2853,7 @@ plain_draw_begin(struct eagl *e, GLint enabled[4])vblur_level(e, (int)function_values[FUNCTION_VARIABLE_DOWNSAMPLE][0]);census_draw(e, function, CENSUS_LEVEL);if (told++ < 8) {- say("redwood-gl: a blur whose radius varies: level %d of texture %u made of level %d\n",+ say("hakios-gl: a blur whose radius varies: level %d of texture %u made of level %d\n",(int)function_values[FUNCTION_VARIABLE_DOWNSAMPLE][0] + 1, e->bound[0],(int)function_values[FUNCTION_VARIABLE_DOWNSAMPLE][0]);}@@ -2874,7 +2874,7 @@ plain_draw_begin(struct eagl *e, GLint enabled[4])}if (function < 90 && !said[function]) {said[function] = 1;- say("redwood-gl: a draw with no program is CoreAnimation's function %u (\"%s\")\n", function, census_name(function));+ say("hakios-gl: a draw with no program is CoreAnimation's function %u (\"%s\")\n", function, census_name(function));}if ((int)function == trace_function && --trace_function_after == 0) {trace_function_met = 1;@@ -2999,7 +2999,7 @@ plain_draw_begin(struct eagl *e, GLint enabled[4])const GLfloat *position = e->arrays[0].pointer, *where = e->arrays[2].pointer;e->plain_said++;- say("redwood-gl: a draw with no program, into framebuffer %u: texture %u on the first unit%s; arrays %d %d %d; first "+ say("hakios-gl: a draw with no program, into framebuffer %u: texture %u on the first unit%s; arrays %d %d %d; first ""corner %g %g, texture coordinates %g %g\n", e->framebuffer, e->bound[0], rows == 1 ? ", a table on the second" : "",enabled[0], enabled[1], enabled[2], position ? (double)position[0] : 0, position ? (double)position[1] : 0,where ? (double)where[0] : 0, where ? (double)where[1] : 0);@@ -3273,12 +3273,12 @@ my_glGetString(void *context, GLenum name)if (name == GL_EXTENSIONS && string != NULL) {size_t length = strlen((const char *)string);- say("redwood-gl: asked for string %#x, %zu characters:\n", name, length);+ say("hakios-gl: asked for string %#x, %zu characters:\n", name, length);for (size_t at = 0; at < length; at += 700) {- say("redwood-gl: %.700s\n", (const char *)string + at);+ say("hakios-gl: %.700s\n", (const char *)string + at);}} else {- say("redwood-gl: asked for string %#x: %.900s\n", name, string ? (const char *)string : "(none)");+ say("hakios-gl: asked for string %#x: %.900s\n", name, string ? (const char *)string : "(none)");}EAGL_LEAVE(e, 0x3b0);return string;@@ -3294,7 +3294,7 @@ my_glGetIntegerv(void *context, GLenum name, GLint *values)glGetIntegerv(name, values);if (said < 40) {said++;- say("redwood-gl: asked for number %#x: %d\n", name, values[0]);+ say("hakios-gl: asked for number %#x: %d\n", name, values[0]);}EAGL_LEAVE(e, 0x348);}@@ -3409,7 +3409,7 @@ say_callers(const char *what)}used += (size_t)snprintf(line + used, sizeof(line) - used, " %#lx", callers[i] - slide);}- say("redwood-gl: %s, asked for by%s\n", what, line);+ say("hakios-gl: %s, asked for by%s\n", what, line);}/*@@ -3452,9 +3452,9 @@ astc_thumbnail(GLenum internal, GLsizei width, GLsizei height, GLsizei size, conused += (size_t)snprintf(line + used, sizeof(line) - used, " ......");}}- say("redwood-gl: astc %u x %u, row %u:%s\n", across, down, by, line);+ say("hakios-gl: astc %u x %u, row %u:%s\n", across, down, by, line);}- say("redwood-gl: astc %u x %u: %u of the %u blocks looked at hold one colour\n", across, down, flat, seen);+ say("hakios-gl: astc %u x %u: %u of the %u blocks looked at hold one colour\n", across, down, flat, seen);}static void@@ -3494,7 +3494,7 @@ my_glCompressedTexImage2D(void *context, GLenum target, GLint level, GLenum intesnprintf(head + 3 * i, 4, " %02x", ((const uint8_t *)data)[i]);}told++;- say("redwood-gl: a compressed picture into texture %u: internal format %#x, %d x %d, "+ say("hakios-gl: a compressed picture into texture %u: internal format %#x, %d x %d, ""level %d, %d bytes%s, it begins%s\n", e->bound[e->unit], internal, width, height,level, size, error == 0 ? "" : error == 0x500 ? " -- refused, no such format" : " -- refused",head);@@ -3582,7 +3582,7 @@ my_glFramebufferParameteriAPPLE(void *context, GLenum target, GLenum name, GLintEAGL_ENTER(e, 0x2008);if (slot_calls[0x2008 / 8] <= 4) {- say("redwood-gl: glFramebufferParameteriAPPLE(%#x, %#x, %d): nothing done\n", target, name, value);+ say("hakios-gl: glFramebufferParameteriAPPLE(%#x, %#x, %d): nothing done\n", target, name, value);}}@@ -3641,9 +3641,9 @@ static const char fragment_start[] ="#define textureCube texture\n""#define sampler2DRect sampler2D\n""#define texture2DRect(s, c) texture(s, (c) / vec2(textureSize(s, 0)))\n"- "highp vec4 redwood_data[1];\n"- "#define gl_FragData redwood_data\n"- "#define gl_FragColor redwood_data[0]\n";+ "highp vec4 hakios_data[1];\n"+ "#define gl_FragData hakios_data\n"+ "#define gl_FragColor hakios_data[0]\n";/** What a fragment shader of the first version writes to (gl_FragData), and with the extension a* GPU's driver offers and CoreAnimation then uses (EXT_shader_framebuffer_fetch) reads what is@@ -3652,21 +3652,21 @@ static const char fragment_start[] =* that variable before and writes it after.*/static const char fragment_plain[] =- "layout(location = 0) out highp vec4 redwood_colour;\n"- "#define main redwood_main\n"+ "layout(location = 0) out highp vec4 hakios_colour;\n"+ "#define main hakios_main\n""#line 1\n";static const char fragment_plain_end[] ="\n#undef main\n"- "void main() { redwood_main(); redwood_colour = redwood_data[0]; }\n";+ "void main() { hakios_main(); hakios_colour = hakios_data[0]; }\n";static const char fragment_fetch[] =- "layout(location = 0) inout highp vec4 redwood_colour;\n"- "highp vec4 redwood_last[1];\n"- "#define gl_LastFragData redwood_last\n"- "#define main redwood_main\n"+ "layout(location = 0) inout highp vec4 hakios_colour;\n"+ "highp vec4 hakios_last[1];\n"+ "#define gl_LastFragData hakios_last\n"+ "#define main hakios_main\n""#line 1\n";static const char fragment_fetch_end[] ="\n#undef main\n"- "void main() { redwood_last[0] = redwood_colour; redwood_main(); redwood_colour = redwood_data[0]; }\n";+ "void main() { hakios_last[0] = hakios_colour; hakios_main(); hakios_colour = hakios_data[0]; }\n";static const char vertex_start[] ="#define attribute in\n""#define varying out\n"@@ -3739,7 +3739,7 @@ my_glShaderSource(void *context, GLuint shader, GLsizei count, const GLchar *constatic voidsay_long(const char *what, const char *text){- say("redwood-gl: %s:\n", what);+ say("hakios-gl: %s:\n", what);for (size_t at = 0, length = strlen(text); at < length; at += 900) {write(2, text + at, length - at < 900 ? length - at : 900);}@@ -3759,12 +3759,12 @@ my_glCompileShader(void *context, GLuint shader)e->shaders++;if (!good) {glGetShaderInfoLog(shader, sizeof(said), NULL, said);- say("redwood-gl: A SHADER DOES NOT COMPILE (shader %u): %s\n", shader, said);+ say("hakios-gl: A SHADER DOES NOT COMPILE (shader %u): %s\n", shader, said);if (e->sources[shader % 256] != NULL) {say_long("its text", e->sources[shader % 256]);}} else if ((e->shaders <= 2 || all_shaders) && e->sources[shader % 256] != NULL) {- say("redwood-gl: shader %u:\n", shader);+ say("hakios-gl: shader %u:\n", shader);say_long(all_shaders ? "a shader" : "the first shaders, for the record", e->sources[shader % 256]);}EAGL_LEAVE(e, 0x12a8);@@ -3783,7 +3783,7 @@ my_glLinkProgram(void *context, GLuint program)e->programs++;if (!good) {glGetProgramInfoLog(program, sizeof(said), NULL, said);- say("redwood-gl: A PROGRAM DOES NOT LINK (program %u): %s\n", program, said);+ say("hakios-gl: A PROGRAM DOES NOT LINK (program %u): %s\n", program, said);}EAGL_LEAVE(e, 0x12c0);}@@ -3822,11 +3822,11 @@ my_initWithAPI(id self, SEL selector, unsigned long api, id properties)for (place = 0; place < sizeof(contexts) / sizeof(contexts[0]) && contexts[place] != NULL; place++) {}if (api < 2 || api > 3 || place == sizeof(contexts) / sizeof(contexts[0]) || (e = calloc(1, sizeof(*e))) == NULL) {- say("redwood-gl: no context of API %lu\n", api);+ say("hakios-gl: no context of API %lu\n", api);return nil;}- if ((e->gl = redwood_gl_create((int)api)) == NULL || !redwood_gl_make_current(e->gl)) {- say("redwood-gl: %s gives no OpenGL ES %lu context\n", redwood_gl_library(), api);+ if ((e->gl = hakios_gl_create((int)api)) == NULL || !hakios_gl_make_current(e->gl)) {+ say("hakios-gl: %s gives no OpenGL ES %lu context\n", hakios_gl_library(), api);free(e);return nil;}@@ -3836,7 +3836,7 @@ my_initWithAPI(id self, SEL selector, unsigned long api, id properties)e->table[0] = e;eagl_fill_table(e->table);contexts[place] = e;- say("redwood-gl: an OpenGL ES %lu context for CoreAnimation, by %s: %s; %s; shaders %s\n", api, redwood_gl_library(),+ say("hakios-gl: an OpenGL ES %lu context for CoreAnimation, by %s: %s; %s; shaders %s\n", api, hakios_gl_library(),(const char *)glGetString(GL_VERSION), (const char *)glGetString(GL_RENDERER),(const char *)glGetString(GL_SHADING_LANGUAGE_VERSION));return self;@@ -3869,7 +3869,7 @@ my_sharegroup(id self, SEL selector)(void)selector;if (!said) {said = 1;- say("redwood-gl: -sharegroup asked for: none (nothing here shares a context)\n");+ say("hakios-gl: -sharegroup asked for: none (nothing here shares a context)\n");}return nil;}@@ -3879,7 +3879,7 @@ my_setParameter(id self, SEL selector, unsigned parameter, const int32_t *values{(void)self;(void)selector;- say("redwood-gl: -setParameter:%#x to:%d: noted\n", parameter, values ? values[0] : 0);+ say("hakios-gl: -setParameter:%#x to:%d: noted\n", parameter, values ? values[0] : 0);return 0;}@@ -3911,7 +3911,7 @@ my_texImageIOSurface(id self, SEL selector, IOSurfaceRef surface, unsigned longclear_now(e);glGetIntegerv(GL_TEXTURE_BINDING_2D, &texture);if (target != GL_TEXTURE_2D || texture == 0 || (image = image_new(e, (GLuint)texture, surface)) == NULL) {- say("redwood-gl: -texImageIOSurface: target %#lx, texture %d: not done\n", target, texture);+ say("hakios-gl: -texImageIOSurface: target %#lx, texture %d: not done\n", target, texture);return NO;}image->to = (GLenum)target;@@ -3925,7 +3925,7 @@ my_texImageIOSurface(id self, SEL selector, IOSurfaceRef surface, unsigned longnote_format(invert ? "IOSurface shown, inverted" : "IOSurface shown", image->internal, image->format, image->type, width,height);if (shown++ < 24) {- say("redwood-gl: -texImageIOSurface: surface %u ('%.4s' %zu x %zu, %zu planes) as texture %d: %d x %d, plane %u%s\n",+ say("hakios-gl: -texImageIOSurface: surface %u ('%.4s' %zu x %zu, %zu planes) as texture %d: %d x %d, plane %u%s\n",IOSurfaceGetID(surface), (const char *)&(uint32_t){ __builtin_bswap32(IOSurfaceGetPixelFormat(surface)) },IOSurfaceGetWidth(surface), IOSurfaceGetHeight(surface), IOSurfaceGetPlaneCount(surface), texture, width,height, plane, invert ? ", inverted" : "");@@ -3963,7 +3963,7 @@ my_attachImage(id self, SEL selector, unsigned long target, IOSurfaceRef surfaceif (target != GL_TEXTURE_2D || texture == 0 || (pixels != 'BGRA' && pixels != 0) ||IOSurfaceGetBytesPerElement(surface) != 4 || IOSurfaceGetPlaneCount(surface) != 0 ||(image = image_new(e, (GLuint)texture, surface)) == NULL) {- say("redwood-gl: -attachImage: target %#lx, texture %d, an IOSurface of '%.4s': not done\n", target, texture,+ say("hakios-gl: -attachImage: target %#lx, texture %d, an IOSurface of '%.4s': not done\n", target, texture,(const char *)&(uint32_t){ __builtin_bswap32(pixels) });return NO;}@@ -3998,7 +3998,7 @@ my_attachImage(id self, SEL selector, unsigned long target, IOSurfaceRef surface}e->attaching += now_us() - began;if (attached++ < 24) {- say("redwood-gl: -attachImage: texture %d is IOSurface %u ('%.4s' %d x %d, %zu bytes a row)%s%s\n", texture,+ say("hakios-gl: -attachImage: texture %d is IOSurface %u ('%.4s' %d x %d, %zu bytes a row)%s%s\n", texture,IOSurfaceGetID(surface), (const char *)&(uint32_t){ __builtin_bswap32(pixels) }, image->width, image->height,IOSurfaceGetBytesPerRow(surface), inverted ? ", drawn inverted" : "", image->shared ? ": its memory" :image->mirror != 0 ? ": a texture, copied into its memory by the GPU" : ": a copy");@@ -4014,7 +4014,7 @@ my_dealloc(id self, SEL selector)struct eagl *e = context_of(self);if (e != NULL) {- say("redwood-gl: the context goes\n");+ say("hakios-gl: the context goes\n");summary(e);for (unsigned i = 0; i < sizeof(contexts) / sizeof(contexts[0]); i++) {if (contexts[i] == e) {@@ -4022,10 +4022,10 @@ my_dealloc(id self, SEL selector)}}if (current == e) {- redwood_gl_make_current(NULL);+ hakios_gl_make_current(NULL);current = NULL;}- redwood_gl_destroy(e->gl);+ hakios_gl_destroy(e->gl);free(e);}((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&super, selector);@@ -4042,7 +4042,7 @@ display_waits(void)if (display == 0) {return false;}- says = IORegistryEntryCreateCFProperty(display, CFSTR("RedwoodWaitsForGPU"), kCFAllocatorDefault, 0);+ says = IORegistryEntryCreateCFProperty(display, CFSTR("HakiosWaitsForGPU"), kCFAllocatorDefault, 0);waits = says == kCFBooleanTrue;if (says != NULL) {CFRelease(says);@@ -4160,7 +4160,7 @@ install(void)if (strstr(arguments, "glwait=0") != NULL || (strstr(arguments, "glwait=1") == NULL && display_waits())) {wait_for_frames = 0;}- say("redwood-gl: a frame is waited for %s\n", wait_for_frames ? "here, before it is handed to the display" :+ say("hakios-gl: a frame is waited for %s\n", wait_for_frames ? "here, before it is handed to the display" :"by the display's driver, not here");for (argument = arguments; (argument = strstr(argument, "glenv=")) != NULL; argument += 6) {char setting[128];@@ -4173,14 +4173,14 @@ install(void)if ((value = strchr(setting, '=')) != NULL) {*value = 0;setenv(setting, value + 1, 1);- say("redwood-gl: in the environment: %s=%s\n", setting, value + 1);+ say("hakios-gl: in the environment: %s=%s\n", setting, value + 1);}}}}if (class == Nil) {- say("redwood-gl: this program has no EAGLContext: nothing to do\n");+ say("hakios-gl: this program has no EAGLContext: nothing to do\n");return;}for (unsigned i = 0; i < sizeof(methods) / sizeof(methods[0]); i++) {@@ -4188,10 +4188,10 @@ install(void)Method method = class_getInstanceMethod(class, selector);if (method == NULL) {- say("redwood-gl: EAGLContext has no -%s\n", methods[i].name);+ say("hakios-gl: EAGLContext has no -%s\n", methods[i].name);continue;}- say("redwood-gl: -[EAGLContext %s] (%s) replaced\n", methods[i].name, method_getTypeEncoding(method));+ say("hakios-gl: -[EAGLContext %s] (%s) replaced\n", methods[i].name, method_getTypeEncoding(method));if (method == class_getInstanceMethod(class_getSuperclass(class), selector)) {/* inherited: the class gets one of its own, the one it inherits is everybody's */class_addMethod(class, selector, methods[i].ours, method_getTypeEncoding(method));@@ -4200,6 +4200,6 @@ install(void)}replaced++;}- say("redwood-gl: %u of %zu methods of EAGLContext are ours; OpenGL ES by %s\n", replaced,- sizeof(methods) / sizeof(methods[0]), redwood_gl_library());+ say("hakios-gl: %u of %zu methods of EAGLContext are ours; OpenGL ES by %s\n", replaced,+ sizeof(methods) / sizeof(methods[0]), hakios_gl_library());}diff --git a/userland/src/gl_osmesa.c b/userland/src/gl_osmesa.cindex b7c280c..912ad95 100644--- a/userland/src/gl_osmesa.c+++ b/userland/src/gl_osmesa.c@@ -13,7 +13,7 @@#include <stdlib.h>#include <string.h>-#include "redwood_gl.h"+#include "hakios.gl.h"/* GL/osmesa.h of Mesa */#define OSMESA_RGBA 0x1908@@ -42,20 +42,20 @@ extern unsigned glGetError(void);*/#define WINDOW 16-struct redwood_gl {+struct hakios_gl {OSMesaContext context;unsigned char window[WINDOW * WINDOW * 4];};-struct redwood_gl *-redwood_gl_create(int version)+struct hakios_gl *+hakios_gl_create(int version){const int attributes[] = {OSMESA_FORMAT, OSMESA_RGBA, OSMESA_DEPTH_BITS, 24, OSMESA_STENCIL_BITS, 8,OSMESA_PROFILE, OSMESA_ES_PROFILE, OSMESA_CONTEXT_MAJOR_VERSION, version, OSMESA_CONTEXT_MINOR_VERSION, 0,0};- struct redwood_gl *gl = calloc(1, sizeof(*gl));+ struct hakios_gl *gl = calloc(1, sizeof(*gl));if (gl != NULL && (gl->context = OSMesaCreateContextAttribs(attributes, NULL)) == NULL) {free(gl);@@ -65,7 +65,7 @@ redwood_gl_create(int version)}int-redwood_gl_make_current(struct redwood_gl *gl)+hakios_gl_make_current(struct hakios_gl *gl){if (gl == NULL) {return OSMesaMakeCurrent(NULL, NULL, 0, 0, 0);@@ -74,14 +74,14 @@ redwood_gl_make_current(struct redwood_gl *gl)}void-redwood_gl_destroy(struct redwood_gl *gl)+hakios_gl_destroy(struct hakios_gl *gl){OSMesaDestroyContext(gl->context);free(gl);}const char *-redwood_gl_library(void)+hakios_gl_library(void){return "Mesa, off-screen (OSMesa)";}@@ -92,7 +92,7 @@ redwood_gl_library(void)* of their own with this processor are not asked: they refuse every time.*/int-redwood_gl_surface_texture(struct redwood_gl *gl, uint32_t surface)+hakios_gl_surface_texture(struct hakios_gl *gl, uint32_t surface){static void (*image_target)(unsigned target, void *image);static int asked, software;diff --git a/userland/src/gl_test.c b/userland/src/gl_test.cindex bf68f53..d3b4e05 100644--- a/userland/src/gl_test.c+++ b/userland/src/gl_test.c@@ -91,7 +91,7 @@ extern void glReadPixels(int x, int y, int width, int height, unsigned format, u#define GL_COLOR_ATTACHMENT0 0x8ce0#define GL_FRAMEBUFFER 0x8d40-/* the kernel's GPU service takes pixels for the panel (iokit/Kernel/RedwoodGPU.cpp: kRedwoodShow) */+/* the kernel's GPU service takes pixels for the panel (iokit/Kernel/hakios.gpu.cpp: kHakiosShow) */struct show {uint64_t pixels;uint32_t width, height, row_bytes, pad;@@ -349,7 +349,7 @@ main(int argc, char **argv)PIXEL(width * 85 / 100, height * 22 / 100), PIXEL(width / 2, height * 80 / 100), coloured,(unsigned)(width * height), (unsigned)((uint64_t)coloured * 100 / (uint64_t)(width * height)));- service = IOServiceGetMatchingService(0, IOServiceMatching("RedwoodGPU"));+ service = IOServiceGetMatchingService(0, IOServiceMatching("HakiosGPU"));if (service == 0 || IOServiceOpen(service, mach_task_self(), 0, &connection) != 0) {printf("gl_test: no GPU service in this kernel to put the picture on the panel with\n");return 0;diff --git a/userland/src/hakios.audio.h b/userland/src/hakios.audio.hnew file mode 100644index 0000000..0e17554--- /dev/null+++ b/userland/src/hakios.audio.h@@ -0,0 +1,92 @@+/*+ * /dev/hakios-audio: the sound iOS plays, on its way to whatever can make it heard.+ *+ * iOS expects its output devices from Apple's audio drivers through IOAudio2; neither exists+ * here. Instead the audio server (mediaserverd) is given a plug-in of ours that presents one+ * stereo output device, and the plug-in writes what the server has mixed for that device+ * here. In the kernel the samples go to a sink -- a driver for something that plays them --+ * and, if asked for, into a recording that outlives the kernel (see dev/hakios.audio.c).+ *+ * write(): whole frames in the format below. Never blocks: the writer is the audio server's+ * real-time thread, which paces itself (48000 frames a second while anything+ * plays, nothing at all otherwise). What the sink cannot take is dropped.+ */+#ifndef _SYS_HAKIOS_AUDIO_H_+#define _SYS_HAKIOS_AUDIO_H_++#include <stdint.h>++#define HAKIOS_AUDIO_DEVICE "/dev/hakios-audio"++/* The one format: 16-bit signed little-endian samples, left then right. */+#define HAKIOS_AUDIO_RATE 48000+#define HAKIOS_AUDIO_CHANNELS 2+#define HAKIOS_AUDIO_FRAME 4 /* bytes */++/*+ * ioctl(HAKIOS_AUDIO_SET_VOLUME): the speakers' volume, as iOS sets it on the plug-in's volume+ * control -- how many eighths of a dB under the loudest they may play, and whether they are+ * muted (iOS's volume at 0). The loudest is the kernel's to say (on the phone: Android's own+ * level less sound_below, hakios.sound.c); the plug-in only says how far under it.+ */+#include <sys/ioccom.h>++struct hakios_audio_volume {+ uint32_t below; /* eighths of a dB */+ uint32_t muted;+};+#define HAKIOS_AUDIO_SET_VOLUME _IOW('r', 1, struct hakios_audio_volume)++#ifdef KERNEL+#include <stdbool.h>++/*+ * For drivers. A sink is offered frames as they are written and says how many it took (the+ * rest are lost); it is called from the writer's thread and must not wait.+ */+typedef uint32_t (*hakios_audio_sink_t)(const int16_t *frames, uint32_t count);++void hakios_audio_set_sink(const char *name, hakios_audio_sink_t sink);+/* The volume iOS has set last (HAKIOS_AUDIO_SET_VOLUME): false if it has set none; *generation counts the settings. */+bool hakios_audio_volume(uint32_t *below, bool *muted, uint32_t *generation);+void hakios_audio_init(void);+void hakios_virtio_sound_init(void); /* boot-arg virtio_sound=1: QEMU's virtio sound device */+void hakios_speaker_init(void); /* boot-arg speaker_probe=N: a look at the phone's speaker amplifiers */++/*+ * The phone's speakers (bsd/dev/hakios.speaker.c): its two Awinic amplifiers, set up as+ * Android's driver sets them up, from Android's own configuration file (see there).+ */+bool hakios_speaker_prepare(const uint8_t *acf, uint64_t size); /* found, reset, configured: powered down, muted */+bool hakios_speaker_start(void); /* powered up and unmuted at the lowest volume: only while the I2S clock runs */+bool hakios_speaker_volume(uint32_t below, uint32_t step_ms); /* below Android's level, in eighths of a dB; 6 dB a step */+bool hakios_speaker_healthy(void); /* no fault reported; on one, both are powered down at once */+void hakios_speaker_stop(void); /* faded out, muted, powered down, in Android's order */+void hakios_speaker_quiesce(void); /* powered down at once, without sleeping: on a panic's way out */++/*+ * The audio DSP's services, for the sound's path (bsd/dev/hakios.adsp.c, bsd/dev/hakios.sound.c).+ * hakios_adsp_apr() sends one APR packet to a service of the DSP (AFE 4, ASM 7, ADM 8) with the+ * given port and token (0: one of its own) and, with wait_ms, waits for the packet that carries+ * that token back. What is not waited for goes to the handler of events, if there is one and it+ * takes it (returns true). The handler is called on the link's thread and must not wait.+ */+struct hakios_apr_answer {+ uint32_t opcode, token, length; /* length: of the payload, in bytes */+ uint32_t words[64];+};+typedef bool (*hakios_apr_events_t)(uint8_t service, uint16_t port, uint32_t opcode, uint32_t token, const uint32_t *payload,+ uint32_t length);++bool hakios_adsp_apr(uint8_t service, uint16_t port, uint32_t token, uint32_t opcode, const void *payload, uint32_t length,+ uint32_t wait_ms, struct hakios_apr_answer *answer);+void hakios_adsp_apr_events(hakios_apr_events_t handler);+const uint8_t *hakios_adsp_fw_file(const char *name, uint64_t *size); /* /fw/name, read whole; give back with: */+void hakios_adsp_fw_free(const uint8_t *data, uint64_t size);++void hakios_sound_dsp_up(void); /* the DSP's audio services are up (adsp=1): boot-arg sound=N begins */+void hakios_sound_dsp_down(void); /* before the DSP is shut down at the run's end: everything of the sound's stopped */+void hakios_sound_quiesce(void); /* on a panic's way out: the amplifiers off, without sleeping */+#endif++#endif /* _SYS_HAKIOS_AUDIO_H_ */diff --git a/userland/src/redwood_camera.h b/userland/src/hakios.camera.hsimilarity index 66%rename from userland/src/redwood_camera.hrename to userland/src/hakios.camera.hindex f6ceb92..7afbcf4 100644--- a/userland/src/redwood_camera.h+++ b/userland/src/hakios.camera.h@@ -1,26 +1,26 @@/*- * /dev/redwood-camera: the phone's wide camera for iOS (boot-arg cam=5; the kernel's bsd/dev/redwood_camera.c,- * whose bsd/sys/redwood_camera.h this is a copy of).+ * /dev/hakios-camera: the phone's wide camera for iOS (boot-arg cam=5; the kernel's bsd/dev/hakios.camera.c,+ * whose bsd/sys/hakios.camera.h this is a copy of).** open() the first one powers the sensor up and starts its frames (the sensor's mode: boot-arg* cam_mode, else the module file's 4000x3000 one); the last close puts everything down* again, and so does a second without a read.* read() waits (at most a second) for the newest frame not read yet: a struct- * redwood_camera_frame, then as many of the frame's bytes as the buffer has room for.+ * hakios_camera_frame, then as many of the frame's bytes as the buffer has room for.* A buffer of the header's size learns the frame's size and nothing else is copied.* EIO when the camera has had a fault: it stays off for the rest of the run.- * write() commands: a struct redwood_camera_command, then what it says follows.+ * write() commands: a struct hakios_camera_command, then what it says follows.*/-#ifndef _SYS_REDWOOD_CAMERA_H_-#define _SYS_REDWOOD_CAMERA_H_+#ifndef _SYS_HAKIOS_CAMERA_H_+#define _SYS_HAKIOS_CAMERA_H_#include <stdint.h>-#define REDWOOD_CAMERA_DEVICE "/dev/redwood-camera"-#define REDWOOD_CAMERA_MAGIC "RWFRAME1"+#define HAKIOS_CAMERA_DEVICE "/dev/hakios-camera"+#define HAKIOS_CAMERA_MAGIC "RWFRAME1"-struct redwood_camera_frame {- char magic[8]; /* REDWOOD_CAMERA_MAGIC */+struct hakios_camera_frame {+ char magic[8]; /* HAKIOS_CAMERA_MAGIC */uint32_t header_bytes; /* this structure's size: the frame's bytes follow */uint32_t width, height; /* pixels */uint32_t stride; /* bytes from one line to the next */@@ -39,26 +39,26 @@ struct redwood_camera_frame {uint32_t frame_lines_max; /* the longest frame it may be given */uint32_t margin; /* exposure_lines is at most frame_lines - margin */uint32_t sensor; /* which: 0 the macro, 1 the wide, 2 the front, 3 the ultra-wide camera */- uint32_t focus; /* the lens's position as last set, 0 (the furthest) to 1023: REDWOOD_CAMERA_NO_FOCUS where it+ uint32_t focus; /* the lens's position as last set, 0 (the furthest) to 1023: HAKIOS_CAMERA_NO_FOCUS where it* has no motor (or it does not answer) */uint32_t reserved[5];};-#define REDWOOD_CAMERA_NO_FOCUS 0xffffffffu+#define HAKIOS_CAMERA_NO_FOCUS 0xffffffffuenum {- REDWOOD_CAMERA_EXPOSURE = 1, /* a: lines, b: gain, c: frame lines (0: the shortest that holds the exposure) */- REDWOOD_CAMERA_KEEP = 2, /* a picture for the host: a width, b height, c stride, d format (1 the frame's RAW10, 2 NV12,+ HAKIOS_CAMERA_EXPOSURE = 1, /* a: lines, b: gain, c: frame lines (0: the shortest that holds the exposure) */+ HAKIOS_CAMERA_KEEP = 2, /* a picture for the host: a width, b height, c stride, d format (1 the frame's RAW10, 2 NV12,* 3 BGRA); bytes follow */- REDWOOD_CAMERA_SENSOR = 3, /* another sensor: a which (as in the frames' header), b its mode (~0: the usual one);+ HAKIOS_CAMERA_SENSOR = 3, /* another sensor: a which (as in the frames' header), b its mode (~0: the usual one);* the frames stop, everything goes down, and the next read starts the other one */- REDWOOD_CAMERA_FOCUS = 4, /* the lens to a: 0 (the furthest) to 1023, from the next frame or so */+ HAKIOS_CAMERA_FOCUS = 4, /* the lens to a: 0 (the furthest) to 1023, from the next frame or so */};-struct redwood_camera_command {+struct hakios_camera_command {uint32_t command;uint32_t bytes; /* of what follows this structure */uint32_t a, b, c, d;};-#endif /* _SYS_REDWOOD_CAMERA_H_ */+#endif /* _SYS_HAKIOS_CAMERA_H_ */diff --git a/userland/src/redwood_gl.h b/userland/src/hakios.gl.hsimilarity index 67%rename from userland/src/redwood_gl.hrename to userland/src/hakios.gl.hindex 4ba8ab5..be98271 100644--- a/userland/src/redwood_gl.h+++ b/userland/src/hakios.gl.h@@ -2,15 +2,15 @@* What src/eagl.c asks of the OpenGL ES library behind it besides the gl* functions: see* src/gl_osmesa.c, the one implementation there is.*/-#ifndef REDWOOD_GL_H-#define REDWOOD_GL_H+#ifndef HAKIOS_GL_H+#define HAKIOS_GL_H-struct redwood_gl;+struct hakios_gl;-struct redwood_gl *redwood_gl_create(int version); /* a context of OpenGL ES 2 or 3; NULL: none to be had */-int redwood_gl_make_current(struct redwood_gl *gl); /* ... the calling thread's (NULL: none); 0 on failure */-void redwood_gl_destroy(struct redwood_gl *gl);-const char *redwood_gl_library(void); /* for the log */+struct hakios_gl *hakios_gl_create(int version); /* a context of OpenGL ES 2 or 3; NULL: none to be had */+int hakios_gl_make_current(struct hakios_gl *gl); /* ... the calling thread's (NULL: none); 0 on failure */+void hakios_gl_destroy(struct hakios_gl *gl);+const char *hakios_gl_library(void); /* for the log *//** The texture bound to GL_TEXTURE_2D made of an IOSurface's own memory: what is drawn into the@@ -18,13 +18,13 @@ const char *redwood_gl_library(void); /* for the log ** For a library whose driver can do that (a GPU's) and a surface it can do it with. 0: not* done; the texture is to be filled and read back with OpenGL ES calls.*/-int redwood_gl_surface_texture(struct redwood_gl *gl, uint32_t surface);+int hakios_gl_surface_texture(struct hakios_gl *gl, uint32_t surface);/** CoreAnimation draws a layer's pixels with one of ninety "functions" (a fragment shader each); these* are the names its Metal renderer has for them, four characters a function, in their order.*/-#define REDWOOD_CA_FUNCTIONS \+#define HAKIOS_CA_FUNCTIONS \"clr img ida cim cid mua m1a lrp lrc lra add spl s1a cma bds bco bim c33 c3b c4b c4p c3a c3x c4x bia grl ds4 ds6 " \"ds8 ups db2 db4 nb7 n11 n15 n19 n23 n27 vrd vrb sb3 axl rad rac con vcm vdk vlt map mpc crv hue clm hom opa met " \"srl ega sdr alt p3c edr hrm lut ovr ovl lub aup alm stl pc0 pc1 prc psl ps0 ps1 psm psr pcr pbl peo bib asg a75 " \diff --git a/userland/src/hakios.input.h b/userland/src/hakios.input.hnew file mode 100644index 0000000..e93aca2--- /dev/null+++ b/userland/src/hakios.input.h@@ -0,0 +1,47 @@+/*+ * /dev/hakios-touch: touch samples on their way from whoever produces them to the+ * program that turns them into HID events for the window server.+ *+ * iOS expects touches from Apple's multitouch driver through IOHIDFamily; neither exists+ * here. Instead a producer -- a kernel driver for a real touch controller or for an emulated+ * pointer, or a user program replaying a script -- posts samples, and code of ours running+ * inside backboardd reads them and synthesizes the events. Both sides use the same record.+ *+ * write(): one or more records (time is ignored; the kernel stamps them)+ * read(): blocks until there is at least one record, returns as many whole ones as fit+ */+#ifndef _SYS_HAKIOS_INPUT_H_+#define _SYS_HAKIOS_INPUT_H_++#include <stdint.h>++#define HAKIOS_TOUCH_DEVICE "/dev/hakios-touch"++#define HAKIOS_TOUCH_DOWN 1 /* a finger has landed */+#define HAKIOS_TOUCH_MOVE 2+#define HAKIOS_TOUCH_UP 3 /* it has lifted (x, y: where it was last) */+#define HAKIOS_BUTTON_DOWN 4 /* a hardware button; `finger` says which (HAKIOS_BUTTON_*), x and y are 0 */+#define HAKIOS_BUTTON_UP 5++#define HAKIOS_BUTTON_LOCK 1 /* the side button */+#define HAKIOS_BUTTON_VOLUME_UP 2+#define HAKIOS_BUTTON_VOLUME_DOWN 3+#define HAKIOS_BUTTON_HOME 4++struct hakios_touch {+ uint64_t time; /* mach_absolute_time() when the sample was posted */+ uint32_t type; /* HAKIOS_TOUCH_* or HAKIOS_BUTTON_DOWN/UP */+ uint32_t finger; /* which finger, from 0 (or which button) */+ uint32_t x, y; /* position on the display, 0 = left/top edge, 65535 = right/bottom edge */+};++#ifdef KERNEL+/* For drivers; not from interrupt context. */+void hakios_touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y);+void hakios_input_init(void);+void hakios_virtio_input_init(void); /* boot-arg virtio_input=1: QEMU's virtio pointer and keyboard */+void hakios_goodix_init(void); /* boot-arg touchscreen=1: the phone's touch screen */+void hakios_cpufreq_init(void); /* boot-arg cpufreq=1: the phone's processor at full speed */+#endif++#endif /* _SYS_HAKIOS_INPUT_H_ */diff --git a/userland/src/init.c b/userland/src/init.cindex 676e98c..6eadcec 100644--- a/userland/src/init.c+++ b/userland/src/init.c@@ -10,7 +10,7 @@* - halts the machine if it is still process 1 after that.** Started with a file name by anything else, it is a command runner: that is- * how a launchd job (LaunchDaemons/com.redwood.demo.plist) runs a list of+ * how a launchd job (LaunchDaemons/com.hakios.demo.plist) runs a list of* commands.*/#include "mini.h"@@ -128,7 +128,7 @@ synthetic_dir(const char *path)* entry of the volume -- not a mount, which whatever registers the system's* applications passed over), made before /private/var is covered by a memory* filesystem.- * Then the volume becomes the root (sysctl kern.redwood_switch_root) and the boot volume+ * Then the volume becomes the root (sysctl kern.hakios_switch_root) and the boot volume* goes to its /private/preboot, the cryptexes onto that volume's Cryptexes/OS and App: the iOS* volume's /System/Cryptexes/OS and App point to /private/preboot/Cryptexes/OS and App, and the* kernel takes a shared cache from the first. This@@ -246,7 +246,7 @@ flash_root(const char *dev)printf(" %d applications waiting to be installed, %d of them in /Applications\n", apps, bound);check(apps > 0 && bound == apps, "the first boot's applications in /Applications");- ok = sysctlbyname("kern.redwood_switch_root", NULL, NULL, "/flash private/preboot", 22) == 0;+ ok = sysctlbyname("kern.hakios_switch_root", NULL, NULL, "/flash private/preboot", 22) == 0;if (!ok) {printf(" switching the root: %s\n", strerror(errno));}@@ -1342,7 +1342,7 @@ test_time(void)/** etc/inject.conf is one line, "LIBRARY NAME NAME ...": the kernel starts the programs with- * these file names with the library inserted (sysctl kern.exec_inject, see libredwood).+ * these file names with the library inserted (sysctl kern.exec_inject, see libhakios).*/static voidconfigure_inject(void)diff --git a/userland/src/inject.c b/userland/src/inject.cindex 837e852..fb9f6b2 100644--- a/userland/src/inject.c+++ b/userland/src/inject.c@@ -1,5 +1,5 @@/*- * libredwood.dylib: code of ours inside stock iOS programs.+ * libhakios.dylib: code of ours inside stock iOS programs.** launchd starts the jobs named in INJECT (see build.sh / mkjobs.py) with* DYLD_INSERT_LIBRARIES pointing here; dyld honours that because the kernel's AMFI stand-in@@ -11,7 +11,7 @@* entries of their virtual tables.* It is also where input enters the system: backboardd is the HID event server,* and without Apple's multitouch driver it has no touch screen. We give it one:- * a "virtual" HID service that turns the samples of /dev/redwood-touch into the+ * a "virtual" HID service that turns the samples of /dev/hakios-touch into the* events that driver would have sent.** And it does not wait five seconds for an ambient light sensor.@@ -46,13 +46,13 @@#include <sys/ucontext.h>#include <unistd.h>-#include "redwood_gl.h"-#include "redwood_input.h"+#include "hakios.gl.h"+#include "hakios.input.h"extern const void *_dyld_get_shared_cache_range(size_t *length);#define CACHE_BASE 0x180000000UL /* where the cache was built to be, before the slide */-#define REDWOOD_GL "/redwood/lib/libredwood-gl.dylib"+#define HAKIOS_GL "/redwood/lib/libhakios.gl.dylib"static uintptr_t slide;@@ -82,13 +82,13 @@ replace_virtual(const char *what, uintptr_t slot, uintptr_t expected, void *replvoid *original;if (*entry != expected + slide) {- say("redwood: %s: found %#lx, expected %#lx; left alone\n", what, *entry - slide, expected);+ say("hakios: %s: found %#lx, expected %#lx; left alone\n", what, *entry - slide, expected);return NULL;}/* the tables are in read-only memory shared by every process: get a private writable copy of the page */kr = vm_protect(mach_task_self(), page, vm_page_size, FALSE, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY);if (kr != KERN_SUCCESS) {- say("redwood: %s: cannot make the table writable (%d)\n", what, kr);+ say("hakios: %s: cannot make the table writable (%d)\n", what, kr);return NULL;}original = (void *)*entry;@@ -122,7 +122,7 @@ my_is_ready(void *display)int ready = orig_is_ready(display);if (ready != last_ready || calls_ready < 3) {- say("redwood: is_ready -> %d (call %u, flags %#llx, b233 %#x)\n", ready, calls_ready,+ say("hakios: is_ready -> %d (call %u, flags %#llx, b233 %#x)\n", ready, calls_ready,(unsigned long long)DISPLAY_FLAGS(display), DISPLAY_B233(display));last_ready = ready;}@@ -138,9 +138,9 @@ my_ignore_update_p(void *display, void *update)if (ignore != last_ignore || calls_ignore < 3) {uint64_t *q = (uint64_t *)((char *)display + 0x220);- say("redwood: ignore_update_p -> %d (call %u, flags %#llx, update flags %#x)\n", ignore, calls_ignore,+ say("hakios: ignore_update_p -> %d (call %u, flags %#llx, update flags %#x)\n", ignore, calls_ignore,(unsigned long long)DISPLAY_FLAGS(display), *(uint32_t *)((char *)update + 0xf0));- say("redwood: display +0x220: %#llx %#llx %#llx %#llx %#llx %#llx\n", (unsigned long long)q[0],+ say("hakios: display +0x220: %#llx %#llx %#llx %#llx %#llx %#llx\n", (unsigned long long)q[0],(unsigned long long)q[1], (unsigned long long)q[2], (unsigned long long)q[3], (unsigned long long)q[4],(unsigned long long)q[5]);last_ignore = ignore;@@ -155,7 +155,7 @@ my_begin_update(void *display, void *update)uintptr_t r = orig_begin_update(display, update);if (calls_begin++ < 6) {- say("redwood: begin_update -> %#lx (flags %#llx)\n", r, (unsigned long long)DISPLAY_FLAGS(display));+ say("hakios: begin_update -> %#lx (flags %#llx)\n", r, (unsigned long long)DISPLAY_FLAGS(display));}return r;}@@ -166,7 +166,7 @@ my_finish_update(void *display, void *update, unsigned flags)uintptr_t r = orig_finish_update(display, update, flags);if (calls_finish++ < 6) {- say("redwood: finish_update(%#x) -> %#lx\n", flags, r);+ say("hakios: finish_update(%#x) -> %#lx\n", flags, r);}return r;}@@ -188,10 +188,10 @@ my_renderer(void *server)renderer = orig_renderer(server);if (renderer == NULL) {failed = 1;- say("redwood: no accelerated renderer; the software one will draw\n");+ say("hakios: no accelerated renderer; the software one will draw\n");} else if (!said) {said = 1;- say("redwood: the server has an accelerated renderer (%p)\n", renderer);+ say("hakios: the server has an accelerated renderer (%p)\n", renderer);}return renderer;}@@ -202,7 +202,7 @@ my_render_update(void *server, void *update, unsigned *flags)uintptr_t r = orig_render_update(server, update, flags);if (calls_render++ < 6) {- say("redwood: render_update -> %#lx (flags %#x)\n", r, flags ? *flags : 0);+ say("hakios: render_update -> %#lx (flags %#x)\n", r, flags ? *flags : 0);}return r;}@@ -274,7 +274,7 @@ say_the_fault(int signal_number, siginfo_t *info, void *context_in)used += (size_t)snprintf(frames + used, sizeof(frames) - used, " %#lx", ret - slide);fp = next > fp ? next : 0; /* the chain only ever goes up the stack */}- say("redwood: signal %d at %p, pc %#lx, lr %#lx, called from%s (unslid)\n", signal_number,+ say("hakios: signal %d at %p, pc %#lx, lr %#lx, called from%s (unslid)\n", signal_number,info != NULL ? info->si_addr : NULL, pc - slide, lr - slide, frames);signal(signal_number, SIG_DFL);raise(signal_number);@@ -352,18 +352,18 @@ give_the_renderer_a_shader(unsigned function, const char *source)vm_address_t page = (vm_address_t)entry & ~(vm_address_t)(vm_page_size - 1);if (*entry != 0) {- say("redwood: CoreAnimation's function %u has a shader of its own; left alone\n", function);+ say("hakios: CoreAnimation's function %u has a shader of its own; left alone\n", function);return;}/* the table is read-only memory shared by every process: a private writable copy of the page */if (vm_protect(mach_task_self(), page, vm_page_size, FALSE,VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY) != KERN_SUCCESS) {- say("redwood: CoreAnimation's function %u: cannot make the table of shaders writable\n", function);+ say("hakios: CoreAnimation's function %u: cannot make the table of shaders writable\n", function);return;}*entry = (uintptr_t)source;vm_protect(mach_task_self(), page, vm_page_size, FALSE, VM_PROT_READ);- say("redwood: CoreAnimation's function %u (\"sb3\") is given a shader of ours\n", function);+ say("hakios: CoreAnimation's function %u (\"sb3\") is given a shader of ours\n", function);}static uint8_t say_yes[90];@@ -372,7 +372,7 @@ static int compile_shaders_said; /* boot-arg glcompile=1: write dstatic voidfunctions_said_yes(const char *arguments){- static const char names[] = REDWOOD_CA_FUNCTIONS;+ static const char names[] = HAKIOS_CA_FUNCTIONS;const char *argument = strstr(arguments, "glno=");/* glno=N[,N...]: and the other way about, for seeing what a function of ours stands in for */@@ -381,7 +381,7 @@ functions_said_yes(const char *arguments)if (function < 90) {say_yes[function] = 0;- say("redwood: the renderer will not answer that it has CoreAnimation's function %u (\"%.3s\")\n",+ say("hakios: the renderer will not answer that it has CoreAnimation's function %u (\"%.3s\")\n",function, names + 4 * function);}argument = *argument == ',' ? argument + 1 : NULL;@@ -392,7 +392,7 @@ functions_said_yes(const char *arguments)if (function < 90) {say_yes[function] = 1;- say("redwood: the renderer will answer that it has CoreAnimation's function %u (\"%.3s\")\n",+ say("hakios: the renderer will answer that it has CoreAnimation's function %u (\"%.3s\")\n",function, names + 4 * function);}argument = *argument == ',' ? argument + 1 : NULL;@@ -419,14 +419,14 @@ my_compile_shader(void *context, const char *source)/* that it is called at all is worth one line, because a renderer that compiles nothing herewould mean the text is assembled and compiled somewhere this table does not reach */if (seen++ == 0) {- say("redwood: CoreAnimation compiles its shaders through the table (the first of them, %zu characters)\n",+ say("hakios: CoreAnimation compiles its shaders through the table (the first of them, %zu characters)\n",source != NULL ? strlen(source) : 0);}if (compile_shaders_said && told < 24) {told++;- say("redwood: CoreAnimation compiles a shader, %zu characters:\n", source != NULL ? strlen(source) : 0);+ say("hakios: CoreAnimation compiles a shader, %zu characters:\n", source != NULL ? strlen(source) : 0);for (size_t at = 0, length = source != NULL ? strlen(source) : 0; at < length; at += 700) {- say("redwood: %.700s\n", source + at);+ say("hakios: %.700s\n", source + at);}}return orig_compile_shader(context, source);@@ -435,7 +435,7 @@ my_compile_shader(void *context, const char *source)static intmy_function_supported(void *context){- static const char names[] = REDWOOD_CA_FUNCTIONS;+ static const char names[] = HAKIOS_CA_FUNCTIONS;static uint8_t said[256];int supported = orig_function_supported(context);uint8_t function = *(*(uint8_t **)((char *)context + 0x10) + 0x10);@@ -443,7 +443,7 @@ my_function_supported(void *context)if (!supported && function < 90 && say_yes[function] && gl_loaded) {if (!said[function]) {said[function] = 1;- say("redwood: CoreAnimation's function %u (\"%.3s\"): the renderer is made to say it has it\n",+ say("hakios: CoreAnimation's function %u (\"%.3s\"): the renderer is made to say it has it\n",function, names + 4 * function);}return 1;@@ -453,7 +453,7 @@ my_function_supported(void *context)}if (!supported && !said[function]) {said[function] = 1;- say("redwood: CoreAnimation's OpenGL ES renderer has no function %u (\"%.3s\"): what needs it is not drawn\n",+ say("hakios: CoreAnimation's OpenGL ES renderer has no function %u (\"%.3s\"): what needs it is not drawn\n",function, function < 90 ? names + 4 * function : "?");}return supported;@@ -489,7 +489,7 @@ my_function_uniform(void *context, unsigned index, size_t components, size_t couif (function < 90 && !told[function]) {told[function] = 1;- say("redwood: function %u takes its numbers from %#lx %#lx %#lx\n", function,+ say("hakios: function %u takes its numbers from %#lx %#lx %#lx\n", function,(uintptr_t)__builtin_return_address(0) - slide,(uintptr_t)__builtin_return_address(1) - slide,(uintptr_t)__builtin_return_address(2) - slide);@@ -525,7 +525,7 @@ window_server_fixes(void)two is not ours to rely on; the hook writes nothing unless glcompile=1 */orig_compile_shader = (uintptr_t (*)(void *, const char *))replace_virtual("compile_shader",VSLOT(VT_GLES_CONTEXT, 0x060), 0x1883fc808UL, my_compile_shader);- say("redwood: the shader compiler of CoreAnimation is %s\n", orig_compile_shader ? "watched" : "NOT watched");+ say("hakios: the shader compiler of CoreAnimation is %s\n", orig_compile_shader ? "watched" : "NOT watched");watch_for_faults();{char arguments[1024] = "";@@ -537,7 +537,7 @@ window_server_fixes(void)}}}- say("redwood: window server hooks %s\n", orig_is_ready && orig_ignore_update_p && orig_begin_update &&+ say("hakios: window server hooks %s\n", orig_is_ready && orig_ignore_update_p && orig_begin_update &&orig_finish_update && orig_renderer && orig_render_update ? "installed" : "INCOMPLETE");}@@ -560,7 +560,7 @@ wait_for_als_arrival(__unused id self, __unused SEL selector){if (input_services_made != NULL &&dispatch_semaphore_wait(input_services_made, dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC)) != 0) {- say("redwood: input: no touch screen service after five seconds; going on without\n");+ say("hakios: input: no touch screen service after five seconds; going on without\n");}}@@ -572,7 +572,7 @@ brightness_fixes(void)IMP original = method ? method_getImplementation(method) : NULL;if (original == NULL || (uintptr_t)original != 0x1af043734UL + slide) {- say("redwood: -[BLControl waitForALSArrival]: found %#lx, not what was expected; left alone\n",+ say("hakios: -[BLControl waitForALSArrival]: found %#lx, not what was expected; left alone\n",original ? (uintptr_t)original - slide : 0);return;}@@ -677,7 +677,7 @@ service_copy_property(__unused void *target, void *refcon, __unused IOHIDServiceCFSetAddValue(asked, key);CFStringGetCString(key, name, sizeof(name), kCFStringEncodingUTF8);- say("redwood: input: the event server asks for property \"%s\", which we do not have\n", name);+ say("hakios: input: the event server asks for property \"%s\", which we do not have\n", name);}return value ? CFRetain(value) : NULL;}@@ -712,7 +712,7 @@ service_set_property(__unused void *target, void *refcon, __unused IOHIDServiceCCFNumberGetValue(value, kCFNumberIntType, &mode);if (mode != touch_mode) {- say("redwood: input: touch detection mode %#x\n", mode);+ say("hakios: input: touch detection mode %#x\n", mode);}touch_mode = mode;}@@ -727,7 +727,7 @@ service_set_property(__unused void *target, void *refcon, __unused IOHIDServiceCCFStringGetCString(description, text, sizeof(text), kCFStringEncodingUTF8);CFRelease(description);}- say("redwood: input: the event server sets \"%s\" = %s\n", name, text);+ say("hakios: input: the event server sets \"%s\" = %s\n", name, text);}return true;}@@ -798,7 +798,7 @@ make_service(IOHIDEventSystemClientRef client, const char *product, int page, inif (made->opened) {break;}- say("redwood: input: the event server has not opened \"%s\" (attempt %d): making it again\n", product, attempt);+ say("hakios: input: the event server has not opened \"%s\" (attempt %d): making it again\n", product, attempt);IOHIDVirtualServiceClientRemove(service);CFRelease(service);service = NULL;@@ -808,20 +808,20 @@ make_service(IOHIDEventSystemClientRef client, const char *product, int page, in/* One frame of the touch screen: the hand, and under it every finger that is down or has just lifted. */static void-send_touch(IOHIDServiceClientRef screen, const struct redwood_touch *t)+send_touch(IOHIDServiceClientRef screen, const struct hakios_touch *t){- uint32_t change = t->type == REDWOOD_TOUCH_MOVE ? DIGITIZER_POSITION : DIGITIZER_RANGE | DIGITIZER_TOUCH;+ uint32_t change = t->type == HAKIOS_TOUCH_MOVE ? DIGITIZER_POSITION : DIGITIZER_RANGE | DIGITIZER_TOUCH;IOHIDEventRef hand, finger;bool any = false;unsigned f = t->finger;- if (f >= MAX_FINGERS || (t->type != REDWOOD_TOUCH_DOWN && !fingers[f].touching)) {+ if (f >= MAX_FINGERS || (t->type != HAKIOS_TOUCH_DOWN && !fingers[f].touching)) {return;}- fingers[f].touching = t->type != REDWOOD_TOUCH_UP;+ fingers[f].touching = t->type != HAKIOS_TOUCH_UP;fingers[f].x = t->x / 65535.0;fingers[f].y = t->y / 65535.0;- if (t->type == REDWOOD_TOUCH_DOWN) {+ if (t->type == HAKIOS_TOUCH_DOWN) {fingers[f].edge = fingers[f].x < EDGE_SIDE || fingers[f].x > 1 - EDGE_SIDE || fingers[f].y < EDGE_TOP ||fingers[f].y > 1 - EDGE_BOTTOM;}@@ -858,7 +858,7 @@ publish_lock_button(bool down){static int token = NOTIFY_TOKEN_INVALID;- if (token == NOTIFY_TOKEN_INVALID && notify_register_check("com.redwood.button.lock", &token) != NOTIFY_STATUS_OK) {+ if (token == NOTIFY_TOKEN_INVALID && notify_register_check("com.hakios.button.lock", &token) != NOTIFY_STATUS_OK) {token = NOTIFY_TOKEN_INVALID;return;}@@ -866,20 +866,20 @@ publish_lock_button(bool down)}static void-send_button(IOHIDServiceClientRef buttons, const struct redwood_touch *t)+send_button(IOHIDServiceClientRef buttons, const struct hakios_touch *t){- uint32_t usage = t->finger == REDWOOD_BUTTON_LOCK ? HID_USAGE_POWER : t->finger == REDWOOD_BUTTON_HOME ? HID_USAGE_MENU :- t->finger == REDWOOD_BUTTON_VOLUME_UP ? HID_USAGE_VOLUME_UP : t->finger == REDWOOD_BUTTON_VOLUME_DOWN ?+ uint32_t usage = t->finger == HAKIOS_BUTTON_LOCK ? HID_USAGE_POWER : t->finger == HAKIOS_BUTTON_HOME ? HID_USAGE_MENU :+ t->finger == HAKIOS_BUTTON_VOLUME_UP ? HID_USAGE_VOLUME_UP : t->finger == HAKIOS_BUTTON_VOLUME_DOWN ?HID_USAGE_VOLUME_DOWN : 0;IOHIDEventRef event;if (usage == 0) {return;}- if (t->finger == REDWOOD_BUTTON_LOCK) {- publish_lock_button(t->type == REDWOOD_BUTTON_DOWN);+ if (t->finger == HAKIOS_BUTTON_LOCK) {+ publish_lock_button(t->type == HAKIOS_BUTTON_DOWN);}- event = IOHIDEventCreateKeyboardEvent(NULL, t->time, HID_PAGE_CONSUMER, usage, t->type == REDWOOD_BUTTON_DOWN, 0);+ event = IOHIDEventCreateKeyboardEvent(NULL, t->time, HID_PAGE_CONSUMER, usage, t->type == HAKIOS_BUTTON_DOWN, 0);IOHIDEventSetIntegerValue(event, FIELD_IS_BUILT_IN, 1);IOHIDVirtualServiceClientDispatchEvent(buttons, event);CFRelease(event);@@ -905,7 +905,7 @@ input_thread(__unused void *arg)static const int types[] = { HID_CLIENT_SIMPLE, HID_CLIENT_RATE_CONTROLLED };IOHIDEventSystemClientRef client = NULL;IOHIDServiceClientRef screen = NULL, buttons = NULL;- struct redwood_touch t;+ struct hakios_touch t;unsigned count = 0, waking = 0; /* waking: the fingers whose touch went into waking the display */int device;@@ -919,9 +919,9 @@ input_thread(__unused void *arg)}mach_timebase_info(&timebase);}- device = open(REDWOOD_TOUCH_DEVICE, O_RDONLY);+ device = open(HAKIOS_TOUCH_DEVICE, O_RDONLY);if (device < 0) {- say("redwood: input: %s: %s\n", REDWOOD_TOUCH_DEVICE, strerror(errno));+ say("hakios: input: %s: %s\n", HAKIOS_TOUCH_DEVICE, strerror(errno));return NULL;}sleep(3); /* let backboardd get as far as starting its event server */@@ -929,19 +929,19 @@ input_thread(__unused void *arg)/* this waits until the server (this very program) answers */client = IOHIDEventSystemClientCreateWithType(NULL, types[i], NULL);if (client == NULL) {- say("redwood: input: no HID client of type %d\n", types[i]);+ say("hakios: input: no HID client of type %d\n", types[i]);continue;}IOHIDEventSystemClientScheduleWithDispatchQueue(client, dispatch_queue_create("redwood.input", NULL));- screen = make_service(client, "Redwood touch screen", HID_PAGE_DIGITIZER, HID_USAGE_TOUCH_SCREEN, true);+ screen = make_service(client, "HakiOS touch screen", HID_PAGE_DIGITIZER, HID_USAGE_TOUCH_SCREEN, true);if (screen == NULL) {- say("redwood: input: a HID client of type %d may not create services\n", types[i]);+ say("hakios: input: a HID client of type %d may not create services\n", types[i]);}}if (screen != NULL) {- buttons = make_service(client, "Redwood buttons", HID_PAGE_CONSUMER, HID_USAGE_CONSUMER_CONTROL, false);+ buttons = make_service(client, "HakiOS buttons", HID_PAGE_CONSUMER, HID_USAGE_CONSUMER_CONTROL, false);}- say("redwood: input: touch screen service %p, buttons %p\n", (void *)screen, (void *)buttons);+ say("hakios: input: touch screen service %p, buttons %p\n", (void *)screen, (void *)buttons);dispatch_semaphore_signal(input_services_made); /* see wait_for_als_arrival() */if (screen == NULL) {return NULL;@@ -951,25 +951,25 @@ input_thread(__unused void *arg)uint64_t read_at = mach_absolute_time();if (count++ < 4) {- say("redwood: input: sample type %u finger %u at %u %u\n", t.type, t.finger, t.x, t.y);+ say("hakios: input: sample type %u finger %u at %u %u\n", t.type, t.finger, t.x, t.y);}- if (t.type > REDWOOD_TOUCH_UP) {+ if (t.type > HAKIOS_TOUCH_UP) {if (buttons != NULL) {send_button(buttons, &t);}- } else if (t.type == REDWOOD_TOUCH_DOWN && (touch_mode & 0xff) == TOUCH_MODE_WAKE && buttons != NULL) {+ } else if (t.type == HAKIOS_TOUCH_DOWN && (touch_mode & 0xff) == TOUCH_MODE_WAKE && buttons != NULL) {/** The display is off and a tap is to wake it. The lock button is what wakes it here:* press it for the finger, and keep the rest of this touch to ourselves.*/- struct redwood_touch press = { .time = t.time, .type = REDWOOD_BUTTON_DOWN, .finger = REDWOOD_BUTTON_LOCK };+ struct hakios_touch press = { .time = t.time, .type = HAKIOS_BUTTON_DOWN, .finger = HAKIOS_BUTTON_LOCK };send_button(buttons, &press);- press.type = REDWOOD_BUTTON_UP;+ press.type = HAKIOS_BUTTON_UP;send_button(buttons, &press);waking |= 1u << (t.finger & 31);} else if (waking & (1u << (t.finger & 31))) {- if (t.type == REDWOOD_TOUCH_UP) {+ if (t.type == HAKIOS_TOUCH_UP) {waking &= ~(1u << (t.finger & 31));}} else {@@ -980,7 +980,7 @@ input_thread(__unused void *arg)}}}- say("redwood: input: %s: %s\n", REDWOOD_TOUCH_DEVICE, strerror(errno));+ say("hakios: input: %s: %s\n", HAKIOS_TOUCH_DEVICE, strerror(errno));return NULL;}@@ -1011,12 +1011,12 @@ container_manager_fixes(void)IMP original = method ? method_getImplementation(method) : NULL;if (original == NULL || (uintptr_t)original != 0x1c3ea6298UL + slide) {- say("redwood: +[MCMUserIdentityCache personasAreSupported]: found %#lx, not what was expected; left alone\n",+ say("hakios: +[MCMUserIdentityCache personasAreSupported]: found %#lx, not what was expected; left alone\n",original ? (uintptr_t)original - slide : 0);return;}method_setImplementation(method, (IMP)personas_are_supported);- say("redwood: container manager: no personas\n");+ say("hakios: container manager: no personas\n");}/* ---------------------------------------------------------------------------------------------- */@@ -1025,7 +1025,7 @@ container_manager_fixes(void)* An OpenGL ES implementation for CoreAnimation (src/eagl.c, Mesa behind it): loaded, it puts* itself behind EAGLContext, and the renderer the server then gets is the OpenGL ES one. That* is worth it where a GPU does the drawing, and only there: on the phone, when the kernel has- * started the GPU and keeps it (boot-arg gpu=1), which the service RedwoodGPU says (it is there+ * started the GPU and keeps it (boot-arg gpu=1), which the service HakiosGPU says (it is there* before the first program runs, or not at all). Everywhere else -- QEMU, a run without the* boot-arg, a phone without the GPU's firmware in the image, a GPU that did not start --* nothing is loaded, and CoreAnimation draws with its own software renderer as in an image@@ -1043,7 +1043,7 @@ opengl_es(void)void *library;int wanted = -1, told = 0;- if (access(REDWOOD_GL, R_OK) != 0) {+ if (access(HAKIOS_GL, R_OK) != 0) {return; /* (an image built without it) */}if (sysctlbyname("kern.bootargs", arguments, &size, NULL, 0) == 0) {@@ -1057,29 +1057,29 @@ opengl_es(void)}}if (wanted < 0) {- gpu = IOServiceGetMatchingService(0, IOServiceMatching("RedwoodGPU"));+ gpu = IOServiceGetMatchingService(0, IOServiceMatching("HakiosGPU"));wanted = gpu != 0;if (gpu != 0) {IOObjectRelease(gpu);}}if (!wanted) {- say("redwood: %s: CoreAnimation keeps its software renderer\n", told ? "gl=0" : "no GPU to draw with");+ say("hakios: %s: CoreAnimation keeps its software renderer\n", told ? "gl=0" : "no GPU to draw with");return;}- if ((library = dlopen(REDWOOD_GL, RTLD_NOW)) == NULL) {- say("redwood: %s: %s\n", REDWOOD_GL, dlerror());+ if ((library = dlopen(HAKIOS_GL, RTLD_NOW)) == NULL) {+ say("hakios: %s: %s\n", HAKIOS_GL, dlerror());return;}gl_loaded = 1;gl_function_values = (void (*)(void *, unsigned, unsigned, size_t, size_t, const float *))dlsym(library,- "redwood_gl_function_values");- gl_function_refused = (void (*)(unsigned))dlsym(library, "redwood_gl_function_refused");+ "hakios_gl_function_values");+ gl_function_refused = (void (*)(unsigned))dlsym(library, "hakios_gl_function_refused");}__attribute__((constructor))static void-redwood_init(void)+hakios_init(void){const char *name = getprogname();size_t length = 0;@@ -1102,7 +1102,7 @@ redwood_init(void)*/if (sysctlbyname("kern.bootargs", arguments, &size, NULL, 0) == 0 && strstr(arguments, "ca_vbl=1") != NULL) {setenv("CA_FORCE_TIMER", "1", 1);- say("redwood: ca_vbl=1: CoreAnimation is to take the display driver's refresh notifications\n");+ say("hakios: ca_vbl=1: CoreAnimation is to take the display driver's refresh notifications\n");}/** Boot-arg caenv=NAME=VALUE (as many as wanted): into the window server's environment, for@@ -1121,7 +1121,7 @@ redwood_init(void)if ((equals = strchr(setting, '=')) != NULL) {*equals = 0;setenv(setting, equals + 1, 1);- say("redwood: caenv: %s=%s for the window server\n", setting, equals + 1);+ say("hakios: caenv: %s=%s for the window server\n", setting, equals + 1);}}opengl_es();diff --git a/userland/src/inject_app.c b/userland/src/inject_app.cindex 08960e3..947c2e2 100644--- a/userland/src/inject_app.c+++ b/userland/src/inject_app.c@@ -1,5 +1,5 @@/*- * libredwood-app.dylib: code of ours inside an application, to find out why it dies (see inject.c+ * libhakios.app.dylib: code of ours inside an application, to find out why it dies (see inject.c* for how it gets there; build.sh's INJECT names the programs).** An application that is launched and gone again in a third of a second leaves nothing behind here:@@ -48,7 +48,7 @@ killed(int number, siginfo_t *info, void *context)int n = backtrace(frames, 32), k;(void)context;- k = snprintf(line, sizeof(line), "redwood: %s: SIGNAL %d at %p (the cache's slide %#lx), the stack:", who, number,+ k = snprintf(line, sizeof(line), "hakios: %s: SIGNAL %d at %p (the cache's slide %#lx), the stack:", who, number,info != NULL ? info->si_addr : NULL, (unsigned long)slide);for (int i = 0; i < n && k < (int)sizeof(line) - 24; i++) {k += snprintf(line + k, sizeof(line) - (size_t)k, " %#lx", (unsigned long)((uintptr_t)frames[i] - slide));@@ -75,10 +75,10 @@ watched_begin_task(id self, SEL cmd, id handler)char line[160];int n;- n = snprintf(line, sizeof(line), "redwood: %s: asking UIKit for a background task\n", who);+ n = snprintf(line, sizeof(line), "hakios: %s: asking UIKit for a background task\n", who);say(line, (size_t)(n > 0 ? n : 0));task = begin_task(self, cmd, handler);- n = snprintf(line, sizeof(line), "redwood: %s: the background task is %lu\n", who, task);+ n = snprintf(line, sizeof(line), "hakios: %s: the background task is %lu\n", who, task);say(line, (size_t)(n > 0 ? n : 0));return task;}@@ -99,7 +99,7 @@ watched_resume_task(id self, SEL cmd)if (text != NULL) {url = string(text, sel_registerName("UTF8String"));}- n = snprintf(line, sizeof(line), "redwood: %s: starting a session task for %s\n", who,+ n = snprintf(line, sizeof(line), "hakios: %s: starting a session task for %s\n", who,url != NULL ? url : "?");say(line, (size_t)(n > 0 ? n : 0));resume_task(self, cmd);@@ -130,7 +130,7 @@ keep_to_the_repositories(void)defaults = get(defaults, sel_registerName("standardUserDefaults"));if (defaults != NULL) {set_bool(defaults, sel_registerName("setBool:forKey:"), 0, key);- say("redwood: Sileo: its Canister search is turned off (it is not reachable here)\n", 73);+ say("hakios: Sileo: its Canister search is turned off (it is not reachable here)\n", 73);}}@@ -168,20 +168,20 @@ spawn_apt_said(pid_t *pid, const posix_spawn_file_actions_t *actions, const posi{static char script[] ="exec 7>/dev/console; J=/var/jb\n"- "echo \"redwood: apt-get runs as $($J/usr/bin/id), in $(pwd)\" >&7\n"+ "echo \"hakios: apt-get runs as $($J/usr/bin/id), in $(pwd)\" >&7\n""$J/bin/ls -ln $J/var/cache/apt/archives $J/var/lib/apt/sileolists >&7 2>&1\n""for a in \"$@\"; do case $a in -*|install) ;; *) p=${a%%=*}\n"- " echo \"redwood: $p in sileolists:\" >&7\n"+ " echo \"hakios: $p in sileolists:\" >&7\n"" $J/usr/bin/grep -h -A30 \"^Package: $p\\$\" $J/var/lib/apt/sileolists/*Packages 2>&1 | $J/usr/bin/head -40 >&7 ;; esac; done\n""$J/usr/bin/apt-get \"$@\"\n"- "s=$?; echo \"redwood: apt-get exits $s; its archives after:\" >&7\n"+ "s=$?; echo \"hakios: apt-get exits $s; its archives after:\" >&7\n""$J/bin/ls -ln $J/var/cache/apt/archives >&7 2>&1; exit $s\n";char *wrapped[96];int k = 0;for (int i = 0; envp != NULL && envp[i] != NULL; i++) {char line[600];- int n = snprintf(line, sizeof(line), "redwood: %s: apt-get's environment: %s\n", who, envp[i]);+ int n = snprintf(line, sizeof(line), "hakios: %s: apt-get's environment: %s\n", who, envp[i]);say(line, (size_t)(n < (int)sizeof(line) ? n : (int)sizeof(line) - 1));}@@ -206,7 +206,7 @@ watched_spawn(pid_t *pid, const char *path, const posix_spawn_file_actions_t *acconst posix_spawnattr_t *attr, char *const argv[], char *const envp[]){char line[1200];- int n = snprintf(line, sizeof(line), "redwood: %s: (uid %d) spawns %s", who, (int)getuid(),+ int n = snprintf(line, sizeof(line), "hakios: %s: (uid %d) spawns %s", who, (int)getuid(),path != NULL ? path : "?");for (int i = 0; argv != NULL && argv[i] != NULL && n < (int)sizeof(line) - 40; i++) {@@ -235,7 +235,7 @@ watched_spawn(pid_t *pid, const char *path, const posix_spawn_file_actions_t *acn = posix_spawn(pid, path, actions, attr, argv, envp);if (n != 0) {char said[300];- int k = snprintf(said, sizeof(said), "redwood: %s: ... and that spawn failed: %s\n", who, strerror(n));+ int k = snprintf(said, sizeof(said), "hakios: %s: ... and that spawn failed: %s\n", who, strerror(n));say(said, (size_t)(k < (int)sizeof(said) ? k : (int)sizeof(said) - 1));}@@ -270,7 +270,7 @@ file_said(const char *what, signed char ok, id from, id to, id error){if (!ok) {char line[1400];- int n = snprintf(line, sizeof(line), "redwood: %s: %s %s -> %s failed: %s\n", who, what, text_of(from),+ int n = snprintf(line, sizeof(line), "hakios: %s: %s %s -> %s failed: %s\n", who, what, text_of(from),text_of(to), error != NULL ? text_of(error) : "(no error given)");say(line, (size_t)(n < (int)sizeof(line) ? n : (int)sizeof(line) - 1));@@ -334,7 +334,7 @@ watch(const char *name, const char *selector, IMP ours, void *theirs)__attribute__((constructor))static void-redwood_app_init(void)+hakios_app_init(void){static const int signals[] = { SIGTRAP, SIGABRT, SIGILL, SIGSEGV, SIGBUS, SIGSYS };struct sigaction action = { 0 };@@ -375,7 +375,7 @@ redwood_app_init(void)watch("NSFileManager", "copyItemAtURL:toURL:error:", (IMP)watched_copy_url, ©_url);watch("NSFileManager", "moveItemAtPath:toPath:error:", (IMP)watched_move_path, &move_path);watch("NSFileManager", "copyItemAtPath:toPath:error:", (IMP)watched_copy_path, ©_path);- n = snprintf(line, sizeof(line), "redwood: %s: started as uid %d (effective %d), watching for what kills it\n",+ n = snprintf(line, sizeof(line), "hakios: %s: started as uid %d (effective %d), watching for what kills it\n",name, (int)getuid(), (int)geteuid());say(line, (size_t)(n > 0 ? n : 0));}diff --git a/userland/src/inject_fairplay.c b/userland/src/inject_fairplay.cindex 45ad5f5..4ff6412 100644--- a/userland/src/inject_fairplay.c+++ b/userland/src/inject_fairplay.c@@ -1,5 +1,5 @@/*- * libredwood-fairplay.dylib: code of ours inside fairplayd.H2 (see inject.c for how it gets there).+ * libhakios.fairplay.dylib: code of ours inside fairplayd.H2 (see inject.c for how it gets there).** Why. The App Store's front page never loads, and the root of that is not in the store: an* AppleMediaServices thread inside appstored sits in a Mach call in _AMSFairPlayGetDeviceType@@ -84,7 +84,7 @@* INTERPOSING CANNOT SEE A LIBSYSTEM-INTERNAL SYSCALL. For arguments to those, the instrument has to* be the kernel: systrace already prints the call and the return, and printing the sysctl MIB and* the __mac_syscall policy and request beside them is a small addition in the same place- * (xnu/redwood.patch, systrace_report). That is the next instrument, and it wants a kernel build.+ * (xnu/hakios.patch, systrace_report). That is the next instrument, and it wants a kernel build.* It mattered because this kernel's AMFI stand-in answers exactly two requests, 0x5a and 0x60, and* returns ENOPOLICY to every other (bsd/kern/kern_minimac.c), and a daemon refused there would be* refused invisibly. MEASURED, AMFI IS CLEARED, and by two roads at once.@@ -196,7 +196,7 @@ say_the_fault(int signal_number, siginfo_t *info, void *context_in)fp = (uintptr_t)context->uc_mcontext->__ss.__fp;}frames_from(fp, frames, sizeof(frames));- say("redwood: fairplayd: signal %d at %p, pc %#lx, called from%s (unslid)\n", signal_number,+ say("hakios: fairplayd: signal %d at %p, pc %#lx, called from%s (unslid)\n", signal_number,info != NULL ? info->si_addr : NULL, pc - slide, frames);signal(signal_number, SIG_DFL);raise(signal_number);@@ -210,7 +210,7 @@ watched_IOServiceMatching(const char *name)CFMutableDictionaryRef matching = IOServiceMatching(name);if (ours) {- say("redwood: fairplayd: IOServiceMatching(\"%s\") -> %s\n", name != NULL ? name : "(null)",+ say("hakios: fairplayd: IOServiceMatching(\"%s\") -> %s\n", name != NULL ? name : "(null)",matching != NULL ? "a dictionary" : "nothing");}return matching;@@ -224,7 +224,7 @@ watched_IOServiceGetMatchingServices(mach_port_t port, CFDictionaryRef matching,if (ours) {io_object_t one = existing != NULL ? IOIteratorNext(*existing) : 0;- say("redwood: fairplayd: IOServiceGetMatchingServices -> %#x, %s\n", result,+ say("hakios: fairplayd: IOServiceGetMatchingServices -> %#x, %s\n", result,one != 0 ? "something matched" : "NOTHING MATCHED");if (one != 0) {IOObjectRelease(one);@@ -240,7 +240,7 @@ watched_IOServiceGetMatchingService(mach_port_t port, CFDictionaryRef matching)io_service_t service = IOServiceGetMatchingService(port, matching);if (ours) {- say("redwood: fairplayd: IOServiceGetMatchingService -> %s\n", service != 0 ? "a service" : "NOTHING");+ say("hakios: fairplayd: IOServiceGetMatchingService -> %s\n", service != 0 ? "a service" : "NOTHING");}return service;}@@ -251,7 +251,7 @@ watched_IOServiceOpen(io_service_t service, task_port_t task, uint32_t type, io_kern_return_t result = IOServiceOpen(service, task, type, connect);if (ours) {- say("redwood: fairplayd: IOServiceOpen(type %u) -> %#x\n", type, result);+ say("hakios: fairplayd: IOServiceOpen(type %u) -> %#x\n", type, result);}return result;}@@ -265,7 +265,7 @@ watched_IOConnectCallMethod(mach_port_t connection, uint32_t selector, const uininput_struct_count, output, output_count, output_struct, output_struct_count);if (ours) {- say("redwood: fairplayd: IOConnectCallMethod selector %u -> %#x\n", selector, result);+ say("hakios: fairplayd: IOConnectCallMethod selector %u -> %#x\n", selector, result);}return result;}@@ -295,7 +295,7 @@ watched_open(const char *path, int flags, ...)* came back.*/if (ours) {- say("redwood: fairplayd: open(\"%s\") -> %d%s\n", path != NULL ? path : "(null)", fd,+ say("hakios: fairplayd: open(\"%s\") -> %d%s\n", path != NULL ? path : "(null)", fd,fd < 0 ? (errno == ENOENT ? " (no such file)" : " (refused)") : "");}return fd;@@ -313,7 +313,7 @@ watched_sysctl(int *mib, unsigned count, void *out, size_t *out_size, void *in,int result = sysctl(mib, count, out, out_size, in, in_size);if (ours && mib != NULL && count >= 1) {- say("redwood: fairplayd: sysctl [%d %d %d %d] (%u deep) -> %d\n", mib[0], count > 1 ? mib[1] : -1,+ say("hakios: fairplayd: sysctl [%d %d %d %d] (%u deep) -> %d\n", mib[0], count > 1 ? mib[1] : -1,count > 2 ? mib[2] : -1, count > 3 ? mib[3] : -1, count, result);}return result;@@ -334,7 +334,7 @@ watched___sysctl(int *mib, unsigned count, void *out, size_t *out_size, void *inint result = __sysctl(mib, count, out, out_size, in, in_size);if (ours && mib != NULL && count >= 1) {- say("redwood: fairplayd: sysctl [%d %d %d %d] (%u deep) -> %d\n", mib[0], count > 1 ? mib[1] : -1,+ say("hakios: fairplayd: sysctl [%d %d %d %d] (%u deep) -> %d\n", mib[0], count > 1 ? mib[1] : -1,count > 2 ? mib[2] : -1, count > 3 ? mib[3] : -1, count, result);}return result;@@ -349,7 +349,7 @@ watched___mac_syscall(const char *policy, int call, void *arg)int result = __mac_syscall(policy, call, arg);if (ours) {- say("redwood: fairplayd: __mac_syscall(\"%s\", %d) -> %d\n", policy != NULL ? policy : "(null)",+ say("hakios: fairplayd: __mac_syscall(\"%s\", %d) -> %d\n", policy != NULL ? policy : "(null)",call, result);}return result;@@ -361,7 +361,7 @@ watched_sysctlbyname(const char *name, void *out, size_t *out_size, void *in, siint result = sysctlbyname(name, out, out_size, in, in_size);if (ours) {- say("redwood: fairplayd: sysctlbyname(\"%s\") -> %d\n", name != NULL ? name : "(null)", result);+ say("hakios: fairplayd: sysctlbyname(\"%s\") -> %d\n", name != NULL ? name : "(null)", result);}return result;}@@ -372,7 +372,7 @@ watched_dlopen(const char *path, int mode)void *library = dlopen(path, mode);if (ours) {- say("redwood: fairplayd: dlopen(\"%s\") -> %s\n", path != NULL ? path : "(null)",+ say("hakios: fairplayd: dlopen(\"%s\") -> %s\n", path != NULL ? path : "(null)",library != NULL ? "loaded" : dlerror());}return library;@@ -391,7 +391,7 @@ watched_xpc_connection_create_mach_service(const char *name, dispatch_queue_t quxpc_connection_t connection = xpc_connection_create_mach_service(name, queue, flags);if (ours) {- say("redwood: fairplayd: xpc_connection_create_mach_service(\"%s\") -> %s\n",+ say("hakios: fairplayd: xpc_connection_create_mach_service(\"%s\") -> %s\n",name != NULL ? name : "(null)", connection != NULL ? "a connection" : "nothing");}return connection;@@ -403,7 +403,7 @@ watched_stat(const char *path, struct stat *out)int result = stat(path, out);if (ours) {- say("redwood: fairplayd: stat(\"%s\") -> %d\n", path != NULL ? path : "(null)", result);+ say("hakios: fairplayd: stat(\"%s\") -> %d\n", path != NULL ? path : "(null)", result);}return result;}@@ -414,7 +414,7 @@ watched_access(const char *path, int mode)int result = access(path, mode);if (ours) {- say("redwood: fairplayd: access(\"%s\") -> %d\n", path != NULL ? path : "(null)", result);+ say("hakios: fairplayd: access(\"%s\") -> %d\n", path != NULL ? path : "(null)", result);}return result;}@@ -425,7 +425,7 @@ watched_mkdir(const char *path, mode_t mode)int result = mkdir(path, mode);if (ours) {- say("redwood: fairplayd: mkdir(\"%s\") -> %d\n", path != NULL ? path : "(null)", result);+ say("hakios: fairplayd: mkdir(\"%s\") -> %d\n", path != NULL ? path : "(null)", result);}return result;}@@ -466,7 +466,7 @@ watched_MGCopyAnswer(CFStringRef key)if (key == NULL || !CFStringGetCString(key, text, sizeof(text), kCFStringEncodingUTF8)) {strlcpy(text, "(unreadable)", sizeof(text));}- say("redwood: fairplayd: MGCopyAnswer(\"%s\") -> %s\n", text, answer != NULL ? "an answer" : "NOTHING");+ say("hakios: fairplayd: MGCopyAnswer(\"%s\") -> %s\n", text, answer != NULL ? "an answer" : "NOTHING");}return answer;}@@ -482,7 +482,7 @@ watched_SecTaskCopyValueForEntitlement(void *task, CFStringRef entitlement, CFErif (entitlement == NULL || !CFStringGetCString(entitlement, text, sizeof(text), kCFStringEncodingUTF8)) {strlcpy(text, "(unreadable)", sizeof(text));}- say("redwood: fairplayd: entitlement \"%s\" -> %s\n", text, value != NULL ? "held" : "NOT HELD");+ say("hakios: fairplayd: entitlement \"%s\" -> %s\n", text, value != NULL ? "held" : "NOT HELD");}return value;}@@ -494,7 +494,7 @@ watched__exit(int status)if (ours) {frames_from((uintptr_t)__builtin_frame_address(0), frames, sizeof(frames));- say("redwood: fairplayd: LEAVING, _exit(%d), called from%s (unslid)\n", status, frames);+ say("hakios: fairplayd: LEAVING, _exit(%d), called from%s (unslid)\n", status, frames);}_exit(status);}@@ -506,7 +506,7 @@ watched_abort(void)if (ours) {frames_from((uintptr_t)__builtin_frame_address(0), frames, sizeof(frames));- say("redwood: fairplayd: LEAVING, abort(), called from%s (unslid)\n", frames);+ say("hakios: fairplayd: LEAVING, abort(), called from%s (unslid)\n", frames);}abort();}@@ -551,7 +551,7 @@ at_the_end(void)if (!ours) {return;}- say("redwood: fairplayd: at the end (an exit handler ran: it left of its own accord), %u samples\n",+ say("hakios: fairplayd: at the end (an exit handler ran: it left of its own accord), %u samples\n",sample_count);/* every distinct pc, newest first: a fifth of a second of a daemon is a short story */for (unsigned i = sample_count; i > 0 && shown < 40; i--) {@@ -565,7 +565,7 @@ at_the_end(void)continue;}shown++;- say("redwood: fairplayd: was at %#lx (cache %#lx, own %#lx)\n", pc, pc - slide, pc - own_slide);+ say("hakios: fairplayd: was at %#lx (cache %#lx, own %#lx)\n", pc, pc - slide, pc - own_slide);}}@@ -576,7 +576,7 @@ watched_exit(int status)if (ours) {frames_from((uintptr_t)__builtin_frame_address(0), frames, sizeof(frames));- say("redwood: fairplayd: LEAVING, exit(%d), called from%s (unslid)\n", status, frames);+ say("hakios: fairplayd: LEAVING, exit(%d), called from%s (unslid)\n", status, frames);}exit(status);}@@ -608,7 +608,7 @@ __attribute__((used)) static struct {__attribute__((constructor))static void-redwood_fairplay_init(void)+hakios_fairplay_init(void){const char *name = getprogname();size_t length = 0;@@ -641,9 +641,9 @@ redwood_fairplay_init(void)char ***argv = _NSGetArgv();int *argc = _NSGetArgc();- say("redwood: fairplayd: ours is in, %d argument(s)\n", argc != NULL ? *argc : -1);+ say("hakios: fairplayd: ours is in, %d argument(s)\n", argc != NULL ? *argc : -1);for (int i = 0; argv != NULL && argc != NULL && i < *argc && i < 6; i++) {- say("redwood: fairplayd: argv[%d] = %s\n", i, (*argv)[i] != NULL ? (*argv)[i] : "(null)");+ say("hakios: fairplayd: argv[%d] = %s\n", i, (*argv)[i] != NULL ? (*argv)[i] : "(null)");}}}diff --git a/userland/src/inject_media.c b/userland/src/inject_media.cindex 973f429..43092f0 100644--- a/userland/src/inject_media.c+++ b/userland/src/inject_media.c@@ -1,5 +1,5 @@/*- * libredwood-media.dylib: code of ours inside mediaserverd (see inject.c for how it gets there).+ * libhakios.media.dylib: code of ours inside mediaserverd (see inject.c for how it gets there).** mediaserverd is the audio server, and also the camera's: the capture stack of CMCapture lives* in the same process. Soon after it starts, that stack "prewarms" the Core Image filters of the@@ -13,7 +13,7 @@* and the stock wallpaper of iOS 16, whose layers are four such pictures, is its gradient alone.* There is no hardware decoder here; VideoToolbox takes its software one (VCPHEVC.videocodec).*- * The flashlight (only where the kernel has one: torch=3, /dev/redwood-torch): Control Center's+ * The flashlight (only where the kernel has one: torch=3, /dev/hakios-torch): Control Center's* button and AVFlashlight reach FigFlashlight in here, which asks the capture stack's device vendor* (+[BWFigCaptureDeviceVendor sharedCaptureDeviceVendor]) for the camera device and its back* camera's stream, and sets the stream's "TorchLevel" (0 to 1). Without a camera there is no@@ -22,7 +22,7 @@* by where it calls from -- is given one of ours, with a device and a stream whose torch level goes* to the kernel (see flashlight_*() below). Everybody else still gets none, as before.*- * The camera (only where the kernel has one: cam=5, /dev/redwood-camera): the vendor is made for+ * The camera (only where the kernel has one: cam=5, /dev/hakios-camera): the vendor is made for* everybody, with the create function of our capture device (camera_device.c) in place of the* one H10ISP.mediacapture would give for the iPhone's ISP; the capture graph is built around it and* its frames reach Camera.app's preview (see camera_device.c). Its stream takes the torch level too,@@ -80,9 +80,9 @@ prewarm_portrait_filter(__unused id self, __unused SEL selector, __unused int ve/* ---- the flashlight ------------------------------------------------------------------------------- */-static int torch = -1; /* /dev/redwood-torch */-static bool camera; /* /dev/redwood-camera is there */-extern int redwood_camera_device_create(const void *allocator, const void *options, void **out);+static int torch = -1; /* /dev/hakios-torch */+static bool camera; /* /dev/hakios-camera is there */+extern int hakios_camera_device_create(const void *allocator, const void *options, void **out);static Class vendor_class, device_class, stream_class;static IMP original_shared_vendor;static unsigned torch_said;@@ -107,9 +107,9 @@ shared_vendor(id self, SEL selector)if (vendor != NULL) {return vendor;}- if (!camera && access("/dev/redwood-camera", F_OK) == 0) {+ if (!camera && access("/dev/hakios-camera", F_OK) == 0) {camera = true; /* (should the kernel have made it after mediaserverd started) */- say("redwood: mediaserverd: the kernel has a camera (/dev/redwood-camera)\n");+ say("hakios: mediaserverd: the kernel has a camera (/dev/hakios-camera)\n");}if (camera) {pthread_mutex_lock(&lock);@@ -117,8 +117,8 @@ shared_vendor(id self, SEL selector)id made = ((id (*)(Class, SEL))objc_msgSend)(objc_getClass("BWFigCaptureDeviceVendor"), sel_registerName("alloc"));camera_vendor = ((id (*)(id, SEL, void *))objc_msgSend)(made, sel_registerName("initWithDeviceCreateFunction:"),- (void *)redwood_camera_device_create);- say("redwood: mediaserverd: the camera's device vendor %s\n", camera_vendor ? "made (camera_device.c)" :+ (void *)hakios_camera_device_create);+ say("hakios: mediaserverd: the camera's device vendor %s\n", camera_vendor ? "made (camera_device.c)" :"CANNOT BE MADE");}pthread_mutex_unlock(&lock);@@ -128,7 +128,7 @@ shared_vendor(id self, SEL selector)if (caller >= flashlight_code[i].from && caller < flashlight_code[i].to) {if (ours == NULL) {ours = class_createInstance(vendor_class, 0);- say("redwood: mediaserverd: no camera, so no device vendor: FigFlashlight gets the flashlight's own\n");+ say("hakios: mediaserverd: no camera, so no device vendor: FigFlashlight gets the flashlight's own\n");}return ours;}@@ -143,8 +143,8 @@ flashlight_set(uint32_t level)if (written != (ssize_t)sizeof(level) || torch_said < 40) {torch_said++;- say("redwood: mediaserverd: the flashlight at %u of 1000%s\n", level, written == (ssize_t)sizeof(level) ? "" :- " (NOT TAKEN by /dev/redwood-torch)");+ say("hakios: mediaserverd: the flashlight at %u of 1000%s\n", level, written == (ssize_t)sizeof(level) ? "" :+ " (NOT TAKEN by /dev/hakios-torch)");}}@@ -281,7 +281,7 @@ audio_source_start(id self, SEL selector, id *error)*error = NULL; /* (autoreleased by the capture stack: not ours to give back) */if (!said) {said = true;- say("redwood: mediaserverd: there is no capture audio on this phone: the session's audio source gives nothing, "+ say("hakios: mediaserverd: there is no capture audio on this phone: the session's audio source gives nothing, ""and the camera runs without it\n");}return true;@@ -308,7 +308,7 @@ quality_prioritization(id self, SEL selector)if (asked > 1 && !said) {said = true;- say("redwood: mediaserverd: a photograph's quality prioritization %d taken as 1 (speed): one frame, no SIS bracket\n",+ say("hakios: mediaserverd: a photograph's quality prioritization %d taken as 1 (speed): one frame, no SIS bracket\n",asked);}return asked > 1 ? 1 : asked;@@ -330,7 +330,7 @@ gnr_render(id self, SEL selector, void *sample_buffer, id input)(void)selector, (void)input;if (!said) {said = true;- say("redwood: mediaserverd: a photograph goes past the noise reduction, which has nothing to do it with here\n");+ say("hakios: mediaserverd: a photograph goes past the noise reduction, which has nothing to do it with here\n");}if (output != nil) {((void (*)(id, SEL, void *))objc_msgSend)(output, sel_registerName("emitSampleBuffer:"), sample_buffer);@@ -363,7 +363,7 @@ time_photo_encoder(id output, CMSampleBufferRef sample_buffer)if (timebase.denom == 0) {mach_timebase_info(&timebase);}- say("redwood: mediaserverd: a photograph of %zux%zu encoded in %.0f ms\n", CVPixelBufferGetWidth(image),+ say("hakios: mediaserverd: a photograph of %zux%zu encoded in %.0f ms\n", CVPixelBufferGetWidth(image),CVPixelBufferGetHeight(image), (double)(mach_absolute_time() - began) * timebase.numer / timebase.denom / 1e6);}began = 0;@@ -394,7 +394,7 @@ emit_sample_buffer(id self, SEL selector, CMSampleBufferRef sample_buffer)if (sample_buffer == NULL) {if (!said) {said = true;- say("redwood: mediaserverd: a node's output was given no sample buffer (the silent audio source's): not passed on\n");+ say("hakios: mediaserverd: a node's output was given no sample buffer (the silent audio source's): not passed on\n");}return;}@@ -425,7 +425,7 @@ register_hevc_encoder(void)int status;if (create == NULL || register_encoder == NULL || id_key == NULL || name_key == NULL || hardware_key == NULL) {- say("redwood: mediaserverd: no software HEVC encoder to register (%s)\n", codec == NULL ? "no VCPHEVC.videocodec" :+ say("hakios: mediaserverd: no software HEVC encoder to register (%s)\n", codec == NULL ? "no VCPHEVC.videocodec" :create == NULL ? "no HEVCVideoEncoder_CreateInstance" : "VideoToolbox without VTRegisterVideoEncoderWithInfo");return;}@@ -437,7 +437,7 @@ register_hevc_encoder(void)status = register_encoder('hvc1', info, create);CFRelease(info);- say("redwood: mediaserverd: the software HEVC encoder of VCPHEVC.videocodec registered for 'hvc1' (%d)\n", status);+ say("hakios: mediaserverd: the software HEVC encoder of VCPHEVC.videocodec registered for 'hvc1' (%d)\n", status);}struct method_spec {@@ -472,9 +472,9 @@ flashlight_classes(void){ "setProperty:value:", "i@:@@", (IMP)flashlight_stream_set },};- vendor_class = make_class("RedwoodFlashlightVendor", vendor, sizeof(vendor) / sizeof(vendor[0]));- device_class = make_class("RedwoodFlashlightDevice", NULL, 0);- stream_class = make_class("RedwoodFlashlightStream", stream, sizeof(stream) / sizeof(stream[0]));+ vendor_class = make_class("HakiosFlashlightVendor", vendor, sizeof(vendor) / sizeof(vendor[0]));+ device_class = make_class("HakiosFlashlightDevice", NULL, 0);+ stream_class = make_class("HakiosFlashlightStream", stream, sizeof(stream) / sizeof(stream[0]));}/*@@ -522,7 +522,7 @@ image_added(__unused const struct mach_header *header, __unused intptr_t image_sclass_getClassMethod(cls, sel_registerName(r->selector));original = method ? method_getImplementation(method) : NULL;if (original == NULL || (uintptr_t)original != r->expected + slide) {- say("redwood: %c[%s %s]: found %#lx, expected %#lx; left alone\n", r->instance ? '-' : '+', r->class_name,+ say("hakios: %c[%s %s]: found %#lx, expected %#lx; left alone\n", r->instance ? '-' : '+', r->class_name,r->selector,original ? (uintptr_t)original - slide : 0, r->expected);continue;@@ -531,13 +531,13 @@ image_added(__unused const struct mach_header *header, __unused intptr_t image_s*r->original = original;}method_setImplementation(method, r->replacement);- say("redwood: mediaserverd: %c[%s %s] replaced\n", r->instance ? '-' : '+', r->class_name, r->selector);+ say("hakios: mediaserverd: %c[%s %s] replaced\n", r->instance ? '-' : '+', r->class_name, r->selector);}}__attribute__((constructor))static void-redwood_media_init(void)+hakios_media_init(void){const char *name = getprogname();size_t length = 0;@@ -546,14 +546,14 @@ redwood_media_init(void)return;}slide = (uintptr_t)_dyld_get_shared_cache_range(&length) - CACHE_BASE;- torch = open("/dev/redwood-torch", O_WRONLY);- camera = access("/dev/redwood-camera", F_OK) == 0;+ torch = open("/dev/hakios-torch", O_WRONLY);+ camera = access("/dev/hakios-camera", F_OK) == 0;if (torch >= 0) {flashlight_classes();- say("redwood: mediaserverd: the kernel has a flashlight (/dev/redwood-torch)\n");+ say("hakios: mediaserverd: the kernel has a flashlight (/dev/hakios-torch)\n");}if (camera) {- say("redwood: mediaserverd: the kernel has a camera (/dev/redwood-camera)\n");+ say("hakios: mediaserverd: the kernel has a camera (/dev/hakios-camera)\n");register_hevc_encoder();}_dyld_register_func_for_add_image(image_added); /* also called for every image already there */diff --git a/userland/src/inject_sb.c b/userland/src/inject_sb.cindex d50005f..81b833b 100644--- a/userland/src/inject_sb.c+++ b/userland/src/inject_sb.c@@ -1,5 +1,5 @@/*- * libredwood-sb.dylib: code of ours inside SpringBoard (see inject.c for how it gets there).+ * libhakios.sb.dylib: code of ours inside SpringBoard (see inject.c for how it gets there).** - The phone is "activated". SpringBoard asks mobileactivationd, which is not running (and* could not talk to Apple anyway); without an answer it treats the device as bricked and@@ -25,9 +25,9 @@* - A long press on the lock screen's wallpaper does not open the poster switcher, which the* window server here shows as a black screen: see poster_switcher_allowed().* - Darwin notifications as a remote control, for scripts (rwtouch notify NAME):- * com.redwood.unlock what the lock screen does after "swipe up to open"- * com.redwood.layers write down the layers SpringBoard has on the screen: see layers()- * com.redwood.switcher open the switcher of running applications: see switcher()+ * com.hakios.unlock what the lock screen does after "swipe up to open"+ * com.hakios.layers write down the layers SpringBoard has on the screen: see layers()+ * com.hakios.switcher open the switcher of running applications: see switcher()* In any other program given this library (INJECT in build.sh) only the last of them is* answered, with that program's layers.*/@@ -147,7 +147,7 @@ replace_method_of_kind(char kind, const char *class_name, const char *selector,IMP original = method ? method_getImplementation(method) : NULL;if (original == NULL || (uintptr_t)original != expected + slide) {- say("redwood: %c[%s %s]: found %#lx, expected %#lx; left alone\n", kind, class_name, selector,+ say("hakios: %c[%s %s]: found %#lx, expected %#lx; left alone\n", kind, class_name, selector,original ? (uintptr_t)original - slide : 0, expected);return NULL;}@@ -181,7 +181,7 @@ static voidset_setup_required_reason(id self, SEL selector, long reason){if (reason != 0) {- say("redwood: SpringBoard wants the setup assistant (reason %ld); not here\n", reason);+ say("hakios: SpringBoard wants the setup assistant (reason %ld); not here\n", reason);}original_set_setup_required_reason(self, selector, 0);}@@ -218,13 +218,13 @@ snapshot_output_format(__unused id self, __unused SEL selector, id snapshot)* iOS reads battery level through UIDevice.batteryLevel and UIDevice.batteryState; SpringBoard's* status bar reads it the same way via SBBatteryController. Where the battery has no power source* of its own in the kernel (battery=1, the loader's way through Qualcomm's UEFI charger protocols),- * we hook the UIDevice accessors to return what XNU publishes as kern.redwood.battery_soc (0..100)- * and kern.redwood.battery_charging.+ * we hook the UIDevice accessors to return what XNU publishes as kern.hakios.battery_soc (0..100)+ * and kern.hakios.battery_charging.* When the sysctl is missing (battery=1 not in boot-args, or the driver never started) we hand* back the value the real implementation computed; the status bar then shows whatever iOS last* knew, which is better than crashing.- * With adsp=1 the battery is a power source (the service RedwoodBattery, an IOPMPowerSource:- * iokit/Kernel/RedwoodBattery.cpp), which powerd reads like an iPhone's own, and from it iOS knows+ * With adsp=1 the battery is a power source (the service HakiosBattery, an IOPMPowerSource:+ * iokit/Kernel/hakios.battery.cpp), which powerd reads like an iPhone's own, and from it iOS knows* everything by itself; once that service is there, the hooks hand everything to iOS's own code.*/static float (*original_battery_level)(id self, SEL sel);@@ -253,7 +253,7 @@ battery_power_source(void)static bool found;io_service_t service;- if (!found && (service = IOServiceGetMatchingService(0, IOServiceMatching("RedwoodBattery"))) != 0) {+ if (!found && (service = IOServiceGetMatchingService(0, IOServiceMatching("HakiosBattery"))) != 0) {IOObjectRelease(service);found = true;}@@ -267,7 +267,7 @@ battery_power_source(void)* has no baseband here. Its item updaters take the data and a getter and setter for the field* (iOS 16.5: -[SBStatusBarStateAggregator _updateSignalStrengthItem:withData:SIMInfo:barsGetter:* barsSetter:], and the like for the service string): the signal one is replaced so that, when the- * kernel's modem is registered (sysctl kern.redwood.cellular_registered, _bars: redwood_mpss.c),+ * kernel's modem is registered (sysctl kern.hakios.cellular_registered, _bars: hakios.mpss.c),* the bars are set and the item switched on (-[... _setItem:enabled:]). The aggregator's whole* method list is said once in the log, for the posting to be found; and the signal item is asked* to update itself every few seconds while the kernel's state changes.@@ -279,22 +279,22 @@ static int cellular_last_bars = -2, cellular_said;static voidupdate_signal_item(id self, SEL sel, long item, void *data, id sim, void *getter, void *setter){- int up = sysctl_int("kern.redwood.cellular_up"), registered = sysctl_int("kern.redwood.cellular_registered");- int bars = sysctl_int("kern.redwood.cellular_bars");+ int up = sysctl_int("kern.hakios.cellular_up"), registered = sysctl_int("kern.hakios.cellular_registered");+ int bars = sysctl_int("kern.hakios.cellular_bars");cellular_aggregator = self;if (original_update_signal_item) {original_update_signal_item(self, sel, item, data, sim, getter, setter);}if (cellular_said++ < 8) {- say("redwood: cellular: signal item %ld: data %p, SIM info %p, getter %p, setter %p; the kernel says up %d registered %d bars %d\n",+ say("hakios: cellular: signal item %ld: data %p, SIM info %p, getter %p, setter %p; the kernel says up %d registered %d bars %d\n",item, data, (void *)sim, getter, setter, up, registered, bars);}if (up > 0 && registered > 0 && bars >= 0 && bars <= 5 && setter != NULL && data != NULL) {((void (*)(void *, int))setter)(data, bars);((void (*)(id, SEL, long, BOOL))objc_msgSend)(self, sel_registerName("_setItem:enabled:"), item, YES);if (bars != cellular_last_bars) {- say("redwood: cellular: %d bars shown (item %ld)\n", bars, item);+ say("hakios: cellular: %d bars shown (item %ld)\n", bars, item);}}cellular_last_bars = bars;@@ -317,8 +317,8 @@ update_service_item(id self, SEL sel, long item, void *data, id sim, id other, vchar name[64] = "";size_t size = sizeof(name) - 1;- sysctlbyname("kern.redwood.cellular_operator", name, &size, NULL, 0);- say("redwood: cellular: service item %ld: data %p, SIM info %p, other %p; string getter %p setter %p, content type getter %p "+ sysctlbyname("kern.hakios.cellular_operator", name, &size, NULL, 0);+ say("hakios: cellular: service item %ld: data %p, SIM info %p, other %p; string getter %p setter %p, content type getter %p ""setter %p; the kernel's network \"%s\"\n", item, data, (void *)sim, (void *)other, g1, s1, g3, s3, name);}}@@ -334,7 +334,7 @@ cellular_hook(void)Method method = cls ? class_getInstanceMethod(cls, sel_registerName(service_selector)) : NULL;if (method) {- say("redwood: cellular: -[SBStatusBarStateAggregator %s] at %#lx, types \"%s\": looked at\n", service_selector,+ say("hakios: cellular: -[SBStatusBarStateAggregator %s] at %#lx, types \"%s\": looked at\n", service_selector,(uintptr_t)method_getImplementation(method) - slide, method_getTypeEncoding(method));original_update_service_item = (void (*)(id, SEL, long, void *, id, id, void *, void *, void *, void *, void *, void *, void *,void *))method_getImplementation(method);@@ -346,10 +346,10 @@ cellular_hook(void)Method method = cls ? class_getInstanceMethod(cls, sel_registerName(selector)) : NULL;if (method == NULL) {- say("redwood: cellular: no -[SBStatusBarStateAggregator %s]\n", selector);+ say("hakios: cellular: no -[SBStatusBarStateAggregator %s]\n", selector);return;}- say("redwood: cellular: -[SBStatusBarStateAggregator %s] at %#lx, types \"%s\": replaced\n", selector,+ say("hakios: cellular: -[SBStatusBarStateAggregator %s] at %#lx, types \"%s\": replaced\n", selector,(uintptr_t)method_getImplementation(method) - slide, method_getTypeEncoding(method));original_update_signal_item = (void (*)(id, SEL, long, void *, id, void *, void *))method_getImplementation(method);method_setImplementation(method, (IMP)update_signal_item);@@ -365,7 +365,7 @@ cellular_hook(void)size_t n = strlen(name);if (at + n + 2 > sizeof(line)) {- say("redwood: cellular: aggregator methods: %s\n", line);+ say("hakios: cellular: aggregator methods: %s\n", line);line[0] = 0;at = 0;}@@ -375,7 +375,7 @@ cellular_hook(void)line[at] = 0;}if (at) {- say("redwood: cellular: aggregator methods: %s\n", line);+ say("hakios: cellular: aggregator methods: %s\n", line);}free(list);}@@ -385,7 +385,7 @@ cellular_hook(void)dispatch_source_set_timer(timer, dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), 3 * NSEC_PER_SEC, NSEC_PER_SEC / 2);dispatch_source_set_event_handler(timer, ^{static int last_registered = -2, last_bars = -2;- int registered = sysctl_int("kern.redwood.cellular_registered"), bars = sysctl_int("kern.redwood.cellular_bars");+ int registered = sysctl_int("kern.hakios.cellular_registered"), bars = sysctl_int("kern.hakios.cellular_bars");if ((registered != last_registered || bars != last_bars) && cellular_aggregator != nil) {SEL update = sel_registerName("_updateSignalStrengthItem");@@ -394,7 +394,7 @@ cellular_hook(void)last_bars = bars;if (class_getInstanceMethod(object_getClass(cellular_aggregator), update)) {((void (*)(id, SEL))objc_msgSend)(cellular_aggregator, update);- say("redwood: cellular: the signal item asked to update (registered %d, bars %d)\n", registered, bars);+ say("hakios: cellular: the signal item asked to update (registered %d, bars %d)\n", registered, bars);}}});@@ -405,7 +405,7 @@ cellular_hook(void)static floatbattery_level(id self, SEL sel){- int soc = sysctl_int("kern.redwood.battery_soc");+ int soc = sysctl_int("kern.hakios.battery_soc");if (soc < 0 || soc > 100 || battery_power_source()) {return original_battery_level ? original_battery_level(self, sel) : -1.0f;@@ -417,10 +417,10 @@ battery_level(id self, SEL sel)static longbattery_state(id self, SEL sel){- int charging = sysctl_int("kern.redwood.battery_charging");- int present = sysctl_int("kern.redwood.battery_present");- int plugged = sysctl_int("kern.redwood.battery_charger_present");- int soc = sysctl_int("kern.redwood.battery_soc");+ int charging = sysctl_int("kern.hakios.battery_charging");+ int present = sysctl_int("kern.hakios.battery_present");+ int plugged = sysctl_int("kern.hakios.battery_charger_present");+ int soc = sysctl_int("kern.hakios.battery_soc");if (charging == -1 || present == -1 || plugged == -1 || soc < 0 || soc > 100 || battery_power_source()) {return original_battery_state ? original_battery_state(self, sel) : 0;@@ -438,7 +438,7 @@ battery_state(id self, SEL sel)static BOOLbattery_view_shows_percentage(id self, SEL sel){- int soc = sysctl_int("kern.redwood.battery_soc");+ int soc = sysctl_int("kern.hakios.battery_soc");if (soc >= 0 && soc <= 100 && !battery_power_source()) return YES;return original_battery_view_shows_percentage ? original_battery_view_shows_percentage(self, sel) : NO;@@ -447,7 +447,7 @@ battery_view_shows_percentage(id self, SEL sel)static voidbattery_view_set_shows_percentage(id self, SEL sel, BOOL shows){- int soc = sysctl_int("kern.redwood.battery_soc");+ int soc = sysctl_int("kern.hakios.battery_soc");original_battery_view_set_shows_percentage(self, sel, (soc >= 0 && soc <= 100 && !battery_power_source()) ? YES : shows);}@@ -455,9 +455,9 @@ battery_view_set_shows_percentage(id self, SEL sel, BOOL shows)static BOOLbattery_view_should_show_bolt(id self, SEL sel){- int charging = sysctl_int("kern.redwood.battery_charging");- int present = sysctl_int("kern.redwood.battery_present");- int plugged = sysctl_int("kern.redwood.battery_charger_present");+ int charging = sysctl_int("kern.hakios.battery_charging");+ int present = sysctl_int("kern.hakios.battery_present");+ int plugged = sysctl_int("kern.hakios.battery_charger_present");if (charging != -1 && present != -1 && plugged != -1 && !battery_power_source()) return charging && present && plugged;return original_battery_view_should_show_bolt ? original_battery_view_should_show_bolt(self, sel) : NO;@@ -473,7 +473,7 @@ battery_view_should_show_bolt(id self, SEL sel)static doublebattery_view_charge_percent(id self, SEL sel){- int soc = sysctl_int("kern.redwood.battery_soc");+ int soc = sysctl_int("kern.hakios.battery_soc");if (soc >= 0 && soc <= 100 && !battery_power_source()) return (double)soc / 100.0;return original_battery_view_charge_percent ? original_battery_view_charge_percent(self, sel) : 0.0;@@ -482,7 +482,7 @@ battery_view_charge_percent(id self, SEL sel)static voidbattery_view_set_charge_percent(id self, SEL sel, double p){- int soc = sysctl_int("kern.redwood.battery_soc");+ int soc = sysctl_int("kern.hakios.battery_soc");original_battery_view_set_charge_percent(self, sel, (soc >= 0 && soc <= 100 && !battery_power_source()) ? (double)soc / 100.0 : p);}@@ -491,7 +491,7 @@ battery_view_set_charge_percent(id self, SEL sel, double p)static doublering_charging_level(id self, SEL sel){- int soc = sysctl_int("kern.redwood.battery_soc");+ int soc = sysctl_int("kern.hakios.battery_soc");if (soc >= 0 && soc <= 100 && !battery_power_source()) return (double)soc / 100.0;return original_ring_charging_level ? original_ring_charging_level(self, sel) : 0.0;@@ -521,7 +521,7 @@ battery_post_notifications(void)/* ---- the lock screen's clock without a GPU ------------------------------------------------------- */-#define REDWOOD_GL "/redwood/lib/libredwood-gl.dylib"+#define HAKIOS_GL "/redwood/lib/libhakios.gl.dylib"/* Does the window server draw with OpenGL ES? The same question, asked the same way, as opengl_es() in inject.c. */static bool@@ -532,7 +532,7 @@ gpu_draws(void)const char *argument;io_service_t gpu;- if (access(REDWOOD_GL, R_OK) != 0) {+ if (access(HAKIOS_GL, R_OK) != 0) {return false;}if (sysctlbyname("kern.bootargs", arguments, &size, NULL, 0) == 0) {@@ -542,7 +542,7 @@ gpu_draws(void)}}}- gpu = IOServiceGetMatchingService(0, IOServiceMatching("RedwoodGPU"));+ gpu = IOServiceGetMatchingService(0, IOServiceMatching("HakiosGPU"));if (gpu != 0) {IOObjectRelease(gpu);}@@ -568,7 +568,7 @@ plain_vibrancy(void)return;}CFPreferencesSetAppValue(CFSTR("BSUIVibrancyEffectViewDisabled"), kCFBooleanTrue, kCFPreferencesCurrentApplication);- say("redwood: SpringBoard: no GPU draws, vibrant views are plain (the lock screen's clock is white)\n");+ say("hakios: SpringBoard: no GPU draws, vibrant views are plain (the lock screen's clock is white)\n");}/* ---- the side button's long press ---------------------------------------------------------------- */@@ -597,7 +597,7 @@ lock_button_held(void)static int token = NOTIFY_TOKEN_INVALID;uint64_t state = 0;- if (token == NOTIFY_TOKEN_INVALID && notify_register_check("com.redwood.button.lock", &token) != NOTIFY_STATUS_OK) {+ if (token == NOTIFY_TOKEN_INVALID && notify_register_check("com.hakios.button.lock", &token) != NOTIFY_STATUS_OK) {token = NOTIFY_TOKEN_INVALID;return true;}@@ -616,7 +616,7 @@ lock_long_press(id self, SEL selector, id recognizer)if (state == GESTURE_BEGAN) {dropping = !lock_button_held();if (dropping) {- say("redwood: SpringBoard: a long press of the side button, which was released long ago: dropped\n");+ say("hakios: SpringBoard: a long press of the side button, which was released long ago: dropped\n");}}if (dropping) {@@ -642,18 +642,18 @@ unlock(void)if (cls == NULL || class_getClassMethod(cls, shared) == NULL || class_getInstanceMethod(cls, locked) == NULL ||class_getInstanceMethod(cls, unlock_ui) == NULL) {- say("redwood: unlock: SBLockScreenManager is not what it was\n");+ say("hakios: unlock: SBLockScreenManager is not what it was\n");return;}manager = ((id (*)(Class, SEL))objc_msgSend)(cls, shared);if (manager == NULL) {- say("redwood: unlock: no lock screen manager yet\n");+ say("hakios: unlock: no lock screen manager yet\n");} else if (!((BOOL (*)(id, SEL))objc_msgSend)(manager, locked)) {- say("redwood: unlock: not locked\n");+ say("hakios: unlock: not locked\n");} else {BOOL done = ((BOOL (*)(id, SEL, long, id))objc_msgSend)(manager, unlock_ui, UNLOCK_SOURCE_COVER_SHEET, NULL);- say("redwood: unlock: asked, answer %d\n", done);+ say("hakios: unlock: asked, answer %d\n", done);}}@@ -740,7 +740,7 @@ switcher_wallpaper_overlay(id self, SEL selector)(at = strstr(args, "switcher_wallpaper=1")) != NULL && (at == args || at[-1] == ' ');}if (told++ == 0) {- say("redwood: the switcher's wash of wallpaper is %s\n", wanted ?+ say("hakios: the switcher's wash of wallpaper is %s\n", wanted ?"drawn as iOS asks (switcher_wallpaper=1)" : "left out: there is no picture of the wallpaper for it");}if (wanted) {@@ -757,7 +757,7 @@ layer_filter(id filter, const char *what, int depth)size_t n;if (!class_respondsToSelector(object_getClass(filter), sel_registerName("type"))) {- say("redwood: layers%s: %*s %s %s\n", layers_of, 2 * depth, "", what, text_of(filter)); /* a name alone */+ say("hakios: layers%s: %*s %s %s\n", layers_of, 2 * depth, "", what, text_of(filter)); /* a name alone */return;}n = (size_t)snprintf(line, sizeof(line), "%s %s \"%s\"%s", what, text_of(SEND(id, filter, "type")),@@ -779,7 +779,7 @@ layer_filter(id filter, const char *what, int depth)n += (size_t)snprintf(line + n, sizeof(line) - n, " %s %s", inputs[i], text_of(value));}}- say("redwood: layers%s: %*s %s\n", layers_of, 2 * depth, "", line);+ say("hakios: layers%s: %*s %s\n", layers_of, 2 * depth, "", line);}static void@@ -895,7 +895,7 @@ layer_line(id layer, const char *role, int depth)text_of(SEND1(id, keys, "objectAtIndex:", long, i)));}}- say("redwood: layers%s: %*s%s%s %p \"%s\" %g,%g %gx%g opacity %g%s\n", layers_of, 2 * depth, "", role, class_name, (void *)layer,+ say("hakios: layers%s: %*s%s%s %p \"%s\" %g,%g %gx%g opacity %g%s\n", layers_of, 2 * depth, "", role, class_name, (void *)layer,text_of(SEND(id, layer, "name")), frame.x, frame.y, frame.w, frame.h, (double)SEND(float, layer, "opacity"), more);for (long i = 0; filters != NULL && i < SEND(long, filters, "count"); i++) {layer_filter(SEND1(id, filters, "objectAtIndex:", long, i), "filter", depth);@@ -933,7 +933,7 @@ web_views(id view, int depth)SEL background = sel_registerName("_isBackground"), pid = sel_registerName("_webProcessIdentifier");SEL responsive = sel_registerName("_webProcessIsResponsive");- say("redwood: layers%s: a WKWebView %p: in the background %s, web process %d, responsive %s, in a window %s, hidden %s\n",+ say("hakios: layers%s: a WKWebView %p: in the background %s, web process %d, responsive %s, in a window %s, hidden %s\n",layers_of, (void *)view, class_respondsToSelector(object_getClass(view), background) ?(SEND(BOOL, view, "_isBackground") ? "YES" : "no") : "?", class_respondsToSelector(object_getClass(view), pid) ?SEND(int, view, "_webProcessIdentifier") : -1, class_respondsToSelector(object_getClass(view), responsive) ?@@ -956,9 +956,9 @@ layers(void)id authentication = application && class_respondsToSelector(object_getClass(application),sel_registerName("authenticationController")) ? SEND(id, application, "authenticationController") : NULL;- say("redwood: layers%s: %ld windows\n", layers_of, windows ? SEND(long, windows, "count") : 0L);+ say("hakios: layers%s: %ld windows\n", layers_of, windows ? SEND(long, windows, "count") : 0L);if (authentication != NULL) {- say("redwood: layers: the user is %sauthenticated, %s passcode, the display %sin secure mode\n",+ say("hakios: layers: the user is %sauthenticated, %s passcode, the display %sin secure mode\n",SEND(BOOL, authentication, "isAuthenticated") ? "" : "NOT ", SEND(BOOL, authentication, "hasPasscodeSet") ? "a" : "no",SEND(BOOL, authentication, "inSecureDisplayMode") ? "" : "not ");}@@ -967,24 +967,24 @@ layers(void)id scene = class_respondsToSelector(object_getClass(w), sel_registerName("windowScene")) ? SEND(id, w, "windowScene") : NULL;id context = class_respondsToSelector(object_getClass(w), sel_registerName("_boundContext")) ? SEND(id, w, "_boundContext") : NULL;- say("redwood: layers%s: window %s level %g, context %#x (%ssecure, %u commits), scene %s (activation state %ld)\n",+ say("hakios: layers%s: window %s level %g, context %#x (%ssecure, %u commits), scene %s (activation state %ld)\n",layers_of, object_getClassName(w), SEND(double, w, "windowLevel"), context ? SEND(unsigned, context, "contextId") : 0,context && SEND(BOOL, context, "isSecure") ? "" : "not ", context ? (unsigned)SEND(unsigned long long, context, "commitId") : 0,scene ? text_of(SEND(id, scene, "_persistenceIdentifier")) : "none", scene ? SEND(long, scene, "activationState") : -1L);layer_line(SEND(id, w, "layer"), "", 1);}if (application != NULL) {- say("redwood: layers%s: the application's state %ld (0 active, 1 inactive, 2 in the background)\n", layers_of,+ say("hakios: layers%s: the application's state %ld (0 active, 1 inactive, 2 in the background)\n", layers_of,SEND(long, application, "applicationState"));}for (long i = 0; windows != NULL && i < SEND(long, windows, "count"); i++) {web_views(SEND1(id, windows, "objectAtIndex:", long, i), 0);}- say("redwood: layers%s: end\n", layers_of);+ say("hakios: layers%s: end\n", layers_of);}/*- * The switcher of running applications, on the notification com.redwood.switcher (rwtouch notify).+ * The switcher of running applications, on the notification com.hakios.switcher (rwtouch notify).* A drag up from the bottom edge is the way to it on a phone, but the touches a script puts in do* not reach iOS's system gestures -- nothing comes of such a drag, not even going home -- and two* presses of the home button only go home (there is no home button on a phone of this shape, and@@ -1009,11 +1009,11 @@ switcher(void)Method method = shared != NULL ? class_getInstanceMethod(object_getClass(shared), activate) : NULL;if (method == NULL) {- say("redwood: the switcher: %s has no %s\n",+ say("hakios: the switcher: %s has no %s\n",coordinator != NULL ? "SBMainSwitcherControllerCoordinator" : "nothing", sel_getName(activate));return;}- say("redwood: the switcher: opening it (%s, %s)\n", object_getClassName(shared),+ say("hakios: the switcher: opening it (%s, %s)\n", object_getClassName(shared),method_getTypeEncoding(method) != NULL ? method_getTypeEncoding(method) : "?");/** It answers whether it took the request. The source is an analytics label and not every one@@ -1026,7 +1026,7 @@ switcher(void)for (long source = 0; source < 10; source++) {BOOL taken = ((BOOL (*)(id, SEL, long, BOOL))objc_msgSend)(shared, activate, source, NO);- say("redwood: the switcher: from source %ld: %s\n", source, taken ? "taken" : "refused");+ say("hakios: the switcher: from source %ld: %s\n", source, taken ? "taken" : "refused");if (taken) {return;}@@ -1088,7 +1088,7 @@ add_animation_cc(id self, SEL selector, id animation, id key)SEND1(void, fade, "setDuration:", double, cc_fade_s);SEND1(void, fade, "setTimingFunction:", id, ease);if (cc_fades++ < 3) {- say("redwood: Control Center: an opacity animation of %.3f s (%s) made a fade of %.3f s\n",+ say("hakios: Control Center: an opacity animation of %.3f s (%s) made a fade of %.3f s\n",SEND(double, animation, "duration"), object_getClassName(animation), cc_fade_s);}animation = fade;@@ -1116,7 +1116,7 @@ control_center_fades(const char *arguments)* Open the tweak loader of the package manager's prefix, when there is one. Nothing here depends on* it: without a prefix (or without ElleKit in it) the file is not there and this does nothing.*/-#define REDWOOD_TWEAK_LOADER "/redwood/lib/libredwood-tweaks.dylib"+#define HAKIOS_TWEAK_LOADER "/redwood/lib/libhakios.tweaks.dylib"static voidload_tweaks(void)@@ -1126,16 +1126,16 @@ load_tweaks(void)if (stat("/var/jb/usr/lib/TweakInject", &st) != 0) {return; /* no package manager's prefix here, so no tweaks */}- if (dlopen(REDWOOD_TWEAK_LOADER, RTLD_NOW | RTLD_GLOBAL) == NULL) {- say("redwood: the tweak loader %s: %s\n", REDWOOD_TWEAK_LOADER, dlerror());+ if (dlopen(HAKIOS_TWEAK_LOADER, RTLD_NOW | RTLD_GLOBAL) == NULL) {+ say("hakios: the tweak loader %s: %s\n", HAKIOS_TWEAK_LOADER, dlerror());} else {- say("redwood: tweaks: %s opened\n", REDWOOD_TWEAK_LOADER);+ say("hakios: tweaks: %s opened\n", HAKIOS_TWEAK_LOADER);}}__attribute__((constructor))static void-redwood_springboard_init(void)+hakios_springboard_init(void){const char *name = getprogname();size_t length = 0;@@ -1153,8 +1153,8 @@ redwood_springboard_init(void)if ((say_fd = open("/dev/console", O_WRONLY | O_NOCTTY)) < 0) {say_fd = 2;}- say("redwood: in %s[%d]: its layers are said on the notification com.redwood.layers\n", name, getpid());- notify_register_dispatch("com.redwood.layers", &token, dispatch_get_main_queue(), ^(__unused int t) {+ say("hakios: in %s[%d]: its layers are said on the notification com.hakios.layers\n", name, getpid());+ notify_register_dispatch("com.hakios.layers", &token, dispatch_get_main_queue(), ^(__unused int t) {layers();});return;@@ -1201,15 +1201,15 @@ redwood_springboard_init(void)0x1c48c2cf4UL, (IMP)ring_charging_level);battery_lvl = (IMP)original_battery_level;battery_st = (IMP)original_battery_state;- say("redwood: SpringBoard: activation %s, setup assistant %s, application snapshots %s, the side button's long press %s, "+ say("hakios: SpringBoard: activation %s, setup assistant %s, application snapshots %s, the side button's long press %s, ""battery level %s, battery state %s, poster switcher %s\n",activation ? "answered here" : "NOT replaced", original_set_setup_required_reason ? "refused" : "NOT replaced",snapshot_format ? "as JPEG" : "NOT changed", original_lock_long_press ? "checked" : "NOT checked",battery_lvl ? "from QG" : "NOT replaced", battery_st ? "from QG" : "NOT replaced",poster_switcher ? "not offered" : "NOT withheld");/*- * Cellular, a survey first (the modem's bars come from the kernel: sysctl kern.redwood.cellular_*,- * bsd/dev/redwood_mpss.c): where UIKit makes the status bar's cellular entry from the raw data,+ * Cellular, a survey first (the modem's bars come from the kernel: sysctl kern.hakios.cellular_*,+ * bsd/dev/hakios.mpss.c): where UIKit makes the status bar's cellular entry from the raw data,* and with which signature -- said in the log with the unslid address, for the hook to come.*/{@@ -1224,23 +1224,23 @@ redwood_springboard_init(void)Method minus = cls ? class_getInstanceMethod(cls, sel_registerName(selector)) : NULL;if (plus) {- say("redwood: cellular: +[%s %s] at %#lx, types \"%s\"\n", classes[c], selector,+ say("hakios: cellular: +[%s %s] at %#lx, types \"%s\"\n", classes[c], selector,(uintptr_t)method_getImplementation(plus) - slide, method_getTypeEncoding(plus));}if (minus) {- say("redwood: cellular: -[%s %s] at %#lx, types \"%s\"\n", classes[c], selector,+ say("hakios: cellular: -[%s %s] at %#lx, types \"%s\"\n", classes[c], selector,(uintptr_t)method_getImplementation(minus) - slide, method_getTypeEncoding(minus));}if (cls && !plus && !minus) {- say("redwood: cellular: %s has no such method\n", classes[c]);+ say("hakios: cellular: %s has no such method\n", classes[c]);}}- say("redwood: cellular: the kernel says up=%d registered=%d bars=%d dbm=%d radio=%d\n", sysctl_int("kern.redwood.cellular_up"),- sysctl_int("kern.redwood.cellular_registered"), sysctl_int("kern.redwood.cellular_bars"),- sysctl_int("kern.redwood.cellular_dbm"), sysctl_int("kern.redwood.cellular_radio"));+ say("hakios: cellular: the kernel says up=%d registered=%d bars=%d dbm=%d radio=%d\n", sysctl_int("kern.hakios.cellular_up"),+ sysctl_int("kern.hakios.cellular_registered"), sysctl_int("kern.hakios.cellular_bars"),+ sysctl_int("kern.hakios.cellular_dbm"), sysctl_int("kern.hakios.cellular_radio"));}cellular_hook();- say("redwood: battery UI: shows%% %s, set-shows%% %s, bolt %s, chargePercent %s, setChargePercent %s, lockscreen ring %s\n",+ say("hakios: battery UI: shows%% %s, set-shows%% %s, bolt %s, chargePercent %s, setChargePercent %s, lockscreen ring %s\n",original_battery_view_shows_percentage ? "ok" : "NO",original_battery_view_set_shows_percentage ? "ok" : "NO",original_battery_view_should_show_bolt ? "ok" : "NO",@@ -1280,18 +1280,18 @@ redwood_springboard_init(void)control_center_fades(arguments);}}- say("redwood: battery: SOC=%d%% battery=%d charger=%d charging=%d\n",- sysctl_int("kern.redwood.battery_soc"), sysctl_int("kern.redwood.battery_present"),- sysctl_int("kern.redwood.battery_charger_present"), sysctl_int("kern.redwood.battery_charging"));+ say("hakios: battery: SOC=%d%% battery=%d charger=%d charging=%d\n",+ sysctl_int("kern.hakios.battery_soc"), sysctl_int("kern.hakios.battery_present"),+ sysctl_int("kern.hakios.battery_charger_present"), sysctl_int("kern.hakios.battery_charging"));battery_post_notifications();});- notify_register_dispatch("com.redwood.unlock", &token, dispatch_get_main_queue(), ^(__unused int t) {+ notify_register_dispatch("com.hakios.unlock", &token, dispatch_get_main_queue(), ^(__unused int t) {unlock();});- notify_register_dispatch("com.redwood.layers", &token, dispatch_get_main_queue(), ^(__unused int t) {+ notify_register_dispatch("com.hakios.layers", &token, dispatch_get_main_queue(), ^(__unused int t) {layers();});- notify_register_dispatch("com.redwood.switcher", &token, dispatch_get_main_queue(), ^(__unused int t) {+ notify_register_dispatch("com.hakios.switcher", &token, dispatch_get_main_queue(), ^(__unused int t) {switcher();});/*@@ -1312,7 +1312,7 @@ redwood_springboard_init(void)if (sysctlbyname("kern.bootargs", args, &size, NULL, 0) == 0 && (arg = strstr(args, "autounlock=0")) != NULL &&(arg == args || arg[-1] == ' ')) {- say("redwood: the lock screen stays until it is swiped away (autounlock=0)\n");+ say("hakios: the lock screen stays until it is swiped away (autounlock=0)\n");return;}}diff --git a/userland/src/inject_store.c b/userland/src/inject_store.cindex a5101cc..eb46105 100644--- a/userland/src/inject_store.c+++ b/userland/src/inject_store.c@@ -1,5 +1,5 @@/*- * libredwood-store.dylib: code of ours inside appstored (see inject.c for how it gets there).+ * libhakios.store.dylib: code of ours inside appstored (see inject.c for how it gets there).** What it is for. The App Store opens and shows LOADING for ever. The front page is a "bag" --* AppleMediaServices' configuration -- and AMS will not load one until it knows the storefront, the@@ -243,10 +243,10 @@ say(const char *format, ...)* report read by position belongs to whichever process happened to be writing -- the lines are* interleaved, not grouped. Every line names its own program instead.*/- if (strncmp(line, "redwood: store: ", 16) == 0) {+ if (strncmp(line, "hakios: store: ", 16) == 0) {char named[sizeof(line) + 32];- n = snprintf(named, sizeof(named), "redwood: %s: %s", who, line + 16);+ n = snprintf(named, sizeof(named), "hakios: %s: %s", who, line + 16);if (n > (int)sizeof(named) - 1) {n = sizeof(named) - 1;}@@ -279,7 +279,7 @@ step_in(int which)unsigned n = __sync_add_and_fetch(&serial, 1);entered[which]++;- say("redwood: store: -> #%u %s\n", n, counted[which]);+ say("hakios: store: -> #%u %s\n", n, counted[which]);return n;}@@ -287,7 +287,7 @@ static voidstep_out(int which, unsigned n, bool got_something){returned[which]++;- say("redwood: store: <- #%u %s%s\n", n, counted[which], got_something ? "" : " (nil)");+ say("hakios: store: <- #%u %s%s\n", n, counted[which], got_something ? "" : " (nil)");}/*@@ -344,7 +344,7 @@ dump_tasks(void){static const char *const states[] = { "running", "suspended", "cancelling", "COMPLETED" };- say("redwood: store: %u tasks resumed\n", task_count);+ say("hakios: store: %u tasks resumed\n", task_count);for (unsigned i = 0; i < task_count; i++) {id task = tasks[i];long state = ((long (*)(id, SEL))objc_msgSend)(task, sel_registerName("state"));@@ -357,7 +357,7 @@ dump_tasks(void)id type = response != NULL ? ((id (*)(id, SEL))objc_msgSend)(response, sel_registerName("MIMEType")) : NULL;char one[96], two[64], three[200];- say("redwood: store: task %u %s status %ld, %lld bytes, %s%s%s, %s\n", i,+ say("hakios: store: task %u %s status %ld, %lld bytes, %s%s%s, %s\n", i,state >= 0 && state < 4 ? states[state] : "?", status, got,type != NULL ? text_of(type, one, sizeof(one)) : "(no type)",error != NULL ? ", error " : "", error != NULL ? text_of(error, two, sizeof(two)) : "",@@ -384,10 +384,10 @@ dump_tasks(void)* engine is alive and posting.* AND THE READER IS PLAINLY HAPPY. With the counters printed on their own line, early, instead of as* one line of a sixty-line report:- * redwood: AppStore: JETPACK processStream: in- * redwood: AppStore: JETPACK processStream: out, a result, error (none)- * redwood: AppStore: KEY brotli entered 0 returned 0, processStream entered 2 returned 2- * redwood: appstored: KEY brotli entered 0 returned 0, processStream entered 0 returned 0+ * hakios: AppStore: JETPACK processStream: in+ * hakios: AppStore: JETPACK processStream: out, a result, error (none)+ * hakios: AppStore: KEY brotli entered 0 returned 0, processStream entered 2 returned 2+ * hakios: appstored: KEY brotli entered 0 returned 0, processStream entered 0 returned 0* -[JPReader processStream:signatureVerifier:options:error:] is entered twice -- once per fetch --* and both times it RETURNS A RESULT WITH NO ERROR. So the page is fetched whole and parsed without* complaint: it is not the signature, not the package format, and not Brotli (which never runs at@@ -478,7 +478,7 @@ new_brotli(id self, SEL cmd, void *a, void *b, void *c, void *d)result = old_brotli(self, cmd, a, b, c, d);returned[COUNT_brotli]++;if (returned[COUNT_brotli] <= 4 || result != 1) {- say("redwood: store: BROTLI decompressStream -> %ld (call %lu)\n", result, returned[COUNT_brotli]);+ say("hakios: store: BROTLI decompressStream -> %ld (call %lu)\n", result, returned[COUNT_brotli]);}return result;}@@ -519,7 +519,7 @@ new_dataTaskLocal(id self, SEL cmd, void *request, void *handler)entered[COUNT_dataTaskCreated]++;task = ((id (*)(id, SEL, void *, void *))old_dataTaskLocal)(self, cmd, request, handler);returned[COUNT_dataTaskCreated]++;- say("redwood: store: TASK CREATED %s\n", text_of((id)request, buffer, sizeof(buffer)));+ say("hakios: store: TASK CREATED %s\n", text_of((id)request, buffer, sizeof(buffer)));return task;}@@ -539,7 +539,7 @@ new_dataTaskAMS(id self, SEL cmd, void *request, void *handler)entered[COUNT_dataTaskCreated]++;task = ((id (*)(id, SEL, void *, void *))old_dataTaskAMS)(self, cmd, request, handler);returned[COUNT_dataTaskCreated]++;- say("redwood: store: TASK CREATED (ams session) %s\n", text_of((id)request, buffer, sizeof(buffer)));+ say("hakios: store: TASK CREATED (ams session) %s\n", text_of((id)request, buffer, sizeof(buffer)));return task;}@@ -553,7 +553,7 @@ new_dataTaskURL(id self, SEL cmd, void *url, void *handler)entered[COUNT_dataTaskCreated]++;task = ((id (*)(id, SEL, void *, void *))old_dataTaskURL)(self, cmd, url, handler);returned[COUNT_dataTaskCreated]++;- say("redwood: store: TASK CREATED (url) %s\n", text_of((id)url, buffer, sizeof(buffer)));+ say("hakios: store: TASK CREATED (url) %s\n", text_of((id)url, buffer, sizeof(buffer)));return task;}@@ -568,7 +568,7 @@ new_dataTaskSignpost(id self, SEL cmd, void *request, void *signpost, void *handentered[COUNT_dataTaskCreated]++;task = ((id (*)(id, SEL, void *, void *, void *))old_dataTaskSignpost)(self, cmd, request, signpost, handler);returned[COUNT_dataTaskCreated]++;- say("redwood: store: TASK CREATED (ams) %s\n", text_of((id)request, buffer, sizeof(buffer)));+ say("hakios: store: TASK CREATED (ams) %s\n", text_of((id)request, buffer, sizeof(buffer)));return task;}@@ -582,7 +582,7 @@ new_dataTaskPlain(id self, SEL cmd, void *request)entered[COUNT_dataTaskCreated]++;task = ((id (*)(id, SEL, void *))old_dataTaskPlain)(self, cmd, request);returned[COUNT_dataTaskCreated]++;- say("redwood: store: TASK CREATED (no handler) %s\n", text_of((id)request, buffer, sizeof(buffer)));+ say("hakios: store: TASK CREATED (no handler) %s\n", text_of((id)request, buffer, sizeof(buffer)));return task;}@@ -602,11 +602,11 @@ dump_classes(const char *needle)if (name != NULL && strstr(name, needle) != NULL) {shown++;- say("redwood: store: class %s\n", name);+ say("hakios: store: class %s\n", name);}}free(classes);- say("redwood: store: %u classes in all, %u named like \"%s\"\n", count, shown, needle);+ say("hakios: store: %u classes in all, %u named like \"%s\"\n", count, shown, needle);}/*@@ -632,7 +632,7 @@ new_updateStorefront(id self, SEL cmd, void *account)(void)account;entered[COUNT_updateStorefront]++;returned[COUNT_updateStorefront]++;- say("redwood: store: INJECTED _updateStorefrontInLocalAccount: answered at once, no update\n");+ say("hakios: store: INJECTED _updateStorefrontInLocalAccount: answered at once, no update\n");return (void *)((id (*)(id, SEL))objc_msgSend)(self, sel_registerName("ams_localiTunesAccount"));}@@ -648,7 +648,7 @@ new_addCookiesBlocking(id self, SEL cmd, void *account, void *client, void *bag,(void)cleanup;entered[COUNT_addCookiesBlocking]++;returned[COUNT_addCookiesBlocking]++;- say("redwood: store: INJECTED ams_addCookiesForAccount:...:cleanupGlobalCookies: answered with "+ say("hakios: store: INJECTED ams_addCookiesForAccount:...:cleanupGlobalCookies: answered with ""NO COOKIES (not measured; the real one waits for ever on amsaccountsd)\n");return NULL;}@@ -675,7 +675,7 @@ new_processStream(id self, SEL cmd, void *stream, void *verifier, void *options,char one[200];entered[COUNT_processStream]++;- say("redwood: store: JETPACK processStream: in\n");+ say("hakios: store: JETPACK processStream: in\n");result = old_processStream(self, cmd, stream, verifier, options, error);returned[COUNT_processStream]++;{@@ -683,7 +683,7 @@ new_processStream(id self, SEL cmd, void *stream, void *verifier, void *options,char frames[10 * 20 + 1] = "";frames_from((uintptr_t)__builtin_frame_address(0), frames, sizeof(frames));- say("redwood: store: JETPACK processStream: out, %s, error %s, to%s\n",+ say("hakios: store: JETPACK processStream: out, %s, error %s, to%s\n",result != NULL ? "a result" : "(nil)",error != NULL && *error != NULL ? text_of(*error, one, sizeof(one)) : "(none)", frames);}@@ -695,7 +695,7 @@ new_processStream(id self, SEL cmd, void *stream, void *verifier, void *options,* MEASURES. There was an interpose on __cxa_throw here, to see every C++ exception by name. It* answered its question -- std::future_error is AMSPromise being deallocated, see above -- and then,* when it was trimmed to print only the first few and count the rest, both daemons began to die:- * redwood: appstored: signal 6 ... called from _abort, demangling_terminate_handler,+ * hakios: appstored: signal 6 ... called from _abort, demangling_terminate_handler,* _objc_terminate, std::__terminate* which is an exception reaching std::terminate instead of its handler. appstored went from one* start a session to eight, each ending in SIGABRT, and the App Store with it. The runs before that@@ -731,7 +731,7 @@ new_postName(id self, SEL cmd, id name, id object, id info)notifications++;if (interesting_name(text)) {- say("redwood: store: NOTIFICATION %s\n", text);+ say("hakios: store: NOTIFICATION %s\n", text);}return old_postName(self, cmd, name, object, info);}@@ -746,7 +746,7 @@ new_postNotification(id self, SEL cmd, id note)notifications++;if (interesting_name(text)) {- say("redwood: store: NOTIFICATION (object) %s\n", text);+ say("hakios: store: NOTIFICATION (object) %s\n", text);}return old_postNotification(self, cmd, note);}@@ -799,9 +799,9 @@ note_error(id domain, long code)static voiddump_errors(void){- say("redwood: store: %u kinds of error made\n", error_count);+ say("hakios: store: %u kinds of error made\n", error_count);for (unsigned i = 0; i < error_count; i++) {- say("redwood: store: error %-40s code %ld, %u time(s)\n", errors[i].domain, errors[i].code,+ say("hakios: store: error %-40s code %ld, %u time(s)\n", errors[i].domain, errors[i].code,errors[i].count);}}@@ -866,9 +866,9 @@ note_bagkey(const char *key, bool answered)static voiddump_bagkeys(void){- say("redwood: store: %u bag keys asked for\n", bagkey_count);+ say("hakios: store: %u bag keys asked for\n", bagkey_count);for (unsigned i = 0; i < bagkey_count; i++) {- say("redwood: store: bag key %-44s asked %u, answered %u%s\n", bagkeys[i].key, bagkeys[i].asked,+ say("hakios: store: bag key %-44s asked %u, answered %u%s\n", bagkeys[i].key, bagkeys[i].asked,bagkeys[i].answered, bagkeys[i].answered == 0 ? " <-- THE BAG HAS NOT GOT IT" : "");}}@@ -964,11 +964,11 @@ note_label(void *promise, const char *label, const char *frames)static voiddump_promises(void){- say("redwood: store: %u promises seen\n", promise_count);+ say("hakios: store: %u promises seen\n", promise_count);for (unsigned i = 0; i < promise_count; i++) {struct promise_note *note = &promises[i];- say("redwood: store: promise %p %-16s waiters %2u sync %u finished %u%s tid %llu seen from%s\n",+ say("hakios: store: promise %p %-16s waiters %2u sync %u finished %u%s tid %llu seen from%s\n",note->promise, note->label != NULL ? note->label : "", note->waiters, note->sync_waiters,note->finished,note->finished == 0 && note->sync_waiters > 0 ? " <-- NOBODY FULFILS IT" : "",@@ -994,10 +994,10 @@ dump_threads(void)mach_port_t me = mach_task_self();if (task_threads(me, &threads, &count) != KERN_SUCCESS) {- say("redwood: store: task_threads() refused\n");+ say("hakios: store: task_threads() refused\n");return;}- say("redwood: store: %u threads\n", count);+ say("hakios: store: %u threads\n", count);for (unsigned i = 0; i < count; i++) {arm_thread_state64_t state;mach_msg_type_number_t state_count = ARM_THREAD_STATE64_COUNT;@@ -1011,11 +1011,11 @@ dump_threads(void)suspend = basic.suspend_count;}if (thread_get_state(threads[i], ARM_THREAD_STATE64, (thread_state_t)&state, &state_count) != KERN_SUCCESS) {- say("redwood: store: thread %u: no state (run %d)\n", i, run_state);+ say("hakios: store: thread %u: no state (run %d)\n", i, run_state);continue;}frames_from((uintptr_t)arm_thread_state64_get_fp(state), text, sizeof(text));- say("redwood: store: thread %u: run %d suspend %d pc %#lx lr %#lx from%s\n", i, run_state, suspend,+ say("hakios: store: thread %u: run %d suspend %d pc %#lx lr %#lx from%s\n", i, run_state, suspend,(uintptr_t)arm_thread_state64_get_pc(state) - slide,(uintptr_t)arm_thread_state64_get_lr(state) - slide, text);}@@ -1038,7 +1038,7 @@ say_the_fault(int signal_number, siginfo_t *info, void *context_in)fp = (uintptr_t)context->uc_mcontext->__ss.__fp;}frames_from(fp, frames, sizeof(frames));- say("redwood: store: signal %d at %p, pc %#lx, lr %#lx, called from%s (unslid)\n", signal_number,+ say("hakios: store: signal %d at %p, pc %#lx, lr %#lx, called from%s (unslid)\n", signal_number,info != NULL ? info->si_addr : NULL, pc - slide, lr - slide, frames);signal(signal_number, SIG_DFL);raise(signal_number);@@ -1091,7 +1091,7 @@ new_ams_storefront(id self, SEL _cmd)char buffer[128];said = true;- say("redwood: store: ams_storefront was %s, now " STOREFRONT "\n", text_of(was, buffer, sizeof(buffer)));+ say("hakios: store: ams_storefront was %s, now " STOREFRONT "\n", text_of(was, buffer, sizeof(buffer)));}returned[COUNT_ams_storefront]++;return was != NULL ? was : (id)storefront;@@ -1103,7 +1103,7 @@ new_cached_storefront(id self, SEL _cmd)entered[COUNT_cachedStorefront]++;id was = old_cached_storefront != NULL ? old_cached_storefront(self, _cmd) : NULL;- say("redwood: store: cachedStorefront was %s\n", was != NULL ? "set" : "(nil), now " STOREFRONT);+ say("hakios: store: cachedStorefront was %s\n", was != NULL ? "set" : "(nil), now " STOREFRONT);returned[COUNT_cachedStorefront]++;return was != NULL ? was : (id)storefront;}@@ -1115,7 +1115,7 @@ new_bag_storefront(id self, SEL _cmd, id media_type)id was = old_bag_storefront != NULL ? old_bag_storefront(self, _cmd, media_type) : NULL;char buffer[128];- say("redwood: store: bagStorefrontForAccountMediaType:%s was %s\n", text_of(media_type, buffer, sizeof(buffer)),+ say("hakios: store: bagStorefrontForAccountMediaType:%s was %s\n", text_of(media_type, buffer, sizeof(buffer)),was != NULL ? "set" : "(nil), now " STOREFRONT);returned[COUNT_bagStorefront_fixed]++;return was != NULL ? was : (id)storefront;@@ -1128,7 +1128,7 @@ new_bag_storefront_active(id self, SEL _cmd, id media_type)id was = old_bag_storefront_active != NULL ? old_bag_storefront_active(self, _cmd, media_type) : NULL;char buffer[128];- say("redwood: store: active bagStorefrontForAccountMediaType:%s was %s\n",+ say("hakios: store: active bagStorefrontForAccountMediaType:%s was %s\n",text_of(media_type, buffer, sizeof(buffer)), was != NULL ? "set" : "(nil), now " STOREFRONT);returned[COUNT_bagStorefront_active]++;return was != NULL ? was : (id)storefront;@@ -1140,7 +1140,7 @@ new_copy_storefront(id self, SEL _cmd, id account)entered[COUNT_copyStorefront]++;id was = old_copy_storefront != NULL ? old_copy_storefront(self, _cmd, account) : NULL;- say("redwood: store: ams_copyStorefrontFromAccount: was %s\n",+ say("hakios: store: ams_copyStorefrontFromAccount: was %s\n",was != NULL ? "set" : "(nil), now " STOREFRONT);returned[COUNT_copyStorefront]++;return was != NULL ? was : (id)storefront;@@ -1155,7 +1155,7 @@ new_bag_account(id self, SEL _cmd, id media_type, bool must_contain_storefront)returned[COUNT_bagAccount]++;char one[128], two[192];- say("redwood: store: _bagAccountForAccountMediaType:%s mustContainStorefront:%d -> %s\n",+ say("hakios: store: _bagAccountForAccountMediaType:%s mustContainStorefront:%d -> %s\n",text_of(media_type, one, sizeof(one)), must_contain_storefront ? 1 : 0, text_of(account, two, sizeof(two)));return account;}@@ -1170,18 +1170,18 @@ new_perform_fetch(id self, SEL _cmd, long attempt, id account, id front)id promise;- say("redwood: store: BAG FETCH attempt %ld, storefront %s, account %s\n", attempt,+ say("hakios: store: BAG FETCH attempt %ld, storefront %s, account %s\n", attempt,text_of(front, two, sizeof(two)), text_of(account, one, sizeof(one)));for (size_t i = 0; i < replacement_count(); i++) {if (!replacements[i].done) {- say("redwood: store: NOT TAKEN %c[%s %s]\n", replacements[i].class_method ? '+' : '-',+ say("hakios: store: NOT TAKEN %c[%s %s]\n", replacements[i].class_method ? '+' : '-',replacements[i].class_name, replacements[i].selector);}}promise = old_perform_fetch(self, _cmd, attempt, account, front);returned[COUNT_performFetch]++;note_label(promise, "THE BAG FETCH", NULL);- say("redwood: store: BAG FETCH returned %s\n", promise != NULL ? "a promise" : "(nil)");+ say("hakios: store: BAG FETCH returned %s\n", promise != NULL ? "a promise" : "(nil)");return promise;}@@ -1192,7 +1192,7 @@ new_query_items(id self, SEL _cmd, id client, id profile, id version, id cookiesid items = old_query_items(self, _cmd, client, profile, version, cookies, account, front);char one[64], two[160];- say("redwood: store: BAG QUERY profile %s, storefront %s -> %s\n", text_of(profile, one, sizeof(one)),+ say("hakios: store: BAG QUERY profile %s, storefront %s -> %s\n", text_of(profile, one, sizeof(one)),text_of(front, two, sizeof(two)), items != NULL ? "items" : "(nil)");return items;}@@ -1204,7 +1204,7 @@ new_perform_request(id self, SEL _cmd, id request, id completion)entered[COUNT_performRequest]++;char buffer[320];- say("redwood: store: AMSURLSession performRequest:completion: %s\n", text_of(request, buffer, sizeof(buffer)));+ say("hakios: store: AMSURLSession performRequest:completion: %s\n", text_of(request, buffer, sizeof(buffer)));return old_perform_request(self, _cmd, request, completion);}@@ -1214,7 +1214,7 @@ new_perform_request_block(id self, SEL _cmd, id request, id completion)entered[COUNT_performRequestBlock]++;char buffer[320];- say("redwood: store: AMSURLSession performRequest:completionBlock: %s\n", text_of(request, buffer, sizeof(buffer)));+ say("hakios: store: AMSURLSession performRequest:completionBlock: %s\n", text_of(request, buffer, sizeof(buffer)));return old_perform_request_block(self, _cmd, request, completion);}@@ -1229,7 +1229,7 @@ say_resume(id task, const char *where)char buffer[320];id request = ((id (*)(id, SEL))objc_msgSend)(task, sel_registerName("originalRequest"));- say("redwood: store: TASK RESUME (%s) %s\n", where, text_of(request, buffer, sizeof(buffer)));+ say("hakios: store: TASK RESUME (%s) %s\n", where, text_of(request, buffer, sizeof(buffer)));}static void@@ -1264,14 +1264,14 @@ dump_selectors(const char *class_name, const char *needle)Method *methods = cls != NULL ? class_copyMethodList(cls, &count) : NULL;if (methods == NULL) {- say("redwood: store: %s: no such class\n", class_name);+ say("hakios: store: %s: no such class\n", class_name);return;}for (unsigned i = 0; i < count; i++) {const char *name = sel_getName(method_getName(methods[i]));if (needle == NULL || strstr(name, needle) != NULL) {- say("redwood: store: %s has -%s\n", class_name, name);+ say("hakios: store: %s has -%s\n", class_name, name);}}free(methods);@@ -1282,19 +1282,19 @@ one_report(unsigned seconds){bool first = seconds <= 15;- say("redwood: store(%s): report at %u s\n", who, seconds);+ say("hakios: store(%s): report at %u s\n", who, seconds);image_added(NULL, 0); /* and try again for anything whose class has turned up since *//** These two on their own, before the long report: last time the brotli counter was one line of* sixty and it went missing, and a missing line is what this branch has been wrong about five* times. A number that matters does not travel in a crowd.*/- say("redwood: store: KEY brotli entered %lu returned %lu, processStream entered %lu returned %lu\n",+ say("hakios: store: KEY brotli entered %lu returned %lu, processStream entered %lu returned %lu\n",entered[COUNT_brotli], returned[COUNT_brotli], entered[COUNT_processStream], returned[COUNT_processStream]);for (size_t i = 0; i < replacement_count(); i++) {if (!replacements[i].done) {- say("redwood: store: NOT TAKEN %c[%s %s]\n", replacements[i].class_method ? '+' : '-',+ say("hakios: store: NOT TAKEN %c[%s %s]\n", replacements[i].class_method ? '+' : '-',replacements[i].class_name, replacements[i].selector);}}@@ -1306,7 +1306,7 @@ one_report(unsigned seconds)* ams_addCookiesForAccount:clientInfo:bag:cleanupGlobalCookies: instead. Hooked and never* entered can mean the hook is wrong, not the code.*/- say("redwood: store: entered %4lu returned %4lu %s%s\n", entered[i], returned[i], counted[i],+ say("hakios: store: entered %4lu returned %4lu %s%s\n", entered[i], returned[i], counted[i],entered[i] > returned[i] ? " <-- STILL IN IT" :entered[i] == 0 ? " <-- NEVER ENTERED: suspect the hook, not the code" : "");}@@ -1324,7 +1324,7 @@ one_report(unsigned seconds)dump_classes("Jet");dump_classes("JE");}- say("redwood: store: %lu notifications posted\n", notifications);+ say("hakios: store: %lu notifications posted\n", notifications);}/*@@ -1367,7 +1367,7 @@ new_create_request(id self, SEL _cmd, id items)entered[COUNT_createRequest]++;request = old_create_request(self, _cmd, items);returned[COUNT_createRequest]++;- say("redwood: store: STEP _createRequestWithQueryItems: -> %s\n", text_of(request, buffer, sizeof(buffer)));+ say("hakios: store: STEP _createRequestWithQueryItems: -> %s\n", text_of(request, buffer, sizeof(buffer)));note_label(request, "THE BAG REQUEST", NULL);return request;}@@ -1381,7 +1381,7 @@ new_session_promise(id self, SEL _cmd)entered[COUNT_sessionPromise]++;promise = old_session_promise(self, _cmd);returned[COUNT_sessionPromise]++;- say("redwood: store: STEP URLSessionPromise -> %s\n", text_of(promise, buffer, sizeof(buffer)));+ say("hakios: store: STEP URLSessionPromise -> %s\n", text_of(promise, buffer, sizeof(buffer)));return promise;}@@ -1394,7 +1394,7 @@ new_data_task_promise(id self, SEL _cmd, id request)entered[COUNT_dataTaskPromise]++;promise = old_data_task_promise(self, _cmd, request);returned[COUNT_dataTaskPromise]++;- say("redwood: store: STEP dataTaskPromiseWithRequest: -> %s\n", text_of(promise, buffer, sizeof(buffer)));+ say("hakios: store: STEP dataTaskPromiseWithRequest: -> %s\n", text_of(promise, buffer, sizeof(buffer)));return promise;}@@ -1407,7 +1407,7 @@ new_data_task(id self, SEL _cmd, id request)entered[COUNT_dataTask]++;task = old_data_task(self, _cmd, request);returned[COUNT_dataTask]++;- say("redwood: store: STEP dataTaskWithRequest: -> %s\n", text_of(task, buffer, sizeof(buffer)));+ say("hakios: store: STEP dataTaskWithRequest: -> %s\n", text_of(task, buffer, sizeof(buffer)));return task;}@@ -1450,7 +1450,7 @@ new_##name(id self, SEL cmd, void *a) \{ \unsigned n = step_in(COUNT_##name); \void *result = old_##name(self, cmd, a); \- say("redwood: store: #%u is for promise %p\n", n, (void *)self); \+ say("hakios: store: #%u is for promise %p\n", n, (void *)self); \step_out(COUNT_##name, n, result != NULL); \return result; \}@@ -1517,7 +1517,7 @@ new_fpDeviceType(id self, SEL _cmd)(void)_cmd;entered[COUNT_fpDeviceType]++;returned[COUNT_fpDeviceType]++;- say("redwood: store: FairPlay device type answered INJECTED \"" FAIRPLAY_DEVICE_TYPE "\" "+ say("hakios: store: FairPlay device type answered INJECTED \"" FAIRPLAY_DEVICE_TYPE "\" ""(not measured; the real one blocks for ever, see src/inject_fairplay.c)\n");return (id)fairplay_device_type;}@@ -1548,7 +1548,7 @@ new_afterUpdating(id self, SEL cmd, void *storefront)entered[COUNT_afterUpdating]++;account = ((id (*)(id, SEL))objc_msgSend)(self, sel_registerName("ams_localiTunesAccount"));returned[COUNT_afterUpdating]++;- say("redwood: store: _ams_localiTunesAccountAfterUpdatingStorefront: answered at once, %s\n",+ say("hakios: store: _ams_localiTunesAccountAfterUpdatingStorefront: answered at once, %s\n",account != NULL ? "with the local account" : "with nothing");return account;}@@ -1779,7 +1779,7 @@ image_added(__unused const struct mach_header *header, __unused intptr_t image_sif (super != NULL && method == (r->class_method ? class_getClassMethod(super, selector) :class_getInstanceMethod(super, selector))) {r->done = true;- say("redwood: store: %c[%s %s] is inherited, not this class's: left alone\n",+ say("hakios: store: %c[%s %s] is inherited, not this class's: left alone\n",r->class_method ? '+' : '-', r->class_name, r->selector);continue;}@@ -1789,14 +1789,14 @@ image_added(__unused const struct mach_header *header, __unused intptr_t image_s*r->original = original;}method_setImplementation(method, r->replacement);- say("redwood: store: %c[%s %s] taken (was %#lx unslid)\n", r->class_method ? '+' : '-', r->class_name,+ say("hakios: store: %c[%s %s] taken (was %#lx unslid)\n", r->class_method ? '+' : '-', r->class_name,r->selector, (uintptr_t)original - slide);}}__attribute__((constructor))static void-redwood_store_init(void)+hakios_store_init(void){const char *name = getprogname();size_t length = 0;@@ -1815,7 +1815,7 @@ redwood_store_init(void)storefront = CFStringCreateWithCString(NULL, STOREFRONT, kCFStringEncodingUTF8);fairplay_device_type = CFStringCreateWithCString(NULL, FAIRPLAY_DEVICE_TYPE, kCFStringEncodingUTF8);who = name;- say("redwood: store(%s): ours is in, storefront to answer with is " STOREFRONT "\n", name);+ say("hakios: store(%s): ours is in, storefront to answer with is " STOREFRONT "\n", name);{pthread_t thread;diff --git a/userland/src/inject_tweaks.c b/userland/src/inject_tweaks.cindex 6580755..af6e9b8 100644--- a/userland/src/inject_tweaks.c+++ b/userland/src/inject_tweaks.c@@ -1,5 +1,5 @@/*- * libredwood-tweaks.dylib: the tweak loader of this port.+ * libhakios.tweaks.dylib: the tweak loader of this port.** A tweak is a dylib that a package manager put in /var/jb/usr/lib/TweakInject, beside a property* list of the same name whose Filter says which programs it belongs in. Something has to be inside@@ -177,7 +177,7 @@ wanted_here(const char *path, const char *name, const char *identifier)if (plist != NULL) {CFRelease(plist);}- say("redwood: tweaks: %s is not a property list\n", path);+ say("hakios: tweaks: %s is not a property list\n", path);return false;}filter_key = CFSTR("Filter");@@ -246,22 +246,22 @@ load_the_tweaks(void)tried++;if (dlopen(dylib, RTLD_NOW | RTLD_GLOBAL) != NULL) {opened++;- say("redwood: tweaks: %s\n", dylib);+ say("hakios: tweaks: %s\n", dylib);} else {- say("redwood: tweaks: %s: %s\n", dylib, dlerror());+ say("hakios: tweaks: %s: %s\n", dylib, dlerror());}}closedir(dir);}if (tried > 0) {- say("redwood: tweaks: %s (%s): %d of %d opened\n", name != NULL ? name : "?",+ say("hakios: tweaks: %s (%s): %d of %d opened\n", name != NULL ? name : "?",who != NULL ? who : "no bundle", opened, tried);}}__attribute__((constructor))static void-redwood_tweaks_init(void)+hakios_tweaks_init(void){static bool done;diff --git a/userland/src/metal_test.m b/userland/src/metal_test.mindex e55b745..2465f73 100644--- a/userland/src/metal_test.m+++ b/userland/src/metal_test.m@@ -217,7 +217,7 @@ accelerators(void)static voidgpu_services(void){- static const char *const classes[] = { "RedwoodGPU", "IOGPU", "AGXAccelerator", "IOAccelerator" };+ static const char *const classes[] = { "HakiosGPU", "IOGPU", "AGXAccelerator", "IOAccelerator" };int found = 0;for (size_t i = 0; i < sizeof(classes) / sizeof(classes[0]); i++) {@@ -356,7 +356,7 @@ static int coreimage_over_eagl;* an EAGLContext (which on an image built with GL=1, on a phone with gpu=1, is our Mesa behind* src/eagl.c) and hand it over.*/-#define REDWOOD_GL "/redwood/lib/libredwood-gl.dylib"+#define HAKIOS_GL "/redwood/lib/libhakios.gl.dylib"static EAGLContext *make_eagl(void)@@ -364,15 +364,15 @@ make_eagl(void)EAGLContext *gl;/*- * Our OpenGL ES has to be put behind EAGLContext in THIS process first. libredwood.dylib does+ * Our OpenGL ES has to be put behind EAGLContext in THIS process first. libhakios.dylib does* it only for backboardd (src/inject.c, opengl_es(), which is called for that name alone), and* the way it does it -- replacing methods of EAGLContext through the ObjC runtime -- is local* to a process. The library installs itself from a constructor, so loading it is enough; what- * it replaced it says itself in lines "redwood-gl:". Without this, EAGLContext here would be+ * it replaced it says itself in lines "hakios-gl:". Without this, EAGLContext here would be* iOS's own, which is AppleMetalGLRenderer over Metal -- the thing that is missing.*/- if (access(REDWOOD_GL, R_OK) != 0) {- printf("metal_test: %s is not in this image: build it with GL=1\n", REDWOOD_GL);+ if (access(HAKIOS_GL, R_OK) != 0) {+ printf("metal_test: %s is not in this image: build it with GL=1\n", HAKIOS_GL);return nil;}/*@@ -385,11 +385,11 @@ make_eagl(void)setenv("OSMESA_SOFTWARE", "1", 1);printf("metal_test: OSMESA_SOFTWARE=1: Mesa's software driver, not the GPU\n");}- if (dlopen(REDWOOD_GL, RTLD_NOW) == NULL) {- printf("metal_test: %s: %s\n", REDWOOD_GL, dlerror());+ if (dlopen(HAKIOS_GL, RTLD_NOW) == NULL) {+ printf("metal_test: %s: %s\n", HAKIOS_GL, dlerror());return nil;}- printf("metal_test: %s loaded; EAGLContext is ours now\n", REDWOOD_GL);+ printf("metal_test: %s loaded; EAGLContext is ours now\n", HAKIOS_GL);gl = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];if (gl == nil) {diff --git a/userland/src/net_test.m b/userland/src/net_test.mindex a40787c..1e07b3a 100644--- a/userland/src/net_test.m+++ b/userland/src/net_test.m@@ -17,7 +17,7 @@* services say what they decided (X-Set-Apple-Store-Front; rc.jobs.store)* reach NAME what SCNetworkReachability says: the question applications ask first* wait SECONDS- * wifi what the job com.redwood.wifi runs in every image: if the kernel was+ * wifi what the job com.hakios.wifi runs in every image: if the kernel was* started with wifi=1, wait for the radio's interface (en0) to appear,* and ask for it to be configured by DHCP ("dhcp en0") only if configd* has no network service of its own for it; else nothing@@ -31,9 +31,9 @@* (21: a wrong passphrase) and how long it took. The network's name is* the kernel's (its SSID request) and is not printed.*- * The interface QEMU's network gives (en0, bsd/dev/redwood_net.c) has no IOKit object behind it,+ * The interface QEMU's network gives (en0, bsd/dev/hakios.net.c) has no IOKit object behind it,* and configd makes its network services out of those. (The phone's radio has one now:- * iokit/Kernel/RedwoodWLAN.cpp, and configd makes a "Wi-Fi" service of it by itself.) But the+ * iokit/Kernel/hakios.wlan.cpp, and configd makes a "Wi-Fi" service of it by itself.) But the* plugin that does the configuring keeps its own list* of interfaces, straight from the kernel, and has a Mach interface of its own, the one the* "ipconfig" command of macOS uses ("ipconfig set en0 DHCP"; the command itself is not part of@@ -372,7 +372,7 @@ reach(const char *name)/** With wifi=1 among the kernel's arguments: wait for en0, and for configd's own network service for- * it ("Wi-Fi", made of the radio's IOKit objects, iokit/Kernel/RedwoodWLAN.cpp). That service runs+ * it ("Wi-Fi", made of the radio's IOKit objects, iokit/Kernel/hakios.wlan.cpp). That service runs* DHCP by itself, and it has to be the one that does: wifid takes the interface for usable only* when the address appears under a service whose settings name en0, and the service "dhcp en0"* makes has none (Settings then shows a spinner where the tick belongs). Only a kernel without@@ -501,7 +501,7 @@ wrongjoin(void)return;}length = request.length;- /* the layout of iOS 16.5 (bsd/dev/redwood_apple80211.c of the kernel): version, mode, authentication lower and+ /* the layout of iOS 16.5 (bsd/dev/hakios.apple80211.c of the kernel): version, mode, authentication lower and* upper, the name's length and the name, the access point (none: any), the key's version, length and kind (10:* a passphrase as typed), the key */memset(assoc, 0, sizeof(assoc));diff --git a/userland/src/record_test.c b/userland/src/record_test.cindex fa0750d..31de67b 100644--- a/userland/src/record_test.c+++ b/userland/src/record_test.c@@ -11,8 +11,8 @@* motor's resonance (175.5 Hz on the POCO X5 Pro). Then the file is read back: how loud each tenth* of a second is, and how strong 175.5 Hz is before the vibration and while it lasts.*- * On this machine the samples come from the kernel's /dev/redwood-mic (boot-arg mic=4), through- * RedwoodAudio.driver's device "Codec" (audio_plugin.c), of which the virtual audio device makes+ * On this machine the samples come from the kernel's /dev/hakios-mic (boot-arg mic=4), through+ * HakiosAudio.driver's device "Codec" (audio_plugin.c), of which the virtual audio device makes* the built-in microphone.*/#include <CoreFoundation/CoreFoundation.h>diff --git a/userland/src/redwood_audio.h b/userland/src/redwood_audio.hdeleted file mode 100644index 650cfe8..0000000--- a/userland/src/redwood_audio.h+++ /dev/null@@ -1,92 +0,0 @@-/*- * /dev/redwood-audio: the sound iOS plays, on its way to whatever can make it heard.- *- * iOS expects its output devices from Apple's audio drivers through IOAudio2; neither exists- * here. Instead the audio server (mediaserverd) is given a plug-in of ours that presents one- * stereo output device, and the plug-in writes what the server has mixed for that device- * here. In the kernel the samples go to a sink -- a driver for something that plays them --- * and, if asked for, into a recording that outlives the kernel (see dev/redwood_audio.c).- *- * write(): whole frames in the format below. Never blocks: the writer is the audio server's- * real-time thread, which paces itself (48000 frames a second while anything- * plays, nothing at all otherwise). What the sink cannot take is dropped.- */-#ifndef _SYS_REDWOOD_AUDIO_H_-#define _SYS_REDWOOD_AUDIO_H_--#include <stdint.h>--#define REDWOOD_AUDIO_DEVICE "/dev/redwood-audio"--/* The one format: 16-bit signed little-endian samples, left then right. */-#define REDWOOD_AUDIO_RATE 48000-#define REDWOOD_AUDIO_CHANNELS 2-#define REDWOOD_AUDIO_FRAME 4 /* bytes */--/*- * ioctl(REDWOOD_AUDIO_SET_VOLUME): the speakers' volume, as iOS sets it on the plug-in's volume- * control -- how many eighths of a dB under the loudest they may play, and whether they are- * muted (iOS's volume at 0). The loudest is the kernel's to say (on the phone: Android's own- * level less sound_below, redwood_sound.c); the plug-in only says how far under it.- */-#include <sys/ioccom.h>--struct redwood_audio_volume {- uint32_t below; /* eighths of a dB */- uint32_t muted;-};-#define REDWOOD_AUDIO_SET_VOLUME _IOW('r', 1, struct redwood_audio_volume)--#ifdef KERNEL-#include <stdbool.h>--/*- * For drivers. A sink is offered frames as they are written and says how many it took (the- * rest are lost); it is called from the writer's thread and must not wait.- */-typedef uint32_t (*redwood_audio_sink_t)(const int16_t *frames, uint32_t count);--void redwood_audio_set_sink(const char *name, redwood_audio_sink_t sink);-/* The volume iOS has set last (REDWOOD_AUDIO_SET_VOLUME): false if it has set none; *generation counts the settings. */-bool redwood_audio_volume(uint32_t *below, bool *muted, uint32_t *generation);-void redwood_audio_init(void);-void redwood_virtio_sound_init(void); /* boot-arg virtio_sound=1: QEMU's virtio sound device */-void redwood_speaker_init(void); /* boot-arg speaker_probe=N: a look at the phone's speaker amplifiers */--/*- * The phone's speakers (bsd/dev/redwood_speaker.c): its two Awinic amplifiers, set up as- * Android's driver sets them up, from Android's own configuration file (see there).- */-bool redwood_speaker_prepare(const uint8_t *acf, uint64_t size); /* found, reset, configured: powered down, muted */-bool redwood_speaker_start(void); /* powered up and unmuted at the lowest volume: only while the I2S clock runs */-bool redwood_speaker_volume(uint32_t below, uint32_t step_ms); /* below Android's level, in eighths of a dB; 6 dB a step */-bool redwood_speaker_healthy(void); /* no fault reported; on one, both are powered down at once */-void redwood_speaker_stop(void); /* faded out, muted, powered down, in Android's order */-void redwood_speaker_quiesce(void); /* powered down at once, without sleeping: on a panic's way out */--/*- * The audio DSP's services, for the sound's path (bsd/dev/redwood_adsp.c, bsd/dev/redwood_sound.c).- * redwood_adsp_apr() sends one APR packet to a service of the DSP (AFE 4, ASM 7, ADM 8) with the- * given port and token (0: one of its own) and, with wait_ms, waits for the packet that carries- * that token back. What is not waited for goes to the handler of events, if there is one and it- * takes it (returns true). The handler is called on the link's thread and must not wait.- */-struct redwood_apr_answer {- uint32_t opcode, token, length; /* length: of the payload, in bytes */- uint32_t words[64];-};-typedef bool (*redwood_apr_events_t)(uint8_t service, uint16_t port, uint32_t opcode, uint32_t token, const uint32_t *payload,- uint32_t length);--bool redwood_adsp_apr(uint8_t service, uint16_t port, uint32_t token, uint32_t opcode, const void *payload, uint32_t length,- uint32_t wait_ms, struct redwood_apr_answer *answer);-void redwood_adsp_apr_events(redwood_apr_events_t handler);-const uint8_t *redwood_adsp_fw_file(const char *name, uint64_t *size); /* /fw/name, read whole; give back with: */-void redwood_adsp_fw_free(const uint8_t *data, uint64_t size);--void redwood_sound_dsp_up(void); /* the DSP's audio services are up (adsp=1): boot-arg sound=N begins */-void redwood_sound_dsp_down(void); /* before the DSP is shut down at the run's end: everything of the sound's stopped */-void redwood_sound_quiesce(void); /* on a panic's way out: the amplifiers off, without sleeping */-#endif--#endif /* _SYS_REDWOOD_AUDIO_H_ */diff --git a/userland/src/redwood_input.h b/userland/src/redwood_input.hdeleted file mode 100644index 3944100..0000000--- a/userland/src/redwood_input.h+++ /dev/null@@ -1,47 +0,0 @@-/*- * /dev/redwood-touch: touch samples on their way from whoever produces them to the- * program that turns them into HID events for the window server.- *- * iOS expects touches from Apple's multitouch driver through IOHIDFamily; neither exists- * here. Instead a producer -- a kernel driver for a real touch controller or for an emulated- * pointer, or a user program replaying a script -- posts samples, and code of ours running- * inside backboardd reads them and synthesizes the events. Both sides use the same record.- *- * write(): one or more records (time is ignored; the kernel stamps them)- * read(): blocks until there is at least one record, returns as many whole ones as fit- */-#ifndef _SYS_REDWOOD_INPUT_H_-#define _SYS_REDWOOD_INPUT_H_--#include <stdint.h>--#define REDWOOD_TOUCH_DEVICE "/dev/redwood-touch"--#define REDWOOD_TOUCH_DOWN 1 /* a finger has landed */-#define REDWOOD_TOUCH_MOVE 2-#define REDWOOD_TOUCH_UP 3 /* it has lifted (x, y: where it was last) */-#define REDWOOD_BUTTON_DOWN 4 /* a hardware button; `finger` says which (REDWOOD_BUTTON_*), x and y are 0 */-#define REDWOOD_BUTTON_UP 5--#define REDWOOD_BUTTON_LOCK 1 /* the side button */-#define REDWOOD_BUTTON_VOLUME_UP 2-#define REDWOOD_BUTTON_VOLUME_DOWN 3-#define REDWOOD_BUTTON_HOME 4--struct redwood_touch {- uint64_t time; /* mach_absolute_time() when the sample was posted */- uint32_t type; /* REDWOOD_TOUCH_* or REDWOOD_BUTTON_DOWN/UP */- uint32_t finger; /* which finger, from 0 (or which button) */- uint32_t x, y; /* position on the display, 0 = left/top edge, 65535 = right/bottom edge */-};--#ifdef KERNEL-/* For drivers; not from interrupt context. */-void redwood_touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y);-void redwood_input_init(void);-void redwood_virtio_input_init(void); /* boot-arg virtio_input=1: QEMU's virtio pointer and keyboard */-void redwood_goodix_init(void); /* boot-arg touchscreen=1: the phone's touch screen */-void redwood_cpufreq_init(void); /* boot-arg cpufreq=1: the phone's processor at full speed */-#endif--#endif /* _SYS_REDWOOD_INPUT_H_ */diff --git a/userland/src/rwtouch.c b/userland/src/rwtouch.cindex 89c374c..376269d 100644--- a/userland/src/rwtouch.c+++ b/userland/src/rwtouch.c@@ -1,5 +1,5 @@/*- * rwtouch: replay touches through /dev/redwood-touch (see redwood_input.h).+ * rwtouch: replay touches through /dev/hakios-touch (see hakios.input.h).** usage: rwtouch STEP...* wait SECONDS pause@@ -17,7 +17,7 @@* for measuring how far behind the finger the screen is (tools/latency.py)* button NAME [MS] press a button: home, lock, volup, voldown* read print the samples that arrive, forever (to watch the queue)- * notify NAME post a Darwin notification (com.redwood.unlock: see inject_sb.c)+ * notify NAME post a Darwin notification (com.hakios.unlock: see inject_sb.c)* clock how long short sleeps really take (a check of the kernel's timers)* Positions are fractions of the screen: 0 0 is the top left corner, 1 1 the bottom right.* Example, "swipe up from the bottom edge two minutes after boot":@@ -33,14 +33,14 @@#include <string.h>#include <unistd.h>-#include "redwood_input.h"+#include "hakios.input.h"static int device;static voidpost(uint32_t type, double x, double y){- struct redwood_touch t = { .type = type, .finger = 0, .x = (uint32_t)(x * 65535.0 + 0.5), .y = (uint32_t)(y * 65535.0 + 0.5) };+ struct hakios_touch t = { .type = type, .finger = 0, .x = (uint32_t)(x * 65535.0 + 0.5), .y = (uint32_t)(y * 65535.0 + 0.5) };if (write(device, &t, sizeof(t)) != (ssize_t)sizeof(t)) {perror("rwtouch: write");@@ -51,14 +51,14 @@ post(uint32_t type, double x, double y)static voidbutton(uint32_t which, int ms){- struct redwood_touch t = { .type = REDWOOD_BUTTON_DOWN, .finger = which };+ struct hakios_touch t = { .type = HAKIOS_BUTTON_DOWN, .finger = which };if (write(device, &t, sizeof(t)) != (ssize_t)sizeof(t)) {perror("rwtouch: write");exit(1);}usleep((useconds_t)ms * 1000);- t.type = REDWOOD_BUTTON_UP;+ t.type = HAKIOS_BUTTON_UP;write(device, &t, sizeof(t));}@@ -90,7 +90,7 @@ drag(double x0, double y0, double x1, double y1, int ms, int hold, int grab){uint64_t start, total_us = (uint64_t)(ms > 0 ? ms : 1) * 1000;- post(REDWOOD_TOUCH_DOWN, x0, y0);+ post(HAKIOS_TOUCH_DOWN, x0, y0);/** grab: stay where the finger landed before moving at all. An icon of the home screen is* picked up by a long press and only then dragged, and it has to be one touch throughout --@@ -98,7 +98,7 @@ drag(double x0, double y0, double x1, double y1, int ms, int hold, int grab)*/for (int waited = 0; waited < grab; waited += 100) {usleep(100000);- post(REDWOOD_TOUCH_MOVE, x0, y0);+ post(HAKIOS_TOUCH_MOVE, x0, y0);}start = mach_absolute_time();for (uint64_t at = SAMPLE_MS * 1000;; at += SAMPLE_MS * 1000) {@@ -109,7 +109,7 @@ drag(double x0, double y0, double x1, double y1, int ms, int hold, int grab)}part = (double)at / (double)total_us;sleep_until(start, at);- post(REDWOOD_TOUCH_MOVE, x0 + (x1 - x0) * part, y0 + (y1 - y0) * part);+ post(HAKIOS_TOUCH_MOVE, x0 + (x1 - x0) * part, y0 + (y1 - y0) * part);if (at == total_us) {break;}@@ -119,10 +119,10 @@ drag(double x0, double y0, double x1, double y1, int ms, int hold, int grab)/* (a sample now and then, as a finger that stays still still gives) */for (int waited = 0; waited < hold; waited += 100) {usleep(100000);- post(REDWOOD_TOUCH_MOVE, x1, y1);+ post(HAKIOS_TOUCH_MOVE, x1, y1);}}- post(REDWOOD_TOUCH_UP, x1, y1);+ post(HAKIOS_TOUCH_UP, x1, y1);}static void@@ -130,7 +130,7 @@ zigzag(double x, double y0, double y1, int ms, int times, int step_ms){uint64_t start, legs = (uint64_t)times * 2, total_us = legs * (uint64_t)ms * 1000;- post(REDWOOD_TOUCH_DOWN, x, y0);+ post(HAKIOS_TOUCH_DOWN, x, y0);start = mach_absolute_time();for (uint64_t at = (uint64_t)step_ms * 1000; at <= total_us; at += (uint64_t)step_ms * 1000) {uint64_t leg = at / ((uint64_t)ms * 1000), within = at % ((uint64_t)ms * 1000);@@ -142,10 +142,10 @@ zigzag(double x, double y0, double y1, int ms, int times, int step_ms)}y = leg % 2 == 0 ? y0 + (y1 - y0) * part : y1 + (y0 - y1) * part;sleep_until(start, at);- post(REDWOOD_TOUCH_MOVE, x, y);+ post(HAKIOS_TOUCH_MOVE, x, y);}usleep(16000);- post(REDWOOD_TOUCH_UP, x, y0);+ post(HAKIOS_TOUCH_UP, x, y0);}int@@ -154,9 +154,9 @@ main(int argc, char **argv)/* a gesture is a matter of timing: do not let the rest of a busy system stretch it */pthread_set_qos_class_self_np(QOS_CLASS_USER_INTERACTIVE, 0);mach_timebase_info(&timebase);- device = open(REDWOOD_TOUCH_DEVICE, O_RDWR);+ device = open(HAKIOS_TOUCH_DEVICE, O_RDWR);if (device < 0) {- perror("rwtouch: " REDWOOD_TOUCH_DEVICE);+ perror("rwtouch: " HAKIOS_TOUCH_DEVICE);return 1;}for (int i = 1; i < argc; i++) {@@ -169,9 +169,9 @@ main(int argc, char **argv)} else if (strcmp(step, "tap") == 0 && left >= 2) {double x = atof(argv[i + 1]), y = atof(argv[i + 2]);- post(REDWOOD_TOUCH_DOWN, x, y);+ post(HAKIOS_TOUCH_DOWN, x, y);usleep(60000);- post(REDWOOD_TOUCH_UP, x, y);+ post(HAKIOS_TOUCH_UP, x, y);i += 2;} else if (strcmp(step, "zigzag") == 0 && left >= 5) {int step_ms = left >= 6 && atoi(argv[i + 6]) > 0 ? atoi(argv[i + 6]) : 8;@@ -181,15 +181,15 @@ main(int argc, char **argv)} else if (strcmp(step, "hold") == 0 && left >= 3) {double x = atof(argv[i + 1]), y = atof(argv[i + 2]);- post(REDWOOD_TOUCH_DOWN, x, y);+ post(HAKIOS_TOUCH_DOWN, x, y);usleep((useconds_t)atoi(argv[i + 3]) * 1000);- post(REDWOOD_TOUCH_UP, x, y);+ post(HAKIOS_TOUCH_UP, x, y);i += 3;} else if (strcmp(step, "button") == 0 && left >= 1) {const char *name = argv[i + 1];- uint32_t which = strcmp(name, "home") == 0 ? REDWOOD_BUTTON_HOME : strcmp(name, "lock") == 0 ?- REDWOOD_BUTTON_LOCK : strcmp(name, "volup") == 0 ? REDWOOD_BUTTON_VOLUME_UP :- strcmp(name, "voldown") == 0 ? REDWOOD_BUTTON_VOLUME_DOWN : 0;+ uint32_t which = strcmp(name, "home") == 0 ? HAKIOS_BUTTON_HOME : strcmp(name, "lock") == 0 ?+ HAKIOS_BUTTON_LOCK : strcmp(name, "volup") == 0 ? HAKIOS_BUTTON_VOLUME_UP :+ strcmp(name, "voldown") == 0 ? HAKIOS_BUTTON_VOLUME_DOWN : 0;int ms = left >= 2 && argv[i + 2][0] >= '0' && argv[i + 2][0] <= '9' ? atoi(argv[i + 2]) : 0;if (which == 0) {@@ -234,15 +234,15 @@ main(int argc, char **argv)(unsigned long long)total, (unsigned long long)(worst * timebase.numer / timebase.denom / 1000));}} else if (strcmp(step, "read") == 0) {- struct redwood_touch t;+ struct hakios_touch t;while (read(device, &t, sizeof(t)) == (ssize_t)sizeof(t)) {- if (t.type >= REDWOOD_BUTTON_DOWN) {- printf("rwtouch: button %u %s\n", t.finger, t.type == REDWOOD_BUTTON_DOWN ? "down" : "up");+ if (t.type >= HAKIOS_BUTTON_DOWN) {+ printf("rwtouch: button %u %s\n", t.finger, t.type == HAKIOS_BUTTON_DOWN ? "down" : "up");continue;}- printf("rwtouch: %s finger %u at %.3f %.3f\n", t.type == REDWOOD_TOUCH_DOWN ? "down" :- t.type == REDWOOD_TOUCH_MOVE ? "move" : "up ", t.finger, t.x / 65535.0, t.y / 65535.0);+ printf("rwtouch: %s finger %u at %.3f %.3f\n", t.type == HAKIOS_TOUCH_DOWN ? "down" :+ t.type == HAKIOS_TOUCH_MOVE ? "move" : "up ", t.finger, t.x / 65535.0, t.y / 65535.0);}return 0;} else {diff --git a/userland/src/sound_test.c b/userland/src/sound_test.cindex 5cc9fd2..7b153e7 100644--- a/userland/src/sound_test.c+++ b/userland/src/sound_test.c@@ -10,7 +10,7 @@* full scale, through an audio queue: what a music player does* level PEAK the tones after this one at PEAK of full scale (0 to 1) instead* (before iOS's volume, which scales the samples itself)- * raw SECONDS the same tone written straight to /dev/redwood-audio, past iOS's own+ * raw SECONDS the same tone written straight to /dev/hakios-audio, past iOS's own* processing and volume (which keep a tone more than 12 dB under full* scale even at the top): to try what the kernel does with full scale* system ID a system sound by its number (1100 is the lock sound,@@ -25,7 +25,7 @@* restart kill the audio server (launchd starts it again when it is next asked for):* what every program then sees as "media services were reset"*- * The samples come out of /dev/redwood-audio (see sys/redwood_audio.h); a tone is something one+ * The samples come out of /dev/hakios-audio (see sys/hakios.audio.h); a tone is something one* can recognize there without ears: two peaks in the spectrum, where they were put.*/#include <AudioToolbox/AudioToolbox.h>@@ -77,17 +77,17 @@ fill(__unused void *context, AudioQueueRef queue, AudioQueueBufferRef buffer)static intraw(double seconds){- int device = open("/dev/redwood-audio", O_WRONLY);+ int device = open("/dev/hakios-audio", O_WRONLY);int16_t block[2 * 480];uint64_t total = (uint64_t)(seconds * RATE), written = 0, start;mach_timebase_info_data_t timebase;if (device < 0) {- printf("sound_test: /dev/redwood-audio: %s\n", strerror(errno));+ printf("sound_test: /dev/hakios-audio: %s\n", strerror(errno));return 1;}mach_timebase_info(&timebase);- printf("sound_test: a tone of %.0f and %.0f Hz at %.2f of full scale for %.1f s, straight to /dev/redwood-audio\n",+ printf("sound_test: a tone of %.0f and %.0f Hz at %.2f of full scale for %.1f s, straight to /dev/hakios-audio\n",frequency[0], frequency[1], peak, seconds);fflush(stdout);start = mach_absolute_time();@@ -104,7 +104,7 @@ raw(double seconds)}}if (write(device, block, count * 4) != (ssize_t)(count * 4)) {- printf("sound_test: /dev/redwood-audio: a write failed: %s\n", strerror(errno));+ printf("sound_test: /dev/hakios-audio: a write failed: %s\n", strerror(errno));break;}written += count;diff --git a/userland/src/stage0.c b/userland/src/stage0.cindex fe7be92..516346f 100644--- a/userland/src/stage0.c+++ b/userland/src/stage0.c@@ -25,7 +25,7 @@ main(int argc, char **argv, char **envp)}if (mount("apfs", "/redwood", MNT_RDONLY, (void *)"/dev/md1") != 0) {- printf("stage0: cannot mount /dev/md1 on /redwood: %s\n", strerror(errno));+ printf("stage0: cannot mount /dev/md1 on /hakios: %s\n", strerror(errno));} else {execve(init_argv[0], init_argv, envp);printf("stage0: cannot run %s: %s\n", init_argv[0], strerror(errno));diff --git a/userland/src/svc_test.c b/userland/src/svc_test.cindex 8ec6dea..a31db9c 100644--- a/userland/src/svc_test.c+++ b/userland/src/svc_test.c@@ -33,7 +33,7 @@ main(void)printf("svc_test: pid %d, uid %d\n", getpid(), getuid());/* notifyd */- status = notify_register_check("com.redwood.test", &token);+ status = notify_register_check("com.hakios.test", &token);check(status == NOTIFY_STATUS_OK, "notifyd: register for a notification");if (status == NOTIFY_STATUS_OK) {notify_check(token, &changed); /* the first check always reports a change */@@ -41,7 +41,7 @@ main(void)check(status == NOTIFY_STATUS_OK && notify_get_state(token, &state) == NOTIFY_STATUS_OK && state == 0x1234abcd,"notifyd: store and fetch a state value");changed = 0;- status = notify_post("com.redwood.test");+ status = notify_post("com.hakios.test");usleep(100000);check(status == NOTIFY_STATUS_OK && notify_check(token, &changed) == NOTIFY_STATUS_OK && changed,"notifyd: post a notification and see it arrive");@@ -51,7 +51,7 @@ main(void)/* cfprefsd */{- CFStringRef app = CFSTR("com.redwood.test"), key = CFSTR("greeting");+ CFStringRef app = CFSTR("com.hakios.test"), key = CFSTR("greeting");CFStringRef value;char text[64] = "";diff --git a/userland/src/torch_test.c b/userland/src/torch_test.cindex 9362f9b..66fe60e 100644--- a/userland/src/torch_test.c+++ b/userland/src/torch_test.c@@ -1,7 +1,7 @@/** torch_test: the flashlight the way a program (and Control Center) works it: AVFlashlight, which* asks mediaserverd's FigFlashlight, which sets the back camera's torch level (on this machine:- * libredwood-media.dylib in mediaserverd, the kernel's /dev/redwood-torch, torch=3).+ * libhakios.media.dylib in mediaserverd, the kernel's /dev/hakios-torch, torch=3).** usage: torch_test STEP...* wait SECONDS@@ -45,11 +45,11 @@ text(id object)static voidkernel_state(void){- int device = open("/dev/redwood-torch", O_RDONLY);+ int device = open("/dev/hakios-torch", O_RDONLY);uint32_t lit = 0;if (device < 0 || read(device, &lit, sizeof(lit)) != (ssize_t)sizeof(lit)) {- printf("torch_test: the kernel has no flashlight (/dev/redwood-torch)\n");+ printf("torch_test: the kernel has no flashlight (/dev/hakios-torch)\n");} else {printf("torch_test: the kernel says: %s%u of 1000\n", lit ? "LIT at " : "dark, ", lit);}diff --git a/userland/src/tweaks/redbare.c b/userland/src/tweaks/redbare.cindex 6c12cae..84fc957 100644--- a/userland/src/tweaks/redbare.c+++ b/userland/src/tweaks/redbare.c@@ -10,6 +10,6 @@__attribute__((constructor))static void redbare_init(void) {int fd = open("/dev/console", O_WRONLY);- const char *s = "redwood: bare tweak loaded (no libsubstrate)\n";+ const char *s = "hakios: bare tweak loaded (no libsubstrate)\n";if (fd >= 0) { (void)write(fd, s, strlen(s)); close(fd); }}diff --git a/userland/src/tweaks/redtest.c b/userland/src/tweaks/redtest.cindex 7101c9b..e93ed74 100644--- a/userland/src/tweaks/redtest.c+++ b/userland/src/tweaks/redtest.c@@ -22,19 +22,19 @@ static void say(const char *s) {static void (*orig_setIcon)(id, SEL, id);static int hit;static void my_setIcon(id self, SEL _cmd, id icon) {- if (!hit) { hit = 1; say("redwood: tweak hook fired: -[SBIconView setIcon:]\n"); }+ if (!hit) { hit = 1; say("hakios: tweak hook fired: -[SBIconView setIcon:]\n"); }orig_setIcon(self, _cmd, icon);}__attribute__((constructor))static void redtest_init(void) {- say("redwood: test tweak loaded\n");+ say("hakios: test tweak loaded\n");Class c = objc_getClass("SBIconView");SEL s = sel_registerName("setIcon:");if (c && class_getInstanceMethod(c, s)) {MSHookMessageEx(c, s, (IMP)my_setIcon, (IMP *)&orig_setIcon);- say("redwood: tweak hooked -[SBIconView setIcon:]\n");+ say("hakios: tweak hooked -[SBIconView setIcon:]\n");} else {- say("redwood: tweak: no SBIconView setIcon:\n");+ say("hakios: tweak: no SBIconView setIcon:\n");}}diff --git a/userland/src/var_store.c b/userland/src/var_store.cindex 3e496d3..8571946 100644--- a/userland/src/var_store.c+++ b/userland/src/var_store.c@@ -9,7 +9,7 @@* here -- what is needed is that the bytes come back. So the tree is packed into a plain archive* and the archive is written into the one place on the phone's flash this port owns and nothing of* it uses: the partition darwin, past the iOS volume and both cryptexes. The kernel takes those- * writes on /dev/rufs_darwin alone and refuses anything else (bsd/dev/redwood_ufs.c, ufs_write=1).+ * writes on /dev/rufs_darwin alone and refuses anything else (bsd/dev/hakios.ufs.c, ufs_write=1).** var_store save pack /private/var into the store* var_store load unpack the newest good store into /private/var (init, at boot)@@ -19,15 +19,15 @@* var_store erase forget both slots (the next boot starts empty again)* var_store stamp PATH write a line into PATH saying when: a marker for a run*- * Nobody has to remember to save. `watch` registers with the kernel (kern.redwood.var_save), and+ * Nobody has to remember to save. `watch` registers with the kernel (kern.hakios.var_save), and* on the orderly way back to the loader -- the run's time up, or "xl stop" -- the kernel asks it- * for the volume and waits, bounded, before it goes (bsd/dev/redwood_ufs.c,- * redwood_var_save_on_return). A save every SECS seconds is there as well but is not the default:+ * for the volume and waits, bounded, before it goes (bsd/dev/hakios.ufs.c,+ * hakios_var_save_on_return). A save every SECS seconds is there as well but is not the default:* one costs seconds of the run and a hundred-odd megabytes of flash, and while it runs the* storage is read through the loader rather than through this kernel's own driver.** One saver at a time: a write to the store is refused unless the writer holds the claim- * (kern.redwood.var_busy), so two of them cannot interleave into one slot. Even if they did, the+ * (kern.hakios.var_busy), so two of them cannot interleave into one slot. Even if they did, the* slot being written is never the one holding the newest good archive, and a header is written* last and over a zeroed one -- so the worst an interrupted or doubled save can do is lose itself.*@@ -168,7 +168,7 @@ sysctl_set_int(const char *name, int value)static intclaim(void){- if (sysctl_set_int("kern.redwood.var_busy", 1) != 0) {+ if (sysctl_set_int("kern.hakios.var_busy", 1) != 0) {printf("var_store: the store is claimed by another saver (%s)\n", strerror(errno));return 0;}@@ -178,7 +178,7 @@ claim(void)static voidrelease(void){- (void)sysctl_set_int("kern.redwood.var_busy", 0);+ (void)sysctl_set_int("kern.hakios.var_busy", 0);}/* ---- checksum (the same one the loader reads a write back with) ---- */@@ -1246,7 +1246,7 @@ save_once(void)/** The device is opened for the save and closed again, not held: while a write is in flight* this kernel's own transfer list is out of the controller, and it goes back in when the- * device is closed (bsd/dev/redwood_ufs.c, ufs_cclose). A watcher that kept the device open+ * device is closed (bsd/dev/hakios.ufs.c, ufs_cclose). A watcher that kept the device open* would leave iOS reading the flash through the loader for the rest of the run.*/fd = open(DEVICE, O_RDWR, 0);@@ -1275,7 +1275,7 @@ watch(int seconds)}close(fd);fd = -1;- if (sysctl_set_int("kern.redwood.var_save", VAR_SAVE_IDLE) != 0) {+ if (sysctl_set_int("kern.hakios.var_save", VAR_SAVE_IDLE) != 0) {printf("var_store: this kernel does not keep the data volume (%s)\n", strerror(errno));return 0;}@@ -1291,7 +1291,7 @@ watch(int seconds)struct timeval tv = { 0, 0 };int state = VAR_SAVE_NONE;- if (sysctl_int("kern.redwood.var_save", &state) == 0 && state == VAR_SAVE_WANTED) {+ if (sysctl_int("kern.hakios.var_save", &state) == 0 && state == VAR_SAVE_WANTED) {asked = 1;}gettimeofday(&tv, NULL);@@ -1304,7 +1304,7 @@ watch(int seconds)last = (uint64_t)tv.tv_sec;if (asked) {/* answered either way: the kernel is waiting on this to go back to the loader */- (void)sysctl_set_int("kern.redwood.var_save", VAR_SAVE_DONE);+ (void)sysctl_set_int("kern.hakios.var_save", VAR_SAVE_DONE);return ok;}}@@ -1363,7 +1363,7 @@ main(int argc, char **argv, char **envp)(void)envp;crc_init();if (strcmp(what, "stamp") == 0) {- return stamp(argc > 2 ? argv[2] : "/private/var/redwood-stamp") ? 0 : 1;+ return stamp(argc > 2 ? argv[2] : "/private/var/hakios-stamp") ? 0 : 1;}buffer = mmap(NULL, BUFFER, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);links = mmap(NULL, LINKS * sizeof(*links), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);diff --git a/wifi/lx/include/linux/soc/qcom/qmi.h b/wifi/lx/include/linux/soc/qcom/qmi.hindex 71332ea..242b826 100644--- a/wifi/lx/include/linux/soc/qcom/qmi.h+++ b/wifi/lx/include/linux/soc/qcom/qmi.h@@ -1,16 +1,16 @@/** QMI, the protocol in which the driver talks to the radio's firmware before the radio's own- * registers exist. The helpers are the kernel's (bsd/sys/redwood_qmi.h, bsd/dev/redwood_qmi.c),+ * registers exist. The helpers are the kernel's (bsd/sys/hakios.qmi.h, bsd/dev/hakios.qmi.c),* under Linux's names; a kernel tree that does not have them yet gets LinuxKPI's header, in* which every call fails.*/#ifndef _LX_LINUX_SOC_QCOM_QMI_H#define _LX_LINUX_SOC_QCOM_QMI_H-#ifdef LX_REDWOOD_QMI_H+#ifdef LX_HAKIOS_QMI_H#include <linux/jiffies.h>-#define REDWOOD_QMI_JIFFIES_TO_MS(j) jiffies_to_msecs(j)-#include LX_REDWOOD_QMI_H+#define HAKIOS_QMI_JIFFIES_TO_MS(j) jiffies_to_msecs(j)+#include LX_HAKIOS_QMI_H/** What the driver sends goes past the radio's bus first (src/lx_bus.c), which has to know of one* request: the mode the firmware is asked for. The radio's registers answer in mission mode only.diff --git a/wifi/lx/include/lx_os.h b/wifi/lx/include/lx_os.hindex 95a6cd6..484ec08 100644--- a/wifi/lx/include/lx_os.h+++ b/wifi/lx/include/lx_os.h@@ -1,11 +1,11 @@/** What the driver's object asks of the kernel it is linked into. The kernel describes that- * itself (bsd/sys/redwood_lx.h of the kernel tree, which tools/mk-ath11k.sh names here): there+ * itself (bsd/sys/hakios.lx.h of the kernel tree, which tools/mk-ath11k.sh names here): there* is one description, and both sides are compiled against it.*/#ifndef _LX_OS_H_#define _LX_OS_H_-#include LX_REDWOOD_LX_H+#include LX_HAKIOS_LX_H#endifdiff --git a/wifi/lx/include/stdbool.h b/wifi/lx/include/stdbool.hindex 52f0d2b..71fb8c6 100644--- a/wifi/lx/include/stdbool.h+++ b/wifi/lx/include/stdbool.h@@ -1,5 +1,5 @@/*- * <stdbool.h>, for the kernel's own headers that are read on this side (sys/redwood_qmi.h): in a+ * <stdbool.h>, for the kernel's own headers that are read on this side (sys/hakios.qmi.h): in a* FreeBSD kernel what it declares comes with these.*/#include <sys/types.h>diff --git a/wifi/lx/include/stddef.h b/wifi/lx/include/stddef.hindex dbb0d20..85ffbde 100644--- a/wifi/lx/include/stddef.h+++ b/wifi/lx/include/stddef.h@@ -1,5 +1,5 @@/*- * <stddef.h>, for the kernel's own headers that are read on this side (sys/redwood_qmi.h): in a+ * <stddef.h>, for the kernel's own headers that are read on this side (sys/hakios.qmi.h): in a* FreeBSD kernel what it declares comes with these.*/#include <sys/types.h>diff --git a/wifi/lx/include/stdint.h b/wifi/lx/include/stdint.hindex 28eb61b..f488286 100644--- a/wifi/lx/include/stdint.h+++ b/wifi/lx/include/stdint.h@@ -1,5 +1,5 @@/*- * <stdint.h>, for the kernel's own headers that are read on this side (sys/redwood_qmi.h): in a+ * <stdint.h>, for the kernel's own headers that are read on this side (sys/hakios.qmi.h): in a* FreeBSD kernel what it declares comes with these.*/#include <sys/types.h>diff --git a/wifi/lx/src/lx.h b/wifi/lx/src/lx.hindex 3e3fb9e..0625ebb 100644--- a/wifi/lx/src/lx.h+++ b/wifi/lx/src/lx.h@@ -14,7 +14,7 @@ int lx_station_join(void); /* lx_80211.c: join the network the kernel was givenvoid lx_station_say(void); /* lx_80211.c: what has passed since */void lx_station_leave(void); /* lx_80211.c: leave it, and the interface down */int lx_station_send(const unsigned char *frame, unsigned long length); /* lx_80211.c: an Ethernet frame for the network */-int lx_station_offer(void); /* lx_80211.c: the station given to the kernel to ask (sys/redwood_sta.h); 0, or an errno */+int lx_station_offer(void); /* lx_80211.c: the station given to the kernel to ask (sys/hakios.sta.h); 0, or an errno */void lx_station_withdraw(void); /* lx_80211.c: ... and taken back */#endifdiff --git a/wifi/lx/src/lx_80211.c b/wifi/lx/src/lx_80211.cindex ea753f2..32bde30 100644--- a/wifi/lx/src/lx_80211.c+++ b/wifi/lx/src/lx_80211.c@@ -19,7 +19,7 @@** On the phone, 13 October, this scans -- 26 channels in 4.1 s, the access points around heard* with their channels and strengths -- and joins: the handshake is through 130 ms after the- * association, and iOS has the network (bsd/dev/redwood_wifi.c, step_driver(), has the+ * association, and iOS has the network (bsd/dev/hakios.wifi.c, step_driver(), has the* account). What is said of other people's networks names them: it is for the log of the run.* The name of the network to join and its passphrase are never said, only their lengths.*/@@ -38,7 +38,7 @@int linuxkpi_debug_80211; /* (which of the headers' own remarks are printed: none) */#define HEARD_MOST 128-#define ELEMENTS_MOST REDWOOD_STA_ELEMENTS_MOST+#define ELEMENTS_MOST HAKIOS_STA_ELEMENTS_MOST/* A network, as its beacons describe it. */struct lx_heard {@@ -998,7 +998,7 @@ station_down(struct lx_radio *radio)* is to be `quiet`, only listens. 0 when the driver has said the scan is over.*/static int-station_scan(struct lx_radio *radio, const uint8_t *name, unsigned name_length, bool quiet, const struct redwood_sta_scan *what)+station_scan(struct lx_radio *radio, const uint8_t *name, unsigned name_length, bool quiet, const struct hakios_sta_scan *what){struct ieee80211_hw *hw = &radio->hw;struct ieee80211_scan_request *request;@@ -1567,7 +1567,7 @@ station_width(struct lx_radio *radio, struct linuxkpi_ieee80211_channel *primary* the last scan, if that heard the network, or one made now.*/static int-station_join(struct lx_radio *radio, const struct redwood_sta_join *what)+station_join(struct lx_radio *radio, const struct hakios_sta_join *what){const uint8_t *name = what->ssid;unsigned name_length = what->ssid_length;@@ -1586,7 +1586,7 @@ station_join(struct lx_radio *radio, const struct redwood_sta_join *what)if (name_length == 0 || name_length > sizeof(radio->want)) {return (EINVAL);}- if (what->security != REDWOOD_STA_WPA2_PSK) {+ if (what->security != HAKIOS_STA_WPA2_PSK) {lx_tell("lx: a network without WPA2 and a passphrase is asked for: that is not built\n");return (ENOTSUP);}@@ -1837,7 +1837,7 @@ out:intlx_station_join(void){- static struct redwood_sta_join what;+ static struct hakios_sta_join what;struct lx_radio *radio = the_radio;unsigned name_length = sizeof(what.ssid), passphrase_length = sizeof(what.passphrase);int error;@@ -1852,7 +1852,7 @@ lx_station_join(void)}what.ssid_length = (uint8_t)name_length;what.passphrase_length = (uint8_t)passphrase_length;- what.security = REDWOOD_STA_WPA2_PSK;+ what.security = HAKIOS_STA_WPA2_PSK;lx_os_net_attach(radio->wiphy->perm_addr);error = station_join(radio, &what);explicit_bzero(&what, sizeof(what));@@ -1903,7 +1903,7 @@ lx_station_send(const unsigned char *frame, unsigned long length)return (ethernet_send(radio, frame, (unsigned)length) ? 0 : ENOBUFS);}-/* ---- the station boundary: what the kernel asks through sys/redwood_sta.h --------------------------------- */+/* ---- the station boundary: what the kernel asks through sys/hakios.sta.h --------------------------------- */static intboundary_power(bool on)@@ -1925,7 +1925,7 @@ boundary_power(bool on)}static int-boundary_scan(const struct redwood_sta_scan *what)+boundary_scan(const struct hakios_sta_scan *what){static unsigned said;struct lx_radio *radio = the_radio;@@ -1950,9 +1950,9 @@ boundary_scan(const struct redwood_sta_scan *what)}static void-boundary_heard(void (*each)(const struct redwood_sta_bss *, void *), void *context)+boundary_heard(void (*each)(const struct hakios_sta_bss *, void *), void *context){- static struct redwood_sta_bss bss; /* (one thread calls this) */+ static struct hakios_sta_bss bss; /* (one thread calls this) */struct lx_radio *radio = the_radio;for (unsigned i = 0; radio != NULL && i < radio->heard_count; i++) {@@ -1978,7 +1978,7 @@ boundary_heard(void (*each)(const struct redwood_sta_bss *, void *), void *conte}static int-boundary_join(const struct redwood_sta_join *what)+boundary_join(const struct hakios_sta_join *what){struct lx_radio *radio = the_radio;int error;@@ -2009,7 +2009,7 @@ boundary_leave(void)/* (on any thread: nothing here but reading) */static void-boundary_state(struct redwood_sta_state *state)+boundary_state(struct hakios_sta_state *state){struct lx_radio *radio = the_radio;@@ -2018,8 +2018,8 @@ boundary_state(struct redwood_sta_state *state)return;}lx_os_lock();- state->phase = radio->joined ? REDWOOD_STA_JOINED : radio->joining ? REDWOOD_STA_JOINING : radio->scan == 1 ?- REDWOOD_STA_SCANNING : REDWOOD_STA_IDLE;+ state->phase = radio->joined ? HAKIOS_STA_JOINED : radio->joining ? HAKIOS_STA_JOINING : radio->scan == 1 ?+ HAKIOS_STA_SCANNING : HAKIOS_STA_IDLE;state->last_error = radio->last_error;if ((radio->joined || radio->joining) && radio->target.found) {memcpy(state->bss.bssid, radio->target.address, ETH_ALEN);@@ -2037,7 +2037,7 @@ boundary_state(struct redwood_sta_state *state)}static unsigned-boundary_channels(struct redwood_sta_channel *channels, unsigned most)+boundary_channels(struct hakios_sta_channel *channels, unsigned most){struct lx_radio *radio = the_radio;unsigned count = 0;@@ -2048,15 +2048,15 @@ boundary_channels(struct redwood_sta_channel *channels, unsigned most)for (int i = 0; has != NULL && i < has->n_channels && count < most; i++) {if (!(has->channels[i].flags & IEEE80211_CHAN_DISABLED)) {channels[count].frequency = (uint16_t)has->channels[i].center_freq;- channels[count++].flags = (uint16_t)((has->channels[i].flags & IEEE80211_CHAN_NO_IR ? REDWOOD_STA_CHANNEL_PASSIVE :- 0) | (has->channels[i].flags & IEEE80211_CHAN_RADAR ? REDWOOD_STA_CHANNEL_RADAR : 0));+ channels[count++].flags = (uint16_t)((has->channels[i].flags & IEEE80211_CHAN_NO_IR ? HAKIOS_STA_CHANNEL_PASSIVE :+ 0) | (has->channels[i].flags & IEEE80211_CHAN_RADAR ? HAKIOS_STA_CHANNEL_RADAR : 0));}}}return (count);}-static struct redwood_sta_ops boundary = {+static struct hakios_sta_ops boundary = {.power = boundary_power,.scan = boundary_scan,.heard = boundary_heard,diff --git a/wifi/lx/src/lx_base.c b/wifi/lx/src/lx_base.cindex df4daee..ea4932b 100644--- a/wifi/lx/src/lx_base.c+++ b/wifi/lx/src/lx_base.c@@ -3,7 +3,7 @@* ask it: locks, sleeping and waking, work queues, timers, memory, memory the radio reads and* writes, socket buffers, firmware files. The headers that declare all this are FreeBSD's* LinuxKPI; FreeBSD's own implementations stand on FreeBSD's kernel and are not used. These- * stand on the few calls of lx_os.h, which the XNU side gives (bsd/dev/redwood_lx.c), and are+ * stand on the few calls of lx_os.h, which the XNU side gives (bsd/dev/hakios.lx.c), and are* written for a driver that runs on threads only: nothing here is called from an interrupt.** Everything that sleeps does so with lx_os_sleep() under the one lock of lx_os.h, and wakesdiff --git a/wifi/lx/src/lx_bus.c b/wifi/lx/src/lx_bus.cindex 6943a33..cf40307 100644--- a/wifi/lx/src/lx_bus.c+++ b/wifi/lx/src/lx_bus.c@@ -22,7 +22,7 @@** What the phone said, 13 October: all of that happens, 270 ms from the start of the bus to* "unified ready", with the copy engines looked at once a millisecond, and the scan hears the- * networks around (bsd/dev/redwood_wifi.c, step_driver(), has the account).+ * networks around (bsd/dev/hakios.wifi.c, step_driver(), has the account).*/#define LX_QMI_AS_IT_IS /* (this file is where the driver's requests go past) */#include <linux/kernel.h>@@ -175,7 +175,7 @@ window(struct ath11k_base *ab, u32 offset)/** The registers answer while the firmware is in mission mode and at no other time: an access- * outside it ends the kernel (bsd/dev/redwood_wifi.c, step 16). The driver asks for that mode+ * outside it ends the kernel (bsd/dev/hakios.wifi.c, step 16). The driver asks for that mode* before it first touches them; once it has stopped the bus, on its way to asking for the mode* "off", nothing is let through any more.*/diff --git a/xl b/xlindex 1a3849e..2481eaf 100755--- a/xl+++ b/xl@@ -54,7 +54,7 @@ L=xnuloader/loader.efimkdir -p logs# There is one phone, whichever working copy (tools/new-workspace.sh) talks to it: the locks are# outside all of them.-PHONE=${XDG_RUNTIME_DIR:-/tmp}/darwin-redwood-phone+PHONE=${XDG_RUNTIME_DIR:-/tmp}/darwin-hakios-phone# one fastboot at a time (a run in one terminal, "xl screenshot" in another): each takes the lock for itselffb() { flock -w 90 $PHONE.lock timeout "${FB_TIMEOUT:-10}" fastboot "$@" 2>&1; }diff --git a/xnu-build.sh b/xnu-build.shindex dc3c7c4..7af6e62 100755--- a/xnu-build.sh+++ b/xnu-build.sh@@ -5,7 +5,7 @@ cd "$XNU_SRC" || exit 1# The Wi-Fi driver's object (tools/mk-ath11k.sh) is linked into the kernel when it is there; make# does not see it change, so the linked kernel is thrown away when it has.LX=$XNUDEPS/build/ath11k/out/ath11k.o-STAMP=BUILD/obj/redwood-objects+STAMP=BUILD/obj/hakios-objectsmtime() { if [ "$XNU_HOST_OS" = Darwin ]; then stat -f %m "$1"; else stat -c %Y "$1"; fi; }if [ -f "$LX" ]; then now="$LX $(mtime "$LX")"; else LX= now=; fi# the build tools of SETUP/ are Apple's: on macOS they build as they are, on Linux with a compatibility header@@ -15,6 +15,6 @@ if [ -d BUILD/obj ] && [ "$(cat $STAMP 2>/dev/null)" != "$now" ]; thenrm -f BUILD/obj/*/mach.*.unstrippedecho "$now" > $STAMPfi-exec make REDWOOD_OBJECTS="$LX" SDKROOT=iphoneos ARCH_CONFIGS=ARM64 MACHINE_CONFIGS=${MACHINE:-BCM2837} KERNEL_CONFIGS=DEVELOPMENT \+exec make HAKIOS_OBJECTS="$LX" SDKROOT=iphoneos ARCH_CONFIGS=ARM64 MACHINE_CONFIGS=${MACHINE:-BCM2837} KERNEL_CONFIGS=DEVELOPMENT \ARCH_STRING_FOR_CURRENT_MACHINE_CONFIG=arm64 BUILD_WERROR=0 BUILD_LTO=0 DO_CTFMERGE=0 \HOST_CC="$HOSTCC" HOST_FLEX=flex HOST_BISON=bison HOST_GM4=m4 CC=xnu-clang CXX=xnu-clang++ LOGCOLORS=n "$@"diff --git a/xnu/README.md b/xnu/README.mdindex b2febef..c6de13f 100644--- a/xnu/README.md+++ b/xnu/README.md@@ -2,7 +2,7 @@Our changes to XNU `xnu-8796.121.2` (the kernel of iOS 16.5, Darwin 22.5.0):-- `redwood.patch`: changes to Apple's files;+- `hakios.patch`: changes to Apple's files;- `files/`: new files at their paths in the XNU tree;- `apply.sh`: fetches the sources from Apple's GitHub and lays all of this over them;`export.sh`: the reverse, run before committing.@@ -46,15 +46,15 @@ Things to know:| `iokit/Kernel/GenericARMPE.cpp`, `MiniIOSurface.*`, `MiniIOMobileFramebuffer.cpp`, `MiniAppleKeyStore.cpp` | the platform expert and replacements for closed drivers: surfaces, the display, the key store || `bsd/miscfs/apfs/`, `bsd/miscfs/ramfs/` | read-only APFS and a writable RAM file system || `bsd/kern/kern_minimac.c`, `libkern/amfi/` | AMFI and Sandbox stubs |-| `bsd/dev/redwood_input.c`, `redwood_goodix.c` | input: `/dev/redwood-touch`, the Goodix GT9916 touch controller |-| `bsd/dev/redwood_cpufreq.c` | CPU clocks (Qualcomm EPSS) |-| `bsd/dev/redwood_net.c`, `redwood_virtio_net.c` | the `en0` network interface |-| `bsd/dev/redwood_adreno.c`, `iokit/Kernel/RedwoodGPU.cpp` | the Adreno 642L GPU |-| `bsd/dev/redwood_wifi.c`, `redwood_wlfw.c` | Wi-Fi (WCN6750): shared memory, the radio's DSP, the driver |-| `bsd/dev/redwood_qmi.c`, `redwood_nas.c` | QMI and the NAS client |-| `bsd/dev/redwood_mpss.c` | the modem: firmware, file systems, IPA, SIM, registration |-| `bsd/dev/redwood_audio.c`, `redwood_adsp.c`, `redwood_speaker.c`, `redwood_mic.c` | sound through the audio DSP; the battery comes through it too |-| `bsd/dev/redwood_haptic.c`, `redwood_camera.c`, `redwood_ufs.c` | the vibration motor, the cameras, the UFS storage |+| `bsd/dev/hakios.input.c`, `hakios.goodix.c` | input: `/dev/hakios-touch`, the Goodix GT9916 touch controller |+| `bsd/dev/hakios.cpufreq.c` | CPU clocks (Qualcomm EPSS) |+| `bsd/dev/hakios.net.c`, `hakios.virtio_net.c` | the `en0` network interface |+| `bsd/dev/hakios.adreno.c`, `iokit/Kernel/hakios.gpu.cpp` | the Adreno 642L GPU |+| `bsd/dev/hakios.wifi.c`, `hakios.wlfw.c` | Wi-Fi (WCN6750): shared memory, the radio's DSP, the driver |+| `bsd/dev/hakios.qmi.c`, `hakios.nas.c` | QMI and the NAS client |+| `bsd/dev/hakios.mpss.c` | the modem: firmware, file systems, IPA, SIM, registration |+| `bsd/dev/hakios.audio.c`, `hakios.adsp.c`, `hakios.speaker.c`, `hakios.mic.c` | sound through the audio DSP; the battery comes through it too |+| `bsd/dev/hakios.haptic.c`, `hakios.camera.c`, `hakios.ufs.c` | the vibration motor, the cameras, the UFS storage || `bsd/pthread/pthread_kext_static.c` | the pthread kext linked into the kernel |The patch also fixes what keeps open XNU from building and running outside Apple: the makefilesdiff --git a/xnu/apply.sh b/xnu/apply.shindex 5e5b4f7..ed4322f 100755--- a/xnu/apply.sh+++ b/xnu/apply.sh@@ -1,10 +1,10 @@#!/bin/bash-# Get Apple's XNU sources (the release that iOS 16.5 was built from) and put the redwood-# work on top of them: redwood.patch changes Apple's files, files/ holds the new ones.+# Get Apple's XNU sources (the release that iOS 16.5 was built from) and put the HakiOS+# work on top of them: hakios.patch changes Apple's files, files/ holds the new ones.# usage: xnu/apply.sh [DIR] (default: $XNU_SRC, else xnu-src/xnu-8796.121.2 next to this directory)# env: XNU_URL where to fetch from (default: Apple's repository on GitHub; an existing clone# that has the tag will do: XNU_URL=file:///path/to/xnu)-# The result is a git tree on the branch "redwood" with the work uncommitted, which is how+# The result is a git tree on the branch "hakios" with the work uncommitted, which is how# xnu/export.sh expects to find it. A directory that already exists is left alone.set -eHERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)@@ -14,7 +14,7 @@ TAG=xnu-8796.121.2BASE=c54f35ca767986246321eb901baf8f5ff7923f6a[ -e "$DIR" ] && { echo "apply.sh: $DIR already exists; not touching it" >&2; exit 1; }-[ -s "$HERE/redwood.patch" ] && [ -d "$HERE/files" ] || { echo "apply.sh: no redwood.patch and files/ in $HERE" >&2; exit 1; }+[ -s "$HERE/hakios.patch" ] && [ -d "$HERE/files" ] || { echo "apply.sh: no hakios.patch and files/ in $HERE" >&2; exit 1; }mkdir -p "$(dirname "$DIR")"DIR=$(cd "$(dirname "$DIR")" && pwd)/$(basename "$DIR")git init -q "$DIR"@@ -22,9 +22,9 @@ trap 'echo "apply.sh: failed; removing the incomplete $DIR" >&2; rm -rf "$DIR"'cd "$DIR"git remote add origin "$URL"git fetch -q --depth 1 origin "refs/tags/$TAG:refs/tags/$TAG" # that one release, without the history-git checkout -q -b redwood "$TAG"+git checkout -q -b hakios "$TAG"[ "$(git rev-parse HEAD)" = "$BASE" ] || { echo "apply.sh: $TAG is $(git rev-parse HEAD), expected $BASE" >&2; false; }echo 'BUILD/' >> .git/info/exclude-git apply --whitespace=nowarn "$HERE/redwood.patch"+git apply --whitespace=nowarn "$HERE/hakios.patch"cp -a "$HERE/files/." .-echo "apply.sh: $DIR: $TAG + $(grep -c '^diff --git' "$HERE/redwood.patch") changed and $(find "$HERE/files" -type f | wc -l) new files"+echo "apply.sh: $DIR: $TAG + $(grep -c '^diff --git' "$HERE/hakios.patch") changed and $(find "$HERE/files" -type f | wc -l) new files"diff --git a/xnu/export.sh b/xnu/export.shindex 8d3868c..35cf78b 100755--- a/xnu/export.sh+++ b/xnu/export.sh@@ -1,6 +1,6 @@#!/bin/bash# Save the kernel work as it is in the working tree, in the two forms apply.sh puts back:-# redwood.patch the changes to Apple's files (against the tag the work sits on)+# hakios.patch the changes to Apple's files (against the tag the work sits on)# files/ the files that are not in Apple's tree, at their paths# usage: xnu/export.sh [KERNEL-TREE] (default: $XNU_SRC, else xnu-src/xnu-8796.121.2)# Run it before committing whenever the kernel tree has changed. Committed or not makes no@@ -16,8 +16,8 @@ cd "$SRC"git cat-file -e "$BASE^{commit}" 2>/dev/null || { echo "export.sh: $SRC is not a clone of xnu at $BASE" >&2; exit 1; }# no renames: a moved file is a deletion in the patch and a new file in files/-git -c core.abbrev=12 diff --binary --no-renames --no-color --no-ext-diff --diff-filter=MDT "$BASE" -- . > "$HERE/redwood.patch.new"-mv "$HERE/redwood.patch.new" "$HERE/redwood.patch"+git -c core.abbrev=12 diff --binary --no-renames --no-color --no-ext-diff --diff-filter=MDT "$BASE" -- . > "$HERE/hakios.patch.new"+mv "$HERE/hakios.patch.new" "$HERE/hakios.patch"rm -rf "$HERE/files.new"mkdir "$HERE/files.new"@@ -31,5 +31,5 @@ done < "$HERE/files.list"rm -rf "$HERE/files" "$HERE/files.list"mv "$HERE/files.new" "$HERE/files"-echo "xnu/redwood.patch: $(grep -c '^diff --git' "$HERE/redwood.patch") files changed, $(wc -c < "$HERE/redwood.patch") bytes"+echo "xnu/hakios.patch: $(grep -c '^diff --git' "$HERE/hakios.patch") files changed, $(wc -c < "$HERE/hakios.patch") bytes"echo "xnu/files: $(find "$HERE/files" -type f | wc -l) new files, $(du -sk "$HERE/files" | cut -f1) KB"diff --git a/xnu/files/bsd/dev/redwood_adreno.c b/xnu/files/bsd/dev/hakios.adreno.csimilarity index 98%rename from xnu/files/bsd/dev/redwood_adreno.crename to xnu/files/bsd/dev/hakios.adreno.cindex e5c40c5..0c8e43d 100644--- a/xnu/files/bsd/dev/redwood_adreno.c+++ b/xnu/files/bsd/dev/hakios.adreno.c@@ -5,7 +5,7 @@** Boot-arg gpu=1, on the phone and with the GPU's firmware in the small image: the GPU is* started while the system starts and kept for the window server to draw with (the service- * RedwoodGPU; "the GPU kept on" below). Should a step fail, one line says which, and the system+ * HakiosGPU; "the GPU kept on" below). Should a step fail, one line says which, and the system* draws in software as it does without the boot-arg.** The steps are how this was found out, and they stay for looking: how much of the GPU a kernel@@ -67,7 +67,7 @@* that note is all there is.* adreno_fine=1 the newest step waits like that before every single access* adreno_keep=1 with adreno=21: the GPU is not stopped again but kept for the system to draw- * with, through the service RedwoodGPU (see "the GPU kept on" below); it is+ * with, through the service HakiosGPU (see "the GPU kept on" below); it is* given back when the run ends (adreno_dirty=1: left as a panic leaves it)* adreno_speed=N step 17 asks the GMU for the 3D core's Nth speed: 1 315 MHz, 2 450 MHz,* 3 550 MHz (the default: the most this phone's GPU is rated for)@@ -96,7 +96,7 @@#include <mach/mach_types.h>#include <mach/vm_param.h>#include <pexpert/pexpert.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/stat.h>#include <sys/systm.h>#include <vm/vm_kern.h>@@ -1607,12 +1607,12 @@ extern int mdevgetkernelrange(dev_t dev, vm_offset_t *base, uint64_t *size);*/static bool image_asked_quietly; /* image_file() says nothing: is the file there at all */-extern const uint8_t *redwood_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);+extern const uint8_t *hakios_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);static const uint8_t *image_file(const char *directory, const char *name, uint64_t *size){int disk = -1;- const uint8_t *data = redwood_image_file(directory, name, size, &disk); /* (redwood_image.c) */+ const uint8_t *data = hakios_image_file(directory, name, size, &disk); /* (hakios.image.c) */if (data != NULL) {if (!image_asked_quietly) {@@ -2733,7 +2733,7 @@ step_core_start(void)/** How textures in the GPU's own tiled and compressed layouts are laid out in memory (Linux's* a6xx_calc_ubwc_config, a6xx_set_ubwc_config for this GPU: highest bank bit 14, and the- * rest as below); Mesa is told the same (redwood_gpu_parameter()).+ * rest as below); Mesa is told the same (hakios_gpu_parameter()).*/put(&gpu, "rb_nc_mode_cntl", GPU_WORD(0x8e08), 1u << 11 | 1u << 4 | 1u << 1);put(&gpu, "tpl1_nc_mode_cntl", GPU_WORD(0xb604), 1u << 1);@@ -3127,7 +3127,7 @@ gpu_block_stop(void)* its to use.*/void-redwood_adreno_quiesce(void)+hakios_adreno_quiesce(void){if (cx_off) {return;@@ -3158,7 +3158,7 @@ redwood_adreno_quiesce(void)/** With boot-arg adreno_keep=1 the steps are not undone: the GPU block stays as step 21 leaves it,- * the 3D core powered and taking commands, and the service RedwoodGPU (iokit/Kernel/RedwoodGPU.cpp)+ * the 3D core powered and taking commands, and the service HakiosGPU (iokit/Kernel/hakios.gpu.cpp)* hands it to programs through the interface of Linux's msm driver, which is what Mesa's* freedreno speaks. That file keeps the buffers and the clients; what is the GPU's is here:* addresses in the 3D core's SMMU context, the ring, and the word by which the core says how@@ -3190,27 +3190,27 @@ static uint32_t gpu_timed_count;static uint32_t gpu_timed_by[7]; /* ... how many of them under 0.1, 0.25, 0.5, 1, 2, 4 ms, and longer */static uint32_t gpu_exact = 1; /* boot-arg gpu_exact=0: the core does not wait to be idle before it notes the time */uint32_t gpu_log; /* boot-arg gpu_log=1: a line for every submission and the time the core spent on it */-extern void redwood_tl(const char *format, ...) __printflike(1, 2);+extern void hakios_tl(const char *format, ...) __printflike(1, 2);static struct {uint64_t start, size;} gpu_free[1024]; /* the addresses not in use, in order */static unsigned gpu_free_count;-extern void RedwoodGPUStart(void);-extern void RedwoodGPUStop(void); /* takes the clients' lock, then calls redwood_gpu_stop() */+extern void HakiosGPUStart(void);+extern void HakiosGPUStop(void); /* takes the clients' lock, then calls hakios_gpu_stop() */static void gpu_block_stop(void);/** A run that ends in order -- its time is up, the host asks for the end, five fingers on the* screen, a halt: whoever is about to call loader_return() for one of these calls- * redwood_adreno_stop() first, from a thread that may wait -- gives the GPU back as the steps'+ * hakios_adreno_stop() first, from a thread that may wait -- gives the GPU back as the steps'* own ending does, and the next kernel finds the GPU block as the phone's start leaves it. A- * panic cannot: it leaves the GPU block running but quiet (redwood_adreno_quiesce()), and the+ * panic cannot: it leaves the GPU block running but quiet (hakios_adreno_quiesce()), and the* next kernel's step 4 takes it down (stale_stop()). Boot-arg adreno_dirty=1 makes every ending* a panic's in this respect, to see that work.*/void-redwood_gpu_stop(void)+hakios_gpu_stop(void){if (gpu_kept) {uint32_t waited = 0;@@ -3222,11 +3222,11 @@ redwood_gpu_stop(void)* frame, the GMU may not answer. Half a second at the most; then its bus is halted* for good, and its power switched off from here.*/- while (!redwood_gpu_done(gpu_fence) && waited < 5000) {+ while (!hakios_gpu_done(gpu_fence) && waited < 5000) {sleep_us(100);waited++;}- core_stuck = !redwood_gpu_done(gpu_fence);+ core_stuck = !hakios_gpu_done(gpu_fence);printf("adreno: the run is about to end: the GPU is given back (%s after %u us)\n",core_stuck ? "STILL AT WORK" : "it had finished what it was given", 100 * waited);gpu_block_stop();@@ -3234,24 +3234,24 @@ redwood_gpu_stop(void)}void-redwood_adreno_stop(void)+hakios_adreno_stop(void){uint32_t dirty = 0;if (gpu_kept && !(PE_parse_boot_argn("adreno_dirty", &dirty, sizeof(dirty)) && dirty)) {- RedwoodGPUStop();+ HakiosGPUStop();}}bool-redwood_gpu_ready(void)+hakios_gpu_ready(void){return gpu_kept;}/* The answers to msm's GET_PARAM (Linux's adreno_get_param for this GPU; the numbers are msm_drm.h's). */bool-redwood_gpu_parameter(uint32_t which, uint64_t *value)+hakios_gpu_parameter(uint32_t which, uint64_t *value){switch (which) {case 0x01: /* GPU_ID: none, the chip ID says it */@@ -3293,7 +3293,7 @@ redwood_gpu_parameter(uint32_t which, uint64_t *value)/* Addresses for a buffer of so many bytes; 0: none left. */uint64_t-redwood_gpu_address(uint64_t size)+hakios_gpu_address(uint64_t size){size = (size + 0xffff) & ~0xffffull;for (unsigned i = 0; i < gpu_free_count; i++) {@@ -3312,7 +3312,7 @@ redwood_gpu_address(uint64_t size)}void-redwood_gpu_address_free(uint64_t address, uint64_t size)+hakios_gpu_address_free(uint64_t address, uint64_t size){unsigned at;@@ -3335,21 +3335,21 @@ redwood_gpu_address_free(uint64_t address, uint64_t size)} /* (or else these addresses are lost) */}-/* One 4K page of ours at an address of the 3D core's; after the last of a buffer's, redwood_gpu_mapped(). */+/* One 4K page of ours at an address of the 3D core's; after the last of a buffer's, hakios_gpu_mapped(). */bool-redwood_gpu_map(uint64_t address, uint64_t phys, bool read_only)+hakios_gpu_map(uint64_t address, uint64_t phys, bool read_only){return space_map(&core_space, address, phys, PTE_CORE | (read_only ? PTE_READ_ONLY : 0));}void-redwood_gpu_mapped(void)+hakios_gpu_mapped(void){space_commit(&core_space);}void-redwood_gpu_unmap(uint64_t address, uint64_t size)+hakios_gpu_unmap(uint64_t address, uint64_t size){uint32_t context = smmu_context(&core_space);@@ -3365,14 +3365,14 @@ redwood_gpu_unmap(uint64_t address, uint64_t size)/* Memory that the 3D core and a program see without this processor's cache in between: out of that cache. */void-redwood_gpu_to_memory(void *start, uint64_t size)+hakios_gpu_to_memory(void *start, uint64_t size){to_memory((vm_offset_t)start, size);}/* How far the 3D core has got. */bool-redwood_gpu_done(uint32_t fence)+hakios_gpu_done(uint32_t fence){volatile uint32_t *word = (volatile uint32_t *)(core_scratch.memory + GPU_FENCE_AT);@@ -3381,7 +3381,7 @@ redwood_gpu_done(uint32_t fence)}uint32_t-redwood_gpu_last(void)+hakios_gpu_last(void){return gpu_fence;}@@ -3417,8 +3417,8 @@ gpu_times(void)unsigned by = 0;if (gpu_log) {- /* "tl: q FENCE took US": what the core spent on that submission (iokit/Kernel/RedwoodGPU.cpp: tl: Q) */- redwood_tl("tl: q %u took %llu\n", gpu_timed, ticks * 10 / 192);+ /* "tl: q FENCE took US": what the core spent on that submission (iokit/Kernel/hakios.gpu.cpp: tl: Q) */+ hakios_tl("tl: q %u took %llu\n", gpu_timed, ticks * 10 / 192);}while (by < 6 && ticks >= under[by]) {@@ -3436,7 +3436,7 @@ gpu_times(void)* many of those took it under 0.1, 0.25, 0.5, 1, 2, 4 milliseconds and longer.*/void-redwood_gpu_worked(uint64_t *microseconds, uint32_t *submissions, uint32_t by[7])+hakios_gpu_worked(uint64_t *microseconds, uint32_t *submissions, uint32_t by[7]){gpu_times();*microseconds = gpu_ticks * 10 / 192;@@ -3453,7 +3453,7 @@ redwood_gpu_worked(uint64_t *microseconds, uint32_t *submissions, uint32_t by[7]* full and the core is not reading it.*/uint32_t-redwood_gpu_submit(const uint64_t *addresses, const uint32_t *words, uint32_t count)+hakios_gpu_submit(const uint64_t *addresses, const uint32_t *words, uint32_t count){uint32_t wanted = 26 + 4 * count, room = 0;@@ -3498,7 +3498,7 @@ redwood_gpu_submit(const uint64_t *addresses, const uint32_t *words, uint32_t co/* A submission does not come back: what the 3D core and its SMMU context say. */void-redwood_gpu_report(const char *why)+hakios_gpu_report(const char *why){uint32_t context = smmu_context(&core_space);@@ -3542,7 +3542,7 @@ static struct block tsens = { "tsens1", 0x0c265000, 0x200 };#define TSENS_VALID (1u << 21)void-redwood_adreno_minute(void)+hakios_adreno_minute(void){int32_t tenths[2];@@ -3709,7 +3709,7 @@ out:* that only look (10 to 12) left out, no pauses, no watch. Anywhere else -- QEMU, whose machine* has its peripherals elsewhere -- not one register of the above is touched.*/-#define REDWOOD_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin (its "redwood") */+#define HAKIOS_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin (its "redwood") */extern vm_offset_t pe_arm_get_soc_base_phys(void);@@ -3720,7 +3720,7 @@ start_by_itself(void)const char *missing = NULL;uint64_t size;- if (pe_arm_get_soc_base_phys() != REDWOOD_SOC_BASE) {+ if (pe_arm_get_soc_base_phys() != HAKIOS_SOC_BASE) {printf("adreno: THE GPU IS NOT STARTED: gpu=1 is for the phone, and this is not it\n");return false;}@@ -3745,7 +3745,7 @@ start_by_itself(void)* its end -- all that the loader's notes keep -- is about what is being done here.*/void-redwood_adreno_init(void)+hakios_adreno_init(void){static const char *const what[] = {"", "the clocks outside", "the fuses", "the clock controller", "the CX half's power", "the clocks", "the first words",@@ -3813,8 +3813,8 @@ redwood_adreno_init(void)PE_parse_boot_argn("gpu_log", &gpu_log, sizeof(gpu_log));gpu_kept = true;quiet = true;- printf("adreno: THE GPU STAYS ON for the system to draw with: the service RedwoodGPU\n");- RedwoodGPUStart();+ printf("adreno: THE GPU STAYS ON for the system to draw with: the service HakiosGPU\n");+ HakiosGPUStart();return;}if (!by_itself) {diff --git a/xnu/files/bsd/dev/redwood_adsp.c b/xnu/files/bsd/dev/hakios.adsp.csimilarity index 96%rename from xnu/files/bsd/dev/redwood_adsp.crename to xnu/files/bsd/dev/hakios.adsp.cindex b331003..92f34d6 100644--- a/xnu/files/bsd/dev/redwood_adsp.c+++ b/xnu/files/bsd/dev/hakios.adsp.c@@ -5,7 +5,7 @@* The SoC's audio (LPASS: its clocks, its I2S and SoundWire, the codec's macros) does not belong* to the application processor. It is the audio DSP's -- a Hexagon of its own inside LPASS,* Android's "adsp" -- which stays in reset until somebody loads it, exactly as the Wi-Fi's does- * (redwood_wifi.c): the phone's own signed image, adsp.mdt and adsp.b02 to adsp.b36 from+ * (hakios.wifi.c): the phone's own signed image, adsp.mdt and adsp.b02 to adsp.b36 from* /vendor/firmware_mnt/image of its Android (20 MB: in the system image under /fw, or with ADSP=1 in* the small one, see image_file()), goes into the 64 MB reserved for it, TrustZone is* asked to authenticate and start it, and from there everything is conversation through the@@ -15,7 +15,7 @@* What audio needs of it later -- the audio services, the codec, the speaker's path -- is for the* steps after this one; this file only brings the DSP up and the link with it.*- * The way is the Wi-Fi DSP's, taken over from redwood_wifi.c with the audio DSP's numbers: its+ * The way is the Wi-Fi DSP's, taken over from hakios.wifi.c with the audio DSP's numbers: its* comments say why each thing is done so. What is different is said here:* - processor 2 (not 13) in the shared memory; its SMP2P items 443 (its) and 429 (ours), its* last words in item 423; GLINK's three items in our partition with it@@ -25,7 +25,7 @@* - the always-on processor is told of it as "adsp"* - the Wi-Fi DSP may be running at the same time (wifi=1): the mailbox to the always-on* processor and the lock for allocating in the shared memory are the two things both use,- * each behind a lock both take (redwood_wifi.c); the doorbells are only counted here, and+ * each behind a lock both take (hakios.wifi.c); the doorbells are only counted here, and* only the audio DSP's are cleared from here* The code is a copy, not a shared library, for now: step 1 is not to change what the Wi-Fi does.*@@ -52,8 +52,8 @@* 11 talks APR, on the channel apr_audio_svc that the DSP opens and we answer as well: whether* the audio services are up, and which there are (see step_apr())*- * Once everything is up with adsp=1, the sound's path takes over (redwood_sound.c, boot-arg sound=N):- * redwood_adsp_apr() is how it speaks to the audio services (any service, port and token; what+ * Once everything is up with adsp=1, the sound's path takes over (hakios.sound.c, boot-arg sound=N):+ * hakios_adsp_apr() is how it speaks to the audio services (any service, port and token; what* nobody waits for goes to its handler of events), and it is stopped before the DSP is.** What is started is stopped: when the steps are over (unless adsp_keep=1, and then when the run@@ -74,7 +74,7 @@** Addresses are from the phone's own device tree (qcom,lpass@3700000, qcom,smp2p-adsp,* qcom,glink/adsp, qcom,ipcc@408000, power-controller@c300000, reserved-memory), layouts from- * Linux (see redwood_wifi.c for the files).+ * Linux (see hakios.wifi.c for the files).*/#include <kern/clock.h>#include <kern/kalloc.h>@@ -93,8 +93,8 @@#include <sys/vnode.h>#include <sys/vnode_internal.h>#include <vm/vm_kern.h>-#include <sys/redwood_audio.h>-#include <sys/redwood_input.h>+#include <sys/hakios.audio.h>+#include <sys/hakios.input.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern vm_offset_t ml_io_map_unmappable(vm_offset_t phys_addr, vm_size_t size, unsigned int flags);@@ -106,15 +106,15 @@ extern vm_offset_t pe_arm_get_soc_base_phys(void);extern dev_t mdevlookup(int devid);extern int mdevgetkernelrange(dev_t dev, vm_offset_t *base, uint64_t *size);-/* What the Wi-Fi's DSP and this one both use (redwood_wifi.c). */-extern lck_mtx_t redwood_aop_mailbox_lock;-extern lck_mtx_t redwood_smem_alloc_lock;-extern lck_mtx_t redwood_rsc_lock; /* RPMh's sequencer, shared with the other DSP's driver */+/* What the Wi-Fi's DSP and this one both use (hakios.wifi.c). */+extern lck_mtx_t hakios_aop_mailbox_lock;+extern lck_mtx_t hakios_smem_alloc_lock;+extern lck_mtx_t hakios_rsc_lock; /* RPMh's sequencer, shared with the other DSP's driver */-static LCK_GRP_DECLARE(adsp_lock_group, "redwood-adsp");+static LCK_GRP_DECLARE(adsp_lock_group, "hakios-adsp");#define STEPS 11-#define REDWOOD_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin */+#define HAKIOS_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin */static uint32_t last_step, pause_ms = 2200, listen_seconds = 3;static uint32_t step; /* the one being performed */@@ -123,7 +123,7 @@ static char last_write[96] = "nothing written";static bool leaving; /* on the way back to the loader after a panic: no lock is taken, nothing sleeps *//*- * Every line goes to the log the loader reads from another core as well (as in redwood_wifi.c);+ * Every line goes to the log the loader reads from another core as well (as in hakios.wifi.c);* with adsp=1 only the few that say how it went (tell()), the rest to the kernel's own log.*/extern void loader_log_putc(char c);@@ -218,7 +218,7 @@ option(const char *name)return PE_parse_boot_argn(name, &value, sizeof(value)) && value != 0;}-/* ---- register access (as in redwood_wifi.c) ------------------------------------------------------- */+/* ---- register access (as in hakios.wifi.c) ------------------------------------------------------- */static uint32_t __attribute__((noinline))rd(vm_offset_t address)@@ -285,7 +285,7 @@ put(struct block *b, const char *name, uint32_t offset, uint32_t value)wr(b->base + offset, value);}-/* ---- the shared memory (redwood_wifi.c, step 1) --------------------------------------------------- */+/* ---- the shared memory (hakios.wifi.c, step 1) --------------------------------------------------- */#define SMEM_PHYS 0x80900000UL#define SMEM_SIZE 0x00200000u@@ -583,7 +583,7 @@ show_crash_reason(void)}}-/* ---- the doorbells, and the mailbox to the always-on processor (redwood_wifi.c, steps 2 and 7) ------ */+/* ---- the doorbells, and the mailbox to the always-on processor (hakios.wifi.c, steps 2 and 7) ------ */#define QMP_MAGIC 0x00#define QMP_MAGIC_VALUE 0x4d41494c@@ -669,7 +669,7 @@ ring_aop(void)wr(ipcc.base + IPCC_SEND, IPCC_AOP << 16 | 0);}-/* Linux's qmp_open(), as redwood_wifi.c does it; what is done already is found done. Under the mailbox's lock. */+/* Linux's qmp_open(), as hakios.wifi.c does it; what is done already is found done. Under the mailbox's lock. */static boolmailbox_open(void){@@ -734,7 +734,7 @@ mailbox_send(const char *text)bool sent = false;if (!leaving) {- lck_mtx_lock(&redwood_aop_mailbox_lock);+ lck_mtx_lock(&hakios_aop_mailbox_lock);}if (our_box == 0 && (leaving || !mailbox_open())) {goto out;@@ -761,7 +761,7 @@ mailbox_send(const char *text)sent = true;out:if (!leaving) {- lck_mtx_unlock(&redwood_aop_mailbox_lock);+ lck_mtx_unlock(&hakios_aop_mailbox_lock);}return sent;}@@ -897,12 +897,12 @@ rails(uint32_t level)values[r] = (uint32_t)position;}need(&rsc);- lck_mtx_lock(&redwood_rsc_lock);+ lck_mtx_lock(&hakios_rsc_lock);/* (the boot loader leaves the trigger set after its last request, done: idle is what the status says) */if (rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_STATUS) == 0) {printf("adsp: %u: TCS %u of the sequencer is busy (status %#x, control %#x): the rails are not asked\n", step, RPMH_TCS,rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_STATUS), rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL));- lck_mtx_unlock(&redwood_rsc_lock);+ lck_mtx_unlock(&hakios_rsc_lock);return false;}printf("adsp: %u: about to ask RPMh, through TCS %u, for lcx.lvl (%#x) = %u and lmx.lvl (%#x) = %u (level %u%s)\n", step,@@ -935,7 +935,7 @@ rails(uint32_t level)wr(rsc.base + RSC_IRQ_CLEAR, 1u << RPMH_TCS);wr(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL, rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL) & ~(TCS_TRIGGER | TCS_ACTIVE_MODE));wr(rsc.base + RSC_TCS(RPMH_TCS) + TCS_ENABLED, 0);- lck_mtx_unlock(&redwood_rsc_lock);+ lck_mtx_unlock(&hakios_rsc_lock);return done != 0;}@@ -1019,15 +1019,15 @@ root_file(const char *name, uint64_t *size)static bool from_root; /* the image is in memory of ours (root_file()), to be given back once written */-/* For the sound (redwood_sound.c): a file of /fw on the root, read whole into memory of ours, and given back. */+/* For the sound (hakios.sound.c): a file of /fw on the root, read whole into memory of ours, and given back. */const uint8_t *-redwood_adsp_fw_file(const char *name, uint64_t *size)+hakios_adsp_fw_file(const char *name, uint64_t *size){return root_file(name, size);}void-redwood_adsp_fw_free(const uint8_t *data, uint64_t size)+hakios_adsp_fw_free(const uint8_t *data, uint64_t size){uint8_t *ours = __DECONST(uint8_t *, data);@@ -1035,12 +1035,12 @@ redwood_adsp_fw_free(const uint8_t *data, uint64_t size)}/* A file of fw/ in the small image (ADSP=1 userland/build.sh puts fw-audio/ there), else of /fw on the root (above). */-extern const uint8_t *redwood_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);+extern const uint8_t *hakios_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);static const uint8_t *image_file(const char *name, uint64_t *size){{- const uint8_t *data = redwood_image_file("fw", name, size, NULL); /* (redwood_image.c) */+ const uint8_t *data = hakios_image_file("fw", name, size, NULL); /* (hakios.image.c) */if (data != NULL) {return data;@@ -1190,9 +1190,9 @@ step_mailbox(void)bool open;announce("open the mailbox to the always-on processor, unless it is open: words of its message memory, and its doorbell");- lck_mtx_lock(&redwood_aop_mailbox_lock);+ lck_mtx_lock(&hakios_aop_mailbox_lock);open = mailbox_open();- lck_mtx_unlock(&redwood_aop_mailbox_lock);+ lck_mtx_unlock(&hakios_aop_mailbox_lock);return open;}@@ -1495,7 +1495,7 @@ static struct block smem_lock = { "shared memory's lock", 0x01f43000, 0x1000 };#define LOCK_OWNER 0x000#define LOCK_US 1u-/* Our item made in the partition, as Linux's qcom_smem_alloc_private() makes one (redwood_wifi.c: our_item_make()). */+/* Our item made in the partition, as Linux's qcom_smem_alloc_private() makes one (hakios.wifi.c: our_item_make()). */static boolour_item_make(uint32_t partition){@@ -1505,7 +1505,7 @@ our_item_make(uint32_t partition)uint32_t owner = ~0u, at;bool made = false;- lck_mtx_lock(&redwood_smem_alloc_lock); /* (the Wi-Fi's start allocates under the same hardware lock) */+ lck_mtx_lock(&hakios_smem_alloc_lock); /* (the Wi-Fi's start allocates under the same hardware lock) */need(&smem_lock);printf("adsp: %u: about to take the lock (%#x), write an entry for item %u with %u bytes behind it at the partition's mark, ""move the mark by %u, and release the lock\n", step, smem_lock.phys + LOCK_OWNER, ITEM_SMP2P_OURS, item_size, need_bytes);@@ -1520,7 +1520,7 @@ our_item_make(uint32_t partition)}if (owner != LOCK_US) {printf("adsp: %u: THE LOCK IS HELD BY PROCESSOR %u AND STAYS SO FOR A SECOND: nothing is written\n", step, owner);- lck_mtx_unlock(&redwood_smem_alloc_lock);+ lck_mtx_unlock(&hakios_smem_alloc_lock);return false;}if (!smem_peek(partition, &header, sizeof(header)) || header.free_uncached > header.free_cached ||@@ -1555,7 +1555,7 @@ our_item_make(uint32_t partition)out:wr(smem_lock.base + LOCK_OWNER, 0);printf("adsp: %u: the lock is released (it reads %u)\n", step, rd(smem_lock.base + LOCK_OWNER));- lck_mtx_unlock(&redwood_smem_alloc_lock);+ lck_mtx_unlock(&hakios_smem_alloc_lock);return made;}@@ -1764,7 +1764,7 @@ step_start(void)return ready_at != 0;}-/* ---- GLINK (redwood_wifi.c; items 478 to 480 of our partition with the audio DSP) ------------------- */+/* ---- GLINK (hakios.wifi.c; items 478 to 480 of our partition with the audio DSP) ------------------- */#define ITEM_GLINK_DESCRIPTOR 478#define ITEM_GLINK_OUR_QUEUE 479@@ -2268,7 +2268,7 @@ glink_send(struct glink_channel *channel, const void *data, uint32_t length)return 0;}-/* ---- QRTR: hello, and the services the DSP tells of (redwood_wifi.c, without ports of our own yet) ---- */+/* ---- QRTR: hello, and the services the DSP tells of (hakios.wifi.c, without ports of our own yet) ---- */#define QRTR_US 1u#define QRTR_CONTROL 0xfffffffeu@@ -2464,8 +2464,8 @@ static struct {static uint32_t apr_in, apr_out, apr_next_token = 1;static bool audio_up; /* the core service has said that the audio services are up (step 11) */static uint32_t apr_waited_for; /* the token a question waits for the answer to; 0: none */-static redwood_apr_events_t apr_events; /* the sound's (redwood_sound.c): what nobody waits for */-static redwood_apr_events_t apr_events_second; /* the microphones' (redwood_mic.c) */+static hakios_apr_events_t apr_events; /* the sound's (hakios.sound.c): what nobody waits for */+static hakios_apr_events_t apr_events_second; /* the microphones' (hakios.mic.c) */static LCK_MTX_DECLARE(apr_lock, &adsp_lock_group); /* one question at a time *//* A packet from the DSP's audio services. From the link's thread. */@@ -2488,7 +2488,7 @@ apr_input(const uint8_t *data, uint32_t length)payload = (header.size < length ? header.size : length) - header_length;apr_in++;if (header.token != apr_waited_for || apr_waited_for == 0) {- redwood_apr_events_t events = apr_events;+ hakios_apr_events_t events = apr_events;uint32_t words[64];bzero(words, sizeof(words));@@ -2525,8 +2525,8 @@ apr_input(const uint8_t *data, uint32_t length)* The port is the service's own numbering of what the command is for (ASM: session << 8 | stream).*/bool-redwood_adsp_apr(uint8_t service, uint16_t port, uint32_t token, uint32_t opcode, const void *payload, uint32_t length,- uint32_t ms, struct redwood_apr_answer *answer)+hakios_adsp_apr(uint8_t service, uint16_t port, uint32_t token, uint32_t opcode, const void *payload, uint32_t length,+ uint32_t ms, struct hakios_apr_answer *answer){uint8_t packet[sizeof(struct apr_header) + 256];struct apr_header *header = (struct apr_header *)packet;@@ -2591,13 +2591,13 @@ redwood_adsp_apr(uint8_t service, uint16_t port, uint32_t token, uint32_t opcode}void-redwood_adsp_apr_events(redwood_apr_events_t handler)+hakios_adsp_apr_events(hakios_apr_events_t handler){apr_events = handler;}void-redwood_adsp_apr_events_second(redwood_apr_events_t handler)+hakios_adsp_apr_events_second(hakios_apr_events_t handler){apr_events_second = handler;}@@ -2606,7 +2606,7 @@ redwood_adsp_apr_events_second(redwood_apr_events_t handler)static boolapr_ask(uint8_t service, uint32_t opcode, const void *payload, uint32_t length, uint32_t ms){- return redwood_adsp_apr(service, 0, 0, opcode, payload, length, ms, NULL);+ return hakios_adsp_apr(service, 0, 0, opcode, payload, length, ms, NULL);}/* ---- the battery manager, on the channel PMIC_RTR_ADSP_APPS ------------------------------------------ */@@ -2621,8 +2621,8 @@ apr_ask(uint8_t service, uint32_t opcode, const void *payload, uint32_t length,* that a get does not use, and is answered with the property's number, its value and a result (0:* good). Only gets are sent from here: nothing is set, no limit, no current, no notice asked for.* With adsp=1 (battmgr=0: not) it is asked every BATTMGR_SECONDS while the DSP runs, and what it says- * goes to bsd/dev/redwood_battery.c (redwood_battery_report()), and from there to the power source- * that iOS reads (iokit/Kernel/RedwoodBattery.cpp). battmgr=2: every property once, for the log.+ * goes to bsd/dev/hakios.battery.c (hakios_battery_report()), and from there to the power source+ * that iOS reads (iokit/Kernel/hakios.battery.cpp). battmgr=2: every property once, for the log.* Units: capacity in hundredths of a percent, voltage in uV, current in uA (more than 0 while the* battery takes charge), the temperature in hundredths of a degree, charges in uAh.* The properties' numbers are this phone's firmware's, read with battmgr=2 and checked against what@@ -2750,7 +2750,7 @@ battmgr_thread(__unused void *parameter, __unused wait_result_t result)}}for (unsigned round = 0; battmgr.wanted && glink.up && glink.channel[CHANNEL_PMIC].open; round++) {- struct redwood_battery_state b = { .size = sizeof(b) };+ struct hakios_battery_state b = { .size = sizeof(b) };uint32_t capacity = 0, status = 0, present = 0, volt = 0, curr = 0, temp = 0, usb = 0;uint32_t usb_type = 0, usb_volt = 0, usb_curr = 0, charge = 0;static uint32_t full, design, cycles;@@ -2789,7 +2789,7 @@ battmgr_thread(__unused void *parameter, __unused wait_result_t result)b.usb_type = (int32_t)usb_type;b.usb_voltage_uv = (int32_t)usb_volt;b.usb_current_ua = (int32_t)usb_curr;- redwood_battery_report(&b);+ hakios_battery_report(&b);}if (round < 3 || round % 6 == 0 || !good) {tell("adsp: battmgr: %s capacity %u (hundredths of a percent), status %u, present %u, %d uV, %d uA, temperature %d "@@ -3113,11 +3113,11 @@ steps_over(uint32_t done)/* When the run ends in order: a DSP that runs is shut down, for the next kernel to start again. */void-redwood_adsp_stop(void)+hakios_adsp_stop(void){battmgr_stop();- redwood_sound_dsp_down(); /* the amplifiers, the stream and the port first, while the DSP still listens */- redwood_mic_dsp_down(); /* and what the microphones' path has asked for */+ hakios_sound_dsp_down(); /* the amplifiers, the stream and the port first, while the DSP still listens */+ hakios_mic_dsp_down(); /* and what the microphones' path has asked for */lck_mtx_lock(&dsp_lock);if (dsp_started) {unsigned services = 0;@@ -3138,9 +3138,9 @@ redwood_adsp_stop(void)/* The same on a panic's way back to the loader: one processor, interrupts off, no lock, no sleep. */void-redwood_adsp_quiesce(void)+hakios_adsp_quiesce(void){- redwood_sound_quiesce(); /* the amplifiers off, whatever the DSP's state */+ hakios_sound_quiesce(); /* the amplifiers off, whatever the DSP's state */if (!dsp_started) {return;}@@ -3185,8 +3185,8 @@ whole_thread(__unused void *parameter, __unused wait_result_t result)if (step == STEPS && dsp_started) {tell("adsp: THE AUDIO DSP IS UP AND LINKED, its audio services up (APR), %llu ms after the kernel began on it (the ""root's waited for included): node %u, %u services; it stays on\n", (now_us() - began) / 1000, qrtr_peer, services);- redwood_sound_dsp_up(); /* (boot-arg sound=N: the speakers' path, redwood_sound.c) */- redwood_mic_dsp_up(); /* (boot-arg mic=N: the microphones' path, redwood_mic.c) */+ hakios_sound_dsp_up(); /* (boot-arg sound=N: the speakers' path, hakios.sound.c) */+ hakios_mic_dsp_up(); /* (boot-arg mic=N: the microphones' path, hakios.mic.c) */battmgr_start(); /* (how the battery is, from the DSP; battmgr=0: not asked) */} else {tell("adsp: THE AUDIO DSP DID NOT COME UP: step %u failed (%s); see the kernel's own log for the steps\n", step + 1,@@ -3195,9 +3195,9 @@ whole_thread(__unused void *parameter, __unused wait_result_t result)thread_terminate(current_thread());}-/* Called while the system starts (bsd/dev/redwood_input.c), after the Wi-Fi's start has been set going. */+/* Called while the system starts (bsd/dev/hakios.input.c), after the Wi-Fi's start has been set going. */void-redwood_adsp_init(void)+hakios_adsp_init(void){uint32_t on = 0;thread_t thread;@@ -3206,7 +3206,7 @@ redwood_adsp_init(void)if (last_step == 0 && (!PE_parse_boot_argn("adsp", &on, sizeof(on)) || on != 1)) {return;}- if (pe_arm_get_soc_base_phys() != REDWOOD_SOC_BASE) {+ if (pe_arm_get_soc_base_phys() != HAKIOS_SOC_BASE) {printf("adsp: adsp=1 and adsp_step=N are for the phone's audio DSP, and this is not the phone\n");return;}diff --git a/xnu/files/bsd/dev/redwood_apfs_check.c b/xnu/files/bsd/dev/hakios.apfs_check.csimilarity index 98%rename from xnu/files/bsd/dev/redwood_apfs_check.crename to xnu/files/bsd/dev/hakios.apfs_check.cindex b89d61a..e5ed4ea 100644--- a/xnu/files/bsd/dev/redwood_apfs_check.c+++ b/xnu/files/bsd/dev/hakios.apfs_check.c@@ -85,11 +85,11 @@#include <sys/vnode.h>#include <sys/vnode_if.h>#include <sys/vnode_internal.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/sysctl.h>#include <pexpert/pexpert.h>#include <libkern/OSAtomic.h>-#include <sys/redwood_apfs_check.h>+#include <sys/hakios.apfs_check.h>#include <miscfs/apfs/apfs_lib.h>#include <miscfs/apfs/apfs_write.h>#include <miscfs/apfs/apfs_store.h>@@ -99,7 +99,7 @@extern void loader_return(void); /* osfmk/arm64/loader_return.c */extern void apfs_stats_print(void); /* bsd/miscfs/apfs/apfs_vfsops.c */-extern void redwood_sparse_report(void);+extern void hakios_sparse_report(void);/* how memory stands, for the progress line (osfmk/vm, bsd/vfs) */extern unsigned int vm_page_free_count, vm_page_wire_count, memorystatus_available_pages;@@ -448,7 +448,7 @@ watch_tick(__unused thread_call_param_t p0, __unused thread_call_param_t p1)printf("apfs-check: STUCK: no progress for %d s after entry %llu, at %s, in %s\n",WATCH_SECONDS, cs->entries, cs->path + cs->rel, watch_phase);apfs_stats_print();- redwood_sparse_report();+ hakios_sparse_report();printf("apfs-check: going back to the loader with that\n");loader_return();return;@@ -1021,7 +1021,7 @@ apfs_check_concurrent(void)** Where this can reach, which is the point: a block device. The phone's flash is not one under* this kernel -- it is read through the loader's mailbox and, on the branch that writes to it at- * all, through a character device of its own with its own bounds (bsd/dev/redwood_ufs.c) -- so+ * all, through a character device of its own with its own bounds (bsd/dev/hakios.ufs.c) -- so* nothing here can touch it. In QEMU and on the phone alike the only block devices are RAM* disks. And it happens at all only when asked for twice over: apfs_check=7 and a path.*/@@ -1339,7 +1339,7 @@ out:* read back, so what is reported came off the device.** apfs_check=8- * apfs_dev=md1 the store volume (default rvblk0); its name must be RedwoodStore+ * apfs_dev=md1 the store volume (default rvblk0); its name must be HakiosStore* apfs_store_len=N how many bytes of payload (default 40000)* apfs_store_seed=N which pattern (default 1); a different seed is a different payload* apfs_store_note=N the writer's own number, kept in the header (default 0)@@ -1671,7 +1671,7 @@ apfs_check_thread(void *arg, __unused wait_result_t wr)}walk:- redwood_ufs_report("before the walk");+ hakios_ufs_report("before the walk");start = mach_absolute_time();cs.t0 = start;watch_start(&cs);@@ -1712,8 +1712,8 @@ walk:cs.no_hash ? " (apfs_hash=0)" : "");}apfs_stats_print();- redwood_sparse_report();- redwood_ufs_report("after the walk");+ hakios_sparse_report();+ hakios_ufs_report("after the walk");printf("apfs-check: compare with tools/apfs/verify.py sum\n");kfree_data(cs.path, PATH_CAP);@@ -1730,7 +1730,7 @@ apfs_check_runner(void *arg, wait_result_t wr)}/*- * sysctl kern.redwood_switch_root="INCOMING OUTGOING": the volume mounted on INCOMING+ * sysctl kern.hakios_switch_root="INCOMING OUTGOING": the volume mounted on INCOMING* becomes the root, and what was the root until now is mounted on OUTGOING inside it (a* path without a leading slash, which must be a directory there -- on the iOS volume, a* synthetic one). devfs stays on /dev (vfs_switch_root() keeps it there). This is how@@ -1738,22 +1738,22 @@ apfs_check_runner(void *arg, wait_result_t wr)* small image, whose init mounts the volume, puts in place what the system needs on it* and then asks for this (userland/src/init.c, boot-arg root_apfs=). Process 1 only, once.*/-static int redwood_root_switched;+static int hakios_root_switched;static int-redwood_sysctl_switch_root SYSCTL_HANDLER_ARGS+hakios_sysctl_switch_root SYSCTL_HANDLER_ARGS{#pragma unused(oidp, arg1, arg2)char buf[512], *outgoing;int error;if (req->newptr == USER_ADDR_NULL) {- return SYSCTL_OUT(req, redwood_root_switched ? "1" : "0", 2);+ return SYSCTL_OUT(req, hakios_root_switched ? "1" : "0", 2);}if (proc_getpid(current_proc()) != 1 || suser(kauth_cred_get(), NULL) != 0) {return EPERM;}- if (redwood_root_switched) {+ if (hakios_root_switched) {return EBUSY;}if (req->newlen == 0 || req->newlen >= sizeof(buf)) {@@ -1770,15 +1770,15 @@ redwood_sysctl_switch_root SYSCTL_HANDLER_ARGS}*outgoing++ = '\0';error = vfs_switch_root(buf, outgoing, 0);- printf("redwood: %s is the root now, the one before it on /%s: %d\n", buf, outgoing, error);+ printf("hakios: %s is the root now, the one before it on /%s: %d\n", buf, outgoing, error);if (error == 0) {- redwood_root_switched = 1;+ hakios_root_switched = 1;}return error;}-SYSCTL_PROC(_kern, OID_AUTO, redwood_switch_root, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_LOCKED,- NULL, 0, redwood_sysctl_switch_root, "A",+SYSCTL_PROC(_kern, OID_AUTO, hakios_switch_root, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_LOCKED,+ NULL, 0, hakios_sysctl_switch_root, "A","write \"INCOMING OUTGOING\": the volume on INCOMING becomes the root (process 1, once)");/*@@ -1822,7 +1822,7 @@ apfs_volume_mount(void)}void-redwood_apfs_check_init(void)+hakios_apfs_check_init(void){uint32_t mode = 0;thread_t th;diff --git a/xnu/files/bsd/dev/redwood_apple80211.c b/xnu/files/bsd/dev/hakios.apple80211.csimilarity index 89%rename from xnu/files/bsd/dev/redwood_apple80211.crename to xnu/files/bsd/dev/hakios.apple80211.cindex e2674ee..acf5292 100644--- a/xnu/files/bsd/dev/redwood_apple80211.c+++ b/xnu/files/bsd/dev/hakios.apple80211.c@@ -1,15 +1,15 @@/*- * Darwin-on-redwood: Apple80211, answered in the kernel.+ * Darwin-on-hakios: Apple80211, answered in the kernel.** iOS's Wi-Fi side -- wifid, and through it Settings and the status bar -- talks to a Wi-Fi* driver in requests that were once ioctls and are, where the driver offers no user client,* ioctls still: SIOCGA80211 and SIOCSA80211 on any socket, with a struct apple80211req that* names the interface, a request type, a value, and a buffer in the caller's memory* (IO80211.framework: Apple80211Get/Set and their kin all end there). XNU hands an interface- * ioctl it does not know to the interface, so they arrive in bsd/dev/redwood_net.c, which+ * ioctl it does not know to the interface, so they arrive in bsd/dev/hakios.net.c, which* passes them here when its link is a radio.*- * What is asked is answered from the station boundary (sys/redwood_sta.h): the radio's power,+ * What is asked is answered from the station boundary (sys/hakios.sta.h): the radio's power,* its channels, a scan and what it heard, the network joined. What happens there by itself is* told to iOS the way a driver tells it: kernel events of class 6 (IEEE 802.11), subclass 1,* whose code is Apple80211's own event number and whose data begins with the interface's name@@ -38,9 +38,9 @@#include <sys/kern_event.h>#include <sys/kernel.h>#include <sys/proc.h>-#include <sys/redwood_input.h>-#include <sys/redwood_net.h>-#include <sys/redwood_sta.h>+#include <sys/hakios.input.h>+#include <sys/hakios.net.h>+#include <sys/hakios.sta.h>#include <sys/sockio.h>#include <sys/systm.h>@@ -195,9 +195,9 @@ _Static_assert(sizeof(struct apple80211_scan_result) == 1164 && offsetof(structenum { EVENT_POWER_CHANGED = 1, EVENT_SSID_CHANGED = 2, EVENT_BSSID_CHANGED = 3, EVENT_LINK_CHANGED = 4, EVENT_ASSOC_DONE = 9,EVENT_SCAN_DONE = 10 };-static const char interface_name[16] = "en0"; /* (bsd/dev/redwood_net.c makes one interface, and that is its name) */+static const char interface_name[16] = "en0"; /* (bsd/dev/hakios.net.c makes one interface, and that is its name) */-static LCK_GRP_DECLARE(apple80211_lock_group, "redwood-apple80211");+static LCK_GRP_DECLARE(apple80211_lock_group, "hakios-apple80211");static LCK_MTX_DECLARE(apple80211_lock, &apple80211_lock_group);static unsigned result_next; /* which of what the last scan heard a SCAN_RESULT request gets next */static uint32_t join_result; /* of the last join asked for: 0 while it runs, then Apple80211's number */@@ -226,8 +226,8 @@ channel_fill(struct apple80211_channel *channel, unsigned frequency, unsigned fl{channel->version = 1;channel->channel = channel_number(frequency);- channel->flags = CHANNEL_20MHZ | (frequency < 4000 ? CHANNEL_2GHZ : CHANNEL_5GHZ) | (flags & REDWOOD_STA_CHANNEL_PASSIVE ?- 0 : CHANNEL_ACTIVE) | (flags & REDWOOD_STA_CHANNEL_RADAR ? CHANNEL_DFS : 0);+ channel->flags = CHANNEL_20MHZ | (frequency < 4000 ? CHANNEL_2GHZ : CHANNEL_5GHZ) | (flags & HAKIOS_STA_CHANNEL_PASSIVE ?+ 0 : CHANNEL_ACTIVE) | (flags & HAKIOS_STA_CHANNEL_RADAR ? CHANNEL_DFS : 0);}/* ---- what the caller is given back ------------------------------------------------------------------- */@@ -242,7 +242,7 @@ give(const struct apple80211req *request, const void *data, size_t length)/* An access point in the form a scan's result has; the caller has said how much room for elements there is. */static int-give_network(const struct apple80211req *request, const struct redwood_sta_bss *bss)+give_network(const struct apple80211req *request, const struct hakios_sta_bss *bss){struct apple80211_scan_result *result = kalloc_data(sizeof(*result), Z_WAITOK | Z_ZERO);unsigned room = sizeof(result->elements);@@ -288,13 +288,13 @@ give_network(const struct apple80211req *request, const struct redwood_sta_bss *static intget(struct apple80211req *request){- struct redwood_sta_state *state;+ struct hakios_sta_state *state;int error = 0;switch (request->req_type) {case 43:case 44: { /* the driver's and the hardware's name: the text alone, in 256 bytes */- static const char name[256] = "redwood: ath11k for the WCN6750";+ static const char name[256] = "hakios: ath11k for the WCN6750";return give(request, name, sizeof(name));}@@ -317,7 +317,7 @@ get(struct apple80211req *request)case 19: { /* the radio's power: one radio. Until the driver is up it counts as on: it */struct { /* is being brought up, and iOS asks this once, early */uint32_t version, radios, state[4];- } answer = { .version = 1, .radios = 1, .state = { !redwood_sta_present() || redwood_sta_powered() } };+ } answer = { .version = 1, .radios = 1, .state = { !hakios_sta_present() || hakios_sta_powered() } };return give(request, &answer, sizeof(answer));}@@ -327,8 +327,8 @@ get(struct apple80211req *request)case 27:case 254: { /* the channels the radio may tune to */struct apple80211_channels *answer;- struct redwood_sta_channel channels[96];- unsigned count = redwood_sta_channels(channels, 96);+ struct hakios_sta_channel channels[96];+ unsigned count = hakios_sta_channels(channels, 96);if (count == 0 || (answer = kalloc_data(sizeof(*answer), Z_WAITOK | Z_ZERO)) == NULL) {return count == 0 ? ENXIO : ENOMEM;@@ -344,8 +344,8 @@ get(struct apple80211req *request)}case 207: { /* ... and more of each */struct apple80211_channels_info *answer;- struct redwood_sta_channel channels[96];- unsigned count = redwood_sta_channels(channels, 96);+ struct hakios_sta_channel channels[96];+ unsigned count = hakios_sta_channels(channels, 96);if (count == 0 || (answer = kalloc_data(sizeof(*answer), Z_WAITOK | Z_ZERO)) == NULL) {return count == 0 ? ENXIO : ENOMEM;@@ -356,8 +356,8 @@ get(struct apple80211req *request)channel_fill(&channel, channels[i].frequency, channels[i].flags);answer->number[i] = (uint8_t)channel.channel;- answer->dfs[i] = (channels[i].flags & REDWOOD_STA_CHANNEL_RADAR) != 0;- answer->passive[i] = (channels[i].flags & REDWOOD_STA_CHANNEL_PASSIVE) != 0;+ answer->dfs[i] = (channels[i].flags & HAKIOS_STA_CHANNEL_RADAR) != 0;+ answer->passive[i] = (channels[i].flags & HAKIOS_STA_CHANNEL_PASSIVE) != 0;answer->flags[i] = channel.flags;}error = give(request, answer, sizeof(*answer));@@ -370,7 +370,7 @@ get(struct apple80211req *request)lck_mtx_unlock(&apple80211_lock);return 0;case 11: { /* what the last scan heard, one access point a request; EIO: that was all */- struct redwood_sta_bss *bss = kalloc_data(sizeof(*bss), Z_WAITOK);+ struct hakios_sta_bss *bss = kalloc_data(sizeof(*bss), Z_WAITOK);unsigned index;bool there;@@ -380,7 +380,7 @@ get(struct apple80211req *request)lck_mtx_lock(&apple80211_lock);index = result_next++;lck_mtx_unlock(&apple80211_lock);- there = redwood_sta_heard(index, bss);+ there = hakios_sta_heard(index, bss);error = there ? give_network(request, bss) : EIO;kfree_data(bss, sizeof(*bss));return error;@@ -393,21 +393,21 @@ get(struct apple80211req *request)if ((state = kalloc_data(sizeof(*state), Z_WAITOK)) == NULL) {return ENOMEM;}- redwood_sta_state(state);+ hakios_sta_state(state);switch (request->req_type) {case 13: /* the state: APPLE80211_S_INIT 0, _SCAN 1, _AUTH 2, _ASSOC 3, _RUN 4 */- request->req_val = state->phase == REDWOOD_STA_JOINED ? 4 : state->phase == REDWOOD_STA_JOINING ? 2 :- state->phase == REDWOOD_STA_SCANNING ? 1 : 0;+ request->req_val = state->phase == HAKIOS_STA_JOINED ? 4 : state->phase == HAKIOS_STA_JOINING ? 2 :+ state->phase == HAKIOS_STA_SCANNING ? 1 : 0;break;case 1: /* its name; the length goes back in the request */- if (state->phase != REDWOOD_STA_JOINED) {+ if (state->phase != HAKIOS_STA_JOINED) {error = ENXIO;} else if ((error = give(request, state->bss.ssid, state->bss.ssid_length)) == 0) {request->req_len = state->bss.ssid_length;}break;case 9: /* its access point's address */- error = state->phase != REDWOOD_STA_JOINED ? ENXIO : give(request, state->bss.bssid, 6);+ error = state->phase != HAKIOS_STA_JOINED ? ENXIO : give(request, state->bss.bssid, 6);break;case 4: { /* its channel */struct {@@ -415,7 +415,7 @@ get(struct apple80211req *request)struct apple80211_channel channel;} answer = { .version = 1 };- if (state->phase != REDWOOD_STA_JOINED) {+ if (state->phase != HAKIOS_STA_JOINED) {error = ENXIO;} else {channel_fill(&answer.channel, state->bss.frequency, 0);@@ -430,18 +430,18 @@ get(struct apple80211req *request)} answer = { .version = 1, .radios = 1, .each = { state->bss.rssi }, .all = state->bss.rssi,.each_ext = { state->bss.rssi }, .all_ext = state->bss.rssi };- error = state->phase != REDWOOD_STA_JOINED ? ENXIO : give(request, &answer, sizeof(answer));+ error = state->phase != HAKIOS_STA_JOINED ? ENXIO : give(request, &answer, sizeof(answer));break;}case 103: /* all of it, as a scan's result */- error = state->phase != REDWOOD_STA_JOINED ? ENXIO : give_network(request, &state->bss);+ error = state->phase != HAKIOS_STA_JOINED ? ENXIO : give_network(request, &state->bss);break;case 2: { /* how it was joined: open system, then WPA2 with a passphrase */struct {uint32_t version, lower, upper, extended;} answer = { .version = 1, .lower = 1, .upper = 8 };- error = state->phase != REDWOOD_STA_JOINED ? ENXIO : give(request, &answer, sizeof(answer));+ error = state->phase != HAKIOS_STA_JOINED ? ENXIO : give(request, &answer, sizeof(answer));break;}default:@@ -458,14 +458,14 @@ static intset_scan(const struct apple80211req *request, char *said, size_t said_size){struct apple80211_scan_request *asked;- struct redwood_sta_scan *what;+ struct hakios_sta_scan *what;unsigned unknown = 0;int error;if (request->req_len != sizeof(*asked)) {return EINVAL;}- if (!redwood_sta_present()) {+ if (!hakios_sta_present()) {return EBUSY; /* (the radio is still being brought up: the framework tries again) */}asked = kalloc_data(sizeof(*asked), Z_WAITOK);@@ -499,7 +499,7 @@ set_scan(const struct apple80211req *request, char *said, size_t said_size)lck_mtx_lock(&apple80211_lock);result_next = 0;lck_mtx_unlock(&apple80211_lock);- error = redwood_sta_ask_scan(what);+ error = hakios_sta_ask_scan(what);}out:if (asked != NULL) {@@ -515,7 +515,7 @@ static intset_join(const struct apple80211req *request, char *said, size_t said_size){struct apple80211_assoc *asked;- struct redwood_sta_join *what;+ struct hakios_sta_join *what;int error;if (request->req_len < offsetof(struct apple80211_assoc, rest)) {@@ -539,13 +539,13 @@ set_join(const struct apple80211req *request, char *said, size_t said_size)memcpy(what->ssid, asked->ssid, asked->ssid_length);memcpy(what->bssid, asked->bssid, sizeof(what->bssid));if (asked->key_length == 0) {- what->security = REDWOOD_STA_OPEN;+ what->security = HAKIOS_STA_OPEN;} else if (asked->key_cipher == CIPHER_PASSPHRASE && asked->key_length >= 8 && asked->key_length <= 63) {- what->security = REDWOOD_STA_WPA2_PSK;+ what->security = HAKIOS_STA_WPA2_PSK;what->passphrase_length = (uint8_t)asked->key_length;memcpy(what->passphrase, asked->key, asked->key_length);} else if (asked->key_cipher == CIPHER_PMK && asked->key_length == sizeof(what->pmk)) {- what->security = REDWOOD_STA_WPA2_PSK;+ what->security = HAKIOS_STA_WPA2_PSK;memcpy(what->pmk, asked->key, sizeof(what->pmk));} else {error = EINVAL;@@ -554,7 +554,7 @@ set_join(const struct apple80211req *request, char *said, size_t said_size)lck_mtx_lock(&apple80211_lock);join_result = 0;lck_mtx_unlock(&apple80211_lock);- error = redwood_sta_ask_join(what);+ error = hakios_sta_ask_join(what);out:if (asked != NULL) {memset_s(asked, sizeof(*asked), 0, sizeof(*asked));@@ -574,7 +574,7 @@ set(const struct apple80211req *request, char *said, size_t said_size)case 20:return set_join(request, said, said_size);case 22: /* leave the network */- return redwood_sta_ask_leave();+ return hakios_sta_ask_leave();case 19: { /* the radio's power */struct {uint32_t version, radios, state[4];@@ -585,7 +585,7 @@ set(const struct apple80211req *request, char *said, size_t said_size)return request->req_len < sizeof(asked) ? EINVAL : error;}snprintf(said, said_size, " (power: %s)", asked.state[0] ? "on" : "off");- return redwood_sta_ask_power(asked.state[0] != 0);+ return hakios_sta_ask_power(asked.state[0] != 0);}case 10:return set_scan(request, said, said_size);@@ -613,40 +613,40 @@ post(uint32_t code, const void *data, uint32_t length)kev_post_msg(&message);}-/* What the station side says has happened (bsd/dev/redwood_sta.c calls this, on its thread or the station's). */+/* What the station side says has happened (bsd/dev/hakios.sta.c calls this, on its thread or the station's). */void-redwood_apple80211_event(enum redwood_sta_event event, int status)+hakios_apple80211_event(enum hakios_sta_event event, int status){static unsigned said;if (said < 200) {said++;- printf("apple80211: the station says: %s, %d\n", event == REDWOOD_STA_POWER ? "power" : event == REDWOOD_STA_SCAN_DONE ?- "a scan is over" : event == REDWOOD_STA_JOIN_DONE ? "a join is over" : "the link", status);+ printf("apple80211: the station says: %s, %d\n", event == HAKIOS_STA_POWER ? "power" : event == HAKIOS_STA_SCAN_DONE ?+ "a scan is over" : event == HAKIOS_STA_JOIN_DONE ? "a join is over" : "the link", status);}switch (event) {- case REDWOOD_STA_POWER:+ case HAKIOS_STA_POWER:post(EVENT_POWER_CHANGED, NULL, 0);break;- case REDWOOD_STA_SCAN_DONE:+ case HAKIOS_STA_SCAN_DONE:lck_mtx_lock(&apple80211_lock);result_next = 0;lck_mtx_unlock(&apple80211_lock);post(EVENT_SCAN_DONE, NULL, 0);break;- case REDWOOD_STA_JOIN_DONE:+ case HAKIOS_STA_JOIN_DONE:lck_mtx_lock(&apple80211_lock);join_result = status == 0 ? 1 : status == EAUTH ? 21 : status == ETIMEDOUT ? 9 : 2;lck_mtx_unlock(&apple80211_lock);post(EVENT_ASSOC_DONE, NULL, 0);break;- case REDWOOD_STA_LINK: {+ case HAKIOS_STA_LINK: {struct apple80211_link_changed link = { .down = status != 1, .involuntary = status != 1 && status != 0,.reason = status != 1 && status != 0 ? 4 : 0 }; /* (4: gone, not asked) */- struct redwood_sta_state *state = kalloc_data(sizeof(*state), Z_WAITOK | Z_ZERO);+ struct hakios_sta_state *state = kalloc_data(sizeof(*state), Z_WAITOK | Z_ZERO);if (state != NULL) {- redwood_sta_state(state);+ hakios_sta_state(state);link.rssi = status == 1 ? state->bss.rssi : 0;kfree_data(state, sizeof(*state));}@@ -692,7 +692,7 @@ note(const struct apple80211req *request, bool is_set, int error)}void-redwood_apple80211_summary(void)+hakios_apple80211_summary(void){static bool said;@@ -711,7 +711,7 @@ redwood_apple80211_summary(void)/* An Apple80211 request for the radio's interface, from the process that is running now. */errno_t-redwood_apple80211_ioctl(u_long command, void *data)+hakios_apple80211_ioctl(u_long command, void *data){static unsigned said;struct apple80211req *request = data;diff --git a/xnu/files/bsd/dev/redwood_audio.c b/xnu/files/bsd/dev/hakios.audio.csimilarity index 77%rename from xnu/files/bsd/dev/redwood_audio.crename to xnu/files/bsd/dev/hakios.audio.cindex 70b6e71..de97d92 100644--- a/xnu/files/bsd/dev/redwood_audio.c+++ b/xnu/files/bsd/dev/hakios.audio.c@@ -1,10 +1,10 @@/*- * /dev/redwood-audio: the sound that iOS plays (see sys/redwood_audio.h).+ * /dev/hakios-audio: the sound that iOS plays (see sys/hakios.audio.h).** What is written goes two ways:** to a sink a driver that plays it: the virtio sound device under QEMU- * (redwood_virtio_sound.c). On the phone there is none yet (redwood_speaker.c+ * (hakios.virtio_sound.c). On the phone there is none yet (hakios.speaker.c* is where it begins).** into a recording, with boot-arg rec_sound=N: the first N seconds of sound are also kept@@ -17,8 +17,8 @@* struct rec_header, then per write: struct rec_block, frames * 4 bytes** With rec_sound_fed=1 as well, the recording has instead what the speakers' guard- * let through (redwood_guard.c, on the phone): what reaches the amplifiers. With- * rec_sound_mic=1, what the main microphone hears (redwood_mic.c, mic=3), in both+ * let through (hakios.guard.c, on the phone): what reaches the amplifiers. With+ * rec_sound_mic=1, what the main microphone hears (hakios.mic.c, mic=3), in both* channels.** When the writer has stopped, a line in the log says how long it wrote, at what rate, how much@@ -36,7 +36,7 @@#include <sys/conf.h>#include <sys/errno.h>#include <sys/proc.h>-#include <sys/redwood_audio.h>+#include <sys/hakios.audio.h>#include <sys/systm.h>#include <sys/uio.h>#include <vm/vm_kern.h>@@ -50,7 +50,7 @@ extern uint64_t kvtophys(vm_offset_t va); /* pmap_paddr_t */struct rec_header {char magic[8]; /* "RWSND001" */- uint32_t rate, channels; /* REDWOOD_AUDIO_RATE, REDWOOD_AUDIO_CHANNELS; the samples are 16-bit */+ uint32_t rate, channels; /* HAKIOS_AUDIO_RATE, HAKIOS_AUDIO_CHANNELS; the samples are 16-bit */uint32_t blocks;uint32_t reserved;};@@ -63,14 +63,14 @@ struct rec_block {/* { physical address, bytes, kernel address } of the recording, for the loader: osfmk/arm64/loader_return.c */extern uint64_t loader_sound[3];-static LCK_GRP_DECLARE(audio_lck_grp, "redwood-audio");+static LCK_GRP_DECLARE(audio_lck_grp, "hakios-audio");static LCK_MTX_DECLARE(audio_lock, &audio_lck_grp);-static redwood_audio_sink_t audio_sink;+static hakios_audio_sink_t audio_sink;static uint8_t *rec_base;static bool rec_fed; /* boot-arg rec_sound_fed=1: what the guard let through is recorded, not what was written */-static bool rec_mic; /* boot-arg rec_sound_mic=1: what the microphone hears (redwood_mic.c) */+static bool rec_mic; /* boot-arg rec_sound_mic=1: what the microphone hears (hakios.mic.c) */static uint64_t rec_size, rec_used;static uint64_t rec_frames, rec_frames_max;@@ -108,16 +108,16 @@ audio_report(__unused thread_call_param_t p0, __unused thread_call_param_t p1)report_armed = false;lck_mtx_unlock(&audio_lock);- printf("redwood-audio: %llu.%02llu s written", frames / REDWOOD_AUDIO_RATE,- frames % REDWOOD_AUDIO_RATE * 100 / REDWOOD_AUDIO_RATE);+ printf("hakios-audio: %llu.%02llu s written", frames / HAKIOS_AUDIO_RATE,+ frames % HAKIOS_AUDIO_RATE * 100 / HAKIOS_AUDIO_RATE);if (lasted >= NSEC_PER_SEC) {/* what was written before the latest write took the time between the first and the latest */printf(" at %llu frames a second", (frames - latest) * NSEC_PER_SEC / lasted);}- printf(", %llu.%02llu s of it sound, peak %u%% of full scale", sound / REDWOOD_AUDIO_RATE,- sound % REDWOOD_AUDIO_RATE * 100 / REDWOOD_AUDIO_RATE, loudest * 100 / 32768);+ printf(", %llu.%02llu s of it sound, peak %u%% of full scale", sound / HAKIOS_AUDIO_RATE,+ sound % HAKIOS_AUDIO_RATE * 100 / HAKIOS_AUDIO_RATE, loudest * 100 / 32768);if (lost) {- printf(", %llu ms lost (the sink was full)", lost * 1000 / REDWOOD_AUDIO_RATE);+ printf(", %llu ms lost (the sink was full)", lost * 1000 / HAKIOS_AUDIO_RATE);}printf("\n");}@@ -128,7 +128,7 @@ audio_record(const int16_t *frames, uint32_t count){struct rec_header *header = (struct rec_header *)rec_base;struct rec_block *block;- uint64_t bytes = (uint64_t)count * REDWOOD_AUDIO_FRAME;+ uint64_t bytes = (uint64_t)count * HAKIOS_AUDIO_FRAME;if (rec_base == NULL || rec_frames >= rec_frames_max || rec_used + sizeof(*block) + bytes > rec_size) {return;@@ -143,25 +143,25 @@ audio_record(const int16_t *frames, uint32_t count)header->blocks++;loader_sound[1] = rec_used;if (rec_frames >= rec_frames_max) {- printf("redwood-audio: recording finished: %llu s in %u writes\n", rec_frames / REDWOOD_AUDIO_RATE, header->blocks);+ printf("hakios-audio: recording finished: %llu s in %u writes\n", rec_frames / HAKIOS_AUDIO_RATE, header->blocks);}}bool-redwood_audio_recording_fed(void)+hakios_audio_recording_fed(void){return rec_fed && rec_base != NULL && rec_frames < rec_frames_max;}bool-redwood_audio_recording_mic(void)+hakios_audio_recording_mic(void){return rec_mic && rec_base != NULL && rec_frames < rec_frames_max;}/* From the speakers' feeder: what the guard let through, into the recording (rec_sound_fed=1). */void-redwood_audio_record_fed(const int16_t *frames, uint32_t count)+hakios_audio_record_fed(const int16_t *frames, uint32_t count){lck_mtx_lock(&audio_lock);audio_record(frames, count);@@ -174,7 +174,7 @@ audio_play(const int16_t *frames, uint32_t count)uint32_t loudest = 0, taken = 0;uint64_t deadline;- for (uint32_t i = 0; i < count * REDWOOD_AUDIO_CHANNELS; i++) {+ for (uint32_t i = 0; i < count * HAKIOS_AUDIO_CHANNELS; i++) {uint32_t level = frames[i] < 0 ? -(int32_t)frames[i] : frames[i];if (level > loudest) {@@ -210,12 +210,12 @@ audio_play(const int16_t *frames, uint32_t count)}void-redwood_audio_set_sink(const char *name, redwood_audio_sink_t sink)+hakios_audio_set_sink(const char *name, hakios_audio_sink_t sink){lck_mtx_lock(&audio_lock);audio_sink = sink;lck_mtx_unlock(&audio_lock);- printf("redwood-audio: sound goes to %s\n", name);+ printf("hakios-audio: sound goes to %s\n", name);}static int@@ -233,35 +233,35 @@ audio_close(__unused dev_t dev, __unused int flags, __unused int devtype, __unusstatic intaudio_write(__unused dev_t dev, struct uio *uio, __unused int ioflag){- int16_t frames[CHUNK_FRAMES * REDWOOD_AUDIO_CHANNELS];+ int16_t frames[CHUNK_FRAMES * HAKIOS_AUDIO_CHANNELS];int error = 0;- while (uio_resid(uio) >= REDWOOD_AUDIO_FRAME) {+ while (uio_resid(uio) >= HAKIOS_AUDIO_FRAME) {user_ssize_t bytes = uio_resid(uio);if (bytes > (user_ssize_t)sizeof(frames)) {bytes = sizeof(frames);}- bytes -= bytes % REDWOOD_AUDIO_FRAME;+ bytes -= bytes % HAKIOS_AUDIO_FRAME;error = uiomove((caddr_t)frames, (int)bytes, uio);if (error) {break;}- audio_play(frames, (uint32_t)(bytes / REDWOOD_AUDIO_FRAME));+ audio_play(frames, (uint32_t)(bytes / HAKIOS_AUDIO_FRAME));}return error;}-/* the speakers' volume, as iOS sets it (sys/redwood_audio.h): kept for the sink's driver to look at */+/* the speakers' volume, as iOS sets it (sys/hakios.audio.h): kept for the sink's driver to look at */static uint32_t volume_below, volume_generation;static bool volume_muted;static intaudio_ioctl(__unused dev_t dev, u_long command, caddr_t data, __unused int flags, __unused struct proc *p){- const struct redwood_audio_volume *volume = (const struct redwood_audio_volume *)data;+ const struct hakios_audio_volume *volume = (const struct hakios_audio_volume *)data;- if (command != REDWOOD_AUDIO_SET_VOLUME) {+ if (command != HAKIOS_AUDIO_SET_VOLUME) {return ENOTTY;}lck_mtx_lock(&audio_lock);@@ -269,13 +269,13 @@ audio_ioctl(__unused dev_t dev, u_long command, caddr_t data, __unused int flagsvolume_muted = volume->muted != 0;volume_generation++;lck_mtx_unlock(&audio_lock);- printf("redwood-audio: the volume: %s%u.%03u dB under the loudest\n", volume->muted ? "muted; " : "", volume->below / 8,+ printf("hakios-audio: the volume: %s%u.%03u dB under the loudest\n", volume->muted ? "muted; " : "", volume->below / 8,volume->below % 8 * 125);return 0;}bool-redwood_audio_volume(uint32_t *below, bool *muted, uint32_t *generation)+hakios_audio_volume(uint32_t *below, bool *muted, uint32_t *generation){lck_mtx_lock(&audio_lock);*below = volume_below;@@ -306,21 +306,21 @@ audio_recording_init(void)seconds = REC_MAX_SECONDS;}/* the samples, and a block header for every write of ten milliseconds or more */- size = sizeof(*header) + (uint64_t)seconds * (REDWOOD_AUDIO_RATE * REDWOOD_AUDIO_FRAME + 100 * sizeof(struct rec_block));+ size = sizeof(*header) + (uint64_t)seconds * (HAKIOS_AUDIO_RATE * HAKIOS_AUDIO_FRAME + 100 * sizeof(struct rec_block));size = round_page(size);/* one piece of physical memory: the loader will send it over USB as it lies */if (kmem_alloc_contig(kernel_map, &memory, size, PAGE_MASK, 0, 0, KMA_KOBJECT | KMA_ZERO | KMA_DATA,VM_KERN_MEMORY_IOKIT) != KERN_SUCCESS) {- printf("redwood-audio: no memory for a recording of %u s (%llu MB)\n", seconds, size >> 20);+ printf("hakios-audio: no memory for a recording of %u s (%llu MB)\n", seconds, size >> 20);return;}header = (struct rec_header *)memory;memcpy(header->magic, "RWSND001", 8);- header->rate = REDWOOD_AUDIO_RATE;- header->channels = REDWOOD_AUDIO_CHANNELS;+ header->rate = HAKIOS_AUDIO_RATE;+ header->channels = HAKIOS_AUDIO_CHANNELS;rec_size = size;rec_used = sizeof(*header);- rec_frames_max = (uint64_t)seconds * REDWOOD_AUDIO_RATE;+ rec_frames_max = (uint64_t)seconds * HAKIOS_AUDIO_RATE;rec_base = (uint8_t *)memory;loader_sound[0] = kvtophys(memory);loader_sound[1] = rec_used;@@ -330,25 +330,25 @@ audio_recording_init(void)fed = 0;PE_parse_boot_argn("rec_sound_mic", &fed, sizeof(fed));rec_mic = fed != 0;- printf("redwood-audio: recording the first %u s of sound%s, into %llu MB at %#llx\n", seconds,+ printf("hakios-audio: recording the first %u s of sound%s, into %llu MB at %#llx\n", seconds,rec_fed ? " as the speakers' guard lets it through" : rec_mic ? " the microphone hears (in both channels)" : "", size >> 20,loader_sound[0]);}void-redwood_audio_init(void)+hakios_audio_init(void){int major = cdevsw_add(-1, &audio_cdevsw);- if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "redwood-audio") == NULL) {- printf("redwood-audio: cannot create the device\n");+ if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "hakios-audio") == NULL) {+ printf("hakios-audio: cannot create the device\n");return;}report_call = thread_call_allocate(audio_report, NULL);audio_recording_init();- redwood_virtio_sound_init();- redwood_speaker_init();- redwood_haptic_init();- redwood_torch_init();- redwood_camera_init();+ hakios_virtio_sound_init();+ hakios_speaker_init();+ hakios_haptic_init();+ hakios_torch_init();+ hakios_camera_init();}diff --git a/xnu/files/bsd/dev/redwood_battery.c b/xnu/files/bsd/dev/hakios.battery.csimilarity index 81%rename from xnu/files/bsd/dev/redwood_battery.crename to xnu/files/bsd/dev/hakios.battery.cindex 6e80b4d..58030d4 100644--- a/xnu/files/bsd/dev/redwood_battery.c+++ b/xnu/files/bsd/dev/hakios.battery.c@@ -1,7 +1,7 @@/** Battery monitor for Xiaomi redwood (POCO X5 Pro).*- * Redwood selects PM7325B and qcom,battery-charger over PMIC GLINK/ADSP, not+ * The phone selects PM7325B and qcom,battery-charger over PMIC GLINK/ADSP, not* the local PM7250B/QG layout. The resident UEFI contains the matching* Qualcomm charger drivers. xnuloader owns that firmware context on core 0,* polls it, and publishes a read-only cache; XNU only consumes that cache.@@ -12,7 +12,7 @@#include <libkern/libkern.h>#include <mach/mach_types.h>#include <pexpert/pexpert.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/sysctl.h>#include <sys/systm.h>@@ -45,29 +45,29 @@ static uint64_t battery_updates, battery_failures;/* for others in the kernel (the flashlight's thermal guard): -273 while it is not known */int-redwood_battery_temperature(void)+hakios_battery_temperature(void){return battery_temperature_c;}-SYSCTL_NODE(_kern, OID_AUTO, redwood, CTLFLAG_RW | CTLFLAG_LOCKED, 0, "redwood phone bits");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_soc, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_NODE(_kern, OID_AUTO, hakios, CTLFLAG_RW | CTLFLAG_LOCKED, 0, "redwood phone bits");+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_soc, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_soc_percent, 0, "battery state of charge, 0..100 percent, or -1 if unknown");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_voltage_mv, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_voltage_mv, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_voltage_mv, 0, "battery voltage in millivolts, or -1 if unknown");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_current_ma, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_current_ma, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_current_ma, 0, "battery current reported by Qualcomm firmware, in milliamps");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_temperature_c, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_temperature_c, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_temperature_c, 0, "battery temperature reported by Qualcomm firmware, in Celsius");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_present, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_present, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_present, 0, "1 if Qualcomm firmware reports a battery");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_charger_present, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_charger_present, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_charger_present, 0, "1 if Qualcomm firmware reports an attached charger");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_charging, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_charging, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_charging, 0, "1 while an attached charger is charging a non-full battery");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_soc_estimated, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_soc_estimated, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_soc_estimated, 0, "1 only when SOC had to be estimated from voltage");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_charger_action, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_charger_action, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_charger_action, 0, "last Qualcomm charger action, for diagnostics");static bool@@ -111,25 +111,25 @@ battery_poll(void)}/*- * What the audio DSP's battery manager says (bsd/dev/redwood_adsp.c, with adsp=1 unless battmgr=0):+ * What the audio DSP's battery manager says (bsd/dev/hakios.adsp.c, with adsp=1 unless battmgr=0):* the values that Android shows, from where Android takes them. They are kept here for the sysctls- * and passed on to the power source that iOS reads (iokit/Kernel/RedwoodBattery.cpp).+ * and passed on to the power source that iOS reads (iokit/Kernel/hakios.battery.cpp).*/static int battery_full_uah, battery_design_uah, battery_cycles, battery_source_dsp;-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_full_uah, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_full_uah, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_full_uah, 0, "the battery's full charge as the fuel gauge has learnt it, in uAh (0 if unknown)");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_design_uah, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_design_uah, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_design_uah, 0, "the battery's charge as designed, in uAh (0 if unknown)");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_cycles, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_cycles, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_cycles, 0, "the battery's charge cycles (0 if unknown)");-SYSCTL_INT(_kern_redwood, OID_AUTO, battery_from_dsp, CTLFLAG_RD | CTLFLAG_LOCKED,+SYSCTL_INT(_kern_hakios, OID_AUTO, battery_from_dsp, CTLFLAG_RD | CTLFLAG_LOCKED,&battery_source_dsp, 0, "1 when the values come from the audio DSP's battery manager");-extern void RedwoodBatteryReport(const void *state, unsigned size); /* iokit/Kernel/RedwoodBattery.cpp */+extern void HakiosBatteryReport(const void *state, unsigned size); /* iokit/Kernel/hakios.battery.cpp */void-redwood_battery_report(const struct redwood_battery_state *b)+hakios_battery_report(const struct hakios_battery_state *b){int percent = (b->percent_hundredths + 50) / 100;@@ -153,7 +153,7 @@ redwood_battery_report(const struct redwood_battery_state *b)}battery_source_dsp = 1;battery_updates++;- RedwoodBatteryReport(b, sizeof(*b));+ HakiosBatteryReport(b, sizeof(*b));}static void@@ -173,7 +173,7 @@ battery_thread(__unused void *parameter, __unused wait_result_t result)}void-redwood_battery_init(void)+hakios_battery_init(void){uint32_t enabled = 0;uint64_t shared_pa = 0;diff --git a/xnu/files/bsd/dev/redwood_buttons.c b/xnu/files/bsd/dev/hakios.buttons.csimilarity index 96%rename from xnu/files/bsd/dev/redwood_buttons.crename to xnu/files/bsd/dev/hakios.buttons.cindex 0bb4555..94dbbd5 100644--- a/xnu/files/bsd/dev/redwood_buttons.c+++ b/xnu/files/bsd/dev/hakios.buttons.c@@ -1,6 +1,6 @@/** The buttons of the POCO X5 Pro (redwood) -- power, volume up, volume down -- as a source of- * button records for /dev/redwood-touch (sys/redwood_input.h). Only with boot-arg buttons=1:+ * button records for /dev/hakios-touch (sys/hakios.input.h). Only with boot-arg buttons=1:* every address below belongs to this phone.** None of the three is a pin of the SoC. They are inputs of two of the power management chips:@@ -28,7 +28,7 @@* No interrupt is used; what one would take is said at the end of this file.** The mapping: the phone has what the iPhone X has, whose user space runs here -- a side button- * and two volume keys, no home button. Power is the side button (REDWOOD_BUTTON_LOCK).+ * and two volume keys, no home button. Power is the side button (HAKIOS_BUTTON_LOCK).** The bring-up is made in steps, each said in the log before it is made. Boot-arg* buttons_steps=N stops after the first N:@@ -48,7 +48,7 @@#include <libkern/libkern.h>#include <mach/mach_types.h>#include <pexpert/pexpert.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/systm.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);@@ -125,20 +125,20 @@ static vm_offset_t arb_core, arb_cnfg, arb_observer;/** One transfer at a time through the arbiter for this system, whoever asks (the flashlight's- * driver, bsd/dev/redwood_torch.c, as well): with two at once the arbiter drops one ("the transfer+ * driver, bsd/dev/hakios.torch.c, as well): with two at once the arbiter drops one ("the transfer* was dropped"), as Linux never lets happen (one lock for the bus).*/-static LCK_GRP_DECLARE(spmi_lck_grp, "redwood-spmi");+static LCK_GRP_DECLARE(spmi_lck_grp, "hakios-spmi");static LCK_SPIN_DECLARE(spmi_lock, &spmi_lck_grp);void-redwood_spmi_lock(void)+hakios_spmi_lock(void){lck_spin_lock(&spmi_lock);}void-redwood_spmi_unlock(void)+hakios_spmi_unlock(void){lck_spin_unlock(&spmi_lock);}@@ -170,7 +170,7 @@ spmi_read(const struct peripheral *p, uint8_t reg, uint8_t *bytes, uint32_t counconst char *problem = NULL;nanoseconds_to_absolutetime(READ_TIMEOUT_US * (uint64_t)NSEC_PER_USEC, &interval);- redwood_spmi_lock();+ hakios_spmi_lock();wr(channel + OBSERVER_COMMAND, COMMAND_READ | (uint32_t)reg << 4 | (count - 1));do {status = rd(channel + OBSERVER_STATUS);@@ -178,7 +178,7 @@ spmi_read(const struct peripheral *p, uint8_t reg, uint8_t *bytes, uint32_t coun} while (!(status & STATUS_DONE) && now - start < interval);data[0] = rd(channel + OBSERVER_DATA0);data[1] = count > 4 ? rd(channel + OBSERVER_DATA1) : 0;- redwood_spmi_unlock();+ hakios_spmi_unlock();if (!(status & STATUS_DONE)) {problem = "no answer from the arbiter";@@ -266,16 +266,16 @@ find_channel(struct peripheral *p, uint32_t channels)static struct button {const char * name;- uint32_t record; /* REDWOOD_BUTTON_* */+ uint32_t record; /* HAKIOS_BUTTON_* */bool usable; /* its input is what it was taken for */bool live; /* it has been seen released */bool last; /* the look before this one */bool down; /* as reported */uint64_t since; /* when it went down */uint32_t presses;-} power = { .name = "power", .record = REDWOOD_BUTTON_LOCK },- volume_up = { .name = "volume up", .record = REDWOOD_BUTTON_VOLUME_UP },- volume_down = { .name = "volume down", .record = REDWOOD_BUTTON_VOLUME_DOWN };+} power = { .name = "power", .record = HAKIOS_BUTTON_LOCK },+ volume_up = { .name = "volume up", .record = HAKIOS_BUTTON_VOLUME_UP },+ volume_down = { .name = "volume down", .record = HAKIOS_BUTTON_VOLUME_DOWN };/* "12.345 s (08:13:05.918 UTC)": since boot as in the log's own stamps, and as the daemons' lines have it */static void@@ -322,7 +322,7 @@ button_look(struct button *b, bool pressed)absolutetime_to_nanoseconds(now - b->since, &held);printf("buttons: %s released at %s, after %llu ms\n", b->name, when, held / NSEC_PER_MSEC);}- redwood_touch_post(pressed ? REDWOOD_BUTTON_DOWN : REDWOOD_BUTTON_UP, b->record, 0, 0);+ hakios_touch_post(pressed ? HAKIOS_BUTTON_DOWN : HAKIOS_BUTTON_UP, b->record, 0, 0);}/* One look at both peripherals. */@@ -532,7 +532,7 @@ out:}void-redwood_buttons_init(void)+hakios_buttons_init(void){uint32_t enabled = 0, steps = 5;thread_t thread;diff --git a/xnu/files/bsd/dev/redwood_camera.c b/xnu/files/bsd/dev/hakios.camera.csimilarity index 97%rename from xnu/files/bsd/dev/redwood_camera.crename to xnu/files/bsd/dev/hakios.camera.cindex 133b179..0e3c470 100644--- a/xnu/files/bsd/dev/redwood_camera.c+++ b/xnu/files/bsd/dev/hakios.camera.c@@ -1,11 +1,11 @@/** The cameras of the POCO X5 Pro (redwood): the macro one, an OmniVision OV02B10 (2 MP, Android's- * camera 2, "redwood_aac_ov02b10_macro"), the wide one, a Samsung S5KHM2SD (108 MP, Android's- * camera 0, "redwood_sunny_s5khm2sd_wide"), the front one and the ultra-wide one. Every address and+ * camera 2, "hakios_aac_ov02b10_macro"), the wide one, a Samsung S5KHM2SD (108 MP, Android's+ * camera 0, "hakios_sunny_s5khm2sd_wide"), the front one and the ultra-wide one. Every address and* number below belongs to this phone, from Android's own device tree (cam-sensor0 to cam-sensor3 and- * what they point to), the sensors' module files of Android's camera stack (/vendor/lib64/camera/com.qti.sensormodule.redwood_*.bin: the+ * what they point to), the sensors' module files of Android's camera stack (/vendor/lib64/camera/com.qti.sensormodule.hakios_*.bin: the* slave address, the chip ID and where it is read, the power sequence, the tables) and the drivers- * of the phone's kernel (MiCode redwood-s-oss: cam_sensor_util.c, qcom_pm8008-regulator.c,+ * of the phone's kernel (MiCode hakios-s-oss: cam_sensor_util.c, qcom_pm8008-regulator.c,* camcc-yupik.c, gdsc-regulator.c, pinctrl-yupik.c, pinctrl-spmi-gpio.c, cam_csiphy_*), read as* data. The macro one (the others' differences are in sensors[] below and capture_sensor()):*@@ -81,9 +81,9 @@#include <sys/conf.h>#include <sys/uio.h>#include <miscfs/devfs/devfs.h>-#include <sys/redwood_audio.h>-#include <sys/redwood_camera.h>-#include <sys/redwood_input.h>+#include <sys/hakios.audio.h>+#include <sys/hakios.camera.h>+#include <sys/hakios.input.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern kern_return_t thread_terminate(thread_t thread);@@ -273,7 +273,7 @@ reset_pin(bool high)wr(GPIO_CFG(hw->reset), CFG_OUTPUT | CFG_DRIVE_MA(2)); /* GPIO, no pull, 2 mA: Android's cam_sensor_active_* */}-/* ---- I2C by hand (as in redwood_haptic.c) ---------------------------------------------------------- */+/* ---- I2C by hand (as in hakios.haptic.c) ---------------------------------------------------------- */struct bus {const char * name;@@ -453,7 +453,7 @@ i2c_transfer(struct bus *b, uint8_t address, const uint8_t *out, unsigned out_coreturn answered;}-/* ---- the PMIC arbiter (version 5), for the PM8350C's GPIO 3: as in redwood_torch.c ------------------ */+/* ---- the PMIC arbiter (version 5), for the PM8350C's GPIO 3: as in hakios.torch.c ------------------ */#define ARB_CORE_PHYS 0x0c440000UL#define ARB_CORE_SIZE 0x1100UL@@ -514,7 +514,7 @@ static voidlock(void){if (!leaving) {- redwood_spmi_lock();+ hakios_spmi_lock();}}@@ -522,7 +522,7 @@ static voidunlock(void){if (!leaving) {- redwood_spmi_unlock();+ hakios_spmi_unlock();}}@@ -1107,7 +1107,7 @@ ctab_load(void){const uint8_t *at, *end;- ctab = (const struct ctab_head *)redwood_wifi_file(hw->tab, &ctab_size);+ ctab = (const struct ctab_head *)hakios_wifi_file(hw->tab, &ctab_size);if (ctab == NULL || ctab_size < sizeof(*ctab) || memcmp(ctab->magic, "RWCTAB02", 8) != 0 || ctab->modes == 0 ||ctab->modes > 16) {say("camera: no %s (RWCTAB02) in fw/ of the small image (made from fw-camera/ when it is built)\n", hw->tab);@@ -1303,7 +1303,7 @@ power_down(void)* enabled, with its LDOs off (they are switched above). Put back into reset it does come out* again -- it answers for its revision at 0x08 -- but its regulators are deaf from then on (a* write to 0x09 reads back 0xff), and the camera is gone for the rest of the run. It is put back- * as it was found when the kernel leaves (redwood_camera_quiesce), which is where Android gets+ * as it was found when the kernel leaves (hakios_camera_quiesce), which is where Android gets* the phone back.*/if (leaving && chip_enable_switched) {@@ -2050,7 +2050,7 @@ clocks_down(void)#define SMMU_TCR2 (1u | 1u << 4 | 7u << 15)#define SMMU_MAIR0 0xf404ff44#define SMMU_FSR_ALL 0xc00001fe-#define CAM_PTE (3ull | 1ull << 6 | 2ull << 8 | 1ull << 10 | 1ull << 11) /* as redwood_sound.c's */+#define CAM_PTE (3ull | 1ull << 6 | 2ull << 8 | 1ull << 10 | 1ull << 11) /* as hakios.sound.c's *//* What the loader hands to the host (tools/camraw.py reads it). */struct cam_header {@@ -2068,10 +2068,10 @@ struct cam_header {extern uint64_t loader_recording[3];extern uint64_t kvtophys(vm_offset_t va);-extern lck_mtx_t redwood_smmu_lock;+extern lck_mtx_t hakios_smmu_lock;static vm_offset_t frames, smmu_second, smmu_context, page_tables;-static vm_offset_t keep; /* memory in one piece, taken at boot (redwood_camera_init()) */+static vm_offset_t keep; /* memory in one piece, taken at boot (hakios_camera_init()) */static uint64_t keep_bytes;static uint64_t frames_bytes;static uint32_t smmu_match = ~0u, smmu_context_n, smmu_old_smr, smmu_old_s2cr, smmu_pages_size, smmu_pages;@@ -2085,7 +2085,7 @@ frames_alloc(uint32_t width, uint32_t height, uint32_t stride, uint32_t source)frames_bytes = round_page(CAM_HEADER_BYTES + (uint64_t)CAM_FRAMES * frame_bytes);if (keep != 0 && keep_bytes >= frames_bytes) {- frames = keep; /* (the piece taken at boot: redwood_camera_init()) */+ frames = keep; /* (the piece taken at boot: hakios_camera_init()) */bzero((void *)frames, CAM_HEADER_BYTES);} else if (kmem_alloc_contig(kernel_map, &frames, frames_bytes, PAGE_MASK, 0, 0, KMA_KOBJECT | KMA_ZERO | KMA_DATA,VM_KERN_MEMORY_IOKIT) != KERN_SUCCESS) {@@ -2176,15 +2176,15 @@ smmu_up(void)uint64_t *root, *second, table_root;uint32_t thirds = (uint32_t)((frames_bytes + 0x1fffff) >> 21), pages = (uint32_t)(frames_bytes >> 12);- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);if (!smmu_find()) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);give_up("no place in the SMMU");return false;}if (kmem_alloc(kernel_map, &page_tables, (2 + thirds) * 4096, KMA_KOBJECT | KMA_ZERO | KMA_DATA, VM_KERN_MEMORY_IOKIT) !=KERN_SUCCESS) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);give_up("no memory for page tables");return false;}@@ -2213,7 +2213,7 @@ smmu_up(void)!smmu_put(smmu_context, SMMU_CB_TTBR0 + 4, (uint32_t)(table_root >> 32), ~0u) ||!smmu_put(smmu_context, SMMU_CB_TTBR1, 0, ~0u) || !smmu_put(smmu_context, SMMU_CB_TTBR1 + 4, 0, ~0u) ||!smmu_put(smmu_context, SMMU_CB_MAIR0, SMMU_MAIR0, ~0u) || !smmu_put(smmu_context, SMMU_CB_MAIR1, 0, ~0u)) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);return false;}wr(smmu_context + SMMU_CB_FSR, SMMU_FSR_ALL);@@ -2221,23 +2221,23 @@ smmu_up(void)wr(smmu_context + SMMU_CB_TLBSYNC, 1);for (unsigned waited = 0; rd(smmu_context + SMMU_CB_TLBSTATUS) & 1; waited++) {if (waited > 1000) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);give_up("the SMMU does not finish forgetting");return false;}spin_us(10);}if (!smmu_put(smmu_context, SMMU_CB_SCTLR, SMMU_SCTLR_ON, 1)) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);return false;}smmu_on = true;if (!smmu_put(smmu, SMMU_S2CR(smmu_match), smmu_context_n, 0x300ff) ||!smmu_put(smmu, SMMU_SMR(smmu_match), 1u << 31 | (uint32_t)IFE_STREAM_MASK << 16 | IFE_STREAM, ~0u)) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);return false;}- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);return true;}@@ -2268,7 +2268,7 @@ smmu_down(void)}smmu_faults();if (!leaving) {- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);}if (smmu_match != ~0u) {wr(smmu + SMMU_SMR(smmu_match), smmu_old_smr);@@ -2280,7 +2280,7 @@ smmu_down(void)wr(smmu_context + SMMU_CB_TLBSYNC, 1);}if (!leaving) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);}smmu_on = false;smmu_match = ~0u;@@ -2914,7 +2914,7 @@ sensor_write(uint16_t address, uint16_t value, bool sixteen)/** The wide camera's lens: a voice-coil motor driven by a Dongwoon DW9800 on the sensor's own I2C at- * 0x0c (the module file's actuatorDriver, "redwood_sunny_s5khm2sd_dw9800_wide"), powered by the+ * 0x0c (the module file's actuatorDriver, "hakios_sunny_s5khm2sd_dw9800_wide"), powered by the* PM8350C's L9 (the device tree's actuator0: cam_vaf at 2.8 V, a regulator the SD card's slot has as* its vdd too; RPMh's "ldoc9"). The module file's initialisation, as it is: 0x02 = 0x01 (power down),* 0x02 = 0x00 and 1 ms, 0x02 = 0x02 (ring control), 0x06 = 0x40 (SAC3), 0x07 = 0x07 (its timing), the@@ -2935,7 +2935,7 @@ sensor_write(uint16_t address, uint16_t value, bool sixteen)#define VRM_MODE_HPM 7 /* a PMIC5 LDO's high power mode */static bool vaf_voted;-static uint32_t af_position = REDWOOD_CAMERA_NO_FOCUS;+static uint32_t af_position = HAKIOS_CAMERA_NO_FOCUS;/* (a look, for now: what the LDOs say after the motor does something; said only when not all is well) */static void@@ -2994,7 +2994,7 @@ vaf(bool on)static voidaf_up(bool sensor_frames){- af_position = REDWOOD_CAMERA_NO_FOCUS;+ af_position = HAKIOS_CAMERA_NO_FOCUS;if (hw != &sensors[1] || !sensor_frames) {return;}@@ -3033,7 +3033,7 @@ failed:static voidaf_move(uint32_t position){- if (af_position == REDWOOD_CAMERA_NO_FOCUS) {+ if (af_position == HAKIOS_CAMERA_NO_FOCUS) {return;}position = position > 1023 ? 1023 : position;@@ -3049,7 +3049,7 @@ af_move(uint32_t position)static voidaf_down(void){- if (af_position != REDWOOD_CAMERA_NO_FOCUS) {+ if (af_position != HAKIOS_CAMERA_NO_FOCUS) {/* down in steps, not to knock the lens against its stop */while (af_position > 0) {uint32_t was = af_position;@@ -3061,7 +3061,7 @@ af_down(void)wait_ms(10);}(void)af_write(AF_CONTROL, 0x01);- af_position = REDWOOD_CAMERA_NO_FOCUS;+ af_position = HAKIOS_CAMERA_NO_FOCUS;}if (vaf_voted) {(void)vaf(false);@@ -3230,11 +3230,11 @@ capture_sensor(void)}}-/* ---- cam=5: the wide camera for iOS (/dev/redwood-camera) ------------------------------------------- */+/* ---- cam=5: the wide camera for iOS (/dev/hakios-camera) ------------------------------------------- *//*- * The sensor's frames for a program (iOS's camera stack in mediaserverd, libredwood-media.dylib), for- * as long as it holds /dev/redwood-camera open (sys/redwood_camera.h): the sensor powered up and+ * The sensor's frames for a program (iOS's camera stack in mediaserverd, libhakios.media.dylib), for+ * as long as it holds /dev/hakios-camera open (sys/hakios.camera.h): the sensor powered up and* streaming at the first read after the open, everything down again at the last close, after* IDLE_MS without a read, and on any fault (and then for the rest of the run). The sequence is* cam=4's. The frames go into three places in turn (kernel memory, mapped page by page through the@@ -3248,7 +3248,7 @@ capture_sensor(void)* written over. The exposure the program asks for is written between two frames, after* the address, in the sensor's group hold; it counts from the second frame after.*- * A picture for the host (REDWOOD_CAMERA_KEEP: what the program made of a frame) goes into one+ * A picture for the host (HAKIOS_CAMERA_KEEP: what the program made of a frame) goes into one* piece of memory the loader hands over after the run, as cam=3 and cam=4's frames do (xl camera).*/#define RING 3@@ -3264,7 +3264,7 @@ capture_sensor(void)enum { PLACE_FREE, PLACE_WRITING, PLACE_READY, PLACE_READING };-static LCK_GRP_DECLARE(ios_lck_grp, "redwood-camera");+static LCK_GRP_DECLARE(ios_lck_grp, "hakios-camera");static LCK_MTX_DECLARE(ios_lock, &ios_lck_grp);static struct {uint8_t state;@@ -3288,7 +3288,7 @@ static struct { uint32_t lines, gain, frame_lines; uint64_t from; } ios_now, ios*/enum { SOURCE_SENSOR, SOURCE_SENSOR_PATTERN, SOURCE_CSID_TPG };static int ios_source = SOURCE_SENSOR;-/* REDWOOD_CAMERA_SENSOR: the sensor (and mode) to change to, taken between sessions */+/* HAKIOS_CAMERA_SENSOR: the sensor (and mode) to change to, taken between sessions */static volatile unsigned ios_switch_to; /* 1 + the sensor's index; 0: none asked for */static uint32_t ios_switch_mode;@@ -3619,7 +3619,7 @@ ios_session(void)}/*- * cam_fake=1 (with cam=5; for QEMU): /dev/redwood-camera without the phone's camera. The sessions,+ * cam_fake=1 (with cam=5; for QEMU): /dev/hakios-camera without the phone's camera. The sessions,* sensors, modes and frame headers are cam=5's, from the same tables in fw/, but nothing of the phone* is touched: the frames are a colour chart made here -- eight bars (white, beige, red, yellow, green,* cyan, blue, 18 % grey) over a grey ramp -- in RAW10 in the sensor's own Bayer order, as bright as the@@ -3802,7 +3802,7 @@ camdev_close(__unused dev_t dev, __unused int flags, __unused int type, __unusedstatic intcamdev_read(__unused dev_t dev, struct uio *uio, __unused int ioflag){- struct redwood_camera_frame f;+ struct hakios_camera_frame f;uint64_t since = ios_ms();int b = -1, error = 0;@@ -3835,7 +3835,7 @@ camdev_read(__unused dev_t dev, struct uio *uio, __unused int ioflag)wakeup(&ios_open);}struct timespec ts = { 0, 100 * NSEC_PER_MSEC };- error = msleep(&ios_frames_done, &ios_lock, PZERO | PCATCH, "redwood-camera", &ts);+ error = msleep(&ios_frames_done, &ios_lock, PZERO | PCATCH, "hakios-camera", &ts);if (error != 0 && error != EWOULDBLOCK) {lck_mtx_unlock(&ios_lock);return error;@@ -3845,7 +3845,7 @@ camdev_read(__unused dev_t dev, struct uio *uio, __unused int ioflag)place[b].state = PLACE_READING;ios_given = place[b].sequence;bzero(&f, sizeof(f));- memcpy(f.magic, REDWOOD_CAMERA_MAGIC, 8);+ memcpy(f.magic, HAKIOS_CAMERA_MAGIC, 8);f.header_bytes = sizeof(f);f.width = ios_mode->width;f.height = ios_mode->height;@@ -3901,9 +3901,9 @@ camdev_read(__unused dev_t dev, struct uio *uio, __unused int ioflag)return error;}-/* REDWOOD_CAMERA_KEEP: a picture for the host, in one piece of memory the loader hands over. */+/* HAKIOS_CAMERA_KEEP: a picture for the host, in one piece of memory the loader hands over. */static int-keep_picture(const struct redwood_camera_command *c, struct uio *uio)+keep_picture(const struct hakios_camera_command *c, struct uio *uio){struct cam_header *h;uint64_t want = round_page(CAM_HEADER_BYTES + (uint64_t)c->bytes);@@ -3941,13 +3941,13 @@ keep_picture(const struct redwood_camera_command *c, struct uio *uio)static intcamdev_write(__unused dev_t dev, struct uio *uio, __unused int ioflag){- struct redwood_camera_command c;+ struct hakios_camera_command c;int error;if (uio_resid(uio) < (user_ssize_t)sizeof(c) || (error = uiomove((caddr_t)&c, sizeof(c), uio)) != 0) {return EINVAL;}- if (c.command == REDWOOD_CAMERA_EXPOSURE) {+ if (c.command == HAKIOS_CAMERA_EXPOSURE) {lck_mtx_lock(&ios_lock);ios_ask.lines = c.a;ios_ask.gain = c.b;@@ -3956,17 +3956,17 @@ camdev_write(__unused dev_t dev, struct uio *uio, __unused int ioflag)lck_mtx_unlock(&ios_lock);return 0;}- if (c.command == REDWOOD_CAMERA_KEEP) {+ if (c.command == HAKIOS_CAMERA_KEEP) {return keep_picture(&c, uio);}- if (c.command == REDWOOD_CAMERA_FOCUS) {+ if (c.command == HAKIOS_CAMERA_FOCUS) {lck_mtx_lock(&ios_lock);ios_ask.focus = c.a;ios_ask.focus_pending = true;lck_mtx_unlock(&ios_lock);return 0;}- if (c.command == REDWOOD_CAMERA_SENSOR) {+ if (c.command == HAKIOS_CAMERA_SENSOR) {if (c.a >= sizeof(sensors) / sizeof(sensors[0])) {return EINVAL;}@@ -3997,7 +3997,7 @@ camdev_make(void){int major = cdevsw_add(-1, &camdev_cdevsw);- camdev_made = major >= 0 && devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "redwood-camera") != NULL;+ camdev_made = major >= 0 && devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "hakios-camera") != NULL;}/*@@ -4055,7 +4055,7 @@ ios_select(unsigned index, uint32_t mode_n)ios_ask.frame_lines = 0;(void)PE_parse_boot_argn("cam_shutter", &ios_ask.lines, sizeof(ios_ask.lines));(void)PE_parse_boot_argn("cam_gain", &ios_ask.gain, sizeof(ios_ask.gain));- say("camera: /dev/redwood-camera: the %s camera's frames (mode %u: %ux%u, %u.%03u frames/s at the most), whenever it is "+ say("camera: /dev/hakios-camera: the %s camera's frames (mode %u: %ux%u, %u.%03u frames/s at the most), whenever it is ""read\n", hw->name, mode_n, ios_mode->width, ios_mode->height, ios_mode->fps_milli / 1000, ios_mode->fps_milli % 1000);return true;}@@ -4067,7 +4067,7 @@ serve_ios(void)uint32_t mode_n = ~0u;if (!camdev_made) {- say("camera: /dev/redwood-camera cannot be made\n");+ say("camera: /dev/hakios-camera cannot be made\n");return;}(void)PE_parse_boot_argn("cam_mode", &mode_n, sizeof(mode_n));@@ -4077,7 +4077,7 @@ serve_ios(void)while (!broken) {lck_mtx_lock(&ios_lock);while (!broken && !(ios_open && ios_wanted) && ios_switch_to == 0) {- (void)msleep(&ios_open, &ios_lock, PZERO, "redwood-camera-idle", NULL);+ (void)msleep(&ios_open, &ios_lock, PZERO, "hakios-camera-idle", NULL);}unsigned to = ios_switch_to;@@ -4103,7 +4103,7 @@ serve_ios(void)ios_session();}}- say("camera: /dev/redwood-camera: no more frames in this run\n");+ say("camera: /dev/hakios-camera: no more frames in this run\n");}/* ---- the look, and the thread ----------------------------------------------------------------------- */@@ -4216,7 +4216,7 @@ camera_thread(__unused void *parameter, __unused wait_result_t result)}void-redwood_camera_init(void)+hakios_camera_init(void){thread_t thread;@@ -4251,7 +4251,7 @@ redwood_camera_init(void)/* At the run's end and on a panic's way out: whatever was switched on, off. */void-redwood_camera_quiesce(void)+hakios_camera_quiesce(void){if (level < 2 || tlmm == 0) {return;diff --git a/xnu/files/bsd/dev/redwood_cpufreq.c b/xnu/files/bsd/dev/hakios.cpufreq.csimilarity index 97%rename from xnu/files/bsd/dev/redwood_cpufreq.crename to xnu/files/bsd/dev/hakios.cpufreq.cindex b95b76f..44cca7c 100644--- a/xnu/files/bsd/dev/redwood_cpufreq.c+++ b/xnu/files/bsd/dev/hakios.cpufreq.c@@ -18,19 +18,19 @@#include <mach/mach_types.h>#include <machine/machine_routines.h>#include <pexpert/pexpert.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/systm.h>#include <vm/vm_kern.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern vm_offset_t ml_io_map_wcomb(vm_offset_t phys_addr, vm_size_t size);extern void loader_log_putc(char c);-extern void redwood_tl(const char *format, ...) __printflike(1, 2);+extern void hakios_tl(const char *format, ...) __printflike(1, 2);extern bool ml_cpu_idle_time(int cpu_id, uint64_t *idle);/** The loader's log as well: this runs early, and the kernel's own log of a run keeps only its end. With- * interrupts off -- on the way back to the loader (redwood_ddr_quiesce()) -- the loader's log only: the+ * interrupts off -- on the way back to the loader (hakios_ddr_quiesce()) -- the loader's log only: the* kernel's console may not be written there, and printf was a panic ("Console I/O from interrupt-disabled* context") at the end of every run once the memory vote was taken away on the way back.*/@@ -284,7 +284,7 @@ load_thread(void *arg __unused, wait_result_t wr __unused)}}then = now;- redwood_tl("%s\n", line);+ hakios_tl("%s\n", line);}}@@ -416,7 +416,7 @@ ddr_slots(void)* on for this processor (ACV, bit 3, which the boot loader's firmware had set already, the same).* All cores together got 12.4 GB/s writing without it (membench=2: what one core gets alone), 14.8* with it; frames over 16.7 ms 28% instead of 34-36%. ddr_vote=N: N instead of the most (16383).- * When the kernel goes back to the loader (redwood_ddr_quiesce(), on every way back, a panic's too)+ * When the kernel goes back to the loader (hakios_ddr_quiesce(), on every way back, a panic's too)* the vote goes down to ddr_rest=N (default 1024). What the firmware had voted cannot be read back,* but what the cores get from memory can be measured (membench=2, writing): with any vote from 4* to 4096 12.0 to 12.4 GB/s, as before the first vote (12.4); with the most, 15.4; with none at all@@ -429,7 +429,7 @@ ddr_slots(void)#define BCM_VOTE(x, y) (BCM_COMMIT | BCM_VALID | ((uint32_t)(x) & 0x3fff) << 14 | ((uint32_t)(y) & 0x3fff))#define TCS_REG(reg) (ddr_rsc + 0xd00 + (reg)) /* command slot set 0, an "active" one */#define BCM_ACV_APPS 8-#define DDR_REST 1024 /* the vote left for the loader (ddr_rest=N); see redwood_ddr_quiesce() */+#define DDR_REST 1024 /* the vote left for the loader (ddr_rest=N); see hakios_ddr_quiesce() */static vm_offset_t ddr_rsc;static uint32_t ddr_mc0, ddr_sh0, ddr_acv;@@ -461,7 +461,7 @@ cmd_db_address(const char *name)return 0;}-/* Up to three writes through command slot set 0, and the wait until RPMh has done them (as bsd/dev/redwood_goodix.c) */+/* Up to three writes through command slot set 0, and the wait until RPMh has done them (as bsd/dev/hakios.goodix.c) */static boolddr_rpmh_write(const uint32_t *address, const uint32_t *data, unsigned count){@@ -534,10 +534,10 @@ ddr_raise(void)}/* On the way back to the loader (osfmk/arm64/loader_return.c: loader_return(), whatever the reason; the other processors are stopped) */-void redwood_ddr_quiesce(void);+void hakios_ddr_quiesce(void);void-redwood_ddr_quiesce(void)+hakios_ddr_quiesce(void){uint32_t address[2] = { ddr_mc0, ddr_sh0 };uint32_t rest = DDR_REST, data[2];@@ -555,7 +555,7 @@ redwood_ddr_quiesce(void)}void-redwood_cpufreq_init(void)+hakios_cpufreq_init(void){const ml_topology_info_t *topology = ml_get_topology_info();uint32_t enabled = 0, cores[EPSS_DOMAINS] = { 0 }, before, here;diff --git a/xnu/files/bsd/dev/redwood_focaltech_fw.h b/xnu/files/bsd/dev/hakios.focaltech_fw.hsimilarity index 99%rename from xnu/files/bsd/dev/redwood_focaltech_fw.hrename to xnu/files/bsd/dev/hakios.focaltech_fw.hindex 5dd36ef..c89f28b 100644--- a/xnu/files/bsd/dev/redwood_focaltech_fw.h+++ b/xnu/files/bsd/dev/hakios.focaltech_fw.h@@ -1,6 +1,6 @@/* Generated from fw-touch/focaltech_ts_fw_m20.bin. Do not edit. */-#ifndef _REDWOOD_FOCALTECH_FW_H-#define _REDWOOD_FOCALTECH_FW_H+#ifndef _HAKIOS_FOCALTECH_FW_H+#define _HAKIOS_FOCALTECH_FW_H#define FOCALTECH_FW_LENGTH 116448diff --git a/xnu/files/bsd/dev/redwood_goodix.c b/xnu/files/bsd/dev/hakios.goodix.csimilarity index 98%rename from xnu/files/bsd/dev/redwood_goodix.crename to xnu/files/bsd/dev/hakios.goodix.cindex f969cbd..867b463 100644--- a/xnu/files/bsd/dev/redwood_goodix.c+++ b/xnu/files/bsd/dev/hakios.goodix.c@@ -1,7 +1,7 @@/** The touch screen of the POCO X5 Pro (redwood): either a Goodix GT9916 ("Berlin-D") or a* FocalTech FT3680 on the SPI bus of the SoC's serial engine 13, as a source of touches for- * /dev/redwood-touch (sys/redwood_input.h). Only with boot-arg touchscreen=1: every address+ * /dev/hakios-touch (sys/hakios.input.h). Only with boot-arg touchscreen=1: every address* below belongs to this phone.** There is no clock, pin, regulator or SPI framework in this kernel, so the driver does all of@@ -33,10 +33,10 @@#include <libkern/libkern.h>#include <mach/mach_types.h>#include <pexpert/pexpert.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/systm.h>-extern void redwood_tl(const char *format, ...) __printflike(1, 2);+extern void hakios_tl(const char *format, ...) __printflike(1, 2);extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern vm_offset_t ml_io_map_wcomb(vm_offset_t phys_addr, vm_size_t size);@@ -826,9 +826,9 @@ goodix_report(const uint8_t *touches, uint32_t count)}contact[id].seen = true;if (!contact[id].down) {- redwood_touch_post(REDWOOD_TOUCH_DOWN, id, x, y);+ hakios_touch_post(HAKIOS_TOUCH_DOWN, id, x, y);} else if (contact[id].x != x || contact[id].y != y) {- redwood_touch_post(REDWOOD_TOUCH_MOVE, id, x, y);+ hakios_touch_post(HAKIOS_TOUCH_MOVE, id, x, y);}contact[id].down = true;contact[id].x = x;@@ -838,7 +838,7 @@ goodix_report(const uint8_t *touches, uint32_t count)for (uint32_t id = 0; id < GOODIX_MAX_TOUCHES; id++) {if (contact[id].down && !contact[id].seen) {contact[id].down = false;- redwood_touch_post(REDWOOD_TOUCH_UP, id, contact[id].x, contact[id].y);+ hakios_touch_post(HAKIOS_TOUCH_UP, id, contact[id].x, contact[id].y);}}}@@ -1027,7 +1027,7 @@ focaltech_write(uint8_t address, const uint8_t *data, uint32_t length)#define FTS_ROMBOOT_CMD_START_APP 0x08#define FTS_FLASH_PACKET_LENGTH 32 /* bytes per PRAM write */-#include "redwood_focaltech_fw.h"+#include "hakios.focaltech_fw.h"/** Vendor fts_read_bootid(): send { 0x55, 0xAA } as a 2-byte framed write (treated as a write of@@ -1213,7 +1213,7 @@ focaltech_contact_update(uint32_t id, uint32_t event, uint32_t x, uint32_t y,focaltech_contact[id].seen = true;if (focaltech_contact[id].down) {focaltech_contact[id].down = false;- redwood_touch_post(REDWOOD_TOUCH_UP, id, focaltech_contact[id].x, focaltech_contact[id].y);+ hakios_touch_post(HAKIOS_TOUCH_UP, id, focaltech_contact[id].x, focaltech_contact[id].y);}return;}@@ -1230,9 +1230,9 @@ focaltech_contact_update(uint32_t id, uint32_t event, uint32_t x, uint32_t y,focaltech_contact[id].seen = true;if (!focaltech_contact[id].down) {focaltech_contact[id].down = true;- redwood_touch_post(REDWOOD_TOUCH_DOWN, id, x, y);+ hakios_touch_post(HAKIOS_TOUCH_DOWN, id, x, y);} else if (focaltech_contact[id].x != x || focaltech_contact[id].y != y) {- redwood_touch_post(REDWOOD_TOUCH_MOVE, id, x, y);+ hakios_touch_post(HAKIOS_TOUCH_MOVE, id, x, y);}focaltech_contact[id].x = x;focaltech_contact[id].y = y;@@ -1273,7 +1273,7 @@ focaltech_report(const uint8_t *report)for (uint32_t i = 0; i < FOCALTECH_MAX_TOUCHES; i++) {if (!focaltech_contact[i].seen && focaltech_contact[i].down) {focaltech_contact[i].down = false;- redwood_touch_post(REDWOOD_TOUCH_UP, i, focaltech_contact[i].x, focaltech_contact[i].y);+ hakios_touch_post(HAKIOS_TOUCH_UP, i, focaltech_contact[i].x, focaltech_contact[i].y);}}}@@ -1480,7 +1480,7 @@ goodix_thread(__unused void *parameter, __unused wait_result_t result)reads++;reading += read_at - looked;if (latency) {- redwood_tl("tl: c before %llu seen %llu read %llu\n", before, looked, read_at);+ hakios_tl("tl: c before %llu seen %llu read %llu\n", before, looked, read_at);}} else if (++idle >= idle_looks) {idle = 0;@@ -1500,7 +1500,7 @@ goodix_thread(__unused void *parameter, __unused wait_result_t result)}void-redwood_goodix_init(void)+hakios_goodix_init(void){uint32_t enabled = 0;thread_t thread;diff --git a/xnu/files/bsd/dev/redwood_guard.c b/xnu/files/bsd/dev/hakios.guard.csimilarity index 90%rename from xnu/files/bsd/dev/redwood_guard.crename to xnu/files/bsd/dev/hakios.guard.cindex ebcb79d..2082712 100644--- a/xnu/files/bsd/dev/redwood_guard.c+++ b/xnu/files/bsd/dev/hakios.guard.c@@ -1,6 +1,6 @@/** The speakers' guard: what the samples go through on their way to the phone's two amplifiers- * (bsd/dev/redwood_sound.c's feeder), in place of the protection Android has in the audio DSP.+ * (bsd/dev/hakios.sound.c's feeder), in place of the protection Android has in the audio DSP.** Under Android the DSP runs Awinic's algorithm (SKTune, "aw882xx_rx_switch") with each* speaker's calibration: it keeps the cone's excursion and the voice coil's temperature in@@ -26,7 +26,7 @@* peaks no sample above 3 dB under full scale at Android's level: a limiter that turns* the level down at the sample that would go over (so none does) and lets it come* back with a time constant of 43 ms- * monitor a further reduction that the amplifiers' watch asks for (redwood_speaker.c:+ * monitor a further reduction that the amplifiers' watch asks for (hakios.speaker.c:* Android's table for a cold amplifier, and a low battery)** Before all that, a gain (sound_gain, at most 12 dB): iOS's own processing for the iPhone X's@@ -40,12 +40,12 @@* back only that much later. Everything is integer arithmetic (the kernel's threads do no* floating point); fractions are in Q30 unless said otherwise.*- * One caller at a time (the feeder); redwood_guard_attenuation() and redwood_guard_monitor() may+ * One caller at a time (the feeder); hakios_guard_attenuation() and hakios_guard_monitor() may* be called from another thread.*/#include <stdbool.h>#include <stdint.h>-#include <sys/redwood_audio.h>+#include <sys/hakios.audio.h>#define ONE (1ll << 30)#define FULL_SCALE 32768@@ -79,14 +79,14 @@ static const int64_t hpf_a1 = -2107733822, hpf_a2 = 1034714513;static struct {bool hpf;uint64_t gain; /* the gain before everything, Q30 (1 to 4) */- volatile uint32_t attenuation; /* the amplifiers' level under Android's, eighths of a dB; REDWOOD_GUARD_SILENT: off */+ volatile uint32_t attenuation; /* the amplifiers' level under Android's, eighths of a dB; HAKIOS_GUARD_SILENT: off */volatile uint32_t monitor; /* the monitor's reduction, eighths of a dB */int64_t x1[2], x2[2], y1[2], y2[2]; /* the filter's past, in 1/256 of a sample */uint64_t rms[2], fast[2], slow[2]; /* average powers at each speaker, Q30 of a full-scale square wave at Android's level */uint64_t level; /* the power guard's and the monitor's gain at the end of the last block */uint64_t envelope; /* the peak limiter's, 1/65536 of a sample */- struct redwood_guard_report report;-} guard = { .hpf = true, .attenuation = REDWOOD_GUARD_SILENT, .gain = ONE, .level = ONE, .report = { .least_gain = ONE, .least_peak_gain = 65536 } };+ struct hakios_guard_report report;+} guard = { .hpf = true, .attenuation = HAKIOS_GUARD_SILENT, .gain = ONE, .level = ONE, .report = { .least_gain = ONE, .least_peak_gain = 65536 } };static int32_t work[2 * MAX_FRAMES];@@ -133,21 +133,21 @@ headroom(uint64_t power, uint64_t limit)}void-redwood_guard_configure(bool hpf, uint32_t gain)+hakios_guard_configure(bool hpf, uint32_t gain){guard.hpf = hpf;/* 10^(gain/160): one over the attenuation by as much */- guard.gain = (1ull << 60) / amplitude(gain > REDWOOD_GUARD_MAX_GAIN ? REDWOOD_GUARD_MAX_GAIN : gain);+ guard.gain = (1ull << 60) / amplitude(gain > HAKIOS_GUARD_MAX_GAIN ? HAKIOS_GUARD_MAX_GAIN : gain);}void-redwood_guard_attenuation(uint32_t below)+hakios_guard_attenuation(uint32_t below){guard.attenuation = below;}void-redwood_guard_monitor(uint32_t below)+hakios_guard_monitor(uint32_t below){guard.monitor = below;}@@ -156,8 +156,8 @@ static voidblock(int16_t *frames, uint32_t count){uint32_t attenuation = guard.attenuation;- struct redwood_guard_report *r = &guard.report;- uint64_t to_speaker = attenuation == REDWOOD_GUARD_SILENT ? 0 : amplitude(2 * attenuation);+ struct hakios_guard_report *r = &guard.report;+ uint64_t to_speaker = attenuation == HAKIOS_GUARD_SILENT ? 0 : amplitude(2 * attenuation);uint64_t sum[2] = { 0, 0 }, g2 = ONE, g, start = guard.level, ceiling;uint32_t binding = 0;@@ -222,7 +222,7 @@ block(int16_t *frames, uint32_t count)/* the peaks: no sample over the limit at the speaker (and none over full scale) */ceiling = FULL_SCALE - 1;- if (attenuation != REDWOOD_GUARD_SILENT && attenuation < PEAK_LIMIT) {+ if (attenuation != HAKIOS_GUARD_SILENT && attenuation < PEAK_LIMIT) {ceiling = (uint64_t)FULL_SCALE * amplitude(PEAK_LIMIT - attenuation) >> 30;}for (uint32_t f = 0; f < count; f++) {@@ -269,7 +269,7 @@ block(int16_t *frames, uint32_t count)}void-redwood_guard_process(int16_t *frames, uint32_t count)+hakios_guard_process(int16_t *frames, uint32_t count){while (count > 0) {uint32_t n = count < MAX_FRAMES ? count : MAX_FRAMES;@@ -282,15 +282,15 @@ redwood_guard_process(int16_t *frames, uint32_t count)/* What has happened since the last call (and the averages and the gain as they are now). */void-redwood_guard_take_report(struct redwood_guard_report *report)+hakios_guard_take_report(struct hakios_guard_report *report){*report = guard.report;- guard.report = (struct redwood_guard_report){ .least_gain = ONE, .least_peak_gain = 65536 };+ guard.report = (struct hakios_guard_report){ .least_gain = ONE, .least_peak_gain = 65536 };}/* 10 log10 of a Q30 ratio, in tenths of a dB (for what is said) */int-redwood_guard_decibels(uint64_t ratio)+hakios_guard_decibels(uint64_t ratio){static const uint16_t fraction[17] = {0, 5732, 11136, 16248, 21098, 25711, 30109, 34312, 38336, 42196, 45904, 49472, 52911, 56229, 59434, 62534, 65535,diff --git a/xnu/files/bsd/dev/redwood_haptic.c b/xnu/files/bsd/dev/hakios.haptic.csimilarity index 97%rename from xnu/files/bsd/dev/redwood_haptic.crename to xnu/files/bsd/dev/hakios.haptic.cindex 6939183..944a32b 100644--- a/xnu/files/bsd/dev/redwood_haptic.c+++ b/xnu/files/bsd/dev/hakios.haptic.c@@ -6,7 +6,7 @@** I2C the serial engine 9 (qupv3_se9_i2c at 0xa84000, function qup11 on GPIO 36 data and* 37 clock, internal pull-ups, 400 kHz under Android), address 0x5a; done by hand here- * as for the amplifiers (redwood_speaker.c), the two pins taken for each transaction+ * as for the amplifiers (hakios.speaker.c), the two pins taken for each transaction* and given back as they were found* reset GPIO 35, high = running (Android: low for 5 ms, then high, at its driver's start)* interrupt GPIO 18, pulled up, low when the chip has something to say (not used: polled)@@ -30,7 +30,7 @@* haptic=5 ... configured and loaded as for 3, and instead of the effect the motor for iOS until* the run ends: what iOS plays on its "Actuator" device (the HAL plug-in's,* userland/src/audio_plugin.c: the system's feedbacks and vibrations, CoreHaptics'- * patterns, UIKit's feedbacks) is written to /dev/redwood-haptic as samples of one+ * patterns, UIKit's feedbacks) is written to /dev/hakios-haptic as samples of one* channel, and the motor plays Android's waveforms by it: each waveform of iOS's (a* stretch of samples after a pause) a short tap (waveform 1), and one that goes on for* longer than a tap the waveform Android loops for vibrations (11), until it ends -- or@@ -56,8 +56,8 @@#include <sys/conf.h>#include <sys/systm.h>#include <sys/uio.h>-#include <sys/redwood_audio.h>-#include <sys/redwood_input.h>+#include <sys/hakios.audio.h>+#include <sys/hakios.input.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern kern_return_t thread_terminate(thread_t thread);@@ -161,7 +161,7 @@ reset_pin(bool high)released = high;}-/* ---- I2C by hand (as in redwood_speaker.c) ---------------------------------------------------------- */+/* ---- I2C by hand (as in hakios.speaker.c) ---------------------------------------------------------- */static voidhalf_bit(void)@@ -563,7 +563,7 @@ static boolload_waveforms(void){uint64_t size = 0;- const uint8_t *file = redwood_wifi_file("aw8697_haptic.bin", &size);+ const uint8_t *file = hakios_wifi_file("aw8697_haptic.bin", &size);uint32_t sum = 0, base, length;uint8_t address[2], back[64];@@ -727,12 +727,12 @@ haptic_write(__unused dev_t dev, struct uio *uio, __unused int ioflag)}/*- * A test's stand-in for iOS's waveform (redwood_mic.c, mic_tap=1: the microphone hears the motor): as if+ * A test's stand-in for iOS's waveform (hakios.mic.c, mic_tap=1: the microphone hears the motor): as if* a write of this loudness (of 32767) had just come, or silence for 0. The service plays it with all its* own limits, as it plays iOS's.*/void-redwood_haptic_pretend(uint32_t peak)+hakios_haptic_pretend(uint32_t peak){uint64_t now = now_us();@@ -825,11 +825,11 @@ serve(void)unsigned follows = 0; /* how often the vibration playing now has changed strength */int major = cdevsw_add(-1, &haptic_cdevsw);- if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "redwood-haptic") == NULL) {- say("haptic: /dev/redwood-haptic cannot be made\n");+ if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "hakios-haptic") == NULL) {+ say("haptic: /dev/hakios-haptic cannot be made\n");return;}- say("haptic: THE MOTOR PLAYS WHAT IOS PLAYS ON ITS ACTUATOR (/dev/redwood-haptic) from here on, until the run ends\n");+ say("haptic: THE MOTOR PLAYS WHAT IOS PLAYS ON ITS ACTUATOR (/dev/hakios-haptic) from here on, until the run ends\n");while (!broken) {uint64_t now = now_us();bool active = heard_us != 0 && now - heard_us < ACTIVE_US;@@ -975,7 +975,7 @@ haptic_thread(__unused void *parameter, __unused wait_result_t result)}void-redwood_haptic_init(void)+hakios_haptic_init(void){thread_t thread;@@ -992,7 +992,7 @@ redwood_haptic_init(void)/* At the run's end and on a panic's way out: the chip back into reset, if it was let out. */void-redwood_haptic_quiesce(void)+hakios_haptic_quiesce(void){if (released && tlmm != 0) {leaving = true;diff --git a/xnu/files/bsd/dev/redwood_image.c b/xnu/files/bsd/dev/hakios.image.csimilarity index 90%rename from xnu/files/bsd/dev/redwood_image.crename to xnu/files/bsd/dev/hakios.image.cindex e596cd6..c153e5a 100644--- a/xnu/files/bsd/dev/redwood_image.c+++ b/xnu/files/bsd/dev/hakios.image.c@@ -1,7 +1,7 @@/** A file of one of this port's RAM disks, by path, for the drivers that want one before there is- * a root or without asking it: the GPU's firmware (redwood_adreno.c), the Wi-Fi DSP's- * (redwood_wifi.c), the audio DSP's (redwood_adsp.c) -- "fw/NAME" of the image that travels with+ * a root or without asking it: the GPU's firmware (hakios.adreno.c), the Wi-Fi DSP's+ * (hakios.wifi.c), the audio DSP's (hakios.adsp.c) -- "fw/NAME" of the image that travels with* the kernel (md1; md0 when there is nothing else) or of the resident one (md0).** The image is an APFS container (tools/apfs/mkapfs.py: what userland/build.sh makes). A file@@ -23,7 +23,7 @@extern dev_t mdevlookup(int devid);extern int mdevgetkernelrange(dev_t dev, vm_offset_t *base, uint64_t *size);-const uint8_t *redwood_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);+const uint8_t *hakios_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);/* ---- APFS ---- */@@ -44,7 +44,7 @@ mem_read(void *ctx, uint64_t off, void *buf, size_t len)return 0;}-static LCK_GRP_DECLARE(image_lck_grp, "redwood_image");+static LCK_GRP_DECLARE(image_lck_grp, "hakios_image");static LCK_MTX_DECLARE(image_lock, &image_lck_grp); /* kept[]: the drivers start beside each other */static struct {int disk;@@ -120,7 +120,7 @@ apfs_file(int disk, const uint8_t *base, uint64_t length, const char *dir, constgoto out;}if (i == sizeof(kept) / sizeof(kept[0])) {- printf("redwood_image: %s of /dev/md%d: kept %lu files already, no room for a copy of another\n", path, disk,+ printf("hakios_image: %s of /dev/md%d: kept %lu files already, no room for a copy of another\n", path, disk,(unsigned long)i);error = ENOSPC;}@@ -164,7 +164,7 @@ out:}const uint8_t *-redwood_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out)+hakios_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out){for (int disk = 1; disk >= 0; disk--) {vm_offset_t base = 0;diff --git a/xnu/files/bsd/dev/redwood_input.c b/xnu/files/bsd/dev/hakios.input.csimilarity index 80%rename from xnu/files/bsd/dev/redwood_input.crename to xnu/files/bsd/dev/hakios.input.cindex e5ec5cb..5f8aeb8 100644--- a/xnu/files/bsd/dev/redwood_input.c+++ b/xnu/files/bsd/dev/hakios.input.c@@ -1,5 +1,5 @@/*- * /dev/redwood-touch: a queue of touch samples (see sys/redwood_input.h).+ * /dev/hakios-touch: a queue of touch samples (see sys/hakios.input.h).*/#include <kern/clock.h>#include <kern/locks.h>@@ -9,7 +9,7 @@#include <sys/conf.h>#include <sys/errno.h>#include <sys/proc.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/systm.h>#include <sys/uio.h>#include <pexpert/pexpert.h>@@ -31,10 +31,10 @@ extern void loader_log_line(const char *line);* A "tl:" line, for the kernel's drivers: into the loader's log as it is written -- the kernel's own* log keeps only the last of a run, and a live look at the loader's (XL_FOLLOW) then misses nothing.*/-void redwood_tl(const char *format, ...) __printflike(1, 2);+void hakios_tl(const char *format, ...) __printflike(1, 2);void-redwood_tl(const char *format, ...)+hakios_tl(const char *format, ...){char line[192];va_list list;@@ -56,9 +56,9 @@ latency_lines(void)return touch_lat != 0;}-static LCK_GRP_DECLARE(touch_lck_grp, "redwood-touch");+static LCK_GRP_DECLARE(touch_lck_grp, "hakios-touch");static LCK_MTX_DECLARE(touch_lock, &touch_lck_grp);-static struct redwood_touch touch_queue[TOUCH_QUEUE];+static struct hakios_touch touch_queue[TOUCH_QUEUE];static uint32_t touch_head, touch_tail; /* read from head, add at tail *//*@@ -78,7 +78,7 @@ static voidexit_hold_elapsed(__unused thread_call_param_t p0, __unused thread_call_param_t p1){printf("\n--- %d fingers held on the screen for %d ms: back to the loader ---\n", EXIT_FINGERS, EXIT_HOLD_MS);- redwood_adreno_stop();+ hakios_adreno_stop();loader_return();}@@ -89,10 +89,10 @@ count_fingers(uint32_t type, uint32_t finger)int before = __builtin_popcount(fingers_down), now;uint64_t deadline;- if (finger >= 32 || exit_call == NULL || (type != REDWOOD_TOUCH_DOWN && type != REDWOOD_TOUCH_UP)) {+ if (finger >= 32 || exit_call == NULL || (type != HAKIOS_TOUCH_DOWN && type != HAKIOS_TOUCH_UP)) {return;}- if (type == REDWOOD_TOUCH_DOWN) {+ if (type == HAKIOS_TOUCH_DOWN) {fingers_down |= 1u << finger;} else {fingers_down &= ~(1u << finger);@@ -109,7 +109,7 @@ count_fingers(uint32_t type, uint32_t finger)static voidtouch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y, bool from_driver){- struct redwood_touch *t;+ struct hakios_touch *t;lck_mtx_lock(&touch_lock);if (touch_tail - touch_head == TOUCH_QUEUE) {@@ -121,7 +121,7 @@ touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y, bool from_driuint64_t ns;absolutetime_to_nanoseconds(t->time, &ns);- redwood_tl("tl: p %u %u %u %u at %llu\n", type, finger, x, y, ns / 1000);+ hakios_tl("tl: p %u %u %u %u at %llu\n", type, finger, x, y, ns / 1000);}t->type = type;t->finger = finger;@@ -135,7 +135,7 @@ touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y, bool from_dri}void-redwood_touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y)+hakios_touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y){touch_post(type, finger, x, y, true);}@@ -155,12 +155,12 @@ touch_close(__unused dev_t dev, __unused int flags, __unused int devtype, __unusstatic inttouch_read(__unused dev_t dev, struct uio *uio, __unused int ioflag){- struct redwood_touch t;+ struct hakios_touch t;int error = 0, moved = 0;lck_mtx_lock(&touch_lock);while (touch_head == touch_tail) {- error = msleep(&touch_queue, &touch_lock, PZERO | PCATCH, "redwood-touch", NULL);+ error = msleep(&touch_queue, &touch_lock, PZERO | PCATCH, "hakios-touch", NULL);if (error) {lck_mtx_unlock(&touch_lock);return error;@@ -183,7 +183,7 @@ touch_read(__unused dev_t dev, struct uio *uio, __unused int ioflag)static inttouch_write(__unused dev_t dev, struct uio *uio, __unused int ioflag){- struct redwood_touch t;+ struct hakios_touch t;int error = 0;while (uio_resid(uio) >= (user_ssize_t)sizeof(t)) {@@ -191,7 +191,7 @@ touch_write(__unused dev_t dev, struct uio *uio, __unused int ioflag)if (error) {break;}- if (t.type < REDWOOD_TOUCH_DOWN || t.type > REDWOOD_BUTTON_UP) {+ if (t.type < HAKIOS_TOUCH_DOWN || t.type > HAKIOS_BUTTON_UP) {return EINVAL;}touch_post(t.type, t.finger, t.x, t.y, false);@@ -206,23 +206,23 @@ static const struct cdevsw touch_cdevsw = {};void-redwood_input_init(void)+hakios_input_init(void){int major = cdevsw_add(-1, &touch_cdevsw);- if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "redwood-touch") == NULL) {- printf("redwood-touch: cannot create the device\n");+ if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "hakios-touch") == NULL) {+ printf("hakios-touch: cannot create the device\n");}exit_call = thread_call_allocate(exit_hold_elapsed, NULL);- redwood_cpufreq_init();- redwood_virtio_input_init();- redwood_goodix_init();- redwood_buttons_init();- redwood_battery_init();- redwood_ufs_init();- redwood_net_init();- redwood_adreno_init();- redwood_wifi_init();- redwood_adsp_init();- redwood_mpss_init();+ hakios_cpufreq_init();+ hakios_virtio_input_init();+ hakios_goodix_init();+ hakios_buttons_init();+ hakios_battery_init();+ hakios_ufs_init();+ hakios_net_init();+ hakios_adreno_init();+ hakios_wifi_init();+ hakios_adsp_init();+ hakios_mpss_init();}diff --git a/xnu/files/bsd/dev/redwood_lx.c b/xnu/files/bsd/dev/hakios.lx.csimilarity index 88%rename from xnu/files/bsd/dev/redwood_lx.crename to xnu/files/bsd/dev/hakios.lx.cindex a6786fa..8203bef 100644--- a/xnu/files/bsd/dev/redwood_lx.c+++ b/xnu/files/bsd/dev/hakios.lx.c@@ -1,13 +1,13 @@/*- * Darwin-on-redwood: the kernel's side of the Wi-Fi driver's object.+ * Darwin-on-hakios: the kernel's side of the Wi-Fi driver's object.** The driver of the phone's radio is Linux's ath11k, compiled unmodified outside this tree on a* layer that gives it the kernel interfaces it expects, and tied into one object that the* kernel links when it is there (tools/mk-ath11k.sh and wifi/lx in the repository; the kernel* is built with that object when xnu-build.sh finds it). The object shows one name, lx_start(),- * and asks for the calls of sys/redwood_lx.h, which are here: memory, time, threads, one lock+ * and asks for the calls of sys/hakios.lx.h, which are here: memory, time, threads, one lock* to sleep under, the kernel's options. What it asks of the radio itself -- its firmware's- * files, its view of memory, the processor its firmware runs on -- is redwood_wifi.c's to+ * files, its view of memory, the processor its firmware runs on -- is hakios.wifi.c's to* answer, which knows the phone.** A kernel built without the object has the lx_start() at the end of this file, which says so.@@ -24,9 +24,9 @@#include <pexpert/pexpert.h>#include <sys/errno.h>#include <sys/random.h>-#include <sys/redwood_input.h>-#include <sys/redwood_lx.h>-#include <sys/redwood_net.h>+#include <sys/hakios.input.h>+#include <sys/hakios.lx.h>+#include <sys/hakios.net.h>#include <sys/systm.h>#include <vm/memory_types.h>#include <vm/vm_kern.h>@@ -36,9 +36,9 @@ extern uint64_t kvtophys(vm_offset_t va); /* pmap_paddr_t */extern kern_return_t thread_terminate(thread_t thread);extern void thread_set_thread_name(thread_t thread, const char *name);-#define say redwood_wifi_say+#define say hakios_wifi_say-static LCK_GRP_DECLARE(lx_lock_group, "redwood-lx");+static LCK_GRP_DECLARE(lx_lock_group, "hakios-lx");static LCK_MTX_DECLARE(lx_lock, &lx_lock_group);/* ---- memory ------------------------------------------------------------------------------------------ */@@ -57,7 +57,7 @@ lx_os_free(void *memory, unsigned long size)/** In one physical piece, so that it can be mapped a second time without this processor's cache- * in between (as redwood_adreno.c does with what it shares with the GPU); the first, cached+ * in between (as hakios.adreno.c does with what it shares with the GPU); the first, cached* view is written out and never used again.*/void *@@ -79,7 +79,7 @@ lx_os_radio_memory(unsigned long size, unsigned long long *address)}__asm__ volatile ("dsb sy");uncached = ml_io_map_unmappable(physical, size, VM_WIMG_WCOMB);- if (uncached == 0 || !redwood_wifi_radio_map(physical, size, address)) {+ if (uncached == 0 || !hakios_wifi_radio_map(physical, size, address)) {return NULL;}return (void *)uncached;@@ -105,7 +105,7 @@ lx_os_print(const char *text)voidlx_os_tell(const char *text){- redwood_wifi_tell("%s", text);+ hakios_wifi_tell("%s", text);}void@@ -208,14 +208,14 @@ lx_os_random(void *buffer, unsigned long size)unsignedlx_os_option(const char *name){- return redwood_wifi_option(name);+ return hakios_wifi_option(name);}intlx_os_firmware(const char *name, const void **data, unsigned long *size){uint64_t length = 0;- const uint8_t *file = redwood_wifi_driver_file(name, &length);+ const uint8_t *file = hakios_wifi_driver_file(name, &length);if (file == NULL) {return ENOENT;@@ -228,22 +228,22 @@ lx_os_firmware(const char *name, const void **data, unsigned long *size)intlx_os_rproc_boot(void){- return redwood_wifi_dsp_is_up() ? 0 : ENXIO;+ return hakios_wifi_dsp_is_up() ? 0 : ENXIO;}intlx_os_radio_address(unsigned char *address){- return redwood_wifi_radio_address(address);+ return hakios_wifi_radio_address(address);}intlx_os_network(unsigned char *name, unsigned *name_length, unsigned char *passphrase, unsigned *passphrase_length){- return redwood_wifi_network(name, name_length, passphrase, passphrase_length);+ return hakios_wifi_network(name, name_length, passphrase, passphrase_length);}-/* ---- frames: the radio as the link behind en0 (sys/redwood_net.h) ------------------------------------ */+/* ---- frames: the radio as the link behind en0 (sys/hakios.net.h) ------------------------------------ *//** A frame from the network stack comes on whatever thread sends it, and the driver's side keeps@@ -254,7 +254,7 @@ lx_os_network(unsigned char *name, unsigned *name_length, unsigned char *passphrstruct lx_frame {uint16_t length;- uint8_t bytes[REDWOOD_NET_FRAME_MAX];+ uint8_t bytes[HAKIOS_NET_FRAME_MAX];};static bool lx_link_attached;@@ -288,7 +288,7 @@ lx_link_transmit(mbuf_t packet, size_t length)struct lx_frame *frame;lck_mtx_lock(&lx_queue_lock);- if (length > REDWOOD_NET_FRAME_MAX || lx_queue_in - lx_queue_out == LX_QUEUE) {+ if (length > HAKIOS_NET_FRAME_MAX || lx_queue_in - lx_queue_out == LX_QUEUE) {lx_queue_dropped++;lck_mtx_unlock(&lx_queue_lock);return false;@@ -305,7 +305,7 @@ lx_link_transmit(mbuf_t packet, size_t length)return true;}-static struct redwood_net_link lx_link = {+static struct hakios_net_link lx_link = {.name = "the phone's radio (ath11k)",.wireless = true,.transmit = lx_link_transmit,@@ -327,7 +327,7 @@ lx_os_net_attach(const unsigned char *address)thread_set_thread_name(thread, "wifi-send");thread_deallocate(thread);memcpy(lx_link.address, address, sizeof(lx_link.address));- lx_link_attached = redwood_net_attach(&lx_link);+ lx_link_attached = hakios_net_attach(&lx_link);say("lx: %s\n", lx_link_attached ? "the radio is the link behind en0" : "EN0 HAS A LINK ALREADY: the radio's frames go ""nowhere");}@@ -338,11 +338,11 @@ lx_os_net_attach(const unsigned char *address)* turns up twelve seconds later is one it has already failed to open.*/void-redwood_lx_net_early(void)+hakios_lx_net_early(void){uint8_t address[6];- if (redwood_wifi_radio_address(address)) {+ if (hakios_wifi_radio_address(address)) {lx_os_net_attach(address);}}@@ -351,15 +351,15 @@ voidlx_os_net_link(int up){if (lx_link_attached) {- redwood_net_link_state(up != 0);+ hakios_net_link_state(up != 0);}}voidlx_os_net_input(const unsigned char *frame, unsigned long length){- if (lx_link_attached && length <= REDWOOD_NET_FRAME_MAX) {- redwood_net_input(frame, length);+ if (lx_link_attached && length <= HAKIOS_NET_FRAME_MAX) {+ hakios_net_input(frame, length);}}@@ -432,7 +432,7 @@ lx_os_irq_msi(unsigned long long *address, unsigned *data){uint32_t first = 0;- if (!redwood_wifi_radio_msi(address, data, &first)) {+ if (!hakios_wifi_radio_msi(address, data, &first)) {return 0;}lx_irq_first = first;@@ -448,7 +448,7 @@ lx_os_irq_attach(unsigned vector, void (*function)(void *), void *argument)return EINVAL;}if (lx_irq_thread == THREAD_NULL) {- redwood_wifi_tell("lx: wifi_irq: THE GIC'S DISTRIBUTOR IS WRITTEN for the radio's interrupts: each vector's SPI (%u + v) edge-"+ hakios_wifi_tell("lx: wifi_irq: THE GIC'S DISTRIBUTOR IS WRITTEN for the radio's interrupts: each vector's SPI (%u + v) edge-""triggered, group 1, routed to this processor, then enabled\n", lx_irq_first);if (kernel_thread_start(lx_irq_runs, NULL, &lx_irq_thread) != KERN_SUCCESS) {lx_irq_thread = THREAD_NULL;@@ -521,18 +521,18 @@ lx_os_irq_count(unsigned vector)return vector < LX_VECTORS && lx_irq_first != 0 ? gic_v3_spi_count(lx_irq_first + vector) : 0;}-/* ---- the station (sys/redwood_sta.h) --------------------------------------------------------------------- */+/* ---- the station (sys/hakios.sta.h) --------------------------------------------------------------------- */void-lx_os_station(const struct redwood_sta_ops *ops)+lx_os_station(const struct hakios_sta_ops *ops){- redwood_sta_attach(ops);+ hakios_sta_attach(ops);}voidlx_os_station_lost(int error){- redwood_sta_lost(error);+ hakios_sta_lost(error);}/* ---- the driver ---------------------------------------------------------------------------------------- */@@ -564,19 +564,19 @@ lx_transmit(__unused const unsigned char *frame, __unused unsigned long length)}int-redwood_lx_start(void)+hakios_lx_start(void){return lx_start();}void-redwood_lx_stop(void)+hakios_lx_stop(void){lx_stop();}int-redwood_lx_prepare(void)+hakios_lx_prepare(void){return lx_prepare();}diff --git a/xnu/files/bsd/dev/redwood_mic.c b/xnu/files/bsd/dev/hakios.mic.csimilarity index 96%rename from xnu/files/bsd/dev/redwood_mic.crename to xnu/files/bsd/dev/hakios.mic.cindex c07e930..5cdecde 100644--- a/xnu/files/bsd/dev/redwood_mic.c+++ b/xnu/files/bsd/dev/hakios.mic.c@@ -1,10 +1,10 @@/** The phone's microphones, through the audio DSP. Every address and number below belongs to the* POCO X5 Pro (redwood), from Android's own live device tree, its mixer paths (fw-audio/android/)- * and Xiaomi's kernel (redwood-s-oss, techpack/audio: asoc/codecs/bolero/, asoc/codecs/wcd938x/,+ * and Xiaomi's kernel (hakios-s-oss, techpack/audio: asoc/codecs/bolero/, asoc/codecs/wcd938x/,* soc/swr-mstr-ctrl.c, soc/pinctrl-lpi.c, dsp/q6afe.c, asoc/codecs/audio-ext-clk-up.c). Nothing- * here happens unless boot-arg mic=N asks for it, with adsp=1 (redwood_adsp.c), which calls- * redwood_mic_dsp_up() once the DSP's audio services are up.+ * here happens unless boot-arg mic=N asks for it, with adsp=1 (hakios.adsp.c), which calls+ * hakios_mic_dsp_up() once the DSP's audio services are up.** The main microphone under Android (mixer paths "handset-mic" = "amic1", "audio-record"): the* analog microphone at ADC1 of the WCD938x codec, whose samples go over SoundWire (the TX master@@ -54,7 +54,7 @@* mic_tap=1 with haptic=5 (the vibration motor from 2 s to 3 s of listening: the motor's* 175.5 Hz in the samples)*- * What is asked for is given back at the end, and before the DSP is shut down (redwood_mic_dsp_down()).+ * What is asked for is given back at the end, and before the DSP is shut down (hakios_mic_dsp_down()).*/#include <kern/clock.h>#include <kern/locks.h>@@ -66,8 +66,8 @@#include <miscfs/devfs/devfs.h>#include <pexpert/pexpert.h>#include <sys/conf.h>-#include <sys/redwood_audio.h>-#include <sys/redwood_input.h>+#include <sys/hakios.audio.h>+#include <sys/hakios.input.h>#include <sys/systm.h>#include <sys/uio.h>@@ -75,7 +75,7 @@ extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern kern_return_t thread_terminate(thread_t thread);extern void loader_log_putc(char c);-static LCK_GRP_DECLARE(mic_lock_group, "redwood-mic");+static LCK_GRP_DECLARE(mic_lock_group, "hakios-mic");static LCK_MTX_DECLARE(mic_lock, &mic_lock_group); /* what is asked for, and given back */static uint32_t level;@@ -84,7 +84,7 @@ static bool running;static int say(const char *format, ...) __printflike(1, 2);/*- * Every line is kept as well, and all of them said again at the run's end (redwood_mic_quiesce()):+ * Every line is kept as well, and all of them said again at the run's end (hakios_mic_quiesce()):* the log of a run keeps its beginning and its end, and this happens in between.*/#define KEPT_LINES 400@@ -114,7 +114,7 @@ static bool quiet;#define note(...) do { if (!quiet) { say(__VA_ARGS__); } } while (0)void-redwood_mic_quiesce(void)+hakios_mic_quiesce(void){if (kept_count == 0) {return;@@ -259,14 +259,14 @@ dsp_error(uint32_t status)static boolcommand(const char *what, uint8_t service, uint32_t opcode, const void *payload, uint32_t length, uint32_t wanted,- struct redwood_apr_answer *answer)+ struct hakios_apr_answer *answer){- struct redwood_apr_answer local;+ struct hakios_apr_answer local;if (answer == NULL) {answer = &local;}- if (!redwood_adsp_apr(service, 0, 0, opcode, payload, length, APR_WAIT_MS, answer)) {+ if (!hakios_adsp_apr(service, 0, 0, opcode, payload, length, APR_WAIT_MS, answer)) {say("mic: %s (opcode %#x): NO ANSWER\n", what, opcode);return false;}@@ -331,7 +331,7 @@ vote(uint32_t block, const char *client)uint32_t block;char client[8];} __attribute__((packed)) request = { block, { 0 } };- struct redwood_apr_answer answer;+ struct hakios_apr_answer answer;char what[80];strlcpy(request.client, client, sizeof(request.client));@@ -1301,7 +1301,7 @@ mic_read(unsigned period)uint32_t read[5] = { (uint32_t)(mic_address + 4096 * period), (uint32_t)((mic_address + 4096 * period) >> 32),mic_map_handle, MIC_PERIOD_BYTES, period };- return redwood_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, READ_TOKEN | period, ASM_DATA_CMD_READ_V2, read, sizeof(read), 0, NULL);+ return hakios_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, READ_TOKEN | period, ASM_DATA_CMD_READ_V2, read, sizeof(read), 0, NULL);}static bool@@ -1352,10 +1352,10 @@ dsp_path_on(void)uint16_t session, copps;uint16_t copp[2];} __attribute__((packed)) route = { ADM_MATRIX_AUDIO_TX, 1, MIC_SESSION, 1, { 0, 0 } };- struct redwood_apr_answer answer;+ struct hakios_apr_answer answer;uint32_t bytes = 0;- if (!redwood_audio_dsp_memory(&mic_memory, &mic_address, &bytes) || bytes < MIC_PERIODS * 4096) {+ if (!hakios_audio_dsp_memory(&mic_memory, &mic_address, &bytes) || bytes < MIC_PERIODS * 4096) {say("mic: no memory the DSP can see\n");return false;}@@ -1363,7 +1363,7 @@ dsp_path_on(void)map.low = (uint32_t)mic_address;map.high = (uint32_t)(mic_address >> 32);map.size = MIC_PERIODS * 4096;- redwood_adsp_apr_events_second(mic_events);+ hakios_adsp_apr_events_second(mic_events);if (!command("our periods for the microphone, mapped for the DSP", APR_SVC_ASM, ASM_CMD_SHARED_MEM_MAP_REGIONS, &map,sizeof(map), ASM_CMDRSP_SHARED_MEM_MAP_REGIONS, &answer)) {return false;@@ -1371,20 +1371,20 @@ dsp_path_on(void)mic_mapped = true;mic_map_handle = answer.words[0];say("mic: our %u KB at %#llx are the DSP's handle %#x\n", MIC_PERIODS * 4, mic_address, mic_map_handle);- if (!redwood_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_STREAM_CMD_OPEN_READ_V3, &reading, sizeof(reading), APR_WAIT_MS,+ if (!hakios_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_STREAM_CMD_OPEN_READ_V3, &reading, sizeof(reading), APR_WAIT_MS,&answer) || answer.opcode != APR_BASIC_RSP_RESULT || answer.words[1] != 0) {say("mic: the stream, opened for reading: %s (%#x %#x)\n", "REFUSED OR NO ANSWER", answer.opcode, answer.words[1]);return false;}mic_stream_open = true;say("mic: the stream (session 2), opened for reading 16-bit linear PCM, no processing: done\n");- if (!redwood_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_STREAM_CMD_SET_ENCDEC_PARAM, &encoder, sizeof(encoder), APR_WAIT_MS,+ if (!hakios_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_STREAM_CMD_SET_ENCDEC_PARAM, &encoder, sizeof(encoder), APR_WAIT_MS,&answer) || answer.opcode != APR_BASIC_RSP_RESULT || answer.words[1] != 0) {say("mic: the stream's format: REFUSED OR NO ANSWER (%#x %#x)\n", answer.opcode, answer.words[1]);return false;}say("mic: the stream's format: 1 channel of 16 bits at 48 kHz: done\n");- if (!redwood_adsp_apr(APR_SVC_ADM, MIC_PORT, 0, ADM_CMD_DEVICE_OPEN_V5, &open, sizeof(open), APR_WAIT_MS, &answer) ||+ if (!hakios_adsp_apr(APR_SVC_ADM, MIC_PORT, 0, ADM_CMD_DEVICE_OPEN_V5, &open, sizeof(open), APR_WAIT_MS, &answer) ||answer.opcode != ADM_CMDRSP_DEVICE_OPEN_V5 || answer.words[0] != 0) {say("mic: a device path from the port: REFUSED OR NO ANSWER (%#x %#x)\n", answer.opcode, answer.words[0]);return false;@@ -1422,12 +1422,12 @@ dsp_off(void)uint16_t stop[2] = { MIC_PORT, 0 };if (mic_stream_open) {- (void)redwood_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_STREAM_CMD_CLOSE, NULL, 0, APR_WAIT_MS, NULL);+ (void)hakios_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_STREAM_CMD_CLOSE, NULL, 0, APR_WAIT_MS, NULL);say("mic: the stream, closed\n");mic_stream_open = false;}if (mic_copp_open) {- (void)redwood_adsp_apr(APR_SVC_ADM, (uint16_t)mic_copp, 0, ADM_CMD_DEVICE_CLOSE_V5, NULL, 0, APR_WAIT_MS, NULL);+ (void)hakios_adsp_apr(APR_SVC_ADM, (uint16_t)mic_copp, 0, ADM_CMD_DEVICE_CLOSE_V5, NULL, 0, APR_WAIT_MS, NULL);say("mic: the device path, closed\n");mic_copp_open = false;}@@ -1440,9 +1440,9 @@ dsp_off(void)sizeof(mic_map_handle), 0, NULL);mic_mapped = false;}- redwood_adsp_apr_events_second(NULL);+ hakios_adsp_apr_events_second(NULL);if (memory_taken) {- redwood_audio_dsp_memory_put();+ hakios_audio_dsp_memory_put();memory_taken = false;}}@@ -1450,8 +1450,8 @@ dsp_off(void)/* ---- mic=4: the microphone for iOS ------------------------------------------------------------------- *//*- * What the microphone hears goes into a ring, and /dev/redwood-mic gives it to iOS's audio server- * (RedwoodAudio.driver's device "Codec", userland/src/audio_plugin.c): 16-bit samples, one channel,+ * What the microphone hears goes into a ring, and /dev/hakios-mic gives it to iOS's audio server+ * (HakiosAudio.driver's device "Codec", userland/src/audio_plugin.c): 16-bit samples, one channel,* 48 kHz. The path is up only while the device is open (the audio server opens it when its input* starts and closes it when it stops), and a read never waits: it gives what has come, keeping the* reader about 40 ms behind the DSP (it comes in 20 ms periods), and nothing until that much is@@ -1467,7 +1467,7 @@ static uint64_t ring_read; /* frames taken from it (one reastatic bool ring_primed; /* the reader is RING_KEEP behind; false after it ran dry */static uint64_t ring_skipped, ring_dry; /* frames skipped, reads that found too little: said when iOS stops */static volatile uint32_t ios_wants; /* the device is open */-static volatile bool stopping; /* the run ends (redwood_mic_dsp_down()) */+static volatile bool stopping; /* the run ends (hakios_mic_dsp_down()) */static voidring_put(const int16_t *samples, uint32_t count)@@ -1558,11 +1558,11 @@ listen(bool for_ios)bool unmuted = false, settled = false;uint64_t began = mach_absolute_time(), now, elapsed_ms;- struct redwood_apr_answer answer;+ struct hakios_apr_answer answer;read_ready = 0;reads_done = read_errors = 0;- if (!redwood_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_SESSION_CMD_RUN_V2, run, sizeof(run), APR_WAIT_MS, &answer) ||+ if (!hakios_adsp_apr(APR_SVC_ASM, MIC_STREAM_PORT, 0, ASM_SESSION_CMD_RUN_V2, run, sizeof(run), APR_WAIT_MS, &answer) ||answer.opcode != APR_BASIC_RSP_RESULT || answer.words[1] != 0) {say("mic: the session, run: REFUSED OR NO ANSWER (%#x %#x)\n", answer.opcode, answer.words[1]);return;@@ -1589,9 +1589,9 @@ listen(bool for_ios)settled = dec1_settled();}if (tap && elapsed_ms >= 2000 && elapsed_ms < 3000) {- redwood_haptic_pretend(20000);+ hakios_haptic_pretend(20000);} else if (tap == 1 && elapsed_ms >= 3000) {- redwood_haptic_pretend(0);+ hakios_haptic_pretend(0);tap = 2;}if ((for_ios ? (!ios_wants || stopping) : elapsed_ms >= mic_secs * 1000ull) || broken) {@@ -1629,14 +1629,14 @@ listen(bool for_ios)if (for_ios) {ring_put(samples, got);}- if (redwood_audio_recording_mic()) {+ if (hakios_audio_recording_mic()) {for (uint32_t i = 0; i < got; i += 240) {uint32_t n = got - i < 240 ? got - i : 240;for (uint32_t j = 0; j < n; j++) {stereo[2 * j] = stereo[2 * j + 1] = samples[i + j];}- redwood_audio_record_fed(stereo, n);+ hakios_audio_record_fed(stereo, n);}}}@@ -1718,7 +1718,7 @@ path_up(void)}/*- * mic=4: the path up whenever iOS opens /dev/redwood-mic, down when it closes it; after three+ * mic=4: the path up whenever iOS opens /dev/hakios-mic, down when it closes it; after three* recordings that broke off, no more until the run ends.*/static void@@ -1729,11 +1729,11 @@ for_ios(void)ring = kalloc_data(RING_FRAMES * sizeof(int16_t), Z_WAITOK | Z_ZERO);if (ring == NULL || major < 0 ||- devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "redwood-mic") == NULL) {- say("mic: /dev/redwood-mic cannot be made\n");+ devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "hakios-mic") == NULL) {+ say("mic: /dev/hakios-mic cannot be made\n");return;}- say("mic: THE MICROPHONE IS IOS'S (/dev/redwood-mic) from here on, until the run ends: it listens only while iOS records\n");+ say("mic: THE MICROPHONE IS IOS'S (/dev/hakios-mic) from here on, until the run ends: it listens only while iOS records\n");while (!stopping) {uint64_t began, ns;bool failed;@@ -1785,7 +1785,7 @@ mic_thread(__unused void *parameter, __unused wait_result_t result)say("mic: level %u: %s\n", level, level == 1 ? "a look, after the LPASS's votes and clocks; nothing written to the codec" :level == 2 ? "the codec brought up to answer on SoundWire, nothing of it set; then all undone" :level == 3 ? "the main microphone, as Android records from it, listened to; then all undone" :- "the main microphone for iOS (/dev/redwood-mic), up while iOS records");+ "the main microphone for iOS (/dev/hakios-mic), up while iOS records");if (level == 4) {for_ios();} else {@@ -1812,7 +1812,7 @@ mic_thread(__unused void *parameter, __unused wait_result_t result)}void-redwood_mic_dsp_up(void)+hakios_mic_dsp_up(void){thread_t thread;@@ -1836,7 +1836,7 @@ redwood_mic_dsp_up(void)}void-redwood_mic_dsp_down(void)+hakios_mic_dsp_down(void){stopping = true;if (running) {diff --git a/xnu/files/bsd/dev/redwood_mpss.c b/xnu/files/bsd/dev/hakios.mpss.csimilarity index 97%rename from xnu/files/bsd/dev/redwood_mpss.crename to xnu/files/bsd/dev/hakios.mpss.cindex 4a09ae9..07fe057 100644--- a/xnu/files/bsd/dev/redwood_mpss.c+++ b/xnu/files/bsd/dev/hakios.mpss.c@@ -4,19 +4,19 @@* boot-arg asks for it.** The modem ("MPSS", Android's "modem") is a Hexagon of its own inside the SoC, exactly as the- * Wi-Fi's and the audio's are (redwood_wifi.c, redwood_adsp.c): it stays in reset until somebody+ * Wi-Fi's and the audio's are (hakios.wifi.c, hakios.adsp.c): it stays in reset until somebody* loads its signed image -- modem.mdt and modem.b00 to modem.b29 from /vendor/firmware_mnt/image* of its Android, 85 MB, in the system image under /fw (MODEM=1 SYSTEM=1 userland/build.sh, from* fw-modem/) -- into the 246 MB reserved for it and asks TrustZone to authenticate and start it.* From there everything is conversation through the shared memory: SMP2P for "up", "given up",* "stopped"; GLINK for channels; QRTR on the channel "IPCRTR" for the modem's services, which- * speak QMI (bsd/dev/redwood_qmi.c knows the protocol; here only two of its messages are made by+ * speak QMI (bsd/dev/hakios.qmi.c knows the protocol; here only two of its messages are made by* hand): the device management service is asked to put the modem online, and the network access- * service what network it is on and how strong the signal is (bsd/dev/redwood_nas.c). What this- * learns goes to sysctl kern.redwood.cellular_* for the rest of the system; calls, SMS and data+ * service what network it is on and how strong the signal is (bsd/dev/hakios.nas.c). What this+ * learns goes to sysctl kern.hakios.cellular_* for the rest of the system; calls, SMS and data* are for the steps after this one.*- * The way is the modem's, which is the Wi-Fi DSP's: redwood_adsp.c's comments say why each+ * The way is the modem's, which is the Wi-Fi DSP's: hakios.adsp.c's comments say why each* thing is done so; this file is that one with the modem's numbers (dt: qcom,mss@4080000,* qcom,smp2p-modem, qcom,glink/modem, reserved-memory mpss@8b800000):* - processor 1 in the shared memory; its SMP2P items 435 (its) and 428 (ours); its last words@@ -27,7 +27,7 @@* - its rails are CX and MSS (cx.lvl and mss.lvl), asked for at level 384 while it boots* - the always-on processor is told of it as "modem"* - the channel is IPCRTR only; the modem's others (DS, DATA*, glink_ssr) are left unanswered- * - the ports of QRTR are the Wi-Fi driver's (sys/redwood_qrtr.h): what the NAS client needs+ * - the ports of QRTR are the Wi-Fi driver's (sys/hakios.qrtr.h): what the NAS client needs* The modem and the Wi-Fi DSP may run at the same time: the mailbox to the always-on* processor and the lock for allocating in the shared memory are shared, each behind a lock.*@@ -76,9 +76,9 @@#include <sys/vnode.h>#include <sys/vnode_internal.h>#include <vm/vm_kern.h>-#include <sys/redwood_input.h>-#include <sys/redwood_nas.h>-#include <sys/redwood_qrtr.h>+#include <sys/hakios.input.h>+#include <sys/hakios.nas.h>+#include <sys/hakios.qrtr.h>#include <sys/sysctl.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);@@ -92,12 +92,12 @@ extern dev_t mdevlookup(int devid);extern int mdevgetkernelrange(dev_t dev, vm_offset_t *base, uint64_t *size);extern void FlushPoC_DcacheRegion(vm_offset_t va, size_t length); /* osfmk/arm64/caches_asm.s */-/* What the Wi-Fi's DSP and this one both use (redwood_wifi.c). */-extern lck_mtx_t redwood_aop_mailbox_lock;-extern lck_mtx_t redwood_smem_alloc_lock;-extern lck_mtx_t redwood_rsc_lock; /* RPMh's sequencer, shared with the other DSP's driver */+/* What the Wi-Fi's DSP and this one both use (hakios.wifi.c). */+extern lck_mtx_t hakios_aop_mailbox_lock;+extern lck_mtx_t hakios_smem_alloc_lock;+extern lck_mtx_t hakios_rsc_lock; /* RPMh's sequencer, shared with the other DSP's driver */-static LCK_GRP_DECLARE(mpss_lock_group, "redwood-mpss");+static LCK_GRP_DECLARE(mpss_lock_group, "hakios-mpss");/* the modem's file systems, served from here (rmtfs, below) */static bool rmtfs_buffer_make(void);@@ -110,7 +110,7 @@ static bool rmtfs_start(void);static void rmtfs_stop(void);#define STEPS 11-#define REDWOOD_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin */+#define HAKIOS_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin */static uint32_t last_step, pause_ms = 2200, listen_seconds = 3;static uint32_t step; /* the one being performed */@@ -119,7 +119,7 @@ static char last_write[96] = "nothing written";static bool leaving; /* on the way back to the loader after a panic: no lock is taken, nothing sleeps *//*- * Every line goes to the log the loader reads from another core as well (as in redwood_wifi.c);+ * Every line goes to the log the loader reads from another core as well (as in hakios.wifi.c);* with modem=1 only the few that say how it went (tell()), the rest to the kernel's own log.*/extern void loader_log_putc(char c);@@ -214,7 +214,7 @@ option(const char *name)return PE_parse_boot_argn(name, &value, sizeof(value)) && value != 0;}-/* ---- register access (as in redwood_wifi.c) ------------------------------------------------------- */+/* ---- register access (as in hakios.wifi.c) ------------------------------------------------------- */static uint32_t __attribute__((noinline))rd(vm_offset_t address)@@ -281,7 +281,7 @@ put(struct block *b, const char *name, uint32_t offset, uint32_t value)wr(b->base + offset, value);}-/* ---- the shared memory (redwood_wifi.c, step 1) --------------------------------------------------- */+/* ---- the shared memory (hakios.wifi.c, step 1) --------------------------------------------------- */#define SMEM_PHYS 0x80900000UL#define SMEM_SIZE 0x00200000u@@ -579,7 +579,7 @@ show_crash_reason(void)}}-/* ---- the doorbells, and the mailbox to the always-on processor (redwood_wifi.c, steps 2 and 7) ------ */+/* ---- the doorbells, and the mailbox to the always-on processor (hakios.wifi.c, steps 2 and 7) ------ */#define QMP_MAGIC 0x00#define QMP_MAGIC_VALUE 0x4d41494c@@ -665,7 +665,7 @@ ring_aop(void)wr(ipcc.base + IPCC_SEND, IPCC_AOP << 16 | 0);}-/* Linux's qmp_open(), as redwood_wifi.c does it; what is done already is found done. Under the mailbox's lock. */+/* Linux's qmp_open(), as hakios.wifi.c does it; what is done already is found done. Under the mailbox's lock. */static boolmailbox_open(void){@@ -730,7 +730,7 @@ mailbox_send(const char *text)bool sent = false;if (!leaving) {- lck_mtx_lock(&redwood_aop_mailbox_lock);+ lck_mtx_lock(&hakios_aop_mailbox_lock);}if (our_box == 0 && (leaving || !mailbox_open())) {goto out;@@ -757,7 +757,7 @@ mailbox_send(const char *text)sent = true;out:if (!leaving) {- lck_mtx_unlock(&redwood_aop_mailbox_lock);+ lck_mtx_unlock(&hakios_aop_mailbox_lock);}return sent;}@@ -893,12 +893,12 @@ rails(uint32_t level)values[r] = (uint32_t)position;}need(&rsc);- lck_mtx_lock(&redwood_rsc_lock);+ lck_mtx_lock(&hakios_rsc_lock);/* (the boot loader leaves the trigger set after its last request, done: idle is what the status says) */if (rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_STATUS) == 0) {printf("mpss: %u: TCS %u of the sequencer is busy (status %#x, control %#x): the rails are not asked\n", step, RPMH_TCS,rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_STATUS), rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL));- lck_mtx_unlock(&redwood_rsc_lock);+ lck_mtx_unlock(&hakios_rsc_lock);return false;}printf("mpss: %u: about to ask RPMh, through TCS %u, for cx.lvl (%#x) = %u and mss.lvl (%#x) = %u (level %u%s)\n", step,@@ -931,7 +931,7 @@ rails(uint32_t level)wr(rsc.base + RSC_IRQ_CLEAR, 1u << RPMH_TCS);wr(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL, rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL) & ~(TCS_TRIGGER | TCS_ACTIVE_MODE));wr(rsc.base + RSC_TCS(RPMH_TCS) + TCS_ENABLED, 0);- lck_mtx_unlock(&redwood_rsc_lock);+ lck_mtx_unlock(&hakios_rsc_lock);return done != 0;}@@ -953,10 +953,10 @@ rpmh_command(const char *name, uint32_t value)return false;}need(&rsc);- lck_mtx_lock(&redwood_rsc_lock);+ lck_mtx_lock(&hakios_rsc_lock);if (rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_STATUS) == 0) {printf("mpss: %u: TCS %u of the sequencer is busy: \"%s\" is not asked\n", step, RPMH_TCS, name);- lck_mtx_unlock(&redwood_rsc_lock);+ lck_mtx_unlock(&hakios_rsc_lock);return false;}printf("mpss: %u: about to ask RPMh, through TCS %u, for %s (%#x) = %#x\n", step, RPMH_TCS, name, address, value);@@ -985,7 +985,7 @@ rpmh_command(const char *name, uint32_t value)wr(rsc.base + RSC_IRQ_CLEAR, 1u << RPMH_TCS);wr(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL, rd(rsc.base + RSC_TCS(RPMH_TCS) + TCS_CONTROL) & ~(TCS_TRIGGER | TCS_ACTIVE_MODE));wr(rsc.base + RSC_TCS(RPMH_TCS) + TCS_ENABLED, 0);- lck_mtx_unlock(&redwood_rsc_lock);+ lck_mtx_unlock(&hakios_rsc_lock);return done != 0;}@@ -1096,12 +1096,12 @@ root_file(const char *name, uint64_t *size)static bool from_root; /* the image is in memory of ours (root_file()), to be given back once written *//* A file of fw/ in the small image (MODEM=1 userland/build.sh puts fw-modem/ there), else of /fw on the root (above). */-extern const uint8_t *redwood_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);+extern const uint8_t *hakios_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);static const uint8_t *image_file(const char *name, uint64_t *size){{- const uint8_t *data = redwood_image_file("fw", name, size, NULL); /* (redwood_image.c) */+ const uint8_t *data = hakios_image_file("fw", name, size, NULL); /* (hakios.image.c) */if (data != NULL) {return data;@@ -1262,9 +1262,9 @@ step_mailbox(void)bool open;announce("open the mailbox to the always-on processor, unless it is open: words of its message memory, and its doorbell");- lck_mtx_lock(&redwood_aop_mailbox_lock);+ lck_mtx_lock(&hakios_aop_mailbox_lock);open = mailbox_open();- lck_mtx_unlock(&redwood_aop_mailbox_lock);+ lck_mtx_unlock(&hakios_aop_mailbox_lock);return open;}@@ -1606,7 +1606,7 @@ static struct block smem_lock = { "shared memory's lock", 0x01f43000, 0x1000 };#define LOCK_OWNER 0x000#define LOCK_US 1u-/* Our item made in the partition, as Linux's qcom_smem_alloc_private() makes one (redwood_wifi.c: our_item_make()). */+/* Our item made in the partition, as Linux's qcom_smem_alloc_private() makes one (hakios.wifi.c: our_item_make()). */static boolour_item_make(uint32_t partition, uint32_t item, uint32_t bytes){@@ -1616,7 +1616,7 @@ our_item_make(uint32_t partition, uint32_t item, uint32_t bytes)uint32_t owner = ~0u, at;bool made = false;- lck_mtx_lock(&redwood_smem_alloc_lock); /* (the Wi-Fi's start allocates under the same hardware lock) */+ lck_mtx_lock(&hakios_smem_alloc_lock); /* (the Wi-Fi's start allocates under the same hardware lock) */need(&smem_lock);printf("mpss: %u: about to take the lock (%#x), write an entry for item %u with %u bytes behind it at the partition's mark, ""move the mark by %u, and release the lock\n", step, smem_lock.phys + LOCK_OWNER, item, item_size, need_bytes);@@ -1631,7 +1631,7 @@ our_item_make(uint32_t partition, uint32_t item, uint32_t bytes)}if (owner != LOCK_US) {printf("mpss: %u: THE LOCK IS HELD BY PROCESSOR %u AND STAYS SO FOR A SECOND: nothing is written\n", step, owner);- lck_mtx_unlock(&redwood_smem_alloc_lock);+ lck_mtx_unlock(&hakios_smem_alloc_lock);return false;}if (!smem_peek(partition, &header, sizeof(header)) || header.free_uncached > header.free_cached ||@@ -1669,7 +1669,7 @@ our_item_make(uint32_t partition, uint32_t item, uint32_t bytes)out:wr(smem_lock.base + LOCK_OWNER, 0);printf("mpss: %u: the lock is released (it reads %u)\n", step, rd(smem_lock.base + LOCK_OWNER));- lck_mtx_unlock(&redwood_smem_alloc_lock);+ lck_mtx_unlock(&hakios_smem_alloc_lock);return made;}@@ -1942,7 +1942,7 @@ ipa_hardware_init(void)/** The IPA reaches memory through the application processors' SMMU (dt of Linux: iommus 0x480 and* 0x482 of apps_smmu), where a stream nobody matches faults, and the hypervisor grants no bypass- * (tried on 24 October: the S2CR stayed "fault"). So, as the Wi-Fi's radio has (redwood_wifi.c,+ * (tried on 24 October: the S2CR stayed "fault"). So, as the Wi-Fi's radio has (hakios.wifi.c,* radio_space_on(), where the formats and the order of programming are explained): a translation* context of our own, with the first free match register and the lowest free context, and page* tables of ours. The IPA, though, is shown memory as it is: one table of 2 MB blocks maps the@@ -1997,7 +1997,7 @@ static struct block apps_smmu_context = { "apps smmu, the IPA's context", 0, 0x1#define IPA_BLOCK (1ull | 0ull << 2 | 1ull << 6 | 2ull << 8 | 1ull << 10 | 1ull << 11) /* a 2 MB block, uncached, RW, shared */#define IPA_BLOCK_DEVICE (1ull | 2ull << 2 | 1ull << 6 | 2ull << 8 | 1ull << 10 | 1ull << 11)#define IPA_TABLE 3ull /* a table entry of the root */-extern lck_mtx_t redwood_smmu_lock;+extern lck_mtx_t hakios_smmu_lock;static struct {bool on;uint32_t page, pages, match, match_uc, context, old_smr, old_s2cr, old_smr_uc, old_s2cr_uc, old_sctlr;@@ -2035,7 +2035,7 @@ ipa_space_on(void)if (ipa_space.on) {return true;}- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);need(&apps_smmu);scr0 = rd(apps_smmu.base + SMMU_SCR0);idr0 = rd(apps_smmu.base + SMMU_IDR0);@@ -2045,7 +2045,7 @@ ipa_space_on(void)ipa_space.page = idr1 >> 31 ? 0x10000 : 0x1000;ipa_space.pages = 2u << (idr1 >> 28 & 7);if ((scr0 & 1u << 3) || 2 * ipa_space.pages * ipa_space.page != 0x100000) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);printf("mpss: ipa: the SMMU is not of the shape this knows (scr0 %#x, idr1 %#x)\n", scr0, idr1);return false;}@@ -2068,7 +2068,7 @@ ipa_space_on(void)for (ipa_space.context = 0; ipa_space.context < contexts && used[ipa_space.context]; ipa_space.context++) {}if (ipa_space.match == ~0u || ipa_space.match_uc == ~0u || ipa_space.context >= contexts) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);printf("mpss: ipa: the SMMU has not two match registers or no context left\n");return false;}@@ -2078,13 +2078,13 @@ ipa_space_on(void)need(&apps_smmu_context);ipa_space.old_sctlr = rd(apps_smmu_context.base + SMMU_CB_SCTLR);if (ipa_space.old_sctlr & 1) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);printf("mpss: ipa: context %u of the SMMU is switched on although no stream goes through it: left alone\n", ipa_space.context);return false;}if (ipa_space.tables == 0 &&kmem_alloc(kernel_map, &ipa_space.tables, 3 * 4096, KMA_KOBJECT | KMA_ZERO | KMA_DATA, VM_KERN_MEMORY_IOKIT) != KERN_SUCCESS) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);return false;}root = (uint64_t *)ipa_space.tables;@@ -2121,7 +2121,7 @@ ipa_space_on(void)wr(apps_smmu_context.base + SMMU_CB_TLBSYNC, 1);for (unsigned ms = 0; rd(apps_smmu_context.base + SMMU_CB_TLBSTATUS) & 1; ms++) {if (ms == 100) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);printf("mpss: ipa: the SMMU does not finish forgetting old translations\n");return false;}@@ -2138,7 +2138,7 @@ ipa_space_on(void)rd(apps_smmu.base + SMMU_SMR(ipa_space.match_uc)) != sees_uc ||(rd(apps_smmu.base + SMMU_S2CR(ipa_space.match_uc)) & 0x300ff) != ipa_space.context ||!(rd(apps_smmu_context.base + SMMU_CB_SCTLR) & 1) || rd(apps_smmu_context.base + SMMU_CB_TTBR0) != (uint32_t)ttbr) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);printf("mpss: ipa: THE SMMU DID NOT TAKE WHAT WAS WRITTEN: streams %#x and %#x are not both going through context %u (smr %#x ""s2cr %#x, smr %#x s2cr %#x, sctlr %#x)\n", IPA_STREAM, IPA_STREAM_UC, ipa_space.context,rd(apps_smmu.base + SMMU_SMR(ipa_space.match)), rd(apps_smmu.base + SMMU_S2CR(ipa_space.match)),@@ -2146,7 +2146,7 @@ ipa_space_on(void)rd(apps_smmu_context.base + SMMU_CB_SCTLR));return false;}- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);tell("mpss: ipa: THE IPA'S STREAMS GO THROUGH CONTEXT %u OF THE SMMU, with our tables (match registers %u and %u)\n", ipa_space.context,ipa_space.match, ipa_space.match_uc);return true;@@ -2159,13 +2159,13 @@ ipa_space_off(void)return;}ipa_space_faults("at the end");- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);wr(apps_smmu.base + SMMU_SMR(ipa_space.match), ipa_space.old_smr);wr(apps_smmu.base + SMMU_S2CR(ipa_space.match), ipa_space.old_s2cr);wr(apps_smmu.base + SMMU_SMR(ipa_space.match_uc), ipa_space.old_smr_uc);wr(apps_smmu.base + SMMU_S2CR(ipa_space.match_uc), ipa_space.old_s2cr_uc);wr(apps_smmu_context.base + SMMU_CB_SCTLR, ipa_space.old_sctlr);- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);ipa_space.on = false;printf("mpss: ipa: the IPA's streams and context %u of the SMMU are put back as they were found\n", ipa_space.context);}@@ -2382,7 +2382,7 @@ ipa_firmware_stop(void)/** Android's kernel (this phone, dmesg): the IPA's firmware first, then modem.mdt and its segments* into 0x8b800000..0x9ae00000, "Power/Clock ready", and QRTR's "ready" after that. Here the modem- * is watched for as the audio DSP is (redwood_adsp.c, step 7): its SMP2P item, its doorbells, its+ * is watched for as the audio DSP is (hakios.adsp.c, step 7): its SMP2P item, its doorbells, its* "slave-kernel" word, and its last words in item 421 if it gives up.*/static bool@@ -2532,7 +2532,7 @@ step_start(void)return ready_at != 0;}-/* ---- GLINK (redwood_wifi.c; items 478 to 480 of our partition with the modem) ------------------- */+/* ---- GLINK (hakios.wifi.c; items 478 to 480 of our partition with the modem) ------------------- */#define ITEM_GLINK_DESCRIPTOR 478#define ITEM_GLINK_OUR_QUEUE 479@@ -3027,18 +3027,18 @@ glink_send(struct glink_channel *channel, const void *data, uint32_t length)return 0;}-/* ---- QRTR: the router's datagrams, and ports of ours (redwood_wifi.c) ------------------------------ */+/* ---- QRTR: the router's datagrams, and ports of ours (hakios.wifi.c) ------------------------------ *//** What goes over the channel: datagrams of Qualcomm's IPC router, each with a header that says* who sends it (a node, a port) and to whom, and of which kind. The control port hears of the* services the modem offers ("new server": a service, an instance, a node, a port), and later* their going. We are node 1 (Linux's default, and what this phone's Android is); the modem says- * who it is in what it sends. The interface for the rest of the kernel is sys/redwood_qrtr.h:- * the four calls at the end of this section, which the NAS client (redwood_nas.c) and the QMI- * helpers (redwood_qmi.c) take.+ * who it is in what it sends. The interface for the rest of the kernel is sys/hakios.qrtr.h:+ * the four calls at the end of this section, which the NAS client (hakios.nas.c) and the QMI+ * helpers (hakios.qmi.c) take.*/-#define REDWOOD_QRTR_MAX 8192 /* the most a datagram holds, either way */+#define HAKIOS_QRTR_MAX 8192 /* the most a datagram holds, either way */#define QRTR_US 1u#define QRTR_CONTROL 0xfffffffeu /* the control port */#define QRTR_FIRST_PORT 0x4000u /* where Linux begins numbering ports that ask for no number */@@ -3053,10 +3053,10 @@ struct qrtr_control {uint32_t words[4]; /* a server: service, instance, node, port; a client: node, port */};-struct redwood_qrtr_port {+struct hakios_qrtr_port {uint32_t number; /* 0: free */- redwood_qrtr_receive_t receive;- redwood_qrtr_server_t server;+ hakios_qrtr_receive_t receive;+ hakios_qrtr_server_t server;void *context;struct {uint32_t service, instance; /* the instance as on the wire: version | instance << 8; 0: any */@@ -3067,7 +3067,7 @@ struct redwood_qrtr_port {static LCK_MTX_DECLARE(qrtr_lock, &mpss_lock_group); /* the tables below */static LCK_MTX_DECLARE(qrtr_calling, &mpss_lock_group); /* held by the link's thread around a callback */-static struct redwood_qrtr_port qrtr_ports[16];+static struct hakios_qrtr_port qrtr_ports[16];static struct {uint32_t service, instance, node, port;bool there;@@ -3091,7 +3091,7 @@ qrtr_out_packet(uint32_t type, uint32_t from_port, uint32_t to_node, uint32_t tostruct qrtr_header *packet;int error;- if (length == 0 || length > REDWOOD_QRTR_MAX) {+ if (length == 0 || length > HAKIOS_QRTR_MAX) {return EMSGSIZE;}packet = kalloc_data(sizeof(*packet) + padded, Z_WAITOK | Z_ZERO);@@ -3125,7 +3125,7 @@ qrtr_tell(uint32_t service, uint32_t instance, uint32_t node, uint32_t port, boo{for (unsigned p = 0; p < sizeof(qrtr_ports) / sizeof(qrtr_ports[0]); p++) {for (unsigned l = 0; l < 4; l++) {- redwood_qrtr_server_t server = NULL;+ hakios_qrtr_server_t server = NULL;void *context;lck_mtx_lock(&qrtr_lock);@@ -3230,7 +3230,7 @@ static voidqrtr_input(const uint8_t *data, uint32_t length){struct qrtr_header header;- redwood_qrtr_receive_t receive = NULL;+ hakios_qrtr_receive_t receive = NULL;void *context = NULL;uint32_t at;@@ -3301,7 +3301,7 @@ qrtr_fresh(void){for (unsigned p = 0; p < sizeof(qrtr_ports) / sizeof(qrtr_ports[0]); p++) {for (unsigned l = 0; l < 4; l++) {- redwood_qrtr_server_t server;+ hakios_qrtr_server_t server;uint32_t service, instance;void *context;@@ -3326,10 +3326,10 @@ qrtr_fresh(void)}}-static struct redwood_qrtr_port *-qrtr_open(redwood_qrtr_receive_t receive, redwood_qrtr_server_t server, void *context)+static struct hakios_qrtr_port *+qrtr_open(hakios_qrtr_receive_t receive, hakios_qrtr_server_t server, void *context){- struct redwood_qrtr_port *port = NULL;+ struct hakios_qrtr_port *port = NULL;lck_mtx_lock(&qrtr_lock);for (unsigned p = 0; p < sizeof(qrtr_ports) / sizeof(qrtr_ports[0]) && port == NULL; p++) {@@ -3347,16 +3347,16 @@ qrtr_open(redwood_qrtr_receive_t receive, redwood_qrtr_server_t server, void *co}static int-qrtr_send(struct redwood_qrtr_port *port, uint32_t node, uint32_t to, const void *data, size_t length)+qrtr_send(struct hakios_qrtr_port *port, uint32_t node, uint32_t to, const void *data, size_t length){- if (port == NULL || port->number == 0 || length > REDWOOD_QRTR_MAX) {+ if (port == NULL || port->number == 0 || length > HAKIOS_QRTR_MAX) {return EINVAL;}return qrtr_out_packet(QRTR_DATA, port->number, node, to, data, (uint32_t)length);}static int-qrtr_lookup(struct redwood_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance)+qrtr_lookup(struct hakios_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance){int error = ENOSPC;@@ -3375,7 +3375,7 @@ qrtr_lookup(struct redwood_qrtr_port *port, uint32_t service, uint32_t version,}static void-qrtr_close(struct redwood_qrtr_port *port)+qrtr_close(struct hakios_qrtr_port *port){struct qrtr_control gone = { .command = QRTR_DEL_CLIENT, .words = { QRTR_US, port ? port->number : 0 } };bool outside = current_thread() != link_thread_is;@@ -3397,11 +3397,11 @@ qrtr_close(struct redwood_qrtr_port *port)}}-static const struct redwood_qrtr_ops qrtr_ops = { .open = qrtr_open, .send = qrtr_send, .lookup = qrtr_lookup, .close = qrtr_close };+static const struct hakios_qrtr_ops qrtr_ops = { .open = qrtr_open, .send = qrtr_send, .lookup = qrtr_lookup, .close = qrtr_close };-/* The modem's QRTR for the rest of the kernel: NULL until the link is up (sys/redwood_qrtr.h). */-const struct redwood_qrtr_ops *-redwood_mpss_qrtr(void)+/* The modem's QRTR for the rest of the kernel: NULL until the link is up (sys/hakios.qrtr.h). */+const struct hakios_qrtr_ops *+hakios_mpss_qrtr(void){return glink.channel[CHANNEL_QRTR].open ? &qrtr_ops : NULL;}@@ -3510,7 +3510,7 @@ link_stop(void)* then reads and writes sectors of 512 bytes through that buffer.** Here the four partitions are read whole into memory of ours when the steps begin (the phone's- * storage through the loader, redwood_ufs.c: ufs=2, which the ordinary run has), the modem is+ * storage through the loader, hakios.ufs.c: ufs=2, which the ordinary run has), the modem is* served out of that, and what it writes goes into that memory and no further: the storage is* not written. The modem is content with that for a run; what it would have saved is lost when* the run ends, as the next run reads the partitions afresh.@@ -3550,7 +3550,7 @@ static struct {{ "/boot/modem_fs1", "modemst1" }, { "/boot/modem_fs2", "modemst2" }, { "/boot/modem_fsc", "fsc" },{ "/boot/modem_fsg", "fsg" },};-static struct redwood_qrtr_port *rmtfs_port;+static struct hakios_qrtr_port *rmtfs_port;static vm_offset_t rmtfs_buffer; /* the buffer, as this kernel sees it; 0: none yet */static volatile uint8_t *rmtfs_window; /* ... and the uncached one it is used through */static uint64_t rmtfs_buffer_pa;@@ -3563,7 +3563,7 @@ rmtfs_load(void)for (unsigned f = 0; f < 4; f++) {uint64_t size = 0;- int error = redwood_ufs_read_partition(rmtfs_files[f].partition, 0, NULL, 0, &size);+ int error = hakios_ufs_read_partition(rmtfs_files[f].partition, 0, NULL, 0, &size);if (error != 0 || size == 0 || size > (64u << 20)) {printf("mpss: %u: the partition %s: %s (%d)\n", step, rmtfs_files[f].partition, error == ENXIO ?@@ -3581,7 +3581,7 @@ rmtfs_load(void)printf("mpss: %u: no memory for %s (%llu bytes)\n", step, rmtfs_files[f].partition, size);continue;}- error = redwood_ufs_read_partition(rmtfs_files[f].partition, 0, rmtfs_files[f].data, size, NULL);+ error = hakios_ufs_read_partition(rmtfs_files[f].partition, 0, rmtfs_files[f].data, size, NULL);if (error != 0) {printf("mpss: %u: the partition %s: read error %d\n", step, rmtfs_files[f].partition, error);continue;@@ -3951,10 +3951,10 @@ qrtr_announce_all(uint32_t node)static void tftp_receive(void *context, uint32_t node, uint32_t port, const void *data, size_t length);static void servreg_receive(void *context, uint32_t node, uint32_t port, const void *data, size_t length);-static struct redwood_qrtr_port *tftp_port, *servreg_port;+static struct hakios_qrtr_port *tftp_port, *servreg_port;static bool ipa_qmi_start(void);static void ipa_qmi_stop(void);-static struct redwood_qrtr_port *ipa_host_port;+static struct hakios_qrtr_port *ipa_host_port;/* The port, and the service on it; the partitions are read in step 2, the buffer shared in step 7. */static bool@@ -4050,7 +4050,7 @@ rmtfs_stop(void)#define TFTP_MAX_WINDOW 4struct tftp_transfer {- struct redwood_qrtr_port *port;+ struct hakios_qrtr_port *port;uint32_t node, peer;const uint8_t *data; /* a read: the file, whole, in memory of ours (root_file(), or tftp_files) */uint64_t size;@@ -4072,7 +4072,7 @@ static struct {} tftp_files[8];static void-tftp_error(struct redwood_qrtr_port *from, uint32_t node, uint32_t port, uint16_t code, const char *text)+tftp_error(struct hakios_qrtr_port *from, uint32_t node, uint32_t port, uint16_t code, const char *text){uint8_t packet[64];size_t n = strlen(text) + 1;@@ -4680,7 +4680,7 @@ servreg_receive(__unused void *context, uint32_t node, uint32_t port, const void#define IPA_QMI_DRIVER_INIT_COMPLETE 0x35#define QMI_INDICATION 4-static struct redwood_qrtr_port *ipa_client_port;+static struct hakios_qrtr_port *ipa_client_port;static uint32_t ipa_modem_node, ipa_modem_port; /* the modem's IPA service; 0: not seen */static uint32_t ipa_register_node, ipa_register_port; /* who asked for the indication */static bool ipa_indication_wanted, ipa_indication_sent, ipa_driver_ready, ipa_uc_ready;@@ -4713,7 +4713,7 @@ qmi_put_pair(uint8_t *at, uint8_t type, uint32_t first, uint32_t second)/* A QMI message with only the result TLV: an answer (flags 2, the transaction echoed) or an indication (flags 4). */static void-ipa_qmi_result(struct redwood_qrtr_port *from, uint32_t node, uint32_t port, uint8_t flags, uint16_t transaction, uint16_t message)+ipa_qmi_result(struct hakios_qrtr_port *from, uint32_t node, uint32_t port, uint8_t flags, uint16_t transaction, uint16_t message){uint8_t packet[14] = { flags, (uint8_t)transaction, (uint8_t)(transaction >> 8), (uint8_t)message, (uint8_t)(message >> 8), 7, 0,2, 4, 0, 0, 0, 0, 0 };@@ -5093,10 +5093,10 @@ step_qrtr(void)* of two bytes, the value). The device management service (DMS, 2) is asked to put the modem* online -- message 0x2e, TLV 1 = 0 --: it starts in low power and stays there until somebody* does, which on Android is the RIL's first act. The network access service (NAS, 3) is then- * asked, by redwood_nas.c, for the serving system (0x24: registered or not) and the signal (0x4f:+ * asked, by hakios.nas.c, for the serving system (0x24: registered or not) and the signal (0x4f:* dBm, per radio); both are answers to questions, asked every second here and every two seconds* afterwards (modem=1), since no indication is asked for. What comes back is the kernel's to show:- * sysctl kern.redwood.cellular_up, _registered, _bars, _dbm, _radio.+ * sysctl kern.hakios.cellular_up, _registered, _bars, _dbm, _radio.*/#define QMI_DMS 2#define QMI_NAS 3@@ -5104,9 +5104,9 @@ step_qrtr(void)#define DMS_GET_OPERATING_MODE 0x002d#define DMS_ONLINE 0-static struct redwood_nas_client nas;+static struct hakios_nas_client nas;static bool nas_opened;-static struct redwood_qrtr_port *dms_port;+static struct hakios_qrtr_port *dms_port;static uint32_t dms_node, dms_port_number; /* where DMS is; 0: not seen */static volatile uint32_t dms_answers;static volatile uint32_t dms_result, dms_error;@@ -5115,16 +5115,16 @@ static int cellular_up, cellular_registered, cellular_bars, cellular_dbm, cellulstatic char cellular_operator[40]; /* "MCC MNC name" of the serving network; "" when none */static uint32_t nas_polls, nas_changes;-SYSCTL_DECL(_kern_redwood);-SYSCTL_INT(_kern_redwood, OID_AUTO, cellular_up, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_up, 0,+SYSCTL_DECL(_kern_hakios);+SYSCTL_INT(_kern_hakios, OID_AUTO, cellular_up, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_up, 0,"the modem runs and its network access service answers");-SYSCTL_INT(_kern_redwood, OID_AUTO, cellular_registered, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_registered, 0,+SYSCTL_INT(_kern_hakios, OID_AUTO, cellular_registered, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_registered, 0,"registered with a network");-SYSCTL_INT(_kern_redwood, OID_AUTO, cellular_bars, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_bars, 0, "signal, 0 to 4 bars");-SYSCTL_STRING(_kern_redwood, OID_AUTO, cellular_operator, CTLFLAG_RD | CTLFLAG_LOCKED, cellular_operator, 0,+SYSCTL_INT(_kern_hakios, OID_AUTO, cellular_bars, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_bars, 0, "signal, 0 to 4 bars");+SYSCTL_STRING(_kern_hakios, OID_AUTO, cellular_operator, CTLFLAG_RD | CTLFLAG_LOCKED, cellular_operator, 0,"the serving network: its name as the modem gives it; empty when none");-SYSCTL_INT(_kern_redwood, OID_AUTO, cellular_dbm, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_dbm, 0, "signal, dBm; 0: none read");-SYSCTL_INT(_kern_redwood, OID_AUTO, cellular_radio, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_radio, 0,+SYSCTL_INT(_kern_hakios, OID_AUTO, cellular_dbm, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_dbm, 0, "signal, dBm; 0: none read");+SYSCTL_INT(_kern_hakios, OID_AUTO, cellular_radio, CTLFLAG_RD | CTLFLAG_LOCKED, &cellular_radio, 0,"the radio (QMI NAS): 4 GSM, 5 UMTS, 8 LTE, 12 NR");static const char *@@ -5135,7 +5135,7 @@ radio_name(uint8_t radio)/* From the link's thread, when what NAS says has changed. */static void-nas_changed(__unused void *context, const struct redwood_nas_state *state)+nas_changed(__unused void *context, const struct hakios_nas_state *state){nas_changes++;cellular_registered = state->registered;@@ -5300,7 +5300,7 @@ static volatile bool sim_slot_switched, sim_provisioned, sim_register_again;#define NAS_INITIATE_NETWORK_REGISTER 0x0022#define NAS_GET_SYSTEM_SELECTION_PREFERENCE 0x0034#define NAS_GET_SYSTEM_INFO 0x004d-static struct redwood_qrtr_port *uim_port, *nas2_port;+static struct hakios_qrtr_port *uim_port, *nas2_port;static uint32_t uim_node, uim_port_number, nas2_node, nas2_port_number;static void@@ -5591,7 +5591,7 @@ step_nas(void)printf("mpss: %u: no port for DMS\n", step);return false;}- if (redwood_nas_client_open(&nas, &qrtr_ops, nas_changed, NULL) != 0) {+ if (hakios_nas_client_open(&nas, &qrtr_ops, nas_changed, NULL) != 0) {printf("mpss: %u: no port for NAS\n", step);return false;}@@ -5634,7 +5634,7 @@ step_nas(void)qrtr_send(nas2_port, nas2_node, nas2_port_number, info, sizeof(info));}if (nas.connected) {- nas_polls += redwood_nas_client_poll(&nas) == 0;+ nas_polls += hakios_nas_client_poll(&nas) == 0;}sleep_ms(1000);if (nas.state.registered && nas.state.has_signal) {@@ -5672,7 +5672,7 @@ nas_thread(__unused void *parameter, __unused wait_result_t result){while (nas_wanted) {if (nas_opened && nas.connected) {- nas_polls += redwood_nas_client_poll(&nas) == 0;+ nas_polls += hakios_nas_client_poll(&nas) == 0;}for (unsigned ms = 0; ms < 2000 && nas_wanted; ms += 100) {sleep_ms(100);@@ -5706,7 +5706,7 @@ nas_stop(void)}}if (nas_opened) {- redwood_nas_client_close(&nas);+ hakios_nas_client_close(&nas);nas_opened = false;}if (dms_port != NULL) {@@ -5740,7 +5740,7 @@ steps_over(uint32_t done)/* When the run ends in order: a DSP that runs is shut down, for the next kernel to start again. */void-redwood_mpss_stop(void)+hakios_mpss_stop(void){nas_stop(); /* the questions first, while the modem still listens */lck_mtx_lock(&dsp_lock);@@ -5764,7 +5764,7 @@ redwood_mpss_stop(void)/* The same on a panic's way back to the loader: one processor, interrupts off, no lock, no sleep. */void-redwood_mpss_quiesce(void)+hakios_mpss_quiesce(void){if (!dsp_started) {return;@@ -5839,9 +5839,9 @@ whole_thread(__unused void *parameter, __unused wait_result_t result)thread_terminate(current_thread());}-/* Called while the system starts (bsd/dev/redwood_input.c), after the Wi-Fi's start has been set going. */+/* Called while the system starts (bsd/dev/hakios.input.c), after the Wi-Fi's start has been set going. */void-redwood_mpss_init(void)+hakios_mpss_init(void){uint32_t on = 0;thread_t thread;@@ -5850,7 +5850,7 @@ redwood_mpss_init(void)if (last_step == 0 && (!PE_parse_boot_argn("modem", &on, sizeof(on)) || on != 1)) {return;}- if (pe_arm_get_soc_base_phys() != REDWOOD_SOC_BASE) {+ if (pe_arm_get_soc_base_phys() != HAKIOS_SOC_BASE) {printf("mpss: modem=1 and modem_step=N are for the phone's modem, and this is not the phone\n");return;}diff --git a/xnu/files/bsd/dev/redwood_nas.c b/xnu/files/bsd/dev/hakios.nas.csimilarity index 87%rename from xnu/files/bsd/dev/redwood_nas.crename to xnu/files/bsd/dev/hakios.nas.cindex 634210f..66c4f38 100644--- a/xnu/files/bsd/dev/redwood_nas.c+++ b/xnu/files/bsd/dev/hakios.nas.c@@ -3,9 +3,9 @@* Serving System (0x24), Get Signal Info (0x4f), Signal Info indication (0x51).* It only consumes reports. It never changes modem registration or radio power.*/-#include <sys/redwood_nas.h>+#include <sys/hakios.nas.h>#include <sys/systm.h>-#include <sys/redwood_qrtr.h>+#include <sys/hakios.qrtr.h>static uint16_tle16(const uint8_t *p)@@ -23,10 +23,10 @@ bars_for(int16_t dbm)}int-redwood_nas_apply(struct redwood_nas_state *state, const void *frame, size_t length)+hakios_nas_apply(struct hakios_nas_state *state, const void *frame, size_t length){const uint8_t *data = frame;- struct redwood_nas_state next;+ struct hakios_nas_state next;uint16_t message, payload_size;size_t at;bool serving = false, signal = false, success = false, result_seen = false;@@ -107,11 +107,11 @@ redwood_nas_apply(struct redwood_nas_state *state, const void *frame, size_t lenstatic voidnas_receive(void *context, uint32_t node, uint32_t port, const void *data, size_t length){- struct redwood_nas_client *client = context;+ struct hakios_nas_client *client = context;if (!client->connected || node != client->peer_node || port != client->peer_port) return;client->answers++;- if (redwood_nas_apply(&client->state, data, length) == 1 && client->changed != NULL)+ if (hakios_nas_apply(&client->state, data, length) == 1 && client->changed != NULL)client->changed(client->context, &client->state);}@@ -119,7 +119,7 @@ static voidnas_server(void *context, bool arrived, uint32_t service, uint32_t version, uint32_t instance,uint32_t node, uint32_t port){- struct redwood_nas_client *client = context;+ struct hakios_nas_client *client = context;(void)version;(void)instance;if (service != 3) return; /* QMI NAS */@@ -127,22 +127,22 @@ nas_server(void *context, bool arrived, uint32_t service, uint32_t version, uintclient->connected = true;client->peer_node = node;client->peer_port = port;- if (client->port != NULL) (void)redwood_nas_client_poll(client);+ if (client->port != NULL) (void)hakios_nas_client_poll(client);} else if (!arrived && client->connected && node == client->peer_node && port == client->peer_port) {client->connected = false;- client->state = (struct redwood_nas_state){0};+ client->state = (struct hakios_nas_state){0};if (client->changed != NULL) client->changed(client->context, &client->state);}}int-redwood_nas_client_open(struct redwood_nas_client *client, const struct redwood_qrtr_ops *transport,- void (*changed)(void *, const struct redwood_nas_state *), void *context)+hakios_nas_client_open(struct hakios_nas_client *client, const struct hakios_qrtr_ops *transport,+ void (*changed)(void *, const struct hakios_nas_state *), void *context){int error;if (client == NULL || transport == NULL || transport->open == NULL || transport->lookup == NULL ||transport->send == NULL || transport->close == NULL) return -1;- *client = (struct redwood_nas_client){0};+ *client = (struct hakios_nas_client){0};client->transport = transport;client->changed = changed;client->context = context;@@ -150,14 +150,14 @@ redwood_nas_client_open(struct redwood_nas_client *client, const struct redwood_if (client->port == NULL) return -1;error = transport->lookup(client->port, 3, 0, 0);if (error != 0) {- redwood_nas_client_close(client);+ hakios_nas_client_close(client);return error;}return 0;}int-redwood_nas_client_poll(struct redwood_nas_client *client)+hakios_nas_client_poll(struct hakios_nas_client *client){uint8_t request[7] = {0};const uint16_t messages[2] = {0x24, 0x4f};@@ -177,7 +177,7 @@ redwood_nas_client_poll(struct redwood_nas_client *client)}void-redwood_nas_client_close(struct redwood_nas_client *client)+hakios_nas_client_close(struct hakios_nas_client *client){if (client != NULL && client->port != NULL) {client->transport->close(client->port);diff --git a/xnu/files/bsd/dev/redwood_net.c b/xnu/files/bsd/dev/hakios.net.csimilarity index 93%rename from xnu/files/bsd/dev/redwood_net.crename to xnu/files/bsd/dev/hakios.net.cindex 27a8e03..84fa548 100644--- a/xnu/files/bsd/dev/redwood_net.c+++ b/xnu/files/bsd/dev/hakios.net.c@@ -8,8 +8,8 @@* that has arrived to the stack. What iOS's user space makes of an interface that has no* IOKit object behind it is another matter: see userland/src/net_test.m.*- * What carries the frames is a link driver's business; sys/redwood_net.h is all that the two- * know of each other. The first link is QEMU's virtio network device (redwood_virtio_net.c).+ * What carries the frames is a link driver's business; sys/hakios.net.h is all that the two+ * know of each other. The first link is QEMU's virtio network device (hakios.virtio_net.c).*/#include <kern/clock.h>#include <kern/locks.h>@@ -28,15 +28,15 @@#include <sys/kern_event.h>#include <sys/kpi_mbuf.h>#include <sys/proc.h>-#include <sys/redwood_net.h>+#include <sys/hakios.net.h>#include <sys/sockio.h>#include <sys/systm.h>-extern void RedwoodWLANStart(const char *interface, const uint8_t *address); /* iokit/Kernel/RedwoodWLAN.cpp */+extern void HakiosWLANStart(const char *interface, const uint8_t *address); /* iokit/Kernel/hakios.wlan.cpp */-static LCK_GRP_DECLARE(net_lck_grp, "redwood-net");+static LCK_GRP_DECLARE(net_lck_grp, "hakios-net");static LCK_MTX_DECLARE(net_tx_lock, &net_lck_grp);-static const struct redwood_net_link *net_link;+static const struct hakios_net_link *net_link;static bool net_link_up;static ifnet_t net_ifp;@@ -125,7 +125,7 @@ net_output(ifnet_t ifp, mbuf_t packet)size_t length = mbuf_pkthdr_len(packet);bool sent = false;- if (length <= REDWOOD_NET_FRAME_MAX && net_link_up) {+ if (length <= HAKIOS_NET_FRAME_MAX && net_link_up) {bpf_tap_out(ifp, DLT_EN10MB, packet, NULL, 0);trace_packet(packet, length);lck_mtx_lock(&net_tx_lock);@@ -146,7 +146,7 @@ net_output(ifnet_t ifp, mbuf_t packet)/* A frame has arrived. */void-redwood_net_input(const uint8_t *frame, size_t length)+hakios_net_input(const uint8_t *frame, size_t length){struct ifnet_stat_increment_param stats = { .packets_in = 1, .bytes_in = (uint32_t)length };unsigned int chunks = 1;@@ -154,7 +154,7 @@ redwood_net_input(const uint8_t *frame, size_t length)char *header;trace_frame("in ", frame, length, length);- if (net_ifp == NULL || length < ETHER_HDR_LEN || length > REDWOOD_NET_FRAME_MAX ||+ if (net_ifp == NULL || length < ETHER_HDR_LEN || length > HAKIOS_NET_FRAME_MAX ||mbuf_allocpacket(MBUF_DONTWAIT, length, &chunks, &packet) != 0) {net_count.dropped_in++;return;@@ -231,8 +231,8 @@ net_ioctl(ifnet_t ifp, u_long command, void *data)case SIOCDELMULTI:break; /* the link hands us everything anyway */default:- /* what iOS's Wi-Fi side asks of a radio's interface: bsd/dev/redwood_apple80211.c */- error = net_link->wireless ? redwood_apple80211_ioctl(command, data) : EOPNOTSUPP;+ /* what iOS's Wi-Fi side asks of a radio's interface: bsd/dev/hakios.apple80211.c */+ error = net_link->wireless ? hakios_apple80211_ioctl(command, data) : EOPNOTSUPP;break;}return error;@@ -258,7 +258,7 @@ net_link_event(ifnet_t ifp, uint32_t code)}void-redwood_net_link_state(bool up)+hakios_net_link_state(bool up){if (net_ifp == NULL || up == net_link_up) {return;@@ -290,7 +290,7 @@ net_thread(__unused void *parameter, __unused wait_result_t result)}bool-redwood_net_attach(const struct redwood_net_link *link)+hakios_net_attach(const struct hakios_net_link *link){struct ifnet_init_eparams init = {.ver = IFNET_INIT_CURRENT_VERSION,@@ -300,7 +300,7 @@ redwood_net_attach(const struct redwood_net_link *link)* the interface by itself: sockets are all that is asked of it so far.*/.flags = IFNET_INIT_LEGACY | IFNET_INIT_NX_NOAUTO,- .uniqueid = "redwood-en0",+ .uniqueid = "hakios-en0",.uniqueid_len = 11,.name = "en",.unit = 0,@@ -357,7 +357,7 @@ redwood_net_attach(const struct redwood_net_link *link)if (link->wireless) {/* (a radio's address is the phone's own: not for the log; and iOS's Wi-Fi side finds the interface by a service) */printf("net: en0 attached on %s (a radio), link %s\n", link->name, net_link_up ? "up" : "down");- RedwoodWLANStart("en0", address);+ HakiosWLANStart("en0", address);} else {printf("net: en0 attached on %s, address %02x:%02x:%02x:%02x:%02x:%02x, link %s\n", link->name, address[0],address[1], address[2], address[3], address[4], address[5], net_link_up ? "up" : "down");@@ -369,9 +369,9 @@ redwood_net_attach(const struct redwood_net_link *link)}void-redwood_net_init(void)+hakios_net_init(void){PE_parse_boot_argn("net_trace", &net_trace, sizeof(net_trace));PE_parse_boot_argn("net_names", &net_names, sizeof(net_names));- redwood_virtio_net_init();+ hakios_virtio_net_init();}diff --git a/xnu/files/bsd/dev/redwood_qmi.c b/xnu/files/bsd/dev/hakios.qmi.csimilarity index 94%rename from xnu/files/bsd/dev/redwood_qmi.crename to xnu/files/bsd/dev/hakios.qmi.cindex 130154d..7dd70dc 100644--- a/xnu/files/bsd/dev/redwood_qmi.c+++ b/xnu/files/bsd/dev/hakios.qmi.c@@ -1,5 +1,5 @@/*- * QMI: the helpers of sys/redwood_qmi.h -- messages coded by tables, a handle on the IPC router,+ * QMI: the helpers of sys/hakios.qmi.h -- messages coded by tables, a handle on the IPC router,* requests as transactions, indications to handlers.** The interface is that of Linux's QMI helpers, because the driver that uses it (ath11k's qmi.c)@@ -19,8 +19,8 @@* The same file is compiled into the kernel and, for its tests, on the machine that builds it* (tools/qmi-test): the few things it needs from an operating system are in the first section.*/-#include <sys/redwood_qmi.h>-#include <sys/redwood_qrtr.h>+#include <sys/hakios.qmi.h>+#include <sys/hakios.qrtr.h>/* ---- what is needed of the operating system ---------------------------------------------------- */@@ -36,7 +36,7 @@#include <sys/systm.h>#include <sys/time.h>-static LCK_GRP_DECLARE(qmi_lck_grp, "redwood-qmi");+static LCK_GRP_DECLARE(qmi_lck_grp, "hakios-qmi");struct os_lock {lck_mtx_t mutex;@@ -94,7 +94,7 @@ os_wait(struct os_lock *l, void *what, uint64_t ms){struct timespec ts = { .tv_sec = (time_t)(ms / 1000), .tv_nsec = (long)(ms % 1000) * NSEC_PER_MSEC };- msleep(what, &l->mutex, PZERO, "redwood-qmi", &ts);+ msleep(what, &l->mutex, PZERO, "hakios-qmi", &ts);}static void@@ -385,7 +385,7 @@ encode_structure(struct writer *w, const struct qmi_elem_info *ei, const uint8_t}int-redwood_qmi_encode(uint8_t type, uint16_t message, uint16_t transaction, const struct qmi_elem_info *ei, const void *structure,+hakios_qmi_encode(uint8_t type, uint16_t message, uint16_t transaction, const struct qmi_elem_info *ei, const void *structure,void *buffer, size_t size){struct writer w = { .at = buffer, .end = (uint8_t *)buffer + size };@@ -523,7 +523,7 @@ decode_structure(struct reader *r, const struct qmi_elem_info *ei, uint8_t *stru}int-redwood_qmi_decode(const void *buffer, size_t length, const struct qmi_elem_info *ei, void *structure)+hakios_qmi_decode(const void *buffer, size_t length, const struct qmi_elem_info *ei, void *structure){const uint8_t *start = buffer;struct reader r;@@ -591,8 +591,8 @@ const struct qmi_elem_info qmi_response_type_v01_ei[] = {/* What stands behind a handle (its `sock` points here). */struct qmi_state {struct qmi_handle *handle;- const struct redwood_qrtr_ops *transport;- struct redwood_qrtr_port *port;+ const struct hakios_qrtr_ops *transport;+ struct hakios_qrtr_port *port;struct os_lock lock; /* the lists below and the transactions in them */struct qmi_ops ops;const struct qmi_msg_handler *handlers;@@ -606,10 +606,10 @@ struct qmi_state {bool said_malformed, said_undecoded, said_unknown;};-static const struct redwood_qrtr_ops *qmi_transport;+static const struct hakios_qrtr_ops *qmi_transport;void-redwood_qmi_set_transport(const struct redwood_qrtr_ops *ops)+hakios_qmi_set_transport(const struct hakios_qrtr_ops *ops){qmi_transport = ops;}@@ -661,7 +661,7 @@ to_handler(struct qmi_state *s, uint8_t type, uint16_t id, uint16_t message, uinif (decoded == NULL) {return;}- result = redwood_qmi_decode(data, length, h->ei, decoded);+ result = hakios_qmi_decode(data, length, h->ei, decoded);if (result < 0) {if (!s->said_undecoded) {s->said_undecoded = true;@@ -699,7 +699,7 @@ qmi_receive(void *context, uint32_t node, uint32_t port, const void *data, size_found = find_transaction(s, NULL, id);txn = found != NULL ? *found : NULL;if (txn != NULL && !txn->done && txn->ei != NULL && txn->dest != NULL) {- txn->result = redwood_qmi_decode(data, length, txn->ei, txn->dest);+ txn->result = hakios_qmi_decode(data, length, txn->ei, txn->dest);txn->done = true;os_wake(&s->lock, txn);os_unlock(&s->lock);@@ -759,8 +759,8 @@ qmi_server(void *context, bool arrived, uint32_t service, uint32_t version, uint}int-redwood_qmi_handle_init_transport(struct qmi_handle *qmi, size_t largest, const struct qmi_ops *ops,- const struct qmi_msg_handler *handlers, const struct redwood_qrtr_ops *transport)+hakios_qmi_handle_init_transport(struct qmi_handle *qmi, size_t largest, const struct qmi_ops *ops,+ const struct qmi_msg_handler *handlers, const struct hakios_qrtr_ops *transport){struct qmi_state *s;@@ -794,7 +794,7 @@ redwood_qmi_handle_init_transport(struct qmi_handle *qmi, size_t largest, constintqmi_handle_init(struct qmi_handle *qmi, size_t largest, const struct qmi_ops *ops, const struct qmi_msg_handler *handlers){- return redwood_qmi_handle_init_transport(qmi, largest, ops, handlers, qmi_transport);+ return hakios_qmi_handle_init_transport(qmi, largest, ops, handlers, qmi_transport);}/* Nobody may be waiting in qmi_txn_wait() on this handle any more. */@@ -831,7 +831,7 @@ qmi_add_lookup(struct qmi_handle *qmi, unsigned int service, unsigned int versio}int-redwood_qmi_connect(struct socket *sock, uint32_t node, uint32_t port)+hakios_qmi_connect(struct socket *sock, uint32_t node, uint32_t port){struct qmi_state *s = (struct qmi_state *)(void *)sock;@@ -910,7 +910,7 @@ qmi_send_request(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, struct qmi_txif (buffer == NULL) {return -ENOMEM;}- length = redwood_qmi_encode(QMI_REQUEST, (uint16_t)msg_id, txn->id, ei, structure, buffer, size);+ length = hakios_qmi_encode(QMI_REQUEST, (uint16_t)msg_id, txn->id, ei, structure, buffer, size);if (length < 0) {os_free(buffer, size);return length;@@ -938,7 +938,7 @@ qmi_txn_cancel(struct qmi_txn *txn)}int-redwood_qmi_txn_wait_ms(struct qmi_txn *txn, uint64_t milliseconds)+hakios_qmi_txn_wait_ms(struct qmi_txn *txn, uint64_t milliseconds){struct qmi_state *s = state_of(txn->qmi);uint64_t now = os_now_ms(), until = now + milliseconds;diff --git a/xnu/files/bsd/dev/redwood_sound.c b/xnu/files/bsd/dev/hakios.sound.csimilarity index 92%rename from xnu/files/bsd/dev/redwood_sound.crename to xnu/files/bsd/dev/hakios.sound.cindex 5d1c3a9..9636fdf 100644--- a/xnu/files/bsd/dev/redwood_sound.c+++ b/xnu/files/bsd/dev/hakios.sound.c@@ -1,13 +1,13 @@/** The phone's sound, step 3: what the audio DSP's services are told so that the speakers play.* Every address and number below belongs to the POCO X5 Pro (redwood), and nothing here happens- * unless boot-arg sound=N asks for it, with adsp=1 (redwood_adsp.c), which starts the DSP and- * calls redwood_sound_dsp_up() once its audio services are up.+ * unless boot-arg sound=N asks for it, with adsp=1 (hakios.adsp.c), which starts the DSP and+ * calls hakios_sound_dsp_up() once its audio services are up.** Under Android the speakers' sound goes from the audio server through three of the DSP's* services: ASM, a stream the samples are written into; ADM, the matrix that routes a stream to* a device path ("COPP"); and AFE, the port at the SoC's interface. The two amplifiers- * (redwood_speaker.c) sit on the primary TDM interface, which the DSP runs: Android's+ * (hakios.speaker.c) sit on the primary TDM interface, which the DSP runs: Android's* PRI_TDM_RX_0, AFE port 0x9000 in group 0x9100 (with 0x9002, unused). The samples themselves* lie in memory of ours that the DSP reads through the application processors' SMMU, as* stream 0x1801 (Android: qcom,msm-audio-ion, iommus <&apps_smmu 0x1801 0>, its addresses from@@ -25,16 +25,16 @@* up, started once the clock runs, faded in to sound_below eighths of a dB under* Android's own level (default 160: 20 dB under, the least it may be is 0), faded* out and powered down at the end. Audible.- * sound=4 what iOS plays (/dev/redwood-audio, redwood_audio.c), until the run ends: the port+ * sound=4 what iOS plays (/dev/hakios-audio, hakios.audio.c), until the run ends: the port* and the stream as above, kept running (silence when iOS writes nothing); the* amplifiers set up once and powered down, started and faded in (the driver's quick* fade) whenever a write is not silence, stopped after three seconds of silence; their- * level is what is set on the plug-in's volume control (ioctl REDWOOD_AUDIO_SET_VOLUME):+ * level is what is set on the plug-in's volume control (ioctl HAKIOS_AUDIO_SET_VOLUME):* so far under sound_below, which stays the loudest, and at 0 they stay off. (iOS sets* that control only once, to the top, and applies its volume to the samples itself --* see userland/src/audio_plugin.c --; at its volume 0 it writes silence, and the* amplifiers stay off for that too.) On their way the samples go through the speakers'- * guard (redwood_guard.c), in place of the DSP's speaker protection that Android has:+ * guard (hakios.guard.c), in place of the DSP's speaker protection that Android has:* sound_gain eighths of a dB of gain (default and most 96, 12 dB: iOS's own processing* keeps its top that far under full scale), a high-pass filter, three averages of the* power at the speakers and a peak limiter. sound_guard_as=N, for a test: the guard@@ -44,7 +44,7 @@** The numbers are Android's own, from the phone's live device tree (qcom,msm-dai-tdm-pri-rx and* its port, the pins pri_tdm_*_active), its mixer paths (the speaker: PRI_TDM_RX_0 at 48 kHz,- * two channels, S32_LE) and its kernel (Xiaomi's redwood-s-oss, techpack/audio: asoc/lahaina.c,+ * two channels, S32_LE) and its kernel (Xiaomi's hakios-s-oss, techpack/audio: asoc/lahaina.c,* asoc/msm-dai-q6-v2.c, dsp/q6afe.c, dsp/q6adm.c, dsp/q6asm.c):* - the bit clock: the interface's internal one (clock 0x200, "PRI_TDM_IBIT"), attribute 4* ("invert, couple no", msm-dai-q6-v2.c's default; the tree names none), at 48000 x 32 bits x@@ -63,11 +63,11 @@* opened for writing linear PCM of 16 bits, no processing (0x10c68), routed to that path** What is started is stopped, and what is written is put back, when the time is over -- or, if- * the DSP is to be shut down earlier (the run's end), before that (redwood_sound_dsp_down()).- * The amplifiers are powered down on a panic's way out (redwood_sound_quiesce()).+ * the DSP is to be shut down earlier (the run's end), before that (hakios_sound_dsp_down()).+ * The amplifiers are powered down on a panic's way out (hakios_sound_quiesce()).** Message layouts: the files above, and Linux's sound/soc/qcom/qdsp6/ (q6afe.c, q6adm.c,- * q6asm.c); the SMMU: redwood_wifi.c, which does the same for the Wi-Fi's stream.+ * q6asm.c); the SMMU: hakios.wifi.c, which does the same for the Wi-Fi's stream.*/#include <kern/clock.h>#include <kern/locks.h>@@ -78,7 +78,7 @@#include <mach/vm_param.h>#include <pexpert/pexpert.h>#include <sys/systm.h>-#include <sys/redwood_audio.h>+#include <sys/hakios.audio.h>#include <vm/vm_kern.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);@@ -86,13 +86,13 @@ extern uint64_t kvtophys(vm_offset_t va);extern kern_return_t thread_terminate(thread_t thread);extern void loader_log_putc(char c);-/* The SMMU's match registers and contexts are found free and taken by the Wi-Fi's start as well (redwood_wifi.c). */-extern lck_mtx_t redwood_smmu_lock;+/* The SMMU's match registers and contexts are found free and taken by the Wi-Fi's start as well (hakios.wifi.c). */+extern lck_mtx_t hakios_smmu_lock;-static LCK_GRP_DECLARE(sound_lock_group, "redwood-sound");+static LCK_GRP_DECLARE(sound_lock_group, "hakios-sound");static LCK_MTX_DECLARE(sound_lock, &sound_lock_group); /* the path being set up or taken down */-static uint32_t level, seconds = 3, below = 240, pause_ms = 1000, gain = REDWOOD_GUARD_MAX_GAIN;+static uint32_t level, seconds = 3, below = 240, pause_ms = 1000, gain = HAKIOS_GUARD_MAX_GAIN;static uint32_t guard_as = UINT32_MAX; /* boot-arg sound_guard_as=N: the guard reckons the amplifiers at most N under (a test) */static char last_write[96] = "nothing written";@@ -294,15 +294,15 @@ dsp_error(uint32_t status)*/static boolcommand(const char *what, uint8_t service, uint16_t port, uint32_t opcode, const void *payload, uint32_t length, uint32_t wanted,- struct redwood_apr_answer *answer)+ struct hakios_apr_answer *answer){- struct redwood_apr_answer local;+ struct hakios_apr_answer local;if (answer == NULL) {answer = &local;}snprintf(last_write, sizeof(last_write), "sent %s (opcode %#x)", what, opcode);- if (!redwood_adsp_apr(service, port, 0, opcode, payload, length, APR_WAIT_MS, answer)) {+ if (!hakios_adsp_apr(service, port, 0, opcode, payload, length, APR_WAIT_MS, answer)) {say("sound: %s (opcode %#x to service %u, port %#x): NO ANSWER\n", what, opcode, service, port);return false;}@@ -523,7 +523,7 @@ static struct block apps_smmu_context = { "apps smmu, the audio context", 0, 0x1#define SMMU_MAIR0 0xf404ff44#define SMMU_FSR_ALL 0xc00001fe#define PTE_ADDRESS 0x0000fffffffff000ull-#define AUDIO_PTE (3ull | 1ull << 6 | 2ull << 8 | 1ull << 10 | 1ull << 11) /* as redwood_wifi.c's */+#define AUDIO_PTE (3ull | 1ull << 6 | 2ull << 8 | 1ull << 10 | 1ull << 11) /* as hakios.wifi.c's */#define AUDIO_STREAM 0x1801#define AUDIO_ADDRESSES 0x10000000ull /* dt: qcom,iommu-dma-addr-pool of qcom,msm-audio-ion */@@ -533,7 +533,7 @@ static struct block apps_smmu_context = { "apps smmu, the audio context", 0, 0x1#define PERIOD_FRAMES 960 /* 20 ms */#define PERIOD_BYTES (PERIOD_FRAMES * 4)#define BUFFER_BYTES (PERIODS * 4096) /* a page each */-#define MIC_BYTES (16 * 4096) /* the microphones' (redwood_mic.c), behind the periods */+#define MIC_BYTES (16 * 4096) /* the microphones' (hakios.mic.c), behind the periods */#define SHARED_BYTES (BUFFER_BYTES + MIC_BYTES)static struct {@@ -707,8 +707,8 @@ space_off(void)/** The DSP's view of our memory is one: the sound's periods and the microphones' buffers behind them- * (redwood_mic.c), through the same stream and context. Whoever comes first sets it up, whoever- * leaves last takes it down. user: 0 the sound, 1 the microphones. With redwood_smmu_lock held.+ * (hakios.mic.c), through the same stream and context. Whoever comes first sets it up, whoever+ * leaves last takes it down. user: 0 the sound, 1 the microphones. With hakios_smmu_lock held.*/static uint32_t space_users;@@ -755,13 +755,13 @@ shared_put(unsigned user)}bool-redwood_audio_dsp_memory(uintptr_t *memory, uint64_t *dsp_address, uint32_t *bytes)+hakios_audio_dsp_memory(uintptr_t *memory, uint64_t *dsp_address, uint32_t *bytes){bool ok;- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);ok = shared_get(1);- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);if (ok) {*memory = buffer + BUFFER_BYTES;*dsp_address = buffer_address + BUFFER_BYTES;@@ -771,11 +771,11 @@ redwood_audio_dsp_memory(uintptr_t *memory, uint64_t *dsp_address, uint32_t *byt}void-redwood_audio_dsp_memory_put(void)+hakios_audio_dsp_memory_put(void){- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);shared_put(1);- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);}/* ---- ADM and ASM: the path and the stream --------------------------------------------------------------- */@@ -878,7 +878,7 @@ stream_on(void)uint8_t map[8];} __attribute__((packed)) format = { 20, 2, 16, RATE, 1, 0, { PCM_CHANNEL_FL, PCM_CHANNEL_FR } };uint32_t run[3] = { 0, 0, 0 };- struct redwood_apr_answer answer;+ struct hakios_apr_answer answer;announce("the DSP is given our periods (ASM), a device path to the port (ADM) and a stream routed to it (ASM)");if (!command("our periods, mapped for the DSP", APR_SVC_ASM, 0, ASM_CMD_SHARED_MEM_MAP_REGIONS, &map, sizeof(map),@@ -965,7 +965,7 @@ period_write(unsigned period)uint32_t write[8] = { (uint32_t)(buffer_address + 4096 * period), (uint32_t)((buffer_address + 4096 * period) >> 32),map_handle, PERIOD_BYTES, period, 0, 0, 0 };- return redwood_adsp_apr(APR_SVC_ASM, STREAM_PORT, WRITE_TOKEN | period, ASM_DATA_CMD_WRITE_V2, write, sizeof(write), 0, NULL);+ return hakios_adsp_apr(APR_SVC_ASM, STREAM_PORT, WRITE_TOKEN | period, ASM_DATA_CMD_WRITE_V2, write, sizeof(write), 0, NULL);}/*@@ -1032,7 +1032,7 @@ play(uint32_t ms, bool amplifiers)if (amplifiers && now - last_look >= 200000) {last_look = now;healthy_looks++;- if (!redwood_speaker_healthy()) {+ if (!hakios_speaker_healthy()) {ok = false;tone_over = true;}@@ -1057,7 +1057,7 @@ play(uint32_t ms, bool amplifiers)/* ---- sound=4: what iOS plays ------------------------------------------------------------------------------ *//*- * /dev/redwood-audio's writer (the audio server's real-time thread, redwood_audio.c) puts frames+ * /dev/hakios-audio's writer (the audio server's real-time thread, hakios.audio.c) puts frames* into a ring and does not wait; the feeder, a thread of ours, takes them from there into each* period the DSP gives back (and silence when there is nothing), so the stream never stops* while the run lasts. The amplifiers are only on while there is sound: the watcher starts them@@ -1065,7 +1065,7 @@ play(uint32_t ms, bool amplifiers)* seconds of silence or no writes.*/#define RING_FRAMES 32768 /* 0.68 s; a power of two, the indices run on and wrap */-#define SILENCE 8 /* samples no larger than this are silence (as redwood_audio.c's) */+#define SILENCE 8 /* samples no larger than this are silence (as hakios.audio.c's) */#define QUIET_BEFORE_OFF_US 3000000ullstatic int16_t ring[RING_FRAMES * 2];@@ -1075,7 +1075,7 @@ static volatile bool feeder_runs, watcher_runs;static uint64_t fed_frames, silent_frames, ios_frames;static volatile uint32_t ios_peak; /* the largest sample since the amplifiers last started */-/* From the writer's thread, under redwood_audio.c's lock: never waits. */+/* From the writer's thread, under hakios.audio.c's lock: never waits. */static uint32_tios_sink(const int16_t *frames, uint32_t count){@@ -1113,25 +1113,25 @@ db_text(char *text, int tenths)return text;}-/* What the guard has done since it was last said (redwood_guard.c), as one line; nothing if `quiet'. */+/* What the guard has done since it was last said (hakios.guard.c), as one line; nothing if `quiet'. */static voidguard_say(const char *when, bool quiet){- struct redwood_guard_report r;+ struct hakios_guard_report r;char t[6][16];- redwood_guard_take_report(&r);+ hakios_guard_take_report(&r);if (r.blocks == 0 || quiet) {return;}/* (levels at the speakers: dB under a full-scale square wave at Android's level; gains in dB) */say("sound: the guard%s: peaks in %u, out %u (of 32768); gain now %s dB, least %s dB, held down by the 0.2 s/3 s/60 s ""averages in %u/%u/%u of %u periods; peaks limited in %u frames (by %s dB at most); averages %s/%s/%s dB\n",- when, r.peak_in, r.peak_out, db_text(t[0], redwood_guard_decibels(r.gain * r.gain >> 30)),- db_text(t[1], redwood_guard_decibels(r.least_gain * r.least_gain >> 30)), r.rms_blocks, r.fast_blocks, r.slow_blocks,- r.blocks, r.limited_frames, db_text(t[2], redwood_guard_decibels((uint64_t)r.least_peak_gain * r.least_peak_gain >> 2)),- db_text(t[3], redwood_guard_decibels(r.rms)), db_text(t[4], redwood_guard_decibels(r.fast)),- db_text(t[5], redwood_guard_decibels(r.slow)));+ when, r.peak_in, r.peak_out, db_text(t[0], hakios_guard_decibels(r.gain * r.gain >> 30)),+ db_text(t[1], hakios_guard_decibels(r.least_gain * r.least_gain >> 30)), r.rms_blocks, r.fast_blocks, r.slow_blocks,+ r.blocks, r.limited_frames, db_text(t[2], hakios_guard_decibels((uint64_t)r.least_peak_gain * r.least_peak_gain >> 2)),+ db_text(t[3], hakios_guard_decibels(r.rms)), db_text(t[4], hakios_guard_decibels(r.fast)),+ db_text(t[5], hakios_guard_decibels(r.slow)));}/* A period from the ring, the rest of it silence. */@@ -1151,10 +1151,10 @@ period_fill_ios(unsigned period)ring_tail = tail + n;fed_frames += n;silent_frames += PERIOD_FRAMES - n;- /* the guard, on every period, silence too: its filter and its averages go on (redwood_guard.c) */- redwood_guard_process(samples, PERIOD_FRAMES);- if (n != 0 && redwood_audio_recording_fed()) {- redwood_audio_record_fed(samples, n);+ /* the guard, on every period, silence too: its filter and its averages go on (hakios.guard.c) */+ hakios_guard_process(samples, PERIOD_FRAMES);+ if (n != 0 && hakios_audio_recording_fed()) {+ hakios_audio_record_fed(samples, n);}guard_periods++;for (vm_offset_t line = (vm_offset_t)samples; line < (vm_offset_t)samples + PERIOD_BYTES; line += 64) {@@ -1213,7 +1213,7 @@ feeder_thread(__unused void *parameter, __unused wait_result_t result)static voidguard_level(uint32_t level_below){- redwood_guard_attenuation(level_below < guard_as ? level_below : guard_as);+ hakios_guard_attenuation(level_below < guard_as ? level_below : guard_as);}/*@@ -1227,12 +1227,12 @@ guard_off(bool unheard){guard_on = false;if (unheard) {- redwood_guard_attenuation(REDWOOD_GUARD_SILENT);+ hakios_guard_attenuation(HAKIOS_GUARD_SILENT);}}/*- * The amplifiers on while there is sound, at the volume iOS has set (redwood_audio_volume(): how+ * The amplifiers on while there is sound, at the volume iOS has set (hakios_audio_volume(): how* far under the loudest, sound_below under Android's level), and off while iOS's volume is 0;* their status looked at every 200 ms while they are on. On the sound's thread.*/@@ -1250,7 +1250,7 @@ watch(void)uint32_t extra_now, generation_now;bool muted_now;- if (redwood_audio_volume(&extra_now, &muted_now, &generation_now) && generation_now != generation) {+ if (hakios_audio_volume(&extra_now, &muted_now, &generation_now) && generation_now != generation) {generation = generation_now;extra = extra_now;muted = muted_now;@@ -1261,10 +1261,10 @@ watch(void)if (muted) {guard_off(true);if (on) {- redwood_speaker_stop();+ hakios_speaker_stop();on = false;}- } else if (on && !redwood_speaker_volume(below + extra, 1)) {+ } else if (on && !hakios_speaker_volume(below + extra, 1)) {guard_off(true);on = false;given_up = true;@@ -1276,7 +1276,7 @@ watch(void)say_when("iOS plays: the amplifiers are started");starts++;ios_peak = 0;- if (!redwood_speaker_start() || !redwood_speaker_volume(below + extra, 1)) {+ if (!hakios_speaker_start() || !hakios_speaker_volume(below + extra, 1)) {say("sound: THE AMPLIFIERS DID NOT START; iOS's sound goes on to the DSP, unheard\n");guard_off(true);given_up = true;@@ -1296,11 +1296,11 @@ watch(void)say("sound: what iOS wrote while they were on peaked at %u%% of full scale (%u)\n", ios_peak * 100 / 32768,ios_peak);guard_off(false);- redwood_speaker_stop();+ hakios_speaker_stop();on = false;} else if (on && now - last_look >= 200000) {last_look = now;- if (!redwood_speaker_healthy()) {+ if (!hakios_speaker_healthy()) {guard_off(true);on = false;given_up = true;@@ -1309,12 +1309,12 @@ watch(void)uint32_t wanted;last_monitor = now;- wanted = redwood_speaker_monitor(monitor_looks++ % 10 == 0);+ wanted = hakios_speaker_monitor(monitor_looks++ % 10 == 0);if (wanted != monitor) {say("sound: the amplifiers' watch asks for %u.%03u dB less (it was %u.%03u)\n", wanted / 8, wanted % 8 * 125,monitor / 8, monitor % 8 * 125);monitor = wanted;- redwood_guard_monitor(monitor);+ hakios_guard_monitor(monitor);}}}@@ -1335,7 +1335,7 @@ take_down(void){stopping = true;if (level >= 4) {- redwood_audio_set_sink("nothing", NULL);+ hakios_audio_set_sink("nothing", NULL);}for (unsigned ms = 0; ms < 3000 && (feeder_runs || watcher_runs); ms++) {sleep_ms(1);@@ -1343,14 +1343,14 @@ take_down(void)lck_mtx_lock(&sound_lock);if (running && !taken_down) {taken_down = true;- redwood_speaker_stop();+ hakios_speaker_stop();stream_off();afe_off();pins_off();- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);shared_put(0);- lck_mtx_unlock(&redwood_smmu_lock);- redwood_adsp_apr_events(NULL);+ lck_mtx_unlock(&hakios_smmu_lock);+ hakios_adsp_apr_events(NULL);say("sound: everything of the sound's is stopped and put back\n");}lck_mtx_unlock(&sound_lock);@@ -1377,7 +1377,7 @@ sound_thread(__unused void *parameter, __unused wait_result_t result)"the port, a stream with a test tone, and the amplifiers", seconds);}if (level >= 3) {- acf = redwood_adsp_fw_file("aw882xx_acf.bin", &acf_size);+ acf = hakios_adsp_fw_file("aw882xx_acf.bin", &acf_size);if (acf == NULL) {say("sound: no /fw/aw882xx_acf.bin: put the phone's /vendor/etc/aw882xx_acf.bin into fw-audio/ and run SYSTEM=1 ""userland/build.sh\n");@@ -1385,14 +1385,14 @@ sound_thread(__unused void *parameter, __unused wait_result_t result)}}if (level >= 2) {- lck_mtx_lock(&redwood_smmu_lock);+ lck_mtx_lock(&hakios_smmu_lock);ok = shared_get(0);- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);if (!ok) {goto out;}ok = false;- redwood_adsp_apr_events(events);+ hakios_adsp_apr_events(events);}announce("the TDM pins (GPIO 97 to 100) to the interface, as Android's active state has them");pins_on();@@ -1416,10 +1416,10 @@ sound_thread(__unused void *parameter, __unused wait_result_t result)thread_t feeder;announce("the amplifiers, set up from Android's Music profile, powered down until iOS plays");- if (!redwood_speaker_prepare(acf, acf_size)) {+ if (!hakios_speaker_prepare(acf, acf_size)) {goto out;}- redwood_adsp_fw_free(acf, acf_size);+ hakios_adsp_fw_free(acf, acf_size);acf = NULL;feeder_runs = true;if (kernel_thread_start(feeder_thread, NULL, &feeder) != KERN_SUCCESS) {@@ -1429,10 +1429,10 @@ sound_thread(__unused void *parameter, __unused wait_result_t result)}thread_deallocate(feeder);watcher_runs = true;- redwood_audio_set_sink("the speakers (the audio DSP, redwood_sound.c)", ios_sink);+ hakios_audio_set_sink("the speakers (the audio DSP, hakios.sound.c)", ios_sink);say("sound: WHAT IOS PLAYS GOES TO THE SPEAKERS from here on, %u.%03u dB under Android's level, until the run ends\n",below / 8, below % 8 * 125);- say("sound: through the guard (redwood_guard.c): %u.%03u dB of gain first (sound_gain), then high-pass at 200 Hz; peaks "+ say("sound: through the guard (hakios.guard.c): %u.%03u dB of gain first (sound_gain), then high-pass at 200 Hz; peaks ""3 dB, the 0.2 s/3 s/60 s power 6/9/12 dB under full scale at Android's level\n", gain / 8, gain % 8 * 125);if (guard_as < below) {say("sound: sound_guard_as=%u: FOR A TEST the guard reckons the amplifiers %u.%03u dB under Android's level, louder "@@ -1445,12 +1445,12 @@ sound_thread(__unused void *parameter, __unused wait_result_t result)if (level >= 3) {/* the clock runs (the port is started, the stream as well): the amplifiers can lock to it */announce("the amplifiers, set up from Android's Music profile, then started at the lowest volume");- if (!redwood_speaker_prepare(acf, acf_size) || !redwood_speaker_start()) {+ if (!hakios_speaker_prepare(acf, acf_size) || !hakios_speaker_start()) {goto out;}}/* (the amplifiers are faded in before the tone begins: they fade in on silence, and the tone starts at that level) */- if (level >= 3 && !redwood_speaker_volume(below, 50)) {+ if (level >= 3 && !hakios_speaker_volume(below, 50)) {goto out;}if (level >= 3) {@@ -1463,7 +1463,7 @@ sound_thread(__unused void *parameter, __unused wait_result_t result)space_faults();out:if (acf != NULL) {- redwood_adsp_fw_free(acf, acf_size);+ hakios_adsp_fw_free(acf, acf_size);}lck_mtx_unlock(&sound_lock);take_down();@@ -1472,7 +1472,7 @@ out:}void-redwood_sound_dsp_up(void)+hakios_sound_dsp_up(void){thread_t thread;@@ -1487,10 +1487,10 @@ redwood_sound_dsp_up(void)PE_parse_boot_argn("sound_pause", &pause_ms, sizeof(pause_ms));PE_parse_boot_argn("sound_guard_as", &guard_as, sizeof(guard_as));PE_parse_boot_argn("sound_gain", &gain, sizeof(gain));- if (gain > REDWOOD_GUARD_MAX_GAIN) {- gain = REDWOOD_GUARD_MAX_GAIN;+ if (gain > HAKIOS_GUARD_MAX_GAIN) {+ gain = HAKIOS_GUARD_MAX_GAIN;}- redwood_guard_configure(true, gain);+ hakios_guard_configure(true, gain);if (level >= 2 && level <= 3 && seconds > 3) {seconds = 3; /* the test tone: three seconds at most */}@@ -1504,7 +1504,7 @@ redwood_sound_dsp_up(void)}void-redwood_sound_dsp_down(void)+hakios_sound_dsp_down(void){if (running) {take_down();@@ -1512,7 +1512,7 @@ redwood_sound_dsp_down(void)}void-redwood_sound_quiesce(void)+hakios_sound_quiesce(void){- redwood_speaker_quiesce();+ hakios_speaker_quiesce();}diff --git a/xnu/files/bsd/dev/redwood_sparse.c b/xnu/files/bsd/dev/hakios.sparse.csimilarity index 98%rename from xnu/files/bsd/dev/redwood_sparse.crename to xnu/files/bsd/dev/hakios.sparse.cindex 0a8654c..0725d59 100644--- a/xnu/files/bsd/dev/redwood_sparse.c+++ b/xnu/files/bsd/dev/hakios.sparse.c@@ -31,7 +31,7 @@#include <sys/disk.h>#include <sys/errno.h>#include <sys/systm.h>-#include <sys/redwood_sparse.h>+#include <sys/hakios.sparse.h>extern dev_t mdevlookup(int devid);extern int mdevgetkernelrange(dev_t dev, vm_offset_t *base, uint64_t *size);@@ -202,7 +202,7 @@ static const struct cdevsw sparse_cdevsw = {};void-redwood_sparse_report(void)+hakios_sparse_report(void){if (!sparse_ready) {return;@@ -212,7 +212,7 @@ redwood_sparse_report(void)}void-redwood_sparse_init(void)+hakios_sparse_init(void){uint64_t off = 0;vm_offset_t base = 0;diff --git a/xnu/files/bsd/dev/redwood_speaker.c b/xnu/files/bsd/dev/hakios.speaker.csimilarity index 97%rename from xnu/files/bsd/dev/redwood_speaker.crename to xnu/files/bsd/dev/hakios.speaker.cindex cd1bcc7..cf19161 100644--- a/xnu/files/bsd/dev/redwood_speaker.c+++ b/xnu/files/bsd/dev/hakios.speaker.c@@ -6,7 +6,7 @@* set up over I2C -- the bus of the SoC's serial engine 3, GPIO 12 data and 13 clock, on which* Android's device tree and its running kernel have these two and nothing else -- and fed by* the SoC's first TDM interface ("MI2S 0": GPIO 97 bit clock, 100 frame sync, 99 data out),- * which the audio DSP drives (redwood_sound.c). In Android's tree the amplifier at 0x35 is+ * which the audio DSP drives (hakios.sound.c). In Android's tree the amplifier at 0x35 is* "sound-channel 0" and takes slot 0 of the frame (the left channel), the one at 0x34 is* channel 1 and takes slot 1; neither has a reset pin.*@@ -15,9 +15,9 @@* speaker_probe=1 reads registers and nothing else: the pins, the power names (below)* speaker_probe=2 ... and asks the amplifiers who they are (I2C, below)*- * redwood_speaker_prepare() and the rest (sys/redwood_audio.h), for boot-arg sound=3 of- * redwood_sound.c: the amplifiers set up and run exactly as Android's own driver does it- * (Xiaomi's redwood-s-oss kernel, techpack/audio/asoc/codecs/aw88263s_m20: aw882xx_device.c,+ * hakios_speaker_prepare() and the rest (sys/hakios.audio.h), for boot-arg sound=3 of+ * hakios.sound.c: the amplifiers set up and run exactly as Android's own driver does it+ * (Xiaomi's hakios-s-oss kernel, techpack/audio/asoc/codecs/aw88263s_m20: aw882xx_device.c,* aw882xx_init.c and aw882xx_pid_2113_reg.h; the phone runs its version 2.0.0), with the* registers' values from Android's own configuration file -- /vendor/etc/aw882xx_acf.bin of* the phone, which userland/build.sh puts into /fw of the system image from fw-audio/ and@@ -51,8 +51,8 @@* amplifiers powered down at once (amplifier power-down and power-down, bits 1 and 0 of 0x04)* and nothing more done. What is not done, compared with Android: the DSP's Awinic algorithm,* which protects the speakers with their calibration (aw882xx_rx_switch); in its place the- * samples go through redwood_guard.c on their way here. The driver's monitor is done- * (redwood_speaker_monitor(), below): once a second the chips' temperature and the battery's+ * samples go through hakios.guard.c on their way here. The driver's monitor is done+ * (hakios_speaker_monitor(), below): once a second the chips' temperature and the battery's* voltage, and the reduction that the file's table asks for at either.** I2C is done by hand: a pin is either pulled low or let go (and the pull-ups raise it), at 100@@ -68,7 +68,7 @@#include <mach/mach_types.h>#include <pexpert/pexpert.h>#include <sys/systm.h>-#include <sys/redwood_audio.h>+#include <sys/hakios.audio.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern vm_offset_t ml_io_map_wcomb(vm_offset_t phys_addr, vm_size_t size);@@ -727,7 +727,7 @@ faulty(struct amplifier *a, uint16_t *status)}bool-redwood_speaker_prepare(const uint8_t *acf, uint64_t size)+hakios_speaker_prepare(const uint8_t *acf, uint64_t size){if (tlmm == 0) {tlmm = ml_io_map(TLMM_PHYS, TLMM_SIZE);@@ -817,7 +817,7 @@ redwood_speaker_prepare(const uint8_t *acf, uint64_t size)}bool-redwood_speaker_start(void)+hakios_speaker_start(void){for (unsigned i = 0; i < 2; i++) {struct amplifier *a = &lifiers[i];@@ -888,7 +888,7 @@ redwood_speaker_start(void)}bool-redwood_speaker_volume(uint32_t below, uint32_t step_ms)+hakios_speaker_volume(uint32_t below, uint32_t step_ms){uint16_t status;@@ -939,11 +939,11 @@ redwood_speaker_volume(uint32_t below, uint32_t step_ms)wait_ms(step_ms);}}- return redwood_speaker_healthy();+ return hakios_speaker_healthy();}bool-redwood_speaker_healthy(void)+hakios_speaker_healthy(void){for (unsigned i = 0; i < 2; i++) {struct amplifier *a = &lifiers[i];@@ -987,7 +987,7 @@ monitor_row(const struct amplifier *a, bool temperature, int value, int before)* amplifiers'. With `tell', what was read (also the boosted supply and the current and voltage sense, raw).*/uint32_t-redwood_speaker_monitor(bool tell)+hakios_speaker_monitor(bool tell){uint32_t wanted = 0;@@ -1030,7 +1030,7 @@ redwood_speaker_monitor(bool tell)}void-redwood_speaker_stop(void)+hakios_speaker_stop(void){if (broken) {return; /* (already powered down) */@@ -1065,7 +1065,7 @@ redwood_speaker_stop(void)}void-redwood_speaker_quiesce(void)+hakios_speaker_quiesce(void){bool any = false;@@ -1198,7 +1198,7 @@ probe_thread(__unused void *parameter, __unused wait_result_t result)}void-redwood_speaker_init(void)+hakios_speaker_init(void){thread_t thread;diff --git a/xnu/files/bsd/dev/redwood_sta.c b/xnu/files/bsd/dev/hakios.sta.csimilarity index 75%rename from xnu/files/bsd/dev/redwood_sta.crename to xnu/files/bsd/dev/hakios.sta.cindex f4e0490..b3f7c29 100644--- a/xnu/files/bsd/dev/redwood_sta.c+++ b/xnu/files/bsd/dev/hakios.sta.c@@ -1,6 +1,6 @@/*- * Darwin-on-redwood: what stands between the two sides of the station boundary- * (sys/redwood_sta.h).+ * Darwin-on-hakios: what stands between the two sides of the station boundary+ * (sys/hakios.sta.h).** Whoever wants a network asks from wherever it happens to be: an ioctl of wifid's, the thread* that brings the radio up. The station side wants to be called by one thread, one call at a@@ -24,8 +24,8 @@#include <libkern/libkern.h>#include <mach/mach_types.h>#include <sys/errno.h>-#include <sys/redwood_input.h>-#include <sys/redwood_sta.h>+#include <sys/hakios.input.h>+#include <sys/hakios.sta.h>#include <sys/systm.h>extern void thread_set_thread_name(thread_t thread, const char *name);@@ -33,10 +33,10 @@ extern void thread_set_thread_name(thread_t thread, const char *name);#define HEARD_MOST 128#define CHANNELS_MOST 96-static LCK_GRP_DECLARE(sta_lock_group, "redwood-sta");+static LCK_GRP_DECLARE(sta_lock_group, "hakios-sta");static LCK_MTX_DECLARE(sta_lock, &sta_lock_group);-static const struct redwood_sta_ops *sta_ops; /* the station side, while there is one */+static const struct hakios_sta_ops *sta_ops; /* the station side, while there is one */static bool sta_thread_made;static bool sta_calls; /* the thread is in a call of the station side's */static unsigned sta_reads; /* ... and so many others are in its state() */@@ -44,18 +44,18 @@ static bool sta_on; /* the radio's power, as last as/* what has been asked for and not begun */static bool asked_power, asked_power_on, asked_scan, asked_join, asked_leave;-static struct redwood_sta_scan asked_scan_what;-static struct redwood_sta_join asked_join_what;-static struct redwood_sta_join standing; /* the network joined whenever the radio comes on (ssid_length 0: none) */-static struct redwood_sta_join fallback; /* ... as it was before a join that has not come through yet */+static struct hakios_sta_scan asked_scan_what;+static struct hakios_sta_join asked_join_what;+static struct hakios_sta_join standing; /* the network joined whenever the radio comes on (ssid_length 0: none) */+static struct hakios_sta_join fallback; /* ... as it was before a join that has not come through yet */-static struct redwood_sta_bss *heard; /* by the last scan that came to an end */+static struct hakios_sta_bss *heard; /* by the last scan that came to an end */static unsigned heard_count;-static struct redwood_sta_channel channels[CHANNELS_MOST];+static struct hakios_sta_channel channels[CHANNELS_MOST];static unsigned channel_count;static void-heard_one(const struct redwood_sta_bss *bss, __unused void *context)+heard_one(const struct hakios_sta_bss *bss, __unused void *context){/* (only the thread writes the list, and it reads the count without the lock) */if (heard_count < HEARD_MOST) {@@ -68,11 +68,11 @@ heard_one(const struct redwood_sta_bss *bss, __unused void *context)static voidsta_runs(__unused void *parameter, __unused wait_result_t result){- static struct redwood_sta_scan scan;- static struct redwood_sta_join join;+ static struct hakios_sta_scan scan;+ static struct hakios_sta_join join;for (;;) {- const struct redwood_sta_ops *ops;+ const struct hakios_sta_ops *ops;bool power = false, power_on = false, leave = false, do_join = false, do_scan = false;int error = 0;@@ -103,19 +103,19 @@ sta_runs(__unused void *parameter, __unused wait_result_t result)lck_mtx_unlock(&sta_lock);if (power) {- struct redwood_sta_state *state = kalloc_data(sizeof(*state), Z_WAITOK | Z_ZERO);+ struct hakios_sta_state *state = kalloc_data(sizeof(*state), Z_WAITOK | Z_ZERO);bool was_joined = false;if (state != NULL) {ops->state(state);- was_joined = state->phase == REDWOOD_STA_JOINED;+ was_joined = state->phase == HAKIOS_STA_JOINED;kfree_data(state, sizeof(*state));}error = ops->power(power_on);if (!power_on && was_joined) {- redwood_apple80211_event(REDWOOD_STA_LINK, 0);+ hakios_apple80211_event(HAKIOS_STA_LINK, 0);}- redwood_apple80211_event(REDWOOD_STA_POWER, error == 0 ? power_on : !power_on);+ hakios_apple80211_event(HAKIOS_STA_POWER, error == 0 ? power_on : !power_on);lck_mtx_lock(&sta_lock);if (error == 0 && power_on && standing.ssid_length != 0 && !asked_join) {asked_join_what = standing;@@ -124,13 +124,13 @@ sta_runs(__unused void *parameter, __unused wait_result_t result)lck_mtx_unlock(&sta_lock);} else if (leave) {ops->leave();- redwood_apple80211_event(REDWOOD_STA_LINK, 0);+ hakios_apple80211_event(HAKIOS_STA_LINK, 0);} else if (do_join) {error = ops->join(&join);bzero(&join, sizeof(join));- redwood_apple80211_event(REDWOOD_STA_JOIN_DONE, error);+ hakios_apple80211_event(HAKIOS_STA_JOIN_DONE, error);if (error == 0) {- redwood_apple80211_event(REDWOOD_STA_LINK, 1);+ hakios_apple80211_event(HAKIOS_STA_LINK, 1);}/* a join that did not come through (a wrong passphrase) leaves things as they were: the standing network again */lck_mtx_lock(&sta_lock);@@ -146,7 +146,7 @@ sta_runs(__unused void *parameter, __unused wait_result_t result)heard_count = 0;lck_mtx_unlock(&sta_lock);ops->heard(heard_one, NULL);- redwood_apple80211_event(REDWOOD_STA_SCAN_DONE, error);+ hakios_apple80211_event(HAKIOS_STA_SCAN_DONE, error);}lck_mtx_lock(&sta_lock);@@ -159,7 +159,7 @@ sta_runs(__unused void *parameter, __unused wait_result_t result)/* ---- the station side ---------------------------------------------------------------------------------- */void-redwood_sta_attach(const struct redwood_sta_ops *ops)+hakios_sta_attach(const struct hakios_sta_ops *ops){thread_t thread;@@ -178,12 +178,12 @@ redwood_sta_attach(const struct redwood_sta_ops *ops)heard = kalloc_data(HEARD_MOST * sizeof(*heard), Z_WAITOK | Z_ZERO);}if (heard == NULL) {- redwood_wifi_tell("wifi: no memory for what a scan hears: nobody can ask the radio for a network\n");+ hakios_wifi_tell("wifi: no memory for what a scan hears: nobody can ask the radio for a network\n");return;}if (!sta_thread_made) {if (kernel_thread_start(sta_runs, NULL, &thread) != KERN_SUCCESS) {- redwood_wifi_tell("wifi: no thread for the station: nobody can ask the radio for a network\n");+ hakios_wifi_tell("wifi: no thread for the station: nobody can ask the radio for a network\n");return;}thread_set_thread_name(thread, "wifi-station");@@ -196,31 +196,31 @@ redwood_sta_attach(const struct redwood_sta_ops *ops)sta_on = true;lck_mtx_unlock(&sta_lock);thread_wakeup((event_t)&sta_ops);- redwood_apple80211_event(REDWOOD_STA_POWER, 1);+ hakios_apple80211_event(HAKIOS_STA_POWER, 1);}void-redwood_sta_lost(int error)+hakios_sta_lost(int error){- redwood_apple80211_event(REDWOOD_STA_LINK, error != 0 ? error : ECONNRESET);+ hakios_apple80211_event(HAKIOS_STA_LINK, error != 0 ? error : ECONNRESET);}/* ---- who wants a network ------------------------------------------------------------------------------- */bool-redwood_sta_present(void)+hakios_sta_present(void){return sta_ops != NULL;}bool-redwood_sta_powered(void)+hakios_sta_powered(void){return sta_ops != NULL && sta_on;}bool-redwood_sta_busy(void)+hakios_sta_busy(void){bool busy;@@ -231,7 +231,7 @@ redwood_sta_busy(void)}int-redwood_sta_ask_power(bool on)+hakios_sta_ask_power(bool on){lck_mtx_lock(&sta_lock);if (sta_ops == NULL) {@@ -250,7 +250,7 @@ redwood_sta_ask_power(bool on)}int-redwood_sta_ask_scan(const struct redwood_sta_scan *what)+hakios_sta_ask_scan(const struct hakios_sta_scan *what){lck_mtx_lock(&sta_lock);if (sta_ops == NULL || !sta_on) {@@ -265,9 +265,9 @@ redwood_sta_ask_scan(const struct redwood_sta_scan *what)}int-redwood_sta_ask_join_standing(const struct redwood_sta_join *what)+hakios_sta_ask_join_standing(const struct hakios_sta_join *what){- int error = redwood_sta_ask_join(what);+ int error = hakios_sta_ask_join(what);lck_mtx_lock(&sta_lock);if (error == 0) {@@ -278,7 +278,7 @@ redwood_sta_ask_join_standing(const struct redwood_sta_join *what)}int-redwood_sta_ask_join(const struct redwood_sta_join *what)+hakios_sta_ask_join(const struct hakios_sta_join *what){lck_mtx_lock(&sta_lock);if (sta_ops == NULL || !sta_on) {@@ -298,7 +298,7 @@ redwood_sta_ask_join(const struct redwood_sta_join *what)}int-redwood_sta_ask_leave(void)+hakios_sta_ask_leave(void){lck_mtx_lock(&sta_lock);if (sta_ops == NULL) {@@ -315,7 +315,7 @@ redwood_sta_ask_leave(void)}bool-redwood_sta_heard(unsigned index, struct redwood_sta_bss *bss)+hakios_sta_heard(unsigned index, struct hakios_sta_bss *bss){bool there;@@ -328,9 +328,9 @@ redwood_sta_heard(unsigned index, struct redwood_sta_bss *bss)}void-redwood_sta_state(struct redwood_sta_state *state)+hakios_sta_state(struct hakios_sta_state *state){- const struct redwood_sta_ops *ops;+ const struct hakios_sta_ops *ops;bzero(state, sizeof(*state));lck_mtx_lock(&sta_lock);@@ -348,7 +348,7 @@ redwood_sta_state(struct redwood_sta_state *state)}unsigned-redwood_sta_channels(struct redwood_sta_channel *out, unsigned most)+hakios_sta_channels(struct hakios_sta_channel *out, unsigned most){unsigned count;@@ -360,9 +360,9 @@ redwood_sta_channels(struct redwood_sta_channel *out, unsigned most)}bool-redwood_sta_address(uint8_t *address)+hakios_sta_address(uint8_t *address){- const struct redwood_sta_ops *ops = sta_ops;+ const struct hakios_sta_ops *ops = sta_ops;if (ops != NULL) {memcpy(address, ops->address, 6);diff --git a/xnu/files/bsd/dev/redwood_torch.c b/xnu/files/bsd/dev/hakios.torch.csimilarity index 96%rename from xnu/files/bsd/dev/redwood_torch.crename to xnu/files/bsd/dev/hakios.torch.cindex e3ea958..85ab236 100644--- a/xnu/files/bsd/dev/redwood_torch.c+++ b/xnu/files/bsd/dev/hakios.torch.c@@ -2,7 +2,7 @@* The flashlight of the POCO X5 Pro (redwood): the flash LED module of the PM8350C (SPMI slave 2,* registers 0xee00; "qcom,pm8350c-flash-led", four channels), the rear flash LED on its channel 0.* Every address and number below belongs to this phone, from Android's own device tree, Xiaomi's- * driver for it (drivers/leds/leds-qti-flash.c of the phone's kernel, MiCode redwood-s-oss) and+ * driver for it (drivers/leds/leds-qti-flash.c of the phone's kernel, MiCode hakios-s-oss) and* what Android does when its own flashlight is switched on (its LED class devices read, nothing* written by us):*@@ -18,12 +18,12 @@* every write goes through one function that takes only this module's registers above (the* peripheral the arbiter's channel is checked to be, the registers by a list), every write is* read back, and any surprise ends all writing for the run. Transfers through the arbiter are made- * one at a time with the buttons' driver (redwood_spmi_lock()): two at once, and it drops one.+ * one at a time with the buttons' driver (hakios_spmi_lock()): two at once, and it drops one.** What iOS's flashlight is on this machine: the loader says the camera has a flash (with torch=N,* /product/camera "flash": MobileGestalt's camera-flash, Control Center's flashlight button), and- * libredwood-media.dylib in mediaserverd hands FigFlashlight, which finds no camera here, a device- * of ours whose torch level is written to /dev/redwood-torch (userland/src/inject_media.c).+ * libhakios.media.dylib in mediaserverd hands FigFlashlight, which finds no camera here, a device+ * of ours whose torch level is written to /dev/hakios-torch (userland/src/inject_media.c).** Nothing here is done unless a boot-arg asks for it:*@@ -31,7 +31,7 @@* through it, the module's type, its registers, the PMIC's temperature alarm* torch=2 ... and the light on once at Android's torch current for torch_secs (default 2),* then off, every write read back- * torch=3 ... no light at the start; the light for iOS until the run ends: /dev/redwood-torch+ * torch=3 ... no light at the start; the light for iOS until the run ends: /dev/hakios-torch* takes a level of 0 to 1000 (a 32-bit number; thousandths of Android's current, 0* off) and the module is set to it -- never above Android's 125 mA; a read gives* what is lit now@@ -56,8 +56,8 @@#include <miscfs/devfs/devfs.h>#include <pexpert/pexpert.h>#include <sys/conf.h>-#include <sys/redwood_audio.h>-#include <sys/redwood_input.h>+#include <sys/hakios.audio.h>+#include <sys/hakios.input.h>#include <sys/systm.h>#include <sys/uio.h>@@ -200,7 +200,7 @@ static voidlock(void){if (!leaving) {- redwood_spmi_lock();+ hakios_spmi_lock();}}@@ -208,7 +208,7 @@ static voidunlock(void){if (!leaving) {- redwood_spmi_unlock();+ hakios_spmi_unlock();}}@@ -451,8 +451,8 @@ trouble(void)more[2], more[3], more[4], more[5], more[6], more[7], latched[0], stage);return why;}- if (redwood_battery_temperature() >= HOTTEST_BATTERY_C) {- snprintf(why, sizeof(why), "the battery is at %d C", redwood_battery_temperature());+ if (hakios_battery_temperature() >= HOTTEST_BATTERY_C) {+ snprintf(why, sizeof(why), "the battery is at %d C", hakios_battery_temperature());return why;}return NULL;@@ -572,11 +572,11 @@ serve(void)bool waiting_for_off = false; /* cut at the limit: dark until iOS asks for 0 */int major = cdevsw_add(-1, &torch_cdevsw);- if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "redwood-torch") == NULL) {- say("torch: /dev/redwood-torch cannot be made\n");+ if (major < 0 || devfs_make_node(makedev(major, 0), DEVFS_CHAR, UID_ROOT, GID_WHEEL, 0666, "hakios-torch") == NULL) {+ say("torch: /dev/hakios-torch cannot be made\n");return;}- say("torch: THE LIGHT IS IOS'S (/dev/redwood-torch) from here on, until the run ends: at most Android's %u mA, at most %u s "+ say("torch: THE LIGHT IS IOS'S (/dev/hakios-torch) from here on, until the run ends: at most Android's %u mA, at most %u s ""at a time\n", ANDROID_TORCH_MA, max_secs);while (!broken) {uint32_t want = wanted;@@ -597,7 +597,7 @@ serve(void)if (want == 0) {note("off (iOS asked for 0)");} else {- note("ON (iOS asked for %u of 1000; the battery %d C)", wanted, redwood_battery_temperature());+ note("ON (iOS asked for %u of 1000; the battery %d C)", wanted, hakios_battery_temperature());}applied = want;shown = want;@@ -724,7 +724,7 @@ out:}void-redwood_torch_init(void)+hakios_torch_init(void){thread_t thread;@@ -739,7 +739,7 @@ redwood_torch_init(void)/* At the run's end and on a panic's way out: the light off, if it was ever lit. */void-redwood_torch_quiesce(void)+hakios_torch_quiesce(void){uint8_t module = 0xff, channels = 0xff, target = 0xff;diff --git a/xnu/files/bsd/dev/redwood_ufs.c b/xnu/files/bsd/dev/hakios.ufs.csimilarity index 96%rename from xnu/files/bsd/dev/redwood_ufs.crename to xnu/files/bsd/dev/hakios.ufs.cindex 6d2d6da..fd1e3a9 100644--- a/xnu/files/bsd/dev/redwood_ufs.c+++ b/xnu/files/bsd/dev/hakios.ufs.c@@ -50,10 +50,10 @@#include <sys/proc.h>#include <sys/sysctl.h>#include <sys/uio.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <libkern/crc.h>#include <vm/memory_types.h>-#include "redwood_ufshc.h"+#include "hakios.ufshc.h"extern vm_offset_t ml_io_map_unmappable(vm_offset_t phys_addr, vm_size_t size, unsigned int flags);extern void IOSleep(unsigned int milliseconds);@@ -156,7 +156,7 @@ static uint32_t ufs_last_part = ~0u;static uint64_t ufs_last_end;/*- * This kernel's own UFS driver (redwood_ufshc.c), with ufs_native=1: each partition's logical+ * This kernel's own UFS driver (hakios.ufshc.c), with ufs_native=1: each partition's logical* unit and where it begins there, in bytes; reads go that way unless it fails, and then through* the loader again. While its list is in the controller the loader is asked for nothing.*/@@ -167,7 +167,7 @@ static uint32_t ufs_native_luns; /* how many units are mapped (LUstatic volatile bool ufs_native_on;static uint64_t ufs_native_fallbacks, ufs_mailbox_refused;-static LCK_GRP_DECLARE(ufs_lck_grp, "redwood-ufs");+static LCK_GRP_DECLARE(ufs_lck_grp, "hakios-ufs");static LCK_MTX_DECLARE(ufs_lock, &ufs_lck_grp);/* One writer at a time; never held while the mailbox is, nor while user memory is touched. */static LCK_MTX_DECLARE(ufs_write_mtx, &ufs_lck_grp);@@ -178,7 +178,7 @@ static LCK_MTX_DECLARE(ufs_write_mtx, &ufs_lck_grp);* The volume is packed and written by a program, not by this kernel, so the kernel's part is to* say when and to let only one program at a time do it:*- * kern.redwood.var_save the handshake. The saver writes VAR_SAVE_IDLE when it starts and is+ * kern.hakios.var_save the handshake. The saver writes VAR_SAVE_IDLE when it starts and is* then the one that will be asked; on the orderly way back to the loader* (loader_return_after expired, or "xl stop") the kernel writes* VAR_SAVE_WANTED and waits, and the saver writes VAR_SAVE_DONE when the@@ -186,7 +186,7 @@ static LCK_MTX_DECLARE(ufs_write_mtx, &ufs_lck_grp);* nothing waited for, so a run without a saver returns as it always did.* A panic does not come this way at all -- there is no program left to* ask -- and then the store simply keeps what it had.- * kern.redwood.var_busy the claim. A write to /dev/rufs_darwin is refused unless the writer+ * kern.hakios.var_busy the claim. A write to /dev/rufs_darwin is refused unless the writer* holds it, so two savers cannot interleave into one slot. It is held by* process number, and a claimant may take it from a process that is gone* (a saver killed in the middle leaves no lock behind for the rest of the@@ -208,24 +208,24 @@ static volatile bool ufs_write_busy; /* a write of ours has this kernstatic bool ufs_write_out, ufs_write_was_native; /* the list is out for writing, and was in before */static uint64_t ufs_writes, ufs_write_bytes, ufs_write_errors, ufs_write_refused;-SYSCTL_DECL(_kern_redwood);-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_requests, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_requests,+SYSCTL_DECL(_kern_hakios);+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_requests, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_requests,"requests the phone's storage has answered through the loader");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_errors, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_errors,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_errors, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_errors,"requests the phone's storage has refused or not answered");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_bytes, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_bytes,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_bytes, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_bytes,"bytes read from the phone's storage");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_wait_us, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_wait_us,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_wait_us, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_wait_us,"microseconds spent waiting for core 0's answers");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_copy_us, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_copy_us,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_copy_us, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_copy_us,"microseconds spent copying out of the loader's buffer");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_writes, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_writes,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_writes, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_writes,"requests written into darwin and read back by the loader");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_write_bytes, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_write_bytes,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_write_bytes, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_write_bytes,"bytes written into darwin");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_write_errors, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_write_errors,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_write_errors, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_write_errors,"writes the loader refused or did not finish");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_write_refused, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_write_refused,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_write_refused, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_write_refused,"writes refused here: not darwin, or not past what the build writes");/* The handshake: 1 to register as the saver, 3 to say the volume is in the flash. 2 is the kernel's. */@@ -250,7 +250,7 @@ ufs_sysctl_var_save(__unused struct sysctl_oid *oidp, __unused void *arg1, __unureturn 0;}-SYSCTL_PROC(_kern_redwood, OID_AUTO, var_save, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_LOCKED, NULL, 0,+SYSCTL_PROC(_kern_hakios, OID_AUTO, var_save, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_LOCKED, NULL, 0,ufs_sysctl_var_save, "I", "the data volume's saver: 1 registers, 2 is the kernel asking, 3 is done");/* The claim on the store: 1 takes it, 0 gives it back; reading says which process holds it. */@@ -290,7 +290,7 @@ ufs_sysctl_var_busy(__unused struct sysctl_oid *oidp, __unused void *arg1, __unureturn error;}-SYSCTL_PROC(_kern_redwood, OID_AUTO, var_busy, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_LOCKED, NULL, 0,+SYSCTL_PROC(_kern_hakios, OID_AUTO, var_busy, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_LOCKED, NULL, 0,ufs_sysctl_var_busy, "I", "the claim a writer of /dev/rufs_darwin must hold: 1 takes it, 0 gives it back");/*@@ -403,7 +403,7 @@ ufs_request(uint32_t op, uint32_t part, uint64_t lba, uint64_t count, uint8_t *d/* One of this driver's devices (block or character): a request to it costs tens of microseconds */bool-redwood_ufs_dev(dev_t dev)+hakios_ufs_dev(dev_t dev){return ufs_ready && ((ufs_bmajor >= 0 && major(dev) == ufs_bmajor) ||(ufs_cmajor >= 0 && major(dev) == ufs_cmajor));@@ -414,7 +414,7 @@ redwood_ufs_dev(dev_t dev)* the loader's own clock says how long ReadBlocks itself took) and copying out of its buffer.*/void-redwood_ufs_report(const char *when)+hakios_ufs_report(const char *when){uint64_t loader_ns = 0;@@ -529,7 +529,7 @@ ufs_native_out(const char *why)return error;}-/* The way chosen (ufs_native=, kern.redwood.ufs_native); if this kernel's own fails, the loader's */+/* The way chosen (ufs_native=, kern.hakios.ufs_native); if this kernel's own fails, the loader's */static intufs_read(uint32_t part, uint64_t offset, uint8_t *dst, uint64_t len){@@ -831,7 +831,7 @@ ufs_cwrite(dev_t dev, struct uio *uio, __unused int ioflag)return EROFS;}if (ufs_var_busy_pid != proc_selfpid()) {- /* one writer of the store at a time, and it says so first (kern.redwood.var_busy) */+ /* one writer of the store at a time, and it says so first (kern.hakios.var_busy) */ufs_write_refused++;return EPERM;}@@ -900,7 +900,7 @@ static const struct cdevsw ufs_cdevsw = {* GPU, the DSPs and this kernel's transfer list are still as the run had them.*/void-redwood_var_save_on_return(void)+hakios_var_save_on_return(void){uint32_t ms = VAR_SAVE_MS;uint64_t waited = 0;@@ -1037,7 +1037,7 @@ ufs_bench(__unused void *arg, __unused wait_result_t wr)base += total;}kfree_data(dst, ufs_buffer_size);- redwood_ufs_report("after the bench");+ hakios_ufs_report("after the bench");}/* ---- this kernel's own driver: which unit is which, and whether it reads what the loader reads ---- */@@ -1063,12 +1063,12 @@ ufs_entry(const char *name)}/*- * For the kernel's own drivers (the modem's file systems, bsd/dev/redwood_mpss.c): bytes+ * For the kernel's own drivers (the modem's file systems, bsd/dev/hakios.mpss.c): bytes* [offset, offset + len) of the partition of that name (or of its _a or _b slot), and how big it* is. ENXIO without the storage, ENOENT without the partition; nothing is written.*/int-redwood_ufs_read_partition(const char *name, uint64_t offset, uint8_t *dst, uint64_t len, uint64_t *bytes)+hakios_ufs_read_partition(const char *name, uint64_t offset, uint8_t *dst, uint64_t len, uint64_t *bytes){uint32_t part;@@ -1445,7 +1445,7 @@ ufs_native_bench(void)ufshc_report("after the bench");}-/* kern.redwood.ufs_native: 1 while reads go through this kernel's own driver; 0 or 1 may be set */+/* kern.hakios.ufs_native: 1 while reads go through this kernel's own driver; 0 or 1 may be set */static intufs_sysctl_native(__unused struct sysctl_oid *oidp, __unused void *arg1, __unused int arg2, struct sysctl_req *req){@@ -1462,19 +1462,19 @@ ufs_sysctl_native(__unused struct sysctl_oid *oidp, __unused void *arg1, __unuseufs_native_on = true;} else {ufs_native_on = false;- ufs_native_out("kern.redwood.ufs_native=0");+ ufs_native_out("kern.hakios.ufs_native=0");}return 0;}-SYSCTL_PROC(_kern_redwood, OID_AUTO, ufs_native, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_LOCKED, NULL, 0,+SYSCTL_PROC(_kern_hakios, OID_AUTO, ufs_native, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_LOCKED, NULL, 0,ufs_sysctl_native, "I", "1: the phone's storage is read by this kernel's own UFS driver, 0: through the loader");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_native_fallbacks, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_native_fallbacks,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_native_fallbacks, CTLFLAG_RD | CTLFLAG_LOCKED, &ufs_native_fallbacks,"times a read of this kernel's own UFS driver failed and the loader's was used instead");/* ---- bringing it up ---- */void-redwood_ufs_init(void)+hakios_ufs_init(void){uint64_t pa = 0, buffer_pa;uint32_t check = 0, made = 0;@@ -1615,18 +1615,18 @@ redwood_ufs_init(void)if (compare != 0) {/* right here, in bsd_init's thread, and then back to the loader */ufs_native_check();- redwood_ufs_report("after the check");+ hakios_ufs_report("after the check");loader_return();}ufs_native_on = true;compare = 0;if (PE_parse_boot_argn("ufs_native_bench", &compare, sizeof(compare)) && compare != 0) {ufs_native_bench();- redwood_ufs_report("after the bench");+ hakios_ufs_report("after the bench");loader_return();}printf("ufs: the partitions (LUN 0-%u) are read by this kernel's own UFS driver, its list in the "- "controller (kern.redwood.ufs_native=0: through the loader)\n", ufs_native_luns - 1);+ "controller (kern.hakios.ufs_native=0: through the loader)\n", ufs_native_luns - 1);} else {printf("ufs: this kernel's own UFS driver is not used: through the loader\n");}@@ -1641,7 +1641,7 @@ redwood_ufs_init(void)if (PE_parse_boot_argn("ufs_check", &check, sizeof(check)) && check == 2) {/* right here, whichever way the partitions are read (ufs_native=), and back to the loader */ufs_check((void *)1, THREAD_AWAKENED);- redwood_ufs_report("after the check");+ hakios_ufs_report("after the check");loader_return();}if (check == 1) {diff --git a/xnu/files/bsd/dev/redwood_ufshc.c b/xnu/files/bsd/dev/hakios.ufshc.csimilarity index 97%rename from xnu/files/bsd/dev/redwood_ufshc.crename to xnu/files/bsd/dev/hakios.ufshc.cindex c68595b..ead5b6c 100644--- a/xnu/files/bsd/dev/redwood_ufshc.c+++ b/xnu/files/bsd/dev/hakios.ufshc.c@@ -1,13 +1,13 @@/** The phone's UFS host controller, driven from this kernel -- read only, next to UEFI's driver.*- * Reading the storage through the loader (redwood_ufs.c) is one request at a time: Qualcomm's+ * Reading the storage through the loader (hakios.ufs.c) is one request at a time: Qualcomm's* UFSDxe reads synchronously on core 0, and its transfer request list has room for one request* only (UTRLBA points at a single descriptor, with UFSDxe's command descriptor right behind it,* where slots 8.. would be). The controller takes 32 at once. So for the length of a run this* kernel puts a list of its own into the controller: with nothing in flight, the list is stopped* (UTRLRSR 0), UTRLBA/UTRLBAU are pointed at the new one, the list is started again; at the end- * (redwood_ufs_quiesce, from loader_return), what is in flight is waited for, the list stopped,+ * (hakios_ufs_quiesce, from loader_return), what is in flight is waited for, the list stopped,* UEFI's address written back, the list started. The list and its command descriptors are in* memory the loader owns (it offers it in its page, with UEFI's address); the loader checks the* address on every way back from a run and puts UEFI's back itself if the kernel did not@@ -63,7 +63,7 @@#include <sys/sysctl.h>#include <vm/vm_kern.h>#include <vm/memory_types.h>-#include "redwood_ufshc.h"+#include "hakios.ufshc.h"extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);extern vm_offset_t ml_io_map_unmappable(vm_offset_t phys_addr, vm_size_t size, unsigned int flags);@@ -165,27 +165,27 @@ static uint32_t hc_in_flight;/* where the time goes: doorbell reads while waiting, waits for a free slot, taking hc_lock, how many in flight */static uint64_t hc_polls, hc_slot_waits, hc_slot_wait_ticks, hc_lock_ticks, hc_flight_hist[6];-static LCK_GRP_DECLARE(hc_lck_grp, "redwood-ufshc");+static LCK_GRP_DECLARE(hc_lck_grp, "hakios-ufshc");static LCK_MTX_DECLARE(hc_lock, &hc_lck_grp);-SYSCTL_DECL(_kern_redwood);-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_native_requests, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_requests,+SYSCTL_DECL(_kern_hakios);+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_native_requests, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_requests,"reads this kernel's own UFS driver has had answered");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_native_errors, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_errors,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_native_errors, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_errors,"reads of this kernel's own UFS driver that failed");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_native_bytes, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_bytes,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_native_bytes, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_bytes,"bytes this kernel's own UFS driver has read");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_native_wait_us, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_wait_us,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_native_wait_us, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_wait_us,"microseconds spent waiting for the controller, summed over the reads");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_native_refused, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_refused,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_native_refused, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_refused,"commands the whitelist refused (there should never be one)");-SYSCTL_QUAD(_kern_redwood, OID_AUTO, ufs_native_most_in_flight, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_most_in_flight,+SYSCTL_QUAD(_kern_hakios, OID_AUTO, ufs_native_most_in_flight, CTLFLAG_RD | CTLFLAG_LOCKED, &hc_most_in_flight,"the most reads this kernel's own UFS driver has had in flight at once");/** What this file says goes to the kernel's log, and the last lines are kept: the start of a long* run's log does not come back to the loader (the buffer wraps), so they are said again at the- * end, into the loader's log directly (redwood_ufs_quiesce; printf is not for that moment).+ * end, into the loader's log directly (hakios_ufs_quiesce; printf is not for that moment).*/extern void loader_log_putc(char c);#define KEPT_LINES 64@@ -1283,7 +1283,7 @@ ufshc_probe(const struct ufshc_loader *loader, bool only)hc_nslots = slots;hc_free = (uint32_t)(((1ULL << (slots + 1)) - 1) & ~1ULL); /* slots 1..n */hc_usable = true;- hc_say("ufs: native: usable: a list of %u slots at %llx (the loader's), reads in %u of them, %u KB each (the logical units reads may go to are set by redwood_ufs.c)%s\n",+ hc_say("ufs: native: usable: a list of %u slots at %llx (the loader's), reads in %u of them, %u KB each (the logical units reads may go to are set by hakios.ufs.c)%s\n",SLOTS, loader->area_pa, slots, hc_slot_buffer >> 10, hc_leave ? "; ufs_native_leave=1: the list is left in ""at the end, for the loader to take back" : "");return true;@@ -1295,7 +1295,7 @@ ufshc_probe(const struct ufshc_loader *loader, bool only)* No locks (a stopped processor may hold one).*/void-redwood_ufs_quiesce(void)+hakios_ufs_quiesce(void){struct hc_put_back_result r;diff --git a/xnu/files/bsd/dev/redwood_ufshc.h b/xnu/files/bsd/dev/hakios.ufshc.hsimilarity index 87%rename from xnu/files/bsd/dev/redwood_ufshc.hrename to xnu/files/bsd/dev/hakios.ufshc.hindex 404448f..7b29ce8 100644--- a/xnu/files/bsd/dev/redwood_ufshc.h+++ b/xnu/files/bsd/dev/hakios.ufshc.h@@ -1,8 +1,8 @@/*- * The kernel's own UFS driver (redwood_ufshc.c), as redwood_ufs.c uses it.+ * The kernel's own UFS driver (hakios.ufshc.c), as hakios.ufs.c uses it.*/-#ifndef _REDWOOD_UFSHC_H_-#define _REDWOOD_UFSHC_H_+#ifndef _HAKIOS_UFSHC_H_+#define _HAKIOS_UFSHC_H_#include <stdbool.h>#include <stdint.h>@@ -27,6 +27,6 @@ int ufshc_switch_out(const char *why);bool ufshc_list_in(void);int ufshc_read(uint8_t lun, uint64_t offset, uint8_t *dst, uint64_t len);void ufshc_report(const char *when);-void redwood_ufs_quiesce(void);+void hakios_ufs_quiesce(void);#endifdiff --git a/xnu/files/bsd/dev/redwood_virtio_blk.c b/xnu/files/bsd/dev/hakios.virtio_blk.csimilarity index 98%rename from xnu/files/bsd/dev/redwood_virtio_blk.crename to xnu/files/bsd/dev/hakios.virtio_blk.cindex 97a469a..9c96b0e 100644--- a/xnu/files/bsd/dev/redwood_virtio_blk.c+++ b/xnu/files/bsd/dev/hakios.virtio_blk.c@@ -3,7 +3,7 @@* guest (/dev/rvblk0). Only with boot-arg virtio_blk=1: the bus address is QEMU's and* means nothing on the phone.*- * This exists for the APFS driver. The volume in sysimage/rootfs.dmg is 5.6 GB, which is+ * This exists for the APFS driver. The volume in ios165/rootfs.dmg is 5.6 GB, which is* too much to hold in guest memory as a RAM disk the way this port's own images are held, and the* point of reading APFS is to read a real image rather than one cut down to fit. QEMU* serves it straight off the host's disk:@@ -35,7 +35,7 @@#include <sys/disk.h>#include <sys/errno.h>#include <sys/systm.h>-#include <sys/redwood_virtio_blk.h>+#include <sys/hakios.virtio_blk.h>#include <vm/vm_kern.h>extern vm_offset_t ml_io_map(vm_offset_t phys_addr, vm_size_t size);@@ -133,14 +133,14 @@ struct blk_device {lck_mtx_t lock;};-static LCK_GRP_DECLARE(blk_lck_grp, "redwood-virtio-blk");+static LCK_GRP_DECLARE(blk_lck_grp, "hakios-virtio-blk");static struct blk_device blk_dev;static bool blk_ready;static int blk_bmajor = -1, blk_cmajor = -1;/* One of this driver's devices: every request is a trip through the hypervisor */bool-redwood_virtio_blk_dev(dev_t dev)+hakios_virtio_blk_dev(dev_t dev){return (blk_bmajor >= 0 && major(dev) == blk_bmajor) ||(blk_cmajor >= 0 && major(dev) == blk_cmajor);@@ -476,7 +476,7 @@ blk_attach(struct blk_device *d, int slot)}void-redwood_virtio_blk_init(void)+hakios_virtio_blk_init(void){uint32_t enabled = 0;vm_offset_t bus;diff --git a/xnu/files/bsd/dev/redwood_virtio_input.c b/xnu/files/bsd/dev/hakios.virtio_input.csimilarity index 93%rename from xnu/files/bsd/dev/redwood_virtio_input.crename to xnu/files/bsd/dev/hakios.virtio_input.cindex d8484e3..66abf66 100644--- a/xnu/files/bsd/dev/redwood_virtio_input.c+++ b/xnu/files/bsd/dev/hakios.virtio_input.c@@ -1,5 +1,5 @@/*- * Virtio input devices as a source of touches and buttons (see sys/redwood_input.h).+ * Virtio input devices as a source of touches and buttons (see sys/hakios.input.h).** Under QEMU's "virt" machine a "virtio-tablet-device" stands for the touch screen (the pointer* with its button held is a finger) and a "virtio-keyboard-device" for the phone's buttons. They@@ -12,7 +12,7 @@* The keyboard is also a way to tell the kernel something from the host while the system runs:* F12, a process name, Enter prints where every thread of that process is (ustacks_now(); the* host side is "qemu/touch.py stacks NAME"). F11 is five fingers on the screen for as long as it- * is held, which is how the way out in redwood_input.c is tried ("qemu/touch.py key fivefingers 2000").+ * is held, which is how the way out in hakios.input.c is tried ("qemu/touch.py key fivefingers 2000").*/#include <kern/clock.h>#include <kern/thread_call.h>@@ -20,7 +20,7 @@#include <mach/mach_types.h>#include <mach/vm_param.h>#include <pexpert/pexpert.h>-#include <sys/redwood_input.h>+#include <sys/hakios.input.h>#include <sys/systm.h>#include <vm/vm_kern.h>@@ -191,16 +191,16 @@ button_for_key(uint16_t key)switch (key) {case 116: /* KEY_POWER */case 38: /* KEY_L */- return REDWOOD_BUTTON_LOCK;+ return HAKIOS_BUTTON_LOCK;case 115: /* KEY_VOLUMEUP */case 103: /* KEY_UP */- return REDWOOD_BUTTON_VOLUME_UP;+ return HAKIOS_BUTTON_VOLUME_UP;case 114: /* KEY_VOLUMEDOWN */case 108: /* KEY_DOWN */- return REDWOOD_BUTTON_VOLUME_DOWN;+ return HAKIOS_BUTTON_VOLUME_DOWN;case 102: /* KEY_HOME */case 35: /* KEY_H */- return REDWOOD_BUTTON_HOME;+ return HAKIOS_BUTTON_HOME;}return 0;}@@ -226,21 +226,21 @@ input_event(struct input_device *d, const struct input_event *e)} else if (command_key(e->code, e->value)) {break;} else if (e->code == KEY_F11 && e->value < 2) {- /* five more fingers, for as long as the key is held: the way out of redwood_input.c */+ /* five more fingers, for as long as the key is held: the way out of hakios.input.c */for (uint32_t i = 0; i < 5; i++) {- redwood_touch_post(e->value ? REDWOOD_TOUCH_DOWN : REDWOOD_TOUCH_UP, 5 + i, 13107 + 9830 * i, 32768);+ hakios_touch_post(e->value ? HAKIOS_TOUCH_DOWN : HAKIOS_TOUCH_UP, 5 + i, 13107 + 9830 * i, 32768);}} else if ((button = button_for_key(e->code)) != 0 && e->value < 2) { /* 2 = key repeat */- redwood_touch_post(e->value ? REDWOOD_BUTTON_DOWN : REDWOOD_BUTTON_UP, button, 0, 0);+ hakios_touch_post(e->value ? HAKIOS_BUTTON_DOWN : HAKIOS_BUTTON_UP, button, 0, 0);}break;case EV_SYN:if (d->pressed && !d->touching) {- redwood_touch_post(REDWOOD_TOUCH_DOWN, 0, d->x, d->y);+ hakios_touch_post(HAKIOS_TOUCH_DOWN, 0, d->x, d->y);} else if (d->pressed && d->moved) {- redwood_touch_post(REDWOOD_TOUCH_MOVE, 0, d->x, d->y);+ hakios_touch_post(HAKIOS_TOUCH_MOVE, 0, d->x, d->y);} else if (!d->pressed && d->touching) {- redwood_touch_post(REDWOOD_TOUCH_UP, 0, d->x, d->y);+ hakios_touch_post(HAKIOS_TOUCH_UP, 0, d->x, d->y);}d->touching = d->pressed;d->moved = false;@@ -331,7 +331,7 @@ input_attach(struct input_device *d, int slot)}void-redwood_virtio_input_init(void)+hakios_virtio_input_init(void){uint32_t enabled = 0;vm_offset_t bus;diff --git a/xnu/files/bsd/dev/redwood_virtio_net.c b/xnu/files/bsd/dev/hakios.virtio_net.csimilarity index 96%rename from xnu/files/bsd/dev/redwood_virtio_net.crename to xnu/files/bsd/dev/hakios.virtio_net.cindex 3c4c981..2706ba0 100644--- a/xnu/files/bsd/dev/redwood_virtio_net.c+++ b/xnu/files/bsd/dev/hakios.virtio_net.c@@ -1,5 +1,5 @@/*- * QEMU's virtio network device as the link behind en0 (see sys/redwood_net.h for what a link is).+ * QEMU's virtio network device as the link behind en0 (see sys/hakios.net.h for what a link is).** "-device virtio-net-device" on the virt machine's virtio-mmio bus, which must be the current* one, not "legacy" (-global virtio-mmio.force-legacy=false), with any "-netdev" behind it;@@ -17,7 +17,7 @@#include <net/ethernet.h>#include <pexpert/pexpert.h>#include <sys/kpi_mbuf.h>-#include <sys/redwood_net.h>+#include <sys/hakios.net.h>#include <sys/systm.h>#include <vm/vm_kern.h>@@ -206,7 +206,7 @@ virtio_poll(void)q->seen++;if (length > sizeof(struct virtio_net_header) && length <= BUFFER_SIZE) {- redwood_net_input(q->buffers + (size_t)id * BUFFER_SIZE + sizeof(struct virtio_net_header),+ hakios_net_input(q->buffers + (size_t)id * BUFFER_SIZE + sizeof(struct virtio_net_header),length - sizeof(struct virtio_net_header));}/* give the buffer back */@@ -271,7 +271,7 @@ virtio_net_start(uint8_t address[ETHER_ADDR_LEN])return true;}-static struct redwood_net_link virtio_link = {+static struct hakios_net_link virtio_link = {.name = "QEMU's virtio network device",.address = { 0x02, 'r', 'e', 'd', 'w', 'd' }, /* if the device has none: one "locally administered" */.up = true,@@ -280,14 +280,14 @@ static struct redwood_net_link virtio_link = {};void-redwood_virtio_net_init(void)+hakios_virtio_net_init(void){uint32_t enabled = 0;if (!PE_parse_boot_argn("virtio_net", &enabled, sizeof(enabled)) || !enabled) {return;}- if (!virtio_net_start(virtio_link.address) || !redwood_net_attach(&virtio_link)) {+ if (!virtio_net_start(virtio_link.address) || !hakios_net_attach(&virtio_link)) {printf("net: no network interface\n");}}diff --git a/xnu/files/bsd/dev/redwood_virtio_sound.c b/xnu/files/bsd/dev/hakios.virtio_sound.csimilarity index 94%rename from xnu/files/bsd/dev/redwood_virtio_sound.crename to xnu/files/bsd/dev/hakios.virtio_sound.cindex aafe202..0614978 100644--- a/xnu/files/bsd/dev/redwood_virtio_sound.c+++ b/xnu/files/bsd/dev/hakios.virtio_sound.c@@ -1,14 +1,14 @@/*- * A virtio sound device as the sink of /dev/redwood-audio (see sys/redwood_audio.h).+ * A virtio sound device as the sink of /dev/hakios-audio (see sys/hakios.audio.h).** Under QEMU's "virt" machine a "virtio-sound-device" plays what iOS plays: through the host's* sound system, or into a file ("-audiodev wav"), whichever back end QEMU is given. Like the- * input devices (redwood_virtio_input.c) it sits on the machine's virtio-mmio bus, which must+ * input devices (hakios.virtio_input.c) it sits on the machine's virtio-mmio bus, which must* be the current one, not "legacy". Only with boot-arg virtio_sound=1: the bus address is* QEMU's and means nothing on the phone.** The device has four queues; two are used. Over the control queue its first output stream is- * set to the one format of /dev/redwood-audio and started, once and for good: a started stream+ * set to the one format of /dev/hakios-audio and started, once and for good: a started stream* that is given nothing plays nothing. The samples go out over the transmit queue, a hundredth* of a second to a buffer. The device gives a buffer back when it has played it, which is what* paces us: what does not fit into the buffers waits in a ring, and what does not fit into the@@ -26,7 +26,7 @@#include <mach/mach_types.h>#include <mach/vm_param.h>#include <pexpert/pexpert.h>-#include <sys/redwood_audio.h>+#include <sys/hakios.audio.h>#include <sys/systm.h>#include <vm/vm_kern.h>@@ -118,8 +118,8 @@ struct snd_pcm_status {uint32_t latency_bytes;};-#define PERIOD_FRAMES (REDWOOD_AUDIO_RATE / 100)-#define PERIOD_BYTES (PERIOD_FRAMES * REDWOOD_AUDIO_FRAME)+#define PERIOD_FRAMES (HAKIOS_AUDIO_RATE / 100)+#define PERIOD_BYTES (PERIOD_FRAMES * HAKIOS_AUDIO_FRAME)#define TX_BUFFERS (QUEUE_SIZE / 2) /* two descriptors each: 0.32 s in the device at most */#define RING_FRAMES 16384 /* a power of two: 0.34 s more */#define MAX_STREAMS 8@@ -127,7 +127,7 @@ struct snd_pcm_status {/* one transmit buffer: what the device reads, then what it writes */struct tx_buffer {uint32_t stream_id;- int16_t frames[PERIOD_FRAMES * REDWOOD_AUDIO_CHANNELS];+ int16_t frames[PERIOD_FRAMES * HAKIOS_AUDIO_CHANNELS];struct snd_pcm_status status;};@@ -152,9 +152,9 @@ static uint64_t shared_phys;static struct queue control, tx;static uint32_t stream;-static LCK_GRP_DECLARE(sound_lck_grp, "redwood-virtio-sound");+static LCK_GRP_DECLARE(sound_lck_grp, "hakios-virtio-sound");static LCK_MTX_DECLARE(sound_lock, &sound_lck_grp);-static int16_t ring[RING_FRAMES * REDWOOD_AUDIO_CHANNELS];+static int16_t ring[RING_FRAMES * HAKIOS_AUDIO_CHANNELS];static uint32_t ring_head, ring_tail; /* in frames; play from head, add at tail */static uint16_t tx_free[TX_BUFFERS];static uint32_t tx_free_count;@@ -278,7 +278,7 @@ sound_poll(__unused thread_call_param_t p0, __unused thread_call_param_t p1)lck_mtx_unlock(&sound_lock);}-/* The sink: see sys/redwood_audio.h. */+/* The sink: see sys/hakios.audio.h. */static uint32_tsound_play(const int16_t *frames, uint32_t count){@@ -308,7 +308,7 @@ sound_attach(int slot)uint8_t streams[sizeof(uint32_t) + MAX_STREAMS * SND_PCM_INFO_SIZE]; /* a status word, then the streams */struct snd_query_info query = { .code = SND_R_PCM_INFO, .size = SND_PCM_INFO_SIZE };struct snd_pcm_set_params params = { .code = SND_R_PCM_SET_PARAMS, .buffer_bytes = TX_BUFFERS * PERIOD_BYTES,- .period_bytes = PERIOD_BYTES, .channels = REDWOOD_AUDIO_CHANNELS,+ .period_bytes = PERIOD_BYTES, .channels = HAKIOS_AUDIO_CHANNELS,.format = SND_PCM_FMT_S16, .rate = SND_PCM_RATE_48000 };struct snd_pcm_hdr command = { 0 };uint32_t status, count;@@ -377,7 +377,7 @@ sound_attach(int slot)}void-redwood_virtio_sound_init(void)+hakios_virtio_sound_init(void){uint32_t enabled = 0;vm_offset_t bus;@@ -398,7 +398,7 @@ redwood_virtio_sound_init(void)if (sound_attach(slot)) {printf("virtio-sound: device in slot %d, stream %u\n", slot, stream);poll_call = thread_call_allocate(sound_poll, NULL);- redwood_audio_set_sink("the virtio sound device", sound_play);+ hakios_audio_set_sink("the virtio sound device", sound_play);}return;}diff --git a/xnu/files/bsd/dev/redwood_wifi.c b/xnu/files/bsd/dev/hakios.wifi.csimilarity index 96%rename from xnu/files/bsd/dev/redwood_wifi.crename to xnu/files/bsd/dev/hakios.wifi.cindex 4185611..9e574a5 100644--- a/xnu/files/bsd/dev/redwood_wifi.c+++ b/xnu/files/bsd/dev/hakios.wifi.c@@ -7,7 +7,7 @@* somebody loads it: the application processor puts the signed image -- the phone's own* wpss.mdt and wpss.b02 to wpss.b07, from /vendor/firmware_mnt/image of its Android -- into the* memory reserved for it and asks TrustZone to authenticate and start it, as for the GPU's zap- * shader (redwood_adreno.c). Everything after that is conversation with the running firmware.+ * shader (hakios.adreno.c). Everything after that is conversation with the running firmware.* Its first words go through what this file begins with:** SMEM two megabytes of memory that every processor of the SoC can reach, laid out by the@@ -50,9 +50,9 @@* 13 writes our side of GLINK: the versions, the channel "IPCRTR" opened both ways, our* intents; from here a thread of ours listens to the DSP* 14 talks QRTR on that channel: hello both ways, the services the DSP tells of; a port- * of ours looks the Wi-Fi firmware's service up (sys/redwood_qrtr.h)+ * of ours looks the Wi-Fi firmware's service up (sys/hakios.qrtr.h)* 15 talks to the Wi-Fi firmware's service, what a WCN6750's driver says to it before it- * touches the radio: a stand-in for ath11k's own code, see redwood_wlfw.c+ * touches the radio: a stand-in for ath11k's own code, see hakios.wlfw.c* 16 reads seven words of the radio's registers, where the firmware said they are: only* with wifi_radio_read=1, and only with the firmware in mission mode (outside* it a read there has ended the kernel)@@ -80,7 +80,7 @@** wifi=1 is all of it for whoever uses the phone: the steps that are needed (not the ones that* only look), ath11k as step 15 for real, its station given to the rest of the kernel to ask- * (sys/redwood_sta.h: iOS's Wi-Fi side does, through bsd/dev/redwood_apple80211.c), the network+ * (sys/hakios.sta.h: iOS's Wi-Fi side does, through bsd/dev/hakios.apple80211.c), the network* of fw/network joined if the small image has that file, and everything left running while the* system does -- on a thread of its own, so that the system's start does not wait for it, and* without a word in the log but the outcome (what the steps say is kept, and shown if the radio@@ -106,7 +106,7 @@* wifi_mission=1 step 15 goes on to the configuration and the mode "mission"* wifi_radio_read=1 step 16 does read (2: whatever mode the firmware is in)* wifi_keep=1 when the steps are over the DSP and the link stay up while the system- * runs, for whoever uses sys/redwood_qrtr.h; stopped when the run ends+ * runs, for whoever uses sys/hakios.qrtr.h; stopped when the run ends* wifi_dirty=1 the DSP is not stopped: left as a kernel that died leaves it* wifi_again=1 start the DSP although the one before it was shut down without having* acknowledged a stop: THAT HAS RESET THE PHONE, twice of two@@ -116,18 +116,18 @@* wifi_smmu=2 ... and give that stream a context of the SMMU with page tables of ours,* so that the radio can be shown memory (radio_space_on() below: THE* SMMU IS WRITTEN); taken back when the DSP is stopped- * wifi_mac=A the radio's own address for the driver (redwood_wifi_radio_address()+ * wifi_mac=A the radio's own address for the driver (hakios_wifi_radio_address()* below; xl takes it from a file that is not in the repository)* wifi_scan=1 with wifi_lx=2: once the driver is up, an interface in station mode is* made and the radio scans, listening only; what it heard goes to the log* (other people's networks by name and address: the log is not for* passing on)* wifi_join=1 with wifi_lx=2: the station joins the network named in fw/network of- * the small image (redwood_wifi_network() below) and the driver stays+ * the small image (hakios_wifi_network() below) and the driver stays* up as the link behind en0; with wifi_keep=1 while the system runs,* else until the steps are over (wifi_hold=S: S seconds longer)* wifi_station=1 with wifi_lx=2: the driver stays up and its station is the kernel's to- * ask (sys/redwood_sta.h); nothing is joined by the driver itself+ * ask (sys/hakios.sta.h); nothing is joined by the driver itself* wifi_file=0 with wifi=1: the network of fw/network is not joined at the start* wifi_irq=1 the radio's interrupts (MSI through its SMMU context to the GIC) instead* of looking at its rings every millisecond (lx_bus.c); wifi=1 stands for it@@ -137,7 +137,7 @@* 20 MHz; wifi=1 stands for it* wifi_lx_step=MS the driver's start says each stub it comes to and waits MS there: for* a run that ends without a word (follow it with XL_FOLLOW=2)- * wifi_lx=1 step 15 is ath11k's own instead of the stand-in (redwood_lx.c), with+ * wifi_lx=1 step 15 is ath11k's own instead of the stand-in (hakios.lx.c), with* the radio's registers neither read nor written; 2: for real (which* wants wifi_smmu=2: the radio is given addresses of its rings)* The system does not go on starting until all of this is over, so that the end of the log is@@ -164,9 +164,9 @@#include <vm/memory_types.h>#include <pexpert/pexpert.h>#include <sys/errno.h>-#include <sys/redwood_input.h>-#include <sys/redwood_qrtr.h>-#include <sys/redwood_sta.h>+#include <sys/hakios.input.h>+#include <sys/hakios.qrtr.h>+#include <sys/hakios.sta.h>#include <sys/stat.h>#include <sys/systm.h>#include <vm/vm_kern.h>@@ -179,26 +179,26 @@ extern uint64_t kvtophys(vm_offset_t va); /* pmap_paddr_t */extern void loader_return(void);extern kern_return_t thread_terminate(thread_t thread);-static LCK_GRP_DECLARE(wifi_lock_group, "redwood-wifi");+static LCK_GRP_DECLARE(wifi_lock_group, "hakios-wifi");/*- * What the audio DSP's start (redwood_adsp.c) uses as well, while this may be at work beside it:+ * What the audio DSP's start (hakios.adsp.c) uses as well, while this may be at work beside it:* the mailbox to the always-on processor, one message at a time, and the allocation of items in* the shared memory (whose hardware lock both take under the same number, so it does not keep* the two apart).*/-LCK_MTX_DECLARE(redwood_aop_mailbox_lock, &wifi_lock_group);-LCK_MTX_DECLARE(redwood_smem_alloc_lock, &wifi_lock_group);-LCK_MTX_DECLARE(redwood_rsc_lock, &wifi_lock_group); /* RPMh's sequencer (TCS 0 of the RSC): the audio DSP's and the modem's drivers both ask through it */-/* ... and the sound's (redwood_sound.c): a free match register and context of the SMMU, found and taken */-LCK_MTX_DECLARE(redwood_smmu_lock, &wifi_lock_group);+LCK_MTX_DECLARE(hakios_aop_mailbox_lock, &wifi_lock_group);+LCK_MTX_DECLARE(hakios_smem_alloc_lock, &wifi_lock_group);+LCK_MTX_DECLARE(hakios_rsc_lock, &wifi_lock_group); /* RPMh's sequencer (TCS 0 of the RSC): the audio DSP's and the modem's drivers both ask through it */+/* ... and the sound's (hakios.sound.c): a free match register and context of the SMMU, found and taken */+LCK_MTX_DECLARE(hakios_smmu_lock, &wifi_lock_group);static uint32_t last_step, pause_ms = 2200, fine, watch_seconds = 3;static uint32_t step; /* the one being performed */static uint32_t new_from; /* the first of the steps that have not been seen to work: they wait */static char last_write[96] = "nothing written";-/* As in redwood_adreno.c: every line goes to the log the loader reads from another core as well. */+/* As in hakios.adreno.c: every line goes to the log the loader reads from another core as well. */extern void loader_log_putc(char c);static int say(const char *format, ...) __printflike(1, 2);@@ -209,7 +209,7 @@ static bool leaving; /* on the way back to the loader after a/** With wifi=1 what the steps and the driver say is not for the log of an ordinary session: it is* kept here, the last of it, and shown only if the radio does not come up. What that log is for- * is said with redwood_wifi_tell().+ * is said with hakios_wifi_tell().*/static bool quiet;static char kept[64 * 1024];@@ -257,9 +257,9 @@ say(const char *format, ...)return length;}-/* (for redwood_wlfw.c and the driver's side, which say their lines the same way) */+/* (for hakios.wlfw.c and the driver's side, which say their lines the same way) */int-redwood_wifi_say(const char *format, ...)+hakios_wifi_say(const char *format, ...){char line[400];va_list list;@@ -273,7 +273,7 @@ redwood_wifi_say(const char *format, ...)/* A line for whoever runs the phone, not only for whoever looks for a fault: said also when the rest is kept. */int-redwood_wifi_tell(const char *format, ...)+hakios_wifi_tell(const char *format, ...){char line[400];va_list list;@@ -284,7 +284,7 @@ redwood_wifi_tell(const char *format, ...)say_line(line, true);return 0;}-#define tell redwood_wifi_tell+#define tell hakios_wifi_tell/* The last of what was kept, into the log after all: the radio has not come up. */static void@@ -344,7 +344,7 @@ static volatile bool whole_runs; /* ... and the thread that does it is at* given, unless given otherwise (wifi_irq=0: the rings looked at as before).*/uint32_t-redwood_wifi_option(const char *name)+hakios_wifi_option(const char *name){static const struct {const char *name;@@ -369,7 +369,7 @@ redwood_wifi_option(const char *name)/* ---- register access ------------------------------------------------------------------------------- */-/* One access is one plain load or store (see redwood_adreno.c: the hypervisor carries some of them out). */+/* One access is one plain load or store (see hakios.adreno.c: the hypervisor carries some of them out). */static uint32_t __attribute__((noinline))rd(vm_offset_t address){@@ -874,7 +874,7 @@ step_mailbox(void)/* ---- step 3: RPMh -------------------------------------------------------------------------------------- */-/* dt: reserved-memory cmd_db@80860000: the boot loader's list of what RPMh can switch (cmd-db.c; as in redwood_adreno.c) */+/* dt: reserved-memory cmd_db@80860000: the boot loader's list of what RPMh can switch (cmd-db.c; as in hakios.adreno.c) */#define CMD_DB_PHYS 0x80860000UL#define CMD_DB_SIZE 0x20000UL@@ -1048,7 +1048,7 @@ step_rpmh(void)/* ---- step 4: the supplies themselves ------------------------------------------------------------------- *//*- * The PMIC arbiter, as in redwood_buttons.c: reads go through the "observer" channels, which+ * The PMIC arbiter, as in hakios.buttons.c: reads go through the "observer" channels, which* every system has for every peripheral, whoever owns it. dt: qcom,spmi@c440000; on the bus the* PM7325 is slave 1 and the PM8350C slave 2.*/@@ -1268,13 +1268,13 @@ extern int mdevgetkernelrange(dev_t dev, vm_offset_t *base, uint64_t *size);/** A file of fw/ in the small image that travels with the kernel -- userland/build.sh puts what- * is in fw-wifi/ there --, found in the memory of the RAM disk itself (see redwood_adreno.c).+ * is in fw-wifi/ there --, found in the memory of the RAM disk itself (see hakios.adreno.c).*/-extern const uint8_t *redwood_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);+extern const uint8_t *hakios_image_file(const char *dir, const char *name, uint64_t *size, int *disk_out);static const uint8_t *image_file(const char *name, uint64_t *size){- const uint8_t *data = redwood_image_file("fw", name, size, NULL); /* (redwood_image.c) */+ const uint8_t *data = hakios_image_file("fw", name, size, NULL); /* (hakios.image.c) */if (data != NULL) {return data;@@ -1459,9 +1459,9 @@ step_mailbox_open(void){bool open;- lck_mtx_lock(&redwood_aop_mailbox_lock);+ lck_mtx_lock(&hakios_aop_mailbox_lock);open = step_mailbox_open_locked();- lck_mtx_unlock(&redwood_aop_mailbox_lock);+ lck_mtx_unlock(&hakios_aop_mailbox_lock);return open;}@@ -1533,11 +1533,11 @@ mailbox_send(const char *text)bool sent;if (leaving) {- return mailbox_send_locked(text); /* (one processor left, and no lock taken: see redwood_wifi_quiesce()) */+ return mailbox_send_locked(text); /* (one processor left, and no lock taken: see hakios_wifi_quiesce()) */}- lck_mtx_lock(&redwood_aop_mailbox_lock);+ lck_mtx_lock(&hakios_aop_mailbox_lock);sent = mailbox_send_locked(text);- lck_mtx_unlock(&redwood_aop_mailbox_lock);+ lck_mtx_unlock(&hakios_aop_mailbox_lock);return sent;}@@ -1702,7 +1702,7 @@ dsp_ask_to_stop(uint32_t bound_ms)/* ---- step 8: TrustZone takes the header ---------------------------------------------------------------- */-/* The calls, as in redwood_adreno.c (qcom_scm.c: qcom_scm_pas_*; convention: qcom_scm-smc.c). */+/* The calls, as in hakios.adreno.c (qcom_scm.c: qcom_scm_pas_*; convention: qcom_scm-smc.c). */#define SCM_64 (1ull << 30)#define SCM_SIP (2ull << 24) /* a call of the SoC maker's, not one of the Arm standard */#define SCM_CALL(service, command) ((uint64_t)(service) << 8 | (command))@@ -1770,8 +1770,8 @@ dsp_shutdown(const char *why)printf("wifi: %u: %s: the DSP is asked to stop, then TrustZone to shut it down\n", step, why);if (!leaving) {- redwood_lx_stop(); /* (the driver, if it stayed up: it leaves its network and goes down in order) */- redwood_wlfw_stop(step); /* (what the stand-in of step 15 has to say first, while there is a link) */+ hakios_lx_stop(); /* (the driver, if it stayed up: it leaves its network and goes down in order) */+ hakios_wlfw_stop(step); /* (what the stand-in of step 15 has to say first, while there is a link) */link_stop();}stopped_by_its_word = dsp_ask_to_stop(leaving ? 2000 : 5000);@@ -1819,7 +1819,7 @@ step_header(void)}if (!stopped_by_its_word && !(PE_parse_boot_argn("wifi_again", &again, sizeof(again)) && again)) {printf("wifi: %u: THE DSP IS NOT STARTED AGAIN: it was shut down without having acknowledged a stop, and a start "- "after that has reset the phone (see the top of redwood_wifi.c; wifi_again=1 to try all the same)\n", step);+ "after that has reset the phone (see the top of hakios.wifi.c; wifi_again=1 to try all the same)\n", step);return false;}} else {@@ -1828,7 +1828,7 @@ step_header(void)}announce("hand the image's header to TrustZone to check its signature (image 6), in a page of ours");- /* in memory of ours, page-aligned and in one piece, not touched again and never freed (see redwood_adreno.c) */+ /* in memory of ours, page-aligned and in one piece, not touched again and never freed (see hakios.adreno.c) */if (kmem_alloc(kernel_map, &page, PAGE_SIZE, KMA_KOBJECT | KMA_ZERO | KMA_DATA, VM_KERN_MEMORY_IOKIT) != KERN_SUCCESS) {printf("wifi: %u: no memory\n", step);return false;@@ -1944,9 +1944,9 @@ our_item_make(uint32_t partition){bool made;- lck_mtx_lock(&redwood_smem_alloc_lock);+ lck_mtx_lock(&hakios_smem_alloc_lock);made = our_item_make_locked(partition);- lck_mtx_unlock(&redwood_smem_alloc_lock);+ lck_mtx_unlock(&hakios_smem_alloc_lock);return made;}@@ -2722,11 +2722,11 @@ glink_send(const void *data, uint32_t length)* port: when a link comes up each side says hello, and is told the other's services one by one* ("new server": a service, an instance, a node, a port), and later their going. We are node 1* (Linux's default, and what this phone's Android is); the DSP says who it is in what it sends.- * The interface for the rest of the kernel is sys/redwood_qrtr.h: the four calls at the end of- * this section, handed to the QMI helpers (bsd/dev/redwood_qmi.c), which is what speaks to the+ * The interface for the rest of the kernel is sys/hakios.qrtr.h: the four calls at the end of+ * this section, handed to the QMI helpers (bsd/dev/hakios.qmi.c), which is what speaks to the* services.*/-#define REDWOOD_QRTR_MAX 8192 /* the most a datagram holds, either way */+#define HAKIOS_QRTR_MAX 8192 /* the most a datagram holds, either way */#define QRTR_US 1u#define QRTR_CONTROL 0xfffffffeu /* the control port */#define QRTR_FIRST_PORT 0x4000u /* where Linux begins numbering ports that ask for no number */@@ -2740,10 +2740,10 @@ struct qrtr_control {uint32_t words[4]; /* a server: service, instance, node, port; a client: node, port */};-struct redwood_qrtr_port {+struct hakios_qrtr_port {uint32_t number; /* 0: free */- redwood_qrtr_receive_t receive;- redwood_qrtr_server_t server;+ hakios_qrtr_receive_t receive;+ hakios_qrtr_server_t server;void *context;struct {uint32_t service, instance; /* the instance as on the wire: version | instance << 8; 0: any */@@ -2754,7 +2754,7 @@ struct redwood_qrtr_port {static LCK_MTX_DECLARE(qrtr_lock, &wifi_lock_group); /* the tables below */static LCK_MTX_DECLARE(qrtr_calling, &wifi_lock_group); /* held by the link's thread around a callback */-static struct redwood_qrtr_port qrtr_ports[16];+static struct hakios_qrtr_port qrtr_ports[16];static struct {uint32_t service, instance, node, port;bool there;@@ -2771,7 +2771,7 @@ qrtr_out_packet(uint32_t type, uint32_t from_port, uint32_t to_node, uint32_t tostruct qrtr_header *packet;int error;- if (length == 0 || length > REDWOOD_QRTR_MAX) {+ if (length == 0 || length > HAKIOS_QRTR_MAX) {return EMSGSIZE;}packet = kalloc_data(sizeof(*packet) + padded, Z_WAITOK | Z_ZERO);@@ -2805,7 +2805,7 @@ qrtr_tell(uint32_t service, uint32_t instance, uint32_t node, uint32_t port, boo{for (unsigned p = 0; p < sizeof(qrtr_ports) / sizeof(qrtr_ports[0]); p++) {for (unsigned l = 0; l < 4; l++) {- redwood_qrtr_server_t server = NULL;+ hakios_qrtr_server_t server = NULL;void *context;lck_mtx_lock(&qrtr_lock);@@ -2888,7 +2888,7 @@ static voidqrtr_input(const uint8_t *data, uint32_t length){struct qrtr_header header;- redwood_qrtr_receive_t receive = NULL;+ hakios_qrtr_receive_t receive = NULL;void *context = NULL;uint32_t at;@@ -2955,7 +2955,7 @@ qrtr_fresh(void){for (unsigned p = 0; p < sizeof(qrtr_ports) / sizeof(qrtr_ports[0]); p++) {for (unsigned l = 0; l < 4; l++) {- redwood_qrtr_server_t server;+ hakios_qrtr_server_t server;uint32_t service, instance;void *context;@@ -2980,10 +2980,10 @@ qrtr_fresh(void)}}-static struct redwood_qrtr_port *-qrtr_open(redwood_qrtr_receive_t receive, redwood_qrtr_server_t server, void *context)+static struct hakios_qrtr_port *+qrtr_open(hakios_qrtr_receive_t receive, hakios_qrtr_server_t server, void *context){- struct redwood_qrtr_port *port = NULL;+ struct hakios_qrtr_port *port = NULL;lck_mtx_lock(&qrtr_lock);for (unsigned p = 0; p < sizeof(qrtr_ports) / sizeof(qrtr_ports[0]) && port == NULL; p++) {@@ -3001,16 +3001,16 @@ qrtr_open(redwood_qrtr_receive_t receive, redwood_qrtr_server_t server, void *co}static int-qrtr_send(struct redwood_qrtr_port *port, uint32_t node, uint32_t to, const void *data, size_t length)+qrtr_send(struct hakios_qrtr_port *port, uint32_t node, uint32_t to, const void *data, size_t length){- if (port == NULL || port->number == 0 || length > REDWOOD_QRTR_MAX) {+ if (port == NULL || port->number == 0 || length > HAKIOS_QRTR_MAX) {return EINVAL;}return qrtr_out_packet(QRTR_DATA, port->number, node, to, data, (uint32_t)length);}static int-qrtr_lookup(struct redwood_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance)+qrtr_lookup(struct hakios_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance){int error = ENOSPC;@@ -3029,7 +3029,7 @@ qrtr_lookup(struct redwood_qrtr_port *port, uint32_t service, uint32_t version,}static void-qrtr_close(struct redwood_qrtr_port *port)+qrtr_close(struct hakios_qrtr_port *port){struct qrtr_control gone = { .command = QRTR_DEL_CLIENT, .words = { QRTR_US, port ? port->number : 0 } };bool outside = current_thread() != link_thread_is;@@ -3051,7 +3051,7 @@ qrtr_close(struct redwood_qrtr_port *port)}}-static const struct redwood_qrtr_ops qrtr_ops = { .open = qrtr_open, .send = qrtr_send, .lookup = qrtr_lookup, .close = qrtr_close };+static const struct hakios_qrtr_ops qrtr_ops = { .open = qrtr_open, .send = qrtr_send, .lookup = qrtr_lookup, .close = qrtr_close };/* ---- the link's thread -------------------------------------------------------------------------------- */@@ -3257,7 +3257,7 @@ wlfw_receive(__unused void *context, uint32_t node, uint32_t port, const void *dstatic const uint8_t *image_file(const char *name, uint64_t *size);const uint8_t *-redwood_wifi_file(const char *name, uint64_t *size)+hakios_wifi_file(const char *name, uint64_t *size){return image_file(name, size);}@@ -3347,7 +3347,7 @@ step_driver(uint32_t how)"REGISTERS ARE WRITTEN, by ce.c and hal.c: the copy engines' rings (every write is said as it is made)" :"hand the firmware to ath11k itself: its own exchange up to mission mode; the radio's registers are neither read ""nor written (wifi_lx=1), and nothing is written but datagrams");- error = redwood_lx_start();+ error = hakios_lx_start();radio_space_faults();printf("wifi: %u: the driver's start returns %d\n", step, error);return error == 0;@@ -3361,13 +3361,13 @@ step_exchange(void)if (!glink.open) {return false;}- if ((driver = redwood_wifi_option("wifi_lx")) != 0) {+ if ((driver = hakios_wifi_option("wifi_lx")) != 0) {return step_driver(driver);}announce("have the exchange a WCN6750's driver has with the Wi-Fi firmware's service before it touches the radio, by "- "hand in ath11k's order (redwood_wlfw.c): indications, capabilities both ways, the regulatory database and the "+ "hand in ath11k's order (hakios.wlfw.c): indications, capabilities both ways, the regulatory database and the ""board's data; nothing is written but datagrams");- return redwood_wlfw_exchange(step);+ return hakios_wlfw_exchange(step);}/* ---- step 16: the radio's registers, looked at ------------------------------------------------------- */@@ -3434,13 +3434,13 @@ step_registers(void)uint32_t size = 0, asked = 0;bool mission = false;- if (!redwood_wlfw_registers(&address, &size, &mission) || address > 0xffffffffull || size < 3 * RADIO_WINDOW) {+ if (!hakios_wlfw_registers(&address, &size, &mission) || address > 0xffffffffull || size < 3 * RADIO_WINDOW) {printf("wifi: %u: the firmware has not said where the radio's registers are (step 15)\n", step);return false;}PE_parse_boot_argn("wifi_radio_read", &asked, sizeof(asked));if (asked == 0 || (!mission && asked < 2)) {- printf("wifi: %u: THE RADIO'S REGISTERS (%#llx) ARE NOT READ: %s (see the top of this step in redwood_wifi.c)\n", step,+ printf("wifi: %u: THE RADIO'S REGISTERS (%#llx) ARE NOT READ: %s (see the top of this step in hakios.wifi.c)\n", step,address, asked == 0 ? "not asked for (wifi_radio_read=1)" : "the firmware is not in mission mode (wifi_mission=1), ""and outside it a read there has ended the kernel with a bus error (wifi_radio_read=2 to read all the same)");return false;@@ -3470,7 +3470,7 @@ step_registers(void)static boolstep_qrtr(void){- struct redwood_qrtr_port *port;+ struct hakios_qrtr_port *port;uint32_t ask = 0, seconds = 3, services = 0;if (!glink.open) {@@ -3532,7 +3532,7 @@ step_qrtr(void)* "iommus" of qcom,wcn6750; the SMMU is apps-smmu@15000000, an Arm MMU-500 like the GPU's).* Whether the boot chain leaves that stream passing untranslated, translated or faulting decides* what has to be made before the radio is given an address. This reads the SMMU's global- * registers -- the ones the hypervisor answers for, see redwood_adreno.c -- and says which of+ * registers -- the ones the hypervisor answers for, see hakios.adreno.c -- and says which of* its stream match registers cover that stream. Nothing is written.*/static struct block apps_smmu = { "apps smmu", 0x15000000, 0x2000 };@@ -3586,7 +3586,7 @@ smmu_look(void)/** The boot chain sets nothing up for the radio's stream, and a stream nobody matches faults* (smmu_look()): before the radio can be given the address of a ring, the stream needs a match- * register, a translation context and page tables, as redwood_adreno.c makes them in the GPU's+ * register, a translation context and page tables, as hakios.adreno.c makes them in the GPU's* own SMMU -- there are the formats and the order of programming, and what the hypervisor does* with the global registers. Here they are found rather than known: the first match register* that is not valid, and the lowest context that no valid match register sends a stream@@ -3877,7 +3877,7 @@ radio_space_off(void)}/*- * For the driver (redwood_lx.c): memory of ours that the radio is to see, at the address+ * For the driver (hakios.lx.c): memory of ours that the radio is to see, at the address* returned. Without wifi_smmu=2 it has an address and the radio is shown nothing.*/static bool@@ -3897,26 +3897,26 @@ radio_map(uint64_t physical, uint64_t size, uint64_t attributes, unsigned long l"a context of the SMMU (wifi_smmu=2)\n", step, size >> 10, physical, *address);return true;}- lck_mtx_lock(&redwood_smmu_lock); /* (the sound may be looking for a free context at the same time) */+ lck_mtx_lock(&hakios_smmu_lock); /* (the sound may be looking for a free context at the same time) */if ((!radio_space.found && !radio_space_find()) || !radio_enter(*address, physical, size, attributes)) {- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);return false;}printf("wifi: %u: the radio is to see %llu KB of ours (%#llx) at %#llx\n", step, size >> 10, physical, *address);if (!radio_space.on) {bool on = radio_space_on();- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);return on;}- lck_mtx_unlock(&redwood_smmu_lock);+ lck_mtx_unlock(&hakios_smmu_lock);put(&apps_smmu_context, "tlbiasid", SMMU_CB_TLBIASID, radio_space.context);put(&apps_smmu_context, "tlbsync", SMMU_CB_TLBSYNC, 1);return true;}bool-redwood_wifi_radio_map(uint64_t physical, uint64_t size, unsigned long long *address)+hakios_wifi_radio_map(uint64_t physical, uint64_t size, unsigned long long *address){return radio_map(physical, size, RADIO_PTE, address);}@@ -3927,7 +3927,7 @@ redwood_wifi_radio_map(uint64_t physical, uint64_t size, unsigned long long *add* Once; the GIC's number of the SPI of vector 0 goes to *first_spi.*/bool-redwood_wifi_radio_msi(unsigned long long *address, uint32_t *data, uint32_t *first_spi)+hakios_wifi_radio_msi(unsigned long long *address, uint32_t *data, uint32_t *first_spi){static unsigned long long page;@@ -3966,10 +3966,10 @@ radio_space_try(void)"THE SMMU DID NOT TAKE A CONTEXT FOR THE RADIO'S STREAM");}-/* ---- for the driver (redwood_lx.c): the firmware's processor, and files ------------------------------- */+/* ---- for the driver (hakios.lx.c): the firmware's processor, and files ------------------------------- */bool-redwood_wifi_dsp_is_up(void)+hakios_wifi_dsp_is_up(void){printf("wifi: %u: the driver asks for the firmware's processor: it %s\n", step, dsp_started && glink.open ? "has been up ""since step 11, with the link of step 13" : "IS NOT UP");@@ -3984,7 +3984,7 @@ redwood_wifi_dsp_is_up(void)* firmware's features) are not there.*/const uint8_t *-redwood_wifi_driver_file(const char *name, uint64_t *size)+hakios_wifi_driver_file(const char *name, uint64_t *size){static const char *const files[][2] = { { "board.bin", "bd_m20gl.elf" }, { "regdb.bin", "regdb_xiaomi.bin" } };const char *last = strrchr(name, '/');@@ -4006,7 +4006,7 @@ redwood_wifi_driver_file(const char *name, uint64_t *size)* was, not which.*/bool-redwood_wifi_radio_address(uint8_t *address)+hakios_wifi_radio_address(uint8_t *address){char text[32] = "";uint8_t bytes[6];@@ -4052,7 +4052,7 @@ redwood_wifi_radio_address(uint8_t *address)* loader and printed with a panic. The log says how long the two are, and nothing else of them.*/bool-redwood_wifi_network(uint8_t *name, unsigned *name_length, uint8_t *passphrase, unsigned *passphrase_length)+hakios_wifi_network(uint8_t *name, unsigned *name_length, uint8_t *passphrase, unsigned *passphrase_length){uint64_t size = 0;const uint8_t *file = image_file("network", &size), *end = file + size, *line = file;@@ -4101,13 +4101,13 @@ static bool(*const steps[])(void) = {* end), and when the steps are over: the DSP is stopped (dsp_shutdown()).*/void-redwood_wifi_stop(void)+hakios_wifi_stop(void){/* (a radio that is still on its way up is let get there first, or fail: half a minute at the most) */for (unsigned ms = 0; whole_runs && ms < 40000; ms += 10) {sleep_ms(10);}- redwood_apple80211_summary();+ hakios_apple80211_summary();lck_mtx_lock(&dsp_lock);if (dsp_started && !dirty) {bool down = dsp_shutdown("the run is about to end");@@ -4129,9 +4129,9 @@ redwood_wifi_stop(void)* TrustZone is asked to shut it down.*/void-redwood_wifi_quiesce(void)+hakios_wifi_quiesce(void){- redwood_apple80211_summary(); /* (also when the run is ended from the phone: five fingers) */+ hakios_apple80211_summary(); /* (also when the run is ended from the phone: five fingers) */if (!dsp_started || dirty) {return;}@@ -4140,7 +4140,7 @@ redwood_wifi_quiesce(void)dsp_shutdown("the kernel is on its way back to the loader");}-#define REDWOOD_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin (its "redwood") */+#define HAKIOS_SOC_BASE 0x00400000ul /* where the loader says the phone's peripherals begin (its "redwood") */extern vm_offset_t pe_arm_get_soc_base_phys(void);@@ -4151,7 +4151,7 @@ steps_over(uint32_t done)lck_mtx_lock(&dsp_lock);if (dsp_started && dirty) {printf("wifi: THE DSP IS LEFT RUNNING (wifi_dirty), as a kernel that died would leave it\n");- } else if (dsp_started && done == last_step && redwood_wifi_option("wifi_keep")) {+ } else if (dsp_started && done == last_step && hakios_wifi_option("wifi_keep")) {printf("wifi: THE DSP STAYS ON while the system runs (wifi_keep)%s\n", link_runs ? ", and the link with it" : "");} else if (dsp_started) {dsp_shutdown("the steps are over");@@ -4169,8 +4169,8 @@ steps_over(uint32_t done)static voidjoin_given(uint64_t began){- static struct redwood_sta_join what;- struct redwood_sta_state *state;+ static struct hakios_sta_join what;+ struct hakios_sta_state *state;unsigned name_length = sizeof(what.ssid), passphrase_length = sizeof(what.passphrase);uint64_t size = 0;uint32_t given = 1;@@ -4185,23 +4185,23 @@ join_given(uint64_t began)return;}bzero(&what, sizeof(what));- if (!redwood_wifi_network(what.ssid, &name_length, what.passphrase, &passphrase_length)) {+ if (!hakios_wifi_network(what.ssid, &name_length, what.passphrase, &passphrase_length)) {tell("wifi: the network given in fw/network is not a name and a passphrase: nothing is joined\n");return;}what.ssid_length = (uint8_t)name_length;what.passphrase_length = (uint8_t)passphrase_length;- what.security = REDWOOD_STA_WPA2_PSK;- error = redwood_sta_ask_join_standing(&what);+ what.security = HAKIOS_STA_WPA2_PSK;+ error = hakios_sta_ask_join_standing(&what);bzero(&what, sizeof(what));- for (unsigned waited = 0; error == 0 && redwood_sta_busy() && waited < 300; waited++) {+ for (unsigned waited = 0; error == 0 && hakios_sta_busy() && waited < 300; waited++) {sleep_ms(100);}if ((state = kalloc_data(sizeof(*state), Z_WAITOK)) == NULL) {return;}- redwood_sta_state(state);- if (state->phase == REDWOOD_STA_JOINED) {+ hakios_sta_state(state);+ if (state->phase == HAKIOS_STA_JOINED) {tell("wifi: THE NETWORK OF THE FILE IS JOINED, %llu.%llu s after the kernel began on the radio\n", (now_us() - began) /1000000, (now_us() - began) / 100000 % 10);} else {@@ -4224,7 +4224,7 @@ whole_thread(__unused void *parameter, __unused wait_result_t result)uint32_t done = 0, failed = 0;/* the memory the radio is shown is one piece: taken now, while that is easy to find */- if (redwood_lx_prepare() != 0) {+ if (hakios_lx_prepare() != 0) {tell("wifi: NO MEMORY FOR THE RADIO in one piece: it is not brought up\n");whole_runs = false;thread_terminate(current_thread());@@ -4258,10 +4258,10 @@ whole_thread(__unused void *parameter, __unused wait_result_t result)/** Called while the system starts, before there is a root file system. With wifi_step=N the start- * waits until the steps are over (see redwood_adreno_init()); with wifi=1 it does not.+ * waits until the steps are over (see hakios_adreno_init()); with wifi=1 it does not.*/void-redwood_wifi_init(void)+hakios_wifi_init(void){uint32_t on = 0, back = 0, done = 0;uint64_t size = 0;@@ -4275,18 +4275,18 @@ redwood_wifi_init(void)printf("wifi: wifi=%u is not understood: wifi=1 turns the radio on, wifi_step=N goes the first N steps of that\n", on);return;}- if (pe_arm_get_soc_base_phys() != REDWOOD_SOC_BASE) {+ if (pe_arm_get_soc_base_phys() != HAKIOS_SOC_BASE) {if (last_step != 0 && PE_parse_boot_argn("wifi_lx", &back, sizeof(back)) && back) {/* a check of what is under the driver: it gets as far as finding no firmware to talk to */printf("wifi: this is not the phone; with wifi_lx the driver is started all the same, for what it does before ""it needs a radio\n");- printf("wifi: the driver's start returns %d\n", redwood_lx_start());+ printf("wifi: the driver's start returns %d\n", hakios_lx_start());} else {printf("wifi: wifi=1 and wifi_step=N are for the phone's radio, and this is not the phone\n");}return;}- redwood_qmi_set_transport(&qrtr_ops);+ hakios_qmi_set_transport(&qrtr_ops);if (last_step == 0) {if (image_file("wpss.mdt", &size) == NULL) {printf("wifi: wifi=1, but the radio's firmware is not in the small image (fw-wifi/, see the README): no Wi-Fi\n");@@ -4294,7 +4294,7 @@ redwood_wifi_init(void)}whole = whole_runs = true;quiet = !(PE_parse_boot_argn("wifi_loud", &back, sizeof(back)) && back);- redwood_lx_net_early();+ hakios_lx_net_early();pause_ms = watch_seconds = 0;new_from = STEPS + 1;if (kernel_thread_start(whole_thread, NULL, &thread) != KERN_SUCCESS) {@@ -4318,7 +4318,7 @@ redwood_wifi_init(void)printf("wifi: steps up to %u; those from %u on are new and wait %u ms %s\n", last_step, new_from, pause_ms,fine ? "before every write and call" : "after each announcement");- if ((radio_space.wanted = redwood_wifi_option("wifi_smmu")) != 0) {+ if ((radio_space.wanted = hakios_wifi_option("wifi_smmu")) != 0) {smmu_look();if (radio_space.wanted == 2 && last_step < 15) {uint32_t known_from = new_from;@@ -4350,7 +4350,7 @@ redwood_wifi_init(void)/** What interrupts would take, instead of looking. The buttons want the same (the PMIC arbiter's- * line, see the end of redwood_buttons.c), and the radio will: so the general case first.+ * line, see the end of hakios.buttons.c), and the radio will: so the general case first.** The general case is one shared peripheral interrupt (an "SPI": the interrupt controller's* number for it is 32 more than the device tree's) with a handler. osfmk/arm64/gic_v3_irq.cdiff --git a/xnu/files/bsd/dev/redwood_wlfw.c b/xnu/files/bsd/dev/hakios.wlfw.csimilarity index 95%rename from xnu/files/bsd/dev/redwood_wlfw.crename to xnu/files/bsd/dev/hakios.wlfw.cindex f1e9cf3..c8bba9c 100644--- a/xnu/files/bsd/dev/redwood_wlfw.c+++ b/xnu/files/bsd/dev/hakios.wlfw.c@@ -2,7 +2,7 @@* A STAND-IN, TO BE THROWN AWAY when ath11k's own qmi.c runs here.** Before a WCN6750's driver touches the radio it has an exchange with the Wi-Fi firmware's- * service ("WLFW", on the DSP that redwood_wifi.c starts): it says which indications it wants+ * service ("WLFW", on the DSP that hakios.wifi.c starts): it says which indications it wants* and what the host can do, asks what the firmware and the chip are, sends the regulatory* database and the board's data file in pieces, and is told "init done" and "ready". This file* makes that exchange by hand, in the order and with the values of ath11k's qmi.c for this chip@@ -10,7 +10,7 @@* work of running the real qmi.c is spent: whether this firmware build takes ath11k's messages,* whether it takes the phone's own board file, and what calibration does.*- * It is step 15 of wifi_step=N (redwood_wifi.c), and stops where qmi.c hands over to the rest of the+ * It is step 15 of wifi_step=N (hakios.wifi.c), and stops where qmi.c hands over to the rest of the* driver. Boot-arg wifi_cal=1 adds what qmi.c does with cold-boot calibration switched on.* Boot-arg wifi_mission=1 adds what qmi.c is asked for next (ath11k_qmi_firmware_start()): the* firmware's logging, the configuration, the mode "mission", after which the firmware has the@@ -18,7 +18,7 @@* ath11k's: the copy engines' pipes and the map of services to them are its own tables for this* chip, taken out with the message tables, but the list of shadow registers, which the driver* works out from its rings when it runs, is left out. With that mode the handle stays open- * until redwood_wlfw_stop(), which sends the mode "off" as ath11k does when it stops.+ * until hakios_wlfw_stop(), which sends the mode "off" as ath11k does when it stops.** What the phone said (13 October, firmware WLAN.MSL.1.0.1-01277): every request is answered* with success; the regulatory database goes down in 4 pieces and bd_m20gl.elf in 10; "init@@ -34,33 +34,33 @@* The messages' structures and the tables that describe them are ath11k's own, taken out of its* sources when the kernel is built (tools/mk-wlfw.sh) and not kept anywhere: nothing of them is* in this file. Without them this compiles to a line that says so. The coding itself and the- * transactions are ours (redwood_qmi.c).+ * transactions are ours (hakios.qmi.c).*/#include <kern/clock.h>#include <libkern/libkern.h>#include <pexpert/pexpert.h>#include <sys/errno.h>-#include <sys/redwood_input.h>-#include <sys/redwood_qmi.h>+#include <sys/hakios.input.h>+#include <sys/hakios.qmi.h>#include <sys/systm.h>-#define say redwood_wifi_say+#define say hakios_wifi_say-#if !__has_include("redwood_wlfw_ath11k.h")+#if !__has_include("hakios.wlfw_ath11k.h")bool-redwood_wlfw_registers(__unused uint64_t *address, __unused uint32_t *size, __unused bool *mission)+hakios_wlfw_registers(__unused uint64_t *address, __unused uint32_t *size, __unused bool *mission){return false;}void-redwood_wlfw_stop(__unused uint32_t step)+hakios_wlfw_stop(__unused uint32_t step){}bool-redwood_wlfw_exchange(uint32_t step)+hakios_wlfw_exchange(uint32_t step){say("wifi: %u: THE EXCHANGE IS NOT BUILT IN: ath11k's message descriptions were not there when this kernel was built ""(tools/mk-wlfw.sh, then build again)\n", step);@@ -69,8 +69,8 @@ redwood_wlfw_exchange(uint32_t step)#else-#define REDWOOD_QMI_NO_KERNEL_CONNECT-#include "redwood_wlfw_ath11k.h"+#define HAKIOS_QMI_NO_KERNEL_CONNECT+#include "hakios.wlfw_ath11k.h"#define MODE_COLD_BOOT 7 /* core.h: ATH11K_FIRMWARE_MODE_COLD_BOOT */#define ATH11K_FIRMWARE_MODE_NORMAL 0 /* core.h: the mode "mission" */@@ -98,7 +98,7 @@ now_ms(void)static intwlfw_new_server(struct qmi_handle *qmi, struct qmi_service *service){- int error = redwood_qmi_connect(qmi->sock, service->node, service->port);+ int error = hakios_qmi_connect(qmi->sock, service->node, service->port);say("wifi: %u: the service is at node %u port %u (service %#x, version %u, instance %u)%s\n", wlfw.step, service->node,service->port, service->service, service->version, service->instance, error ? ": CANNOT BE CONNECTED TO" : "");@@ -175,7 +175,7 @@ ask(const char *what, int message, size_t largest, const struct qmi_elem_info *rif (ret < 0) {qmi_txn_cancel(&txn);} else {- ret = redwood_qmi_txn_wait_ms(&txn, ATH11K_QMI_WLANFW_TIMEOUT_MS);+ ret = hakios_qmi_txn_wait_ms(&txn, ATH11K_QMI_WLANFW_TIMEOUT_MS);}}if (ret >= 0 && result->result == QMI_RESULT_SUCCESS_V01) {@@ -191,7 +191,7 @@ ask(const char *what, int message, size_t largest, const struct qmi_elem_info *rsay("wifi: %u: %s (message %#x): THE FIRMWARE REFUSES: result %u, error %u (%#x), after %llu ms\n", wlfw.step, what,message, result->result, result->error, result->error, now_ms() - began);}- ret = redwood_qmi_encode(QMI_REQUEST, (uint16_t)message, 0, request_ei, request, bytes, sizeof(bytes));+ ret = hakios_qmi_encode(QMI_REQUEST, (uint16_t)message, 0, request_ei, request, bytes, sizeof(bytes));for (int at = 0; at < ret && at < 96; at += 24) {char text[3 * 24 + 1] = "";@@ -213,7 +213,7 @@ send_file(const char *what, const char *name, uint8_t type, uint32_t board_id)static struct qmi_wlanfw_bdf_download_req_msg_v01 request;struct qmi_wlanfw_bdf_download_resp_msg_v01 reply;uint64_t size = 0, began = now_ms();- const uint8_t *data = redwood_wifi_file(name, &size);+ const uint8_t *data = hakios_wifi_file(name, &size);uint32_t left, pieces = 0;if (data == NULL || size == 0 || size > 256 * 1024) {@@ -263,7 +263,7 @@ wait_for(volatile bool *flag, uint32_t ms)}bool-redwood_wlfw_registers(uint64_t *address, uint32_t *size, bool *mission)+hakios_wlfw_registers(uint64_t *address, uint32_t *size, bool *mission){*address = registers_at;*size = registers_size;@@ -276,7 +276,7 @@ static bool ask(const char *what, int message, size_t largest, const struct qmi_/* ath11k_qmi_firmware_stop(): the mode "off"; and our handle given up. Before the DSP is stopped, while the link is up. */void-redwood_wlfw_stop(uint32_t step)+hakios_wlfw_stop(uint32_t step){struct qmi_wlanfw_wlan_mode_req_msg_v01 mode;struct qmi_wlanfw_wlan_mode_resp_msg_v01 mode_reply;@@ -364,7 +364,7 @@ mission(void)}bool-redwood_wlfw_exchange(uint32_t step)+hakios_wlfw_exchange(uint32_t step){struct qmi_wlanfw_ind_register_req_msg_v01 indications;struct qmi_wlanfw_ind_register_resp_msg_v01 indications_reply;diff --git a/xnu/files/bsd/miscfs/apfs/apfs_store.c b/xnu/files/bsd/miscfs/apfs/apfs_store.cindex f1a9088..7dce03c 100644--- a/xnu/files/bsd/miscfs/apfs/apfs_store.c+++ b/xnu/files/bsd/miscfs/apfs/apfs_store.c@@ -6,7 +6,7 @@* The data of iOS survives a boot today by being packed into an archive and written into the* phone's flash at a number in a comment: two slots of two gigabytes each at byte 8589934592 of* the partition darwin, straight onto a character device (userland/src/var_store.c,- * bsd/dev/redwood_ufs.c). It works, and its weakness is not the writing but the addressing --+ * bsd/dev/hakios.ufs.c). It works, and its weakness is not the writing but the addressing --* nothing on the medium says those bytes are a store, how long a slot is, or that something else* may not have them. Only the constant does, in two places that have to agree.*diff --git a/xnu/files/bsd/miscfs/apfs/apfs_store.h b/xnu/files/bsd/miscfs/apfs/apfs_store.hindex d59ebb7..959c9be 100644--- a/xnu/files/bsd/miscfs/apfs/apfs_store.h+++ b/xnu/files/bsd/miscfs/apfs/apfs_store.h@@ -10,7 +10,7 @@#include "apfs_write.h"/* The volume this will touch and no other: its name, and the names of the slots in its root. */-#define APFS_STORE_VOLNAME "RedwoodStore"+#define APFS_STORE_VOLNAME "HakiosStore"#define APFS_STORE_SLOTS 2#define APFS_STORE_SLOT0 "slot0"#define APFS_STORE_SLOT1 "slot1"diff --git a/xnu/files/bsd/miscfs/apfs/apfs_vfsops.c b/xnu/files/bsd/miscfs/apfs/apfs_vfsops.cindex 8f0ed38..ae7dfac 100644--- a/xnu/files/bsd/miscfs/apfs/apfs_vfsops.c+++ b/xnu/files/bsd/miscfs/apfs/apfs_vfsops.c@@ -19,8 +19,8 @@#include <sys/sysctl.h>#include <sys/vnode_internal.h>#include <sys/fcntl.h>-#include <sys/redwood_input.h>-#include <sys/redwood_virtio_blk.h>+#include <sys/hakios.input.h>+#include <sys/hakios.virtio_blk.h>#include <sys/proc.h>#include <kern/thread.h>#include <libkern/OSAtomic.h>@@ -458,21 +458,21 @@ apfs_stats_print(void)}}-/* kern.redwood_memory: the kernel's line about memory (osfmk/arm64/loader_return.c), for a job list to keep */-extern void redwood_memory_line(char *buf, size_t len);+/* kern.hakios_memory: the kernel's line about memory (osfmk/arm64/loader_return.c), for a job list to keep */+extern void hakios_memory_line(char *buf, size_t len);static int-sysctl_redwood_memory SYSCTL_HANDLER_ARGS+sysctl_hakios_memory SYSCTL_HANDLER_ARGS{#pragma unused(oidp, arg1, arg2)char line[256];- redwood_memory_line(line, sizeof(line));+ hakios_memory_line(line, sizeof(line));return SYSCTL_OUT(req, line, strlen(line) + 1);}-SYSCTL_PROC(_kern, OID_AUTO, redwood_memory, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_LOCKED,- 0, 0, sysctl_redwood_memory, "A", "where the memory is, in MB");+SYSCTL_PROC(_kern, OID_AUTO, hakios_memory, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_LOCKED,+ 0, 0, sysctl_hakios_memory, "A", "where the memory is, in MB");SYSCTL_PROC(_kern, OID_AUTO, apfs_stats, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_LOCKED,0, 0, sysctl_apfs_stats, "A", "APFS: where the time goes; write to zero it");@@ -1120,7 +1120,7 @@ apfs_mount_common(mount_t mp, vnode_t devvp, vfs_context_t ctx, uint32_t containdev_t rdev = vnode_specrdev(devvp);uint32_t cheap;- am->am_nx.cheap_requests = !redwood_ufs_dev(rdev) && !redwood_virtio_blk_dev(rdev);+ am->am_nx.cheap_requests = !hakios_ufs_dev(rdev) && !hakios_virtio_blk_dev(rdev);if (PE_parse_boot_argn("apfs_cheap", &cheap, sizeof(cheap))) {am->am_nx.cheap_requests = (cheap != 0);}diff --git a/xnu/files/bsd/miscfs/apfs/apfs_vnops.c b/xnu/files/bsd/miscfs/apfs/apfs_vnops.cindex 4169ff6..e879d02 100644--- a/xnu/files/bsd/miscfs/apfs/apfs_vnops.c+++ b/xnu/files/bsd/miscfs/apfs/apfs_vnops.c@@ -1138,7 +1138,7 @@ apfs_vnop_mnomap(__unused struct vnop_mnomap_args *ap)* pieces nobody was reading. Here each file gives it back as soon as it is closed, and* the cache still covers what it is for: the reads of one file, one after another.* (This was first suspected of resetting the phone on long walks; it was not -- memory- * stayed flat throughout -- see redwood_apfs_check.c for what was.)+ * stayed flat throughout -- see hakios.apfs_check.c for what was.)*/static intapfs_vnop_inactive(struct vnop_inactive_args *ap)diff --git a/xnu/files/bsd/miscfs/apfs/apfs_write.c b/xnu/files/bsd/miscfs/apfs/apfs_write.cindex 1abfcf6..8841b0d 100644--- a/xnu/files/bsd/miscfs/apfs/apfs_write.c+++ b/xnu/files/bsd/miscfs/apfs/apfs_write.c@@ -97,7 +97,7 @@* object map -- the bound that holds even if a tree was misread** The bounds are deliberately three deep, after the fashion of the writes into the phone's- * flash (bsd/dev/redwood_ufs.c): the file's own extents say which blocks are its contents, the+ * flash (bsd/dev/hakios.ufs.c): the file's own extents say which blocks are its contents, the* extent-reference tree says the same blocks are that stream's and nobody else's, and a plain* range check refuses anything near the container's own structures whatever the trees said.* Then every block is read back and compared before the next one goes out.@@ -247,7 +247,7 @@ extent_is_ours(struct apfs_btree *er, uint64_t stream_id, uint64_t phys, uint64_* One block out and read back again. A device that says a write went through and then hands* back something else is the one failure no amount of checking above can catch, so every block* is compared before the next goes out -- the same bargain the writes into the phone's flash- * make (bsd/dev/redwood_ufs.c).+ * make (bsd/dev/hakios.ufs.c).*/static intblock_out(struct apfs_nx *nx, uint64_t block, const uint8_t *data, uint8_t *scratch)diff --git a/xnu/files/bsd/sys/hakios.apfs_check.h b/xnu/files/bsd/sys/hakios.apfs_check.hnew file mode 100644index 0000000..5887cee--- /dev/null+++ b/xnu/files/bsd/sys/hakios.apfs_check.h@@ -0,0 +1,11 @@+/*+ * Mount the APFS volume on /dev/rvblk0 and walk it, to compare with what the host reader+ * sees in the same image. Only with boot-arg apfs_check.+ * See bsd/dev/hakios.apfs_check.c.+ */+#ifndef _SYS_HAKIOS_APFS_CHECK_H_+#define _SYS_HAKIOS_APFS_CHECK_H_++void hakios_apfs_check_init(void);++#endif /* _SYS_HAKIOS_APFS_CHECK_H_ */diff --git a/xnu/files/bsd/sys/hakios.audio.h b/xnu/files/bsd/sys/hakios.audio.hnew file mode 100644index 0000000..56db214--- /dev/null+++ b/xnu/files/bsd/sys/hakios.audio.h@@ -0,0 +1,135 @@+/*+ * /dev/hakios-audio: the sound iOS plays, on its way to whatever can make it heard.+ *+ * iOS expects its output devices from Apple's audio drivers through IOAudio2; neither exists+ * here. Instead the audio server (mediaserverd) is given a plug-in of ours that presents one+ * stereo output device, and the plug-in writes what the server has mixed for that device+ * here. In the kernel the samples go to a sink -- a driver for something that plays them --+ * and, if asked for, into a recording that outlives the kernel (see dev/hakios.audio.c).+ *+ * write(): whole frames in the format below. Never blocks: the writer is the audio server's+ * real-time thread, which paces itself (48000 frames a second while anything+ * plays, nothing at all otherwise). What the sink cannot take is dropped.+ */+#ifndef _SYS_HAKIOS_AUDIO_H_+#define _SYS_HAKIOS_AUDIO_H_++#include <stdint.h>++#define HAKIOS_AUDIO_DEVICE "/dev/hakios-audio"++/* The one format: 16-bit signed little-endian samples, left then right. */+#define HAKIOS_AUDIO_RATE 48000+#define HAKIOS_AUDIO_CHANNELS 2+#define HAKIOS_AUDIO_FRAME 4 /* bytes */++/*+ * ioctl(HAKIOS_AUDIO_SET_VOLUME): the speakers' volume, as iOS sets it on the plug-in's volume+ * control -- how many eighths of a dB under the loudest they may play, and whether they are+ * muted (iOS's volume at 0). The loudest is the kernel's to say (on the phone: Android's own+ * level less sound_below, hakios.sound.c); the plug-in only says how far under it.+ */+#include <sys/ioccom.h>++struct hakios_audio_volume {+ uint32_t below; /* eighths of a dB */+ uint32_t muted;+};+#define HAKIOS_AUDIO_SET_VOLUME _IOW('r', 1, struct hakios_audio_volume)++#ifdef KERNEL+#include <stdbool.h>++/*+ * For drivers. A sink is offered frames as they are written and says how many it took (the+ * rest are lost); it is called from the writer's thread and must not wait.+ */+typedef uint32_t (*hakios_audio_sink_t)(const int16_t *frames, uint32_t count);++void hakios_audio_set_sink(const char *name, hakios_audio_sink_t sink);+/* The volume iOS has set last (HAKIOS_AUDIO_SET_VOLUME): false if it has set none; *generation counts the settings. */+bool hakios_audio_volume(uint32_t *below, bool *muted, uint32_t *generation);+void hakios_audio_init(void);+void hakios_virtio_sound_init(void); /* boot-arg virtio_sound=1: QEMU's virtio sound device */+void hakios_speaker_init(void); /* boot-arg speaker_probe=N: a look at the phone's speaker amplifiers */+void hakios_haptic_init(void); /* boot-arg haptic=N: the phone's vibration motor (bsd/dev/hakios.haptic.c) */+void hakios_haptic_quiesce(void); /* its chip back into reset: at the run's end and on a panic's way out */+void hakios_haptic_pretend(uint32_t peak); /* a test's stand-in for iOS's waveform: as if a write of this loudness came */+void hakios_torch_init(void); /* boot-arg torch=N: the phone's flashlight (bsd/dev/hakios.torch.c) */+void hakios_torch_quiesce(void); /* the light off: at the run's end and on a panic's way out */+void hakios_camera_init(void); /* boot-arg cam=N: the phone's cameras (bsd/dev/hakios.camera.c) */+void hakios_camera_quiesce(void); /* whatever of them was switched on, off: at the run's end and on a panic's way out */++/*+ * The phone's speakers (bsd/dev/hakios.speaker.c): its two Awinic amplifiers, set up as+ * Android's driver sets them up, from Android's own configuration file (see there).+ */+bool hakios_speaker_prepare(const uint8_t *acf, uint64_t size); /* found, reset, configured: powered down, muted */+bool hakios_speaker_start(void); /* powered up and unmuted at the lowest volume: only while the I2S clock runs */+bool hakios_speaker_volume(uint32_t below, uint32_t step_ms); /* below Android's level, in eighths of a dB; 6 dB a step */+bool hakios_speaker_healthy(void); /* no fault reported; on one, both are powered down at once */+void hakios_speaker_stop(void); /* faded out, muted, powered down, in Android's order */+void hakios_speaker_quiesce(void); /* powered down at once, without sleeping: on a panic's way out */+/* the amplifiers' own temperature and battery voltage read (every second while they play): the reduction they call for */+uint32_t hakios_speaker_monitor(bool tell);++/*+ * The speakers' guard (bsd/dev/hakios.guard.c): what the samples go through in the feeder on their+ * way to the amplifiers, for want of the DSP's speaker protection. Levels in eighths of a dB.+ */+#define HAKIOS_GUARD_SILENT 0xffffffffu /* the amplifiers are off: nothing reaches the speakers */+struct hakios_guard_report {+ uint32_t blocks, rms_blocks, fast_blocks, slow_blocks; /* blocks done, and in how many each average held the level down */+ uint32_t limited_frames; /* frames in which the peak limiter turned the level down */+ uint32_t peak_in, peak_out; /* the largest sample that came in and that went out */+ uint32_t least_peak_gain; /* the peak limiter's least gain, in 1/65536 */+ uint64_t least_gain, gain; /* the power guard's (with the monitor's) least gain and the latest, Q30 */+ uint64_t rms, fast, slow; /* the averages now, the louder speaker's: Q30 of a full-scale square wave at Android's level */+};+#define HAKIOS_GUARD_MAX_GAIN (12 * 8) /* the most gain before the guard: 12 dB */+void hakios_guard_configure(bool hpf, uint32_t gain); /* the high-pass filter; `gain' before everything */+void hakios_guard_attenuation(uint32_t below); /* the amplifiers' level under Android's (or HAKIOS_GUARD_SILENT):+ * what the limits are reckoned from */+void hakios_guard_monitor(uint32_t below); /* a reduction asked for by hakios_speaker_monitor() */+void hakios_guard_process(int16_t *frames, uint32_t count); /* stereo frames, in place */+void hakios_guard_take_report(struct hakios_guard_report *report); /* what happened since the last call */+int hakios_guard_decibels(uint64_t ratio); /* 10 log10 of a Q30 ratio, in tenths of a dB */+/* boot-arg rec_sound_fed=1: the recording (rec_sound=N) has what the guard let through instead of what iOS wrote */+bool hakios_audio_recording_fed(void);+void hakios_audio_record_fed(const int16_t *frames, uint32_t count);++/*+ * The audio DSP's services, for the sound's path (bsd/dev/hakios.adsp.c, bsd/dev/hakios.sound.c).+ * hakios_adsp_apr() sends one APR packet to a service of the DSP (AFE 4, ASM 7, ADM 8) with the+ * given port and token (0: one of its own) and, with wait_ms, waits for the packet that carries+ * that token back. What is not waited for goes to the handler of events, if there is one and it+ * takes it (returns true). The handler is called on the link's thread and must not wait.+ */+struct hakios_apr_answer {+ uint32_t opcode, token, length; /* length: of the payload, in bytes */+ uint32_t words[64];+};+typedef bool (*hakios_apr_events_t)(uint8_t service, uint16_t port, uint32_t opcode, uint32_t token, const uint32_t *payload,+ uint32_t length);++bool hakios_adsp_apr(uint8_t service, uint16_t port, uint32_t token, uint32_t opcode, const void *payload, uint32_t length,+ uint32_t wait_ms, struct hakios_apr_answer *answer);+void hakios_adsp_apr_events(hakios_apr_events_t handler);+const uint8_t *hakios_adsp_fw_file(const char *name, uint64_t *size); /* /fw/name, read whole; give back with: */+void hakios_adsp_fw_free(const uint8_t *data, uint64_t size);++void hakios_sound_dsp_up(void); /* the DSP's audio services are up (adsp=1): boot-arg sound=N begins */+void hakios_sound_dsp_down(void); /* before the DSP is shut down at the run's end: everything of the sound's stopped */+void hakios_sound_quiesce(void); /* on a panic's way out: the amplifiers off, without sleeping */+/* the microphones' part of the memory the DSP sees (hakios.sound.c): false if it cannot be had; given back with _put() */+bool hakios_audio_dsp_memory(uintptr_t *memory, uint64_t *dsp_address, uint32_t *bytes);+void hakios_audio_dsp_memory_put(void);+/* a second handler of the DSP's events (the microphones'), asked when the first does not take one */+void hakios_adsp_apr_events_second(hakios_apr_events_t handler);+/* boot-arg rec_sound_mic=1: the recording (rec_sound=N) has what the microphone hears (given with hakios_audio_record_fed()) */+bool hakios_audio_recording_mic(void);+void hakios_mic_dsp_up(void); /* the DSP's audio services are up (adsp=1): boot-arg mic=N begins */+void hakios_mic_dsp_down(void); /* before the DSP is shut down at the run's end: what the microphones' path asked for given back */+#endif++#endif /* _SYS_HAKIOS_AUDIO_H_ */diff --git a/xnu/files/bsd/sys/redwood_camera.h b/xnu/files/bsd/sys/hakios.camera.hsimilarity index 67%rename from xnu/files/bsd/sys/redwood_camera.hrename to xnu/files/bsd/sys/hakios.camera.hindex 9cbd416..a5acde0 100644--- a/xnu/files/bsd/sys/redwood_camera.h+++ b/xnu/files/bsd/sys/hakios.camera.h@@ -1,25 +1,25 @@/*- * /dev/redwood-camera: the phone's wide camera for iOS (boot-arg cam=5; bsd/dev/redwood_camera.c).+ * /dev/hakios-camera: the phone's wide camera for iOS (boot-arg cam=5; bsd/dev/hakios.camera.c).** open() the first one powers the sensor up and starts its frames (the sensor's mode: boot-arg* cam_mode, else the module file's 4000x3000 one); the last close puts everything down* again, and so does a second without a read.* read() waits (at most a second) for the newest frame not read yet: a struct- * redwood_camera_frame, then as many of the frame's bytes as the buffer has room for.+ * hakios_camera_frame, then as many of the frame's bytes as the buffer has room for.* A buffer of the header's size learns the frame's size and nothing else is copied.* EIO when the camera has had a fault: it stays off for the rest of the run.- * write() commands: a struct redwood_camera_command, then what it says follows.+ * write() commands: a struct hakios_camera_command, then what it says follows.*/-#ifndef _SYS_REDWOOD_CAMERA_H_-#define _SYS_REDWOOD_CAMERA_H_+#ifndef _SYS_HAKIOS_CAMERA_H_+#define _SYS_HAKIOS_CAMERA_H_#include <stdint.h>-#define REDWOOD_CAMERA_DEVICE "/dev/redwood-camera"-#define REDWOOD_CAMERA_MAGIC "RWFRAME1"+#define HAKIOS_CAMERA_DEVICE "/dev/hakios-camera"+#define HAKIOS_CAMERA_MAGIC "RWFRAME1"-struct redwood_camera_frame {- char magic[8]; /* REDWOOD_CAMERA_MAGIC */+struct hakios_camera_frame {+ char magic[8]; /* HAKIOS_CAMERA_MAGIC */uint32_t header_bytes; /* this structure's size: the frame's bytes follow */uint32_t width, height; /* pixels */uint32_t stride; /* bytes from one line to the next */@@ -38,26 +38,26 @@ struct redwood_camera_frame {uint32_t frame_lines_max; /* the longest frame it may be given */uint32_t margin; /* exposure_lines is at most frame_lines - margin */uint32_t sensor; /* which: 0 the macro, 1 the wide, 2 the front, 3 the ultra-wide camera */- uint32_t focus; /* the lens's position as last set, 0 (the furthest) to 1023: REDWOOD_CAMERA_NO_FOCUS where it+ uint32_t focus; /* the lens's position as last set, 0 (the furthest) to 1023: HAKIOS_CAMERA_NO_FOCUS where it* has no motor (or it does not answer) */uint32_t reserved[5];};-#define REDWOOD_CAMERA_NO_FOCUS 0xffffffffu+#define HAKIOS_CAMERA_NO_FOCUS 0xffffffffuenum {- REDWOOD_CAMERA_EXPOSURE = 1, /* a: lines, b: gain, c: frame lines (0: the shortest that holds the exposure) */- REDWOOD_CAMERA_KEEP = 2, /* a picture for the host: a width, b height, c stride, d format (1 the frame's RAW10, 2 NV12,+ HAKIOS_CAMERA_EXPOSURE = 1, /* a: lines, b: gain, c: frame lines (0: the shortest that holds the exposure) */+ HAKIOS_CAMERA_KEEP = 2, /* a picture for the host: a width, b height, c stride, d format (1 the frame's RAW10, 2 NV12,* 3 BGRA); bytes follow */- REDWOOD_CAMERA_SENSOR = 3, /* another sensor: a which (as in the frames' header), b its mode (~0: the usual one);+ HAKIOS_CAMERA_SENSOR = 3, /* another sensor: a which (as in the frames' header), b its mode (~0: the usual one);* the frames stop, everything goes down, and the next read starts the other one */- REDWOOD_CAMERA_FOCUS = 4, /* the lens to a: 0 (the furthest) to 1023, from the next frame or so */+ HAKIOS_CAMERA_FOCUS = 4, /* the lens to a: 0 (the furthest) to 1023, from the next frame or so */};-struct redwood_camera_command {+struct hakios_camera_command {uint32_t command;uint32_t bytes; /* of what follows this structure */uint32_t a, b, c, d;};-#endif /* _SYS_REDWOOD_CAMERA_H_ */+#endif /* _SYS_HAKIOS_CAMERA_H_ */diff --git a/xnu/files/bsd/sys/hakios.input.h b/xnu/files/bsd/sys/hakios.input.hnew file mode 100644index 0000000..7e8ce82--- /dev/null+++ b/xnu/files/bsd/sys/hakios.input.h@@ -0,0 +1,125 @@+/*+ * /dev/hakios-touch: touch samples on their way from whoever produces them to the+ * program that turns them into HID events for the window server.+ *+ * iOS expects touches from Apple's multitouch driver through IOHIDFamily; neither exists+ * here. Instead a producer -- a kernel driver for a real touch controller or for an emulated+ * pointer, or a user program replaying a script -- posts samples, and code of ours running+ * inside backboardd reads them and synthesizes the events. Both sides use the same record.+ *+ * write(): one or more records (time is ignored; the kernel stamps them)+ * read(): blocks until there is at least one record, returns as many whole ones as fit+ */+#ifndef _SYS_HAKIOS_INPUT_H_+#define _SYS_HAKIOS_INPUT_H_++#include <stdint.h>++#define HAKIOS_TOUCH_DEVICE "/dev/hakios-touch"++#define HAKIOS_TOUCH_DOWN 1 /* a finger has landed */+#define HAKIOS_TOUCH_MOVE 2+#define HAKIOS_TOUCH_UP 3 /* it has lifted (x, y: where it was last) */+#define HAKIOS_BUTTON_DOWN 4 /* a hardware button; `finger` says which (HAKIOS_BUTTON_*), x and y are 0 */+#define HAKIOS_BUTTON_UP 5++#define HAKIOS_BUTTON_LOCK 1 /* the side button */+#define HAKIOS_BUTTON_VOLUME_UP 2+#define HAKIOS_BUTTON_VOLUME_DOWN 3+#define HAKIOS_BUTTON_HOME 4++struct hakios_touch {+ uint64_t time; /* mach_absolute_time() when the sample was posted */+ uint32_t type; /* HAKIOS_TOUCH_* or HAKIOS_BUTTON_DOWN/UP */+ uint32_t finger; /* which finger, from 0 (or which button) */+ uint32_t x, y; /* position on the display, 0 = left/top edge, 65535 = right/bottom edge */+};++#ifdef KERNEL+/* For drivers; not from interrupt context. */+void hakios_touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y);+void hakios_input_init(void);+void hakios_virtio_input_init(void); /* boot-arg virtio_input=1: QEMU's virtio pointer and keyboard */+void hakios_goodix_init(void); /* boot-arg touchscreen=1: the phone's Goodix or FocalTech touch screen */+void hakios_buttons_init(void); /* boot-arg buttons=1: the phone's power and volume keys */+void hakios_ufs_init(void); /* ufs=2 to xnuloader: the phone's storage, read only, through the loader (ufs_shared_pa=) */+void hakios_ufs_report(const char *when); /* where reading the storage has spent its time so far */+bool hakios_ufs_dev(dev_t dev); /* one of the storage's devices */+int hakios_ufs_read_partition(const char *name, uint64_t offset, uint8_t *dst, uint64_t len, uint64_t *bytes); /* for drivers */+void hakios_battery_init(void); /* boot-arg battery=1: Qualcomm UEFI charger state shared by xnuloader */+int hakios_battery_temperature(void); /* the battery's temperature in C, -273 while it is not known */+/* one transfer at a time through the PMIC arbiter for this system (bsd/dev/hakios.buttons.c) */+void hakios_spmi_lock(void);+void hakios_spmi_unlock(void);+/*+ * How the battery is, as the audio DSP's battery manager says (bsd/dev/hakios.adsp.c, with adsp=1):+ * handed to bsd/dev/hakios.battery.c, which keeps it for the sysctls kern.hakios.battery_* and+ * passes it on to iokit/Kernel/hakios.battery.cpp, the power source that iOS reads. The structure+ * is repeated there (this header is not seen from iokit/), and `size` tells whether the two agree.+ */+struct hakios_battery_state {+ uint32_t size; /* sizeof(struct hakios_battery_state) */+ int32_t percent_hundredths; /* the charge, 0..10000 */+ int32_t voltage_uv;+ int32_t current_ua; /* more than 0 while the battery takes charge */+ int32_t temperature_hundredths; /* of a degree Celsius */+ int32_t present; /* 1 if there is a battery */+ int32_t external; /* 1 if a charger or a computer is on the USB port */+ int32_t status; /* Linux's POWER_SUPPLY_STATUS_*: 1 charging, 2 discharging, 3 not charging, 4 full */+ int32_t charge_uah, full_uah, design_uah, cycles; /* 0 when not known (yet) */+ int32_t usb_type; /* Linux's POWER_SUPPLY_USB_TYPE_*: 1 a computer's port, 2 a charger, ... */+ int32_t usb_voltage_uv, usb_current_ua; /* what the port gives */+};+void hakios_battery_report(const struct hakios_battery_state *state);+void hakios_net_init(void); /* en0, if there is something to carry its frames: sys/hakios.net.h */+void hakios_cpufreq_init(void); /* boot-arg cpufreq=1: the phone's processor at full speed */+void hakios_adreno_init(void); /* boot-arg adreno=N: the first N steps of waking the phone's GPU */+void hakios_adreno_quiesce(void); /* on the way back to the loader: the GPU block stopped, out of our memory */+void hakios_adreno_stop(void); /* before that, where the ending is no panic's: the GPU given back in order */+void hakios_adreno_minute(void); /* once a minute: a line about how warm the GPU is, if it is in use */+void hakios_wifi_init(void); /* boot-arg wifi=1: the phone's Wi-Fi; wifi_step=N: the first N steps of it */+void hakios_adsp_init(void); /* boot-arg adsp=1: the phone's audio DSP started and linked; adsp_step=N: the first N steps */+void hakios_mpss_init(void); /* boot-arg modem=1: the phone's modem started and linked; modem_step=N: the first N steps */+void hakios_wifi_stop(void); /* where a run ends in order: the Wi-Fi DSP, if it was started, shut down */+int hakios_wifi_say(const char *format, ...) __printflike(1, 2); /* a line of the Wi-Fi steps' log */+int hakios_wifi_tell(const char *format, ...) __printflike(1, 2); /* ... one that is said even with wifi=1 */+uint32_t hakios_wifi_option(const char *name); /* a boot-arg's number, or what wifi=1 stands for */+const uint8_t *hakios_wifi_file(const char *name, uint64_t *size); /* a file of fw/ in the small image, in place */+bool hakios_wlfw_exchange(uint32_t step); /* step 15 of wifi_step=N: hakios.wlfw.c */+bool hakios_wlfw_registers(uint64_t *address, uint32_t *size, bool *mission); /* ... and what it learnt for step 16 */+void hakios_wlfw_stop(uint32_t step); /* ... and its end, before the DSP is stopped */+void hakios_wifi_quiesce(void); /* on the way back to the loader: the Wi-Fi DSP, if it still runs, shut down */+/* ath11k's object and the kernel's side of it (bsd/dev/hakios.lx.c), and what that asks of the phone's radio */+int hakios_lx_start(void); /* the driver brought up on the radio as far as it is built: 0 or an errno */+void hakios_lx_stop(void); /* ... and down again, if it stayed up (a network joined) */+int hakios_lx_prepare(void); /* before all that: the memory the radio will be shown, taken; 0 or an errno */+void hakios_lx_net_early(void); /* ... and en0 made on the radio now, if the kernel was given its address */+bool hakios_wifi_dsp_is_up(void); /* the DSP that runs the radio's firmware has been started and has a link */+const uint8_t *hakios_wifi_driver_file(const char *name, uint64_t *size); /* a file by the name Linux has for it */+bool hakios_wifi_radio_map(uint64_t physical, uint64_t size, unsigned long long *address); /* memory shown to the radio */+bool hakios_wifi_radio_msi(unsigned long long *address, uint32_t *data, uint32_t *first_spi); /* where the radio raises its interrupts */+bool hakios_wifi_radio_address(uint8_t *address); /* the radio's own address (boot-arg wifi_mac), if one was given */+/* the network to join (fw/network of the small image): name and passphrase, buffer sizes in and lengths out */+bool hakios_wifi_network(uint8_t *name, unsigned *name_length, uint8_t *passphrase, unsigned *passphrase_length);++/*+ * The GPU kept on (boot-arg adreno_keep=1), for iokit/Kernel/hakios.gpu.cpp: see "the GPU kept on"+ * in bsd/dev/hakios.adreno.c. One caller at a time.+ */+bool hakios_gpu_ready(void);+bool hakios_gpu_parameter(uint32_t which, uint64_t *value);+uint64_t hakios_gpu_address(uint64_t size);+void hakios_gpu_address_free(uint64_t address, uint64_t size);+bool hakios_gpu_map(uint64_t address, uint64_t phys, bool read_only);+void hakios_gpu_mapped(void);+void hakios_gpu_unmap(uint64_t address, uint64_t size);+void hakios_gpu_to_memory(void *start, uint64_t size);+uint32_t hakios_gpu_submit(const uint64_t *addresses, const uint32_t *words, uint32_t count);+bool hakios_gpu_done(uint32_t fence);+uint32_t hakios_gpu_last(void);+void hakios_gpu_worked(uint64_t *microseconds, uint32_t *submissions, uint32_t by[7]);+void hakios_gpu_report(const char *why);+void hakios_gpu_stop(void);+#endif++#endif /* _SYS_HAKIOS_INPUT_H_ */diff --git a/xnu/files/bsd/sys/redwood_lx.h b/xnu/files/bsd/sys/hakios.lx.hsimilarity index 93%rename from xnu/files/bsd/sys/redwood_lx.hrename to xnu/files/bsd/sys/hakios.lx.hindex ef79d87..196c23c 100644--- a/xnu/files/bsd/sys/redwood_lx.h+++ b/xnu/files/bsd/sys/hakios.lx.h@@ -1,19 +1,19 @@/** The whole of what the Wi-Fi driver's object asks of the kernel it is linked into. That object* (tools/mk-ath11k.sh in the repository: Linux's ath11k on FreeBSD's LinuxKPI headers and our- * wifi/lx) is compiled as FreeBSD kernel code, bsd/dev/redwood_lx.c on this side as XNU's;+ * wifi/lx) is compiled as FreeBSD kernel code, bsd/dev/hakios.lx.c on this side as XNU's;* neither sees the other's headers, so nothing but C's own types crosses (and the station- * boundary's, redwood_sta.h, which is written for both). Everything the+ * boundary's, hakios.sta.h, which is written for both). Everything the* driver's side knows of locks, timers, work queues and buffers is built in wifi/lx/src on the* few calls here.** Threads: the driver's code runs on threads made by lx_os_thread() and on the kernel's own* threads that call into it; never in an interrupt.*/-#ifndef _SYS_REDWOOD_LX_H_-#define _SYS_REDWOOD_LX_H_+#ifndef _SYS_HAKIOS_LX_H_+#define _SYS_HAKIOS_LX_H_-#include "redwood_sta.h"+#include "hakios.sta.h"/* ---- memory ---- */void *lx_os_alloc(unsigned long size); /* zeroed; NULL when there is none */@@ -83,8 +83,8 @@ void lx_os_irq_disable(unsigned vector); /* returns when its function is notvoid lx_os_irq_detach_all(void); /* returns when no function is running */unsigned long long lx_os_irq_count(unsigned vector); /* how many have arrived */-/* ---- the station: scanning and joining, for whoever asks the kernel (redwood_sta.h) ---- */-void lx_os_station(const struct redwood_sta_ops *ops); /* here it is, to be asked; NULL: no longer (returns when no call is under way) */+/* ---- the station: scanning and joining, for whoever asks the kernel (hakios.sta.h) ---- */+void lx_os_station(const struct hakios_sta_ops *ops); /* here it is, to be asked; NULL: no longer (returns when no call is under way) */void lx_os_station_lost(int error); /* the network joined is gone by itself *//*diff --git a/xnu/files/bsd/sys/redwood_nas.h b/xnu/files/bsd/sys/hakios.nas.hsimilarity index 59%rename from xnu/files/bsd/sys/redwood_nas.hrename to xnu/files/bsd/sys/hakios.nas.hindex 0315bea..f846003 100644--- a/xnu/files/bsd/sys/redwood_nas.h+++ b/xnu/files/bsd/sys/hakios.nas.h@@ -1,12 +1,12 @@/* Minimal, transport-independent QMI NAS network state for cellular UI clients. */-#ifndef _SYS_REDWOOD_NAS_H_-#define _SYS_REDWOOD_NAS_H_+#ifndef _SYS_HAKIOS_NAS_H_+#define _SYS_HAKIOS_NAS_H_#include <stdbool.h>#include <stddef.h>#include <stdint.h>-struct redwood_nas_state {+struct hakios_nas_state {bool registered;bool has_signal;uint8_t radio_interface; /* QMI NAS: 4 GSM, 5 UMTS, 8 LTE, 12 NR */@@ -17,18 +17,18 @@ struct redwood_nas_state {};/* Apply one complete QMI NAS frame. 1: state changed; 0: ignored; -1: malformed. */-int redwood_nas_apply(struct redwood_nas_state *state, const void *frame, size_t length);+int hakios_nas_apply(struct hakios_nas_state *state, const void *frame, size_t length);-struct redwood_qrtr_ops;-struct redwood_qrtr_port;+struct hakios_qrtr_ops;+struct hakios_qrtr_port;/* One NAS service client on a specified processor's QRTR transport. Callbacks are serialized* by that transport; the caller must synchronize a state read on any other thread. */-struct redwood_nas_client {- const struct redwood_qrtr_ops *transport;- struct redwood_qrtr_port *port;- struct redwood_nas_state state;- void (*changed)(void *context, const struct redwood_nas_state *state);+struct hakios_nas_client {+ const struct hakios_qrtr_ops *transport;+ struct hakios_qrtr_port *port;+ struct hakios_nas_state state;+ void (*changed)(void *context, const struct hakios_nas_state *state);void *context;uint32_t peer_node, peer_port;uint16_t transaction;@@ -36,10 +36,10 @@ struct redwood_nas_client {bool connected;};-int redwood_nas_client_open(struct redwood_nas_client *client, const struct redwood_qrtr_ops *transport,- void (*changed)(void *, const struct redwood_nas_state *), void *context);+int hakios_nas_client_open(struct hakios_nas_client *client, const struct hakios_qrtr_ops *transport,+ void (*changed)(void *, const struct hakios_nas_state *), void *context);/* Get Serving System and Get Signal Info. Poll regularly until indications are configured. */-int redwood_nas_client_poll(struct redwood_nas_client *client);-void redwood_nas_client_close(struct redwood_nas_client *client);+int hakios_nas_client_poll(struct hakios_nas_client *client);+void hakios_nas_client_close(struct hakios_nas_client *client);#endifdiff --git a/xnu/files/bsd/sys/redwood_net.h b/xnu/files/bsd/sys/hakios.net.hsimilarity index 61%rename from xnu/files/bsd/sys/redwood_net.hrename to xnu/files/bsd/sys/hakios.net.hindex 41550ce..02e00df 100644--- a/xnu/files/bsd/sys/redwood_net.h+++ b/xnu/files/bsd/sys/hakios.net.h@@ -1,37 +1,37 @@/** en0, and what stands behind it.*- * The network interface iOS uses here is made in bsd/dev/redwood_net.c with the kernel's own+ * The network interface iOS uses here is made in bsd/dev/hakios.net.c with the kernel's own* interface KPI: Ethernet as far as the rest of the kernel and user space can tell. What carries* the frames is a "link", a driver of its own that knows nothing about interfaces: QEMU's virtio- * network device today (bsd/dev/redwood_virtio_net.c), the phone's radio or frames carried over+ * network device today (bsd/dev/hakios.virtio_net.c), the phone's radio or frames carried over* the boot loader's USB channel tomorrow. This is all the two know of each other.** A link driver- * - fills in a struct redwood_net_link and calls redwood_net_attach() once, when it is ready+ * - fills in a struct hakios_net_link and calls hakios_net_attach() once, when it is ready* to carry frames (for a radio: when its firmware is up, not when it has joined a network);- * - hands every frame that arrives to redwood_net_input(): from its own thread, or from+ * - hands every frame that arrives to hakios_net_input(): from its own thread, or from* the poll function the interface's thread calls for it. Not from interrupt context;- * - says with redwood_net_link_state() when frames can pass and when they no longer can+ * - says with hakios_net_link_state() when frames can pass and when they no longer can* (the cable, or for a radio: associated and the keys set). configd starts DHCP on that.* A frame is what goes over an Ethernet cable without the checksum at its end: destination,- * source, type, payload; at most REDWOOD_NET_FRAME_MAX bytes. A radio whose frames are 802.11+ * source, type, payload; at most HAKIOS_NET_FRAME_MAX bytes. A radio whose frames are 802.11* converts in its driver (or has its firmware do it: "Ethernet decap/encap").*/-#ifndef _SYS_REDWOOD_NET_H_-#define _SYS_REDWOOD_NET_H_+#ifndef _SYS_HAKIOS_NET_H_+#define _SYS_HAKIOS_NET_H_#ifdef KERNEL#include <sys/kpi_mbuf.h>-#define REDWOOD_NET_FRAME_MAX 1514+#define HAKIOS_NET_FRAME_MAX 1514-struct redwood_net_link {+struct hakios_net_link {const char * name; /* for the log */uint8_t address[6]; /* the interface's Ethernet address */bool wireless; /* the interface is told to be Wi-Fi (its "subfamily"), which is how the* network stack and configd tell a radio from a cable */- bool up; /* frames can pass from the start (else: wait for redwood_net_link_state()) */+ bool up; /* frames can pass from the start (else: wait for hakios_net_link_state()) *//** Send one frame: a chain of mbufs, `length` bytes in all, the Ethernet header first. The* packet stays the caller's: copy it (mbuf_copydata()). Returns false if it had to be dropped.@@ -39,7 +39,7 @@ struct redwood_net_link {*/bool (*transmit)(mbuf_t packet, size_t length);/*- * Optional. Look whether frames have arrived and call redwood_net_input() for each; returns+ * Optional. Look whether frames have arrived and call hakios_net_input() for each; returns* how many there were. The interface's thread calls it every 2 ms while frames are coming and* every 10 ms when none has for a while. A link that has a thread or an interrupt of its own* leaves it NULL.@@ -48,16 +48,16 @@ struct redwood_net_link {};/* Make en0 on top of that link (the structure must stay). One link, once: false if there is one already. */-bool redwood_net_attach(const struct redwood_net_link *link);+bool hakios_net_attach(const struct hakios_net_link *link);/* A frame has arrived. Copied; the buffer is the caller's again on return. */-void redwood_net_input(const uint8_t *frame, size_t length);+void hakios_net_input(const uint8_t *frame, size_t length);/* Frames can pass now / can no longer pass. */-void redwood_net_link_state(bool up);+void hakios_net_link_state(bool up);-void redwood_net_init(void); /* the links there are: each looks for its hardware (or its boot-arg) */-/* an Apple80211 request (SIOCGA80211, SIOCSA80211) for the interface of a radio: redwood_apple80211.c */-errno_t redwood_apple80211_ioctl(u_long command, void *data);-void redwood_virtio_net_init(void); /* boot-arg virtio_net=1: QEMU's virtio network device */+void hakios_net_init(void); /* the links there are: each looks for its hardware (or its boot-arg) */+/* an Apple80211 request (SIOCGA80211, SIOCSA80211) for the interface of a radio: hakios.apple80211.c */+errno_t hakios_apple80211_ioctl(u_long command, void *data);+void hakios_virtio_net_init(void); /* boot-arg virtio_net=1: QEMU's virtio network device */#endif /* KERNEL */-#endif /* _SYS_REDWOOD_NET_H_ */+#endif /* _SYS_HAKIOS_NET_H_ */diff --git a/xnu/files/bsd/sys/redwood_qmi.h b/xnu/files/bsd/sys/hakios.qmi.hsimilarity index 87%rename from xnu/files/bsd/sys/redwood_qmi.hrename to xnu/files/bsd/sys/hakios.qmi.hindex 62c3b81..44e8258 100644--- a/xnu/files/bsd/sys/redwood_qmi.h+++ b/xnu/files/bsd/sys/hakios.qmi.h@@ -2,12 +2,12 @@* QMI, the message protocol the firmware of Qualcomm's processors speaks (the Wi-Fi DSP's* "WLFW" service among them): the helpers a client needs, under the names and with the meaning* of Linux's <linux/soc/qcom/qmi.h>, so that a driver written for Linux -- ath11k's qmi.c --- * compiles against this header unchanged. The implementation (bsd/dev/redwood_qmi.c) is ours,+ * compiles against this header unchanged. The implementation (bsd/dev/hakios.qmi.c) is ours,* written from what the interface and the wire format are publicly described to be; nothing of* Linux's implementation is in it.** What is here: messages described by tables of struct qmi_elem_info and coded to and from C- * structures by them; a handle that owns a port of the IPC router (sys/redwood_qrtr.h), looks a+ * structures by them; a handle that owns a port of the IPC router (sys/hakios.qrtr.h), looks a* service up and tells its user when the service appears and goes; requests as transactions* (init, send, wait or cancel) whose reply is decoded into the caller's structure; indications* handed to handlers. What is not: serving (no qmi_add_server, no replies of our own).@@ -19,8 +19,8 @@* from the router's delivery thread, with no lock of the helpers held; they may send. A reply* wakes the thread waiting in qmi_txn_wait().*/-#ifndef _SYS_REDWOOD_QMI_H_-#define _SYS_REDWOOD_QMI_H_+#ifndef _SYS_HAKIOS_QMI_H_+#define _SYS_HAKIOS_QMI_H_#include <stdbool.h>#include <stddef.h>@@ -97,9 +97,9 @@ extern const struct qmi_elem_info qmi_response_type_v01_ei[];* decode: the message of `length` bytes at `buffer` by `ei` into `structure` (which the caller* has zeroed: what the message does not have is left as it is).*/-int redwood_qmi_encode(uint8_t type, uint16_t message, uint16_t transaction, const struct qmi_elem_info *ei, const void *structure,+int hakios_qmi_encode(uint8_t type, uint16_t message, uint16_t transaction, const struct qmi_elem_info *ei, const void *structure,void *buffer, size_t size);-int redwood_qmi_decode(const void *buffer, size_t length, const struct qmi_elem_info *ei, void *structure);+int hakios_qmi_decode(const void *buffer, size_t length, const struct qmi_elem_info *ei, void *structure);/* ---- the router's addresses -------------------------------------------------------------------- */@@ -151,7 +151,7 @@ struct qmi_handle {struct socket *sock; /* what kernel_connect() is given; not NULL while the handle is in use */};-struct redwood_qrtr_ops;+struct hakios_qrtr_ops;struct qmi_txn {struct qmi_handle *qmi;@@ -165,12 +165,12 @@ struct qmi_txn {/** `largest`: the biggest message that will be taken (bigger ones are dropped). 0, or a negative- * errno: -ENXIO where there is no router (redwood_qmi_set_transport() has not been called).+ * errno: -ENXIO where there is no router (hakios_qmi_set_transport() has not been called).*/int qmi_handle_init(struct qmi_handle *qmi, size_t largest, const struct qmi_ops *ops, const struct qmi_msg_handler *handlers);/* Bind a handle to a specific processor's QRTR transport (e.g. WPSS or MPSS). */-int redwood_qmi_handle_init_transport(struct qmi_handle *qmi, size_t largest, const struct qmi_ops *ops,- const struct qmi_msg_handler *handlers, const struct redwood_qrtr_ops *transport);+int hakios_qmi_handle_init_transport(struct qmi_handle *qmi, size_t largest, const struct qmi_ops *ops,+ const struct qmi_msg_handler *handlers, const struct hakios_qrtr_ops *transport);void qmi_handle_release(struct qmi_handle *qmi);/* Ask for a service: ops->new_server is called for every server of it there is and will be. */int qmi_add_lookup(struct qmi_handle *qmi, unsigned int service, unsigned int version, unsigned int instance);@@ -189,31 +189,31 @@ void qmi_txn_cancel(struct qmi_txn *txn);* Wait for the reply: what decoding it gave (not negative: the bytes decoded), -ETIMEDOUT, or* the error of a reply that could not be decoded. The transaction is over either way.*/-int redwood_qmi_txn_wait_ms(struct qmi_txn *txn, uint64_t milliseconds);+int hakios_qmi_txn_wait_ms(struct qmi_txn *txn, uint64_t milliseconds);/** Linux's qmi_txn_wait() takes the time in "jiffies", of which the caller's Linux has HZ a second.* HZ is looked up where qmi_txn_wait() is used, so it is the caller's whatever it is (a number,- * a variable); a caller without one defines REDWOOD_QMI_JIFFIES_TO_MS(j) itself before this.+ * a variable); a caller without one defines HAKIOS_QMI_JIFFIES_TO_MS(j) itself before this.*/-#ifndef REDWOOD_QMI_JIFFIES_TO_MS-#define REDWOOD_QMI_JIFFIES_TO_MS(j) ((uint64_t)(j) * 1000 / HZ)+#ifndef HAKIOS_QMI_JIFFIES_TO_MS+#define HAKIOS_QMI_JIFFIES_TO_MS(j) ((uint64_t)(j) * 1000 / HZ)#endif-#define qmi_txn_wait(txn, timeout) redwood_qmi_txn_wait_ms((txn), REDWOOD_QMI_JIFFIES_TO_MS(timeout))+#define qmi_txn_wait(txn, timeout) hakios_qmi_txn_wait_ms((txn), HAKIOS_QMI_JIFFIES_TO_MS(timeout))/** The server that requests without an address go to. In Linux this is a connect() on the* handle's socket, which is how ath11k does it; here that call is this one.*/-int redwood_qmi_connect(struct socket *sock, uint32_t node, uint32_t port);-#ifndef REDWOOD_QMI_NO_KERNEL_CONNECT+int hakios_qmi_connect(struct socket *sock, uint32_t node, uint32_t port);+#ifndef HAKIOS_QMI_NO_KERNEL_CONNECTstatic inline intkernel_connect(struct socket *sock, void *address, __attribute__((unused)) int length, __attribute__((unused)) int flags){const struct sockaddr_qrtr *sq = address; /* (a pointer of whatever type the caller's Linux has for it) */- return redwood_qmi_connect(sock, sq->sq_node, sq->sq_port);+ return hakios_qmi_connect(sock, sq->sq_node, sq->sq_port);}#endif-#endif /* _SYS_REDWOOD_QMI_H_ */+#endif /* _SYS_HAKIOS_QMI_H_ */diff --git a/xnu/files/bsd/sys/redwood_qrtr.h b/xnu/files/bsd/sys/hakios.qrtr.hsimilarity index 57%rename from xnu/files/bsd/sys/redwood_qrtr.hrename to xnu/files/bsd/sys/hakios.qrtr.hindex 0756558..4dabb87 100644--- a/xnu/files/bsd/sys/redwood_qrtr.h+++ b/xnu/files/bsd/sys/hakios.qrtr.h@@ -1,30 +1,30 @@/*- * QRTR as the QMI helpers (sys/redwood_qmi.h) need it: datagrams to and from a port of a node of+ * QRTR as the QMI helpers (sys/hakios.qmi.h) need it: datagrams to and from a port of a node of* Qualcomm's IPC router, and the question "where is that service".** On the phone the router's other nodes are the processors beside ours (the Wi-Fi DSP is one), and* the datagrams travel over GLINK; whoever implements that hands these four calls to the QMI- * helpers with redwood_qmi_set_transport(). On a development machine a test puts a fake in the+ * helpers with hakios_qmi_set_transport(). On a development machine a test puts a fake in the* same place. Nothing here knows what is inside a datagram.*/-#ifndef _SYS_REDWOOD_QRTR_H_-#define _SYS_REDWOOD_QRTR_H_+#ifndef _SYS_HAKIOS_QRTR_H_+#define _SYS_HAKIOS_QRTR_H_#include <stdbool.h>#include <stddef.h>#include <stdint.h>-struct redwood_qrtr_port;+struct hakios_qrtr_port;/** A datagram for the port has arrived from (node, port). The data is the caller's again on return.*/-typedef void (*redwood_qrtr_receive_t)(void *context, uint32_t node, uint32_t port, const void *data, size_t length);+typedef void (*hakios_qrtr_receive_t)(void *context, uint32_t node, uint32_t port, const void *data, size_t length);/** A server of a service that was asked for with lookup() has appeared at (node, port), or the one* that was there has gone. Called once for each that exists when the question is asked, too.*/-typedef void (*redwood_qrtr_server_t)(void *context, bool arrived, uint32_t service, uint32_t version, uint32_t instance,+typedef void (*hakios_qrtr_server_t)(void *context, bool arrived, uint32_t service, uint32_t version, uint32_t instance,uint32_t node, uint32_t port);/*@@ -32,18 +32,18 @@ typedef void (*redwood_qrtr_server_t)(void *context, bool arrived, uint32_t serv* (the QMI helpers take a mutex in them and call their user's handlers from them). `context` is* what open() was given.*/-struct redwood_qrtr_ops {+struct hakios_qrtr_ops {/* A port of our own node; NULL if there is none to be had. */- struct redwood_qrtr_port *(*open)(redwood_qrtr_receive_t receive, redwood_qrtr_server_t server, void *context);+ struct hakios_qrtr_port *(*open)(hakios_qrtr_receive_t receive, hakios_qrtr_server_t server, void *context);/* One datagram to (node, port); 0, or an errno. May sleep. Up to 8192 bytes. */- int (*send)(struct redwood_qrtr_port *port, uint32_t node, uint32_t to_port, const void *data, size_t length);+ int (*send)(struct hakios_qrtr_port *port, uint32_t node, uint32_t to_port, const void *data, size_t length);/* Tell this port's `server` callback about the servers of that service, now and from now on; 0, or an errno. */- int (*lookup)(struct redwood_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance);+ int (*lookup)(struct hakios_qrtr_port *port, uint32_t service, uint32_t version, uint32_t instance);/* No callback comes after this has returned. */- void (*close)(struct redwood_qrtr_port *port);+ void (*close)(struct hakios_qrtr_port *port);};/* The transport there is; NULL takes it away (handles made before keep the one they were made with). */-void redwood_qmi_set_transport(const struct redwood_qrtr_ops *ops);+void hakios_qmi_set_transport(const struct hakios_qrtr_ops *ops);-#endif /* _SYS_REDWOOD_QRTR_H_ */+#endif /* _SYS_HAKIOS_QRTR_H_ */diff --git a/xnu/files/bsd/sys/hakios.sparse.h b/xnu/files/bsd/sys/hakios.sparse.hnew file mode 100644index 0000000..fe2f27a--- /dev/null+++ b/xnu/files/bsd/sys/hakios.sparse.h@@ -0,0 +1,12 @@+/*+ * A block device over an image holding only some of its blocks: how the real iOS root+ * volume is read on the phone, which cannot hold all of it. Only with boot-arg+ * apfs_sparse=<offset in md0>. See bsd/dev/hakios.sparse.c.+ */+#ifndef _SYS_HAKIOS_SPARSE_H_+#define _SYS_HAKIOS_SPARSE_H_++void hakios_sparse_init(void);+void hakios_sparse_report(void);++#endif /* _SYS_HAKIOS_SPARSE_H_ */diff --git a/xnu/files/bsd/sys/redwood_sta.h b/xnu/files/bsd/sys/hakios.sta.hsimilarity index 50%rename from xnu/files/bsd/sys/redwood_sta.hrename to xnu/files/bsd/sys/hakios.sta.hindex c5ed067..de38809 100644--- a/xnu/files/bsd/sys/redwood_sta.h+++ b/xnu/files/bsd/sys/hakios.sta.h@@ -1,28 +1,28 @@/*- * Darwin-on-redwood: the station boundary.+ * Darwin-on-hakios: the station boundary.** On one side whatever does the scanning and the joining with a radio: the station logic over* ath11k on the phone (wifi/lx in the repository). On the other whoever wants a network: the- * Apple80211 requests of iOS's Wi-Fi side, answered in bsd/dev/redwood_apple80211.c, and the- * kernel's own join of the network it was given in a file (bsd/dev/redwood_wifi.c). Frames do- * not pass here, and neither does "the link is up": those go through bsd/sys/redwood_net.h,+ * Apple80211 requests of iOS's Wi-Fi side, answered in bsd/dev/hakios.apple80211.c, and the+ * kernel's own join of the network it was given in a file (bsd/dev/hakios.wifi.c). Frames do+ * not pass here, and neither does "the link is up": those go through bsd/sys/hakios.net.h,* which the station side calls itself.*- * Between the two stands bsd/dev/redwood_sta.c: one thread, on which every call into the station+ * Between the two stands bsd/dev/hakios.sta.c: one thread, on which every call into the station* side is made, one at a time, and what the last scan heard, kept for whoever asks.** Nothing but C's own types here: the station side is not compiled as XNU's code.*/-#ifndef _SYS_REDWOOD_STA_H_-#define _SYS_REDWOOD_STA_H_+#ifndef _SYS_HAKIOS_STA_H_+#define _SYS_HAKIOS_STA_H_#include <stdbool.h>#include <stdint.h>-#define REDWOOD_STA_ELEMENTS_MOST 1024+#define HAKIOS_STA_ELEMENTS_MOST 1024/* One access point, as a scan heard it. */-struct redwood_sta_bss {+struct hakios_sta_bss {uint8_t bssid[6];uint8_t ssid[32], ssid_length;uint16_t frequency; /* MHz */@@ -31,20 +31,20 @@ struct redwood_sta_bss {uint16_t capability; /* the beacon's capability field */uint32_t age_ms; /* how long ago it was last heard */uint16_t elements_length; /* the beacon's information elements as received: who asks */- uint8_t elements[REDWOOD_STA_ELEMENTS_MOST]; /* reads the network's protection out of them itself */+ uint8_t elements[HAKIOS_STA_ELEMENTS_MOST]; /* reads the network's protection out of them itself */};/* What to scan for. All zero: every channel, the radio's own way. */-struct redwood_sta_scan {+struct hakios_sta_scan {uint8_t ssid[32], ssid_length; /* ask for this network by name (a hidden one answers only then) */uint16_t frequencies[64], frequency_count; /* only these channels */bool passive; /* only listen */uint16_t dwell_ms; /* on each channel; 0: the radio's own */};-enum { REDWOOD_STA_OPEN, REDWOOD_STA_WPA2_PSK };+enum { HAKIOS_STA_OPEN, HAKIOS_STA_WPA2_PSK };-struct redwood_sta_join {+struct hakios_sta_join {uint8_t ssid[32], ssid_length;uint8_t bssid[6]; /* all zero: the access point of that name heard best */int security;@@ -52,18 +52,18 @@ struct redwood_sta_join {uint8_t passphrase[64], passphrase_length; /* ... or, if this is not empty, the passphrase itself */};-enum redwood_sta_phase { REDWOOD_STA_OFF, REDWOOD_STA_IDLE, REDWOOD_STA_SCANNING, REDWOOD_STA_JOINING, REDWOOD_STA_JOINED };+enum hakios_sta_phase { HAKIOS_STA_OFF, HAKIOS_STA_IDLE, HAKIOS_STA_SCANNING, HAKIOS_STA_JOINING, HAKIOS_STA_JOINED };-struct redwood_sta_state {- enum redwood_sta_phase phase;- struct redwood_sta_bss bss; /* the network joined or being joined */+struct hakios_sta_state {+ enum hakios_sta_phase phase;+ struct hakios_sta_bss bss; /* the network joined or being joined */int last_error; /* why the last join failed or the network was lost (an errno); 0: it was not */};-#define REDWOOD_STA_CHANNEL_PASSIVE 1u /* the radio may only listen there */-#define REDWOOD_STA_CHANNEL_RADAR 2u /* ... and has to look out for radar */+#define HAKIOS_STA_CHANNEL_PASSIVE 1u /* the radio may only listen there */+#define HAKIOS_STA_CHANNEL_RADAR 2u /* ... and has to look out for radar */-struct redwood_sta_channel {+struct hakios_sta_channel {uint16_t frequency; /* MHz */uint16_t flags;};@@ -73,50 +73,50 @@ struct redwood_sta_channel {* may take as long as the thing takes: scan() returns when the scan is over, join() when frames* can pass or it is known why not. Each gives 0 or an errno.*/-struct redwood_sta_ops {+struct hakios_sta_ops {int (*power)(bool on); /* off: leave the network, stop the radio; on: start it */- int (*scan)(const struct redwood_sta_scan *what);- void (*heard)(void (*each)(const struct redwood_sta_bss *bss, void *context), void *context); /* by the last scan */- int (*join)(const struct redwood_sta_join *what);+ int (*scan)(const struct hakios_sta_scan *what);+ void (*heard)(void (*each)(const struct hakios_sta_bss *bss, void *context), void *context); /* by the last scan */+ int (*join)(const struct hakios_sta_join *what);int (*leave)(void);- void (*state)(struct redwood_sta_state *state); /* on any thread; does not sleep */- unsigned (*channels)(struct redwood_sta_channel *channels, unsigned most); /* what the radio may tune to */+ void (*state)(struct hakios_sta_state *state); /* on any thread; does not sleep */+ unsigned (*channels)(struct hakios_sta_channel *channels, unsigned most); /* what the radio may tune to */uint8_t address[6];};/* What happens, said to whoever listens (the Apple80211 side). */-enum redwood_sta_event {- REDWOOD_STA_POWER, /* status: 1 on, 0 off */- REDWOOD_STA_SCAN_DONE, /* status: 0, or the scan's errno */- REDWOOD_STA_JOIN_DONE, /* status: 0, or the join's errno */- REDWOOD_STA_LINK, /* status: 1 a network is joined, 0 it has been left when asked,+enum hakios_sta_event {+ HAKIOS_STA_POWER, /* status: 1 on, 0 off */+ HAKIOS_STA_SCAN_DONE, /* status: 0, or the scan's errno */+ HAKIOS_STA_JOIN_DONE, /* status: 0, or the join's errno */+ HAKIOS_STA_LINK, /* status: 1 a network is joined, 0 it has been left when asked,* an errno: it was lost (the access point showed us the door) */};#ifdef KERNEL/* ---- the station side ---- */-void redwood_sta_attach(const struct redwood_sta_ops *ops); /* NULL: it is going away (waits for a call under way) */-void redwood_sta_lost(int error); /* the network joined is gone by itself */+void hakios_sta_attach(const struct hakios_sta_ops *ops); /* NULL: it is going away (waits for a call under way) */+void hakios_sta_lost(int error); /* the network joined is gone by itself *//* ---- who wants a network: each asks and returns; the outcome is an event. 0, or an errno ---- */-bool redwood_sta_present(void);-int redwood_sta_ask_power(bool on);-int redwood_sta_ask_scan(const struct redwood_sta_scan *what);-int redwood_sta_ask_join(const struct redwood_sta_join *what);+bool hakios_sta_present(void);+int hakios_sta_ask_power(bool on);+int hakios_sta_ask_scan(const struct hakios_sta_scan *what);+int hakios_sta_ask_join(const struct hakios_sta_join *what);/* ... and joined again whenever the radio is turned on, until some other network is asked for */-int redwood_sta_ask_join_standing(const struct redwood_sta_join *what);-int redwood_sta_ask_leave(void);-bool redwood_sta_busy(void); /* something asked for is not over yet */-bool redwood_sta_powered(void);+int hakios_sta_ask_join_standing(const struct hakios_sta_join *what);+int hakios_sta_ask_leave(void);+bool hakios_sta_busy(void); /* something asked for is not over yet */+bool hakios_sta_powered(void);/* the `index`th access point the last scan heard: true, or false when there are not that many */-bool redwood_sta_heard(unsigned index, struct redwood_sta_bss *bss);-void redwood_sta_state(struct redwood_sta_state *state);-unsigned redwood_sta_channels(struct redwood_sta_channel *channels, unsigned most);-bool redwood_sta_address(uint8_t *address);--/* ---- the listener: bsd/dev/redwood_apple80211.c ---- */-void redwood_apple80211_event(enum redwood_sta_event event, int status);-void redwood_apple80211_summary(void); /* what was asked in this run, to the log */+bool hakios_sta_heard(unsigned index, struct hakios_sta_bss *bss);+void hakios_sta_state(struct hakios_sta_state *state);+unsigned hakios_sta_channels(struct hakios_sta_channel *channels, unsigned most);+bool hakios_sta_address(uint8_t *address);++/* ---- the listener: bsd/dev/hakios.apple80211.c ---- */+void hakios_apple80211_event(enum hakios_sta_event event, int status);+void hakios_apple80211_summary(void); /* what was asked in this run, to the log */#endif#endifdiff --git a/xnu/files/bsd/sys/hakios.virtio_blk.h b/xnu/files/bsd/sys/hakios.virtio_blk.hnew file mode 100644index 0000000..19f334f--- /dev/null+++ b/xnu/files/bsd/sys/hakios.virtio_blk.h@@ -0,0 +1,14 @@+/*+ * A virtio block device for QEMU: a disk image on the host becomes /dev/rvblk0 in the+ * guest. Only with boot-arg virtio_blk=1. See bsd/dev/hakios.virtio_blk.c.+ */+#ifndef _SYS_HAKIOS_VIRTIO_BLK_H_+#define _SYS_HAKIOS_VIRTIO_BLK_H_++#include <stdbool.h>+#include <sys/types.h>++void hakios_virtio_blk_init(void);+bool hakios_virtio_blk_dev(dev_t dev); /* one of its devices */++#endif /* _SYS_HAKIOS_VIRTIO_BLK_H_ */diff --git a/xnu/files/bsd/sys/redwood_apfs_check.h b/xnu/files/bsd/sys/redwood_apfs_check.hdeleted file mode 100644index 2babd7a..0000000--- a/xnu/files/bsd/sys/redwood_apfs_check.h+++ /dev/null@@ -1,11 +0,0 @@-/*- * Mount the APFS volume on /dev/rvblk0 and walk it, to compare with what the host reader- * sees in the same image. Only with boot-arg apfs_check.- * See bsd/dev/redwood_apfs_check.c.- */-#ifndef _SYS_REDWOOD_APFS_CHECK_H_-#define _SYS_REDWOOD_APFS_CHECK_H_--void redwood_apfs_check_init(void);--#endif /* _SYS_REDWOOD_APFS_CHECK_H_ */diff --git a/xnu/files/bsd/sys/redwood_audio.h b/xnu/files/bsd/sys/redwood_audio.hdeleted file mode 100644index eb549c3..0000000--- a/xnu/files/bsd/sys/redwood_audio.h+++ /dev/null@@ -1,135 +0,0 @@-/*- * /dev/redwood-audio: the sound iOS plays, on its way to whatever can make it heard.- *- * iOS expects its output devices from Apple's audio drivers through IOAudio2; neither exists- * here. Instead the audio server (mediaserverd) is given a plug-in of ours that presents one- * stereo output device, and the plug-in writes what the server has mixed for that device- * here. In the kernel the samples go to a sink -- a driver for something that plays them --- * and, if asked for, into a recording that outlives the kernel (see dev/redwood_audio.c).- *- * write(): whole frames in the format below. Never blocks: the writer is the audio server's- * real-time thread, which paces itself (48000 frames a second while anything- * plays, nothing at all otherwise). What the sink cannot take is dropped.- */-#ifndef _SYS_REDWOOD_AUDIO_H_-#define _SYS_REDWOOD_AUDIO_H_--#include <stdint.h>--#define REDWOOD_AUDIO_DEVICE "/dev/redwood-audio"--/* The one format: 16-bit signed little-endian samples, left then right. */-#define REDWOOD_AUDIO_RATE 48000-#define REDWOOD_AUDIO_CHANNELS 2-#define REDWOOD_AUDIO_FRAME 4 /* bytes */--/*- * ioctl(REDWOOD_AUDIO_SET_VOLUME): the speakers' volume, as iOS sets it on the plug-in's volume- * control -- how many eighths of a dB under the loudest they may play, and whether they are- * muted (iOS's volume at 0). The loudest is the kernel's to say (on the phone: Android's own- * level less sound_below, redwood_sound.c); the plug-in only says how far under it.- */-#include <sys/ioccom.h>--struct redwood_audio_volume {- uint32_t below; /* eighths of a dB */- uint32_t muted;-};-#define REDWOOD_AUDIO_SET_VOLUME _IOW('r', 1, struct redwood_audio_volume)--#ifdef KERNEL-#include <stdbool.h>--/*- * For drivers. A sink is offered frames as they are written and says how many it took (the- * rest are lost); it is called from the writer's thread and must not wait.- */-typedef uint32_t (*redwood_audio_sink_t)(const int16_t *frames, uint32_t count);--void redwood_audio_set_sink(const char *name, redwood_audio_sink_t sink);-/* The volume iOS has set last (REDWOOD_AUDIO_SET_VOLUME): false if it has set none; *generation counts the settings. */-bool redwood_audio_volume(uint32_t *below, bool *muted, uint32_t *generation);-void redwood_audio_init(void);-void redwood_virtio_sound_init(void); /* boot-arg virtio_sound=1: QEMU's virtio sound device */-void redwood_speaker_init(void); /* boot-arg speaker_probe=N: a look at the phone's speaker amplifiers */-void redwood_haptic_init(void); /* boot-arg haptic=N: the phone's vibration motor (bsd/dev/redwood_haptic.c) */-void redwood_haptic_quiesce(void); /* its chip back into reset: at the run's end and on a panic's way out */-void redwood_haptic_pretend(uint32_t peak); /* a test's stand-in for iOS's waveform: as if a write of this loudness came */-void redwood_torch_init(void); /* boot-arg torch=N: the phone's flashlight (bsd/dev/redwood_torch.c) */-void redwood_torch_quiesce(void); /* the light off: at the run's end and on a panic's way out */-void redwood_camera_init(void); /* boot-arg cam=N: the phone's cameras (bsd/dev/redwood_camera.c) */-void redwood_camera_quiesce(void); /* whatever of them was switched on, off: at the run's end and on a panic's way out */--/*- * The phone's speakers (bsd/dev/redwood_speaker.c): its two Awinic amplifiers, set up as- * Android's driver sets them up, from Android's own configuration file (see there).- */-bool redwood_speaker_prepare(const uint8_t *acf, uint64_t size); /* found, reset, configured: powered down, muted */-bool redwood_speaker_start(void); /* powered up and unmuted at the lowest volume: only while the I2S clock runs */-bool redwood_speaker_volume(uint32_t below, uint32_t step_ms); /* below Android's level, in eighths of a dB; 6 dB a step */-bool redwood_speaker_healthy(void); /* no fault reported; on one, both are powered down at once */-void redwood_speaker_stop(void); /* faded out, muted, powered down, in Android's order */-void redwood_speaker_quiesce(void); /* powered down at once, without sleeping: on a panic's way out */-/* the amplifiers' own temperature and battery voltage read (every second while they play): the reduction they call for */-uint32_t redwood_speaker_monitor(bool tell);--/*- * The speakers' guard (bsd/dev/redwood_guard.c): what the samples go through in the feeder on their- * way to the amplifiers, for want of the DSP's speaker protection. Levels in eighths of a dB.- */-#define REDWOOD_GUARD_SILENT 0xffffffffu /* the amplifiers are off: nothing reaches the speakers */-struct redwood_guard_report {- uint32_t blocks, rms_blocks, fast_blocks, slow_blocks; /* blocks done, and in how many each average held the level down */- uint32_t limited_frames; /* frames in which the peak limiter turned the level down */- uint32_t peak_in, peak_out; /* the largest sample that came in and that went out */- uint32_t least_peak_gain; /* the peak limiter's least gain, in 1/65536 */- uint64_t least_gain, gain; /* the power guard's (with the monitor's) least gain and the latest, Q30 */- uint64_t rms, fast, slow; /* the averages now, the louder speaker's: Q30 of a full-scale square wave at Android's level */-};-#define REDWOOD_GUARD_MAX_GAIN (12 * 8) /* the most gain before the guard: 12 dB */-void redwood_guard_configure(bool hpf, uint32_t gain); /* the high-pass filter; `gain' before everything */-void redwood_guard_attenuation(uint32_t below); /* the amplifiers' level under Android's (or REDWOOD_GUARD_SILENT):- * what the limits are reckoned from */-void redwood_guard_monitor(uint32_t below); /* a reduction asked for by redwood_speaker_monitor() */-void redwood_guard_process(int16_t *frames, uint32_t count); /* stereo frames, in place */-void redwood_guard_take_report(struct redwood_guard_report *report); /* what happened since the last call */-int redwood_guard_decibels(uint64_t ratio); /* 10 log10 of a Q30 ratio, in tenths of a dB */-/* boot-arg rec_sound_fed=1: the recording (rec_sound=N) has what the guard let through instead of what iOS wrote */-bool redwood_audio_recording_fed(void);-void redwood_audio_record_fed(const int16_t *frames, uint32_t count);--/*- * The audio DSP's services, for the sound's path (bsd/dev/redwood_adsp.c, bsd/dev/redwood_sound.c).- * redwood_adsp_apr() sends one APR packet to a service of the DSP (AFE 4, ASM 7, ADM 8) with the- * given port and token (0: one of its own) and, with wait_ms, waits for the packet that carries- * that token back. What is not waited for goes to the handler of events, if there is one and it- * takes it (returns true). The handler is called on the link's thread and must not wait.- */-struct redwood_apr_answer {- uint32_t opcode, token, length; /* length: of the payload, in bytes */- uint32_t words[64];-};-typedef bool (*redwood_apr_events_t)(uint8_t service, uint16_t port, uint32_t opcode, uint32_t token, const uint32_t *payload,- uint32_t length);--bool redwood_adsp_apr(uint8_t service, uint16_t port, uint32_t token, uint32_t opcode, const void *payload, uint32_t length,- uint32_t wait_ms, struct redwood_apr_answer *answer);-void redwood_adsp_apr_events(redwood_apr_events_t handler);-const uint8_t *redwood_adsp_fw_file(const char *name, uint64_t *size); /* /fw/name, read whole; give back with: */-void redwood_adsp_fw_free(const uint8_t *data, uint64_t size);--void redwood_sound_dsp_up(void); /* the DSP's audio services are up (adsp=1): boot-arg sound=N begins */-void redwood_sound_dsp_down(void); /* before the DSP is shut down at the run's end: everything of the sound's stopped */-void redwood_sound_quiesce(void); /* on a panic's way out: the amplifiers off, without sleeping */-/* the microphones' part of the memory the DSP sees (redwood_sound.c): false if it cannot be had; given back with _put() */-bool redwood_audio_dsp_memory(uintptr_t *memory, uint64_t *dsp_address, uint32_t *bytes);-void redwood_audio_dsp_memory_put(void);-/* a second handler of the DSP's events (the microphones'), asked when the first does not take one */-void redwood_adsp_apr_events_second(redwood_apr_events_t handler);-/* boot-arg rec_sound_mic=1: the recording (rec_sound=N) has what the microphone hears (given with redwood_audio_record_fed()) */-bool redwood_audio_recording_mic(void);-void redwood_mic_dsp_up(void); /* the DSP's audio services are up (adsp=1): boot-arg mic=N begins */-void redwood_mic_dsp_down(void); /* before the DSP is shut down at the run's end: what the microphones' path asked for given back */-#endif--#endif /* _SYS_REDWOOD_AUDIO_H_ */diff --git a/xnu/files/bsd/sys/redwood_input.h b/xnu/files/bsd/sys/redwood_input.hdeleted file mode 100644index 57c5122..0000000--- a/xnu/files/bsd/sys/redwood_input.h+++ /dev/null@@ -1,125 +0,0 @@-/*- * /dev/redwood-touch: touch samples on their way from whoever produces them to the- * program that turns them into HID events for the window server.- *- * iOS expects touches from Apple's multitouch driver through IOHIDFamily; neither exists- * here. Instead a producer -- a kernel driver for a real touch controller or for an emulated- * pointer, or a user program replaying a script -- posts samples, and code of ours running- * inside backboardd reads them and synthesizes the events. Both sides use the same record.- *- * write(): one or more records (time is ignored; the kernel stamps them)- * read(): blocks until there is at least one record, returns as many whole ones as fit- */-#ifndef _SYS_REDWOOD_INPUT_H_-#define _SYS_REDWOOD_INPUT_H_--#include <stdint.h>--#define REDWOOD_TOUCH_DEVICE "/dev/redwood-touch"--#define REDWOOD_TOUCH_DOWN 1 /* a finger has landed */-#define REDWOOD_TOUCH_MOVE 2-#define REDWOOD_TOUCH_UP 3 /* it has lifted (x, y: where it was last) */-#define REDWOOD_BUTTON_DOWN 4 /* a hardware button; `finger` says which (REDWOOD_BUTTON_*), x and y are 0 */-#define REDWOOD_BUTTON_UP 5--#define REDWOOD_BUTTON_LOCK 1 /* the side button */-#define REDWOOD_BUTTON_VOLUME_UP 2-#define REDWOOD_BUTTON_VOLUME_DOWN 3-#define REDWOOD_BUTTON_HOME 4--struct redwood_touch {- uint64_t time; /* mach_absolute_time() when the sample was posted */- uint32_t type; /* REDWOOD_TOUCH_* or REDWOOD_BUTTON_DOWN/UP */- uint32_t finger; /* which finger, from 0 (or which button) */- uint32_t x, y; /* position on the display, 0 = left/top edge, 65535 = right/bottom edge */-};--#ifdef KERNEL-/* For drivers; not from interrupt context. */-void redwood_touch_post(uint32_t type, uint32_t finger, uint32_t x, uint32_t y);-void redwood_input_init(void);-void redwood_virtio_input_init(void); /* boot-arg virtio_input=1: QEMU's virtio pointer and keyboard */-void redwood_goodix_init(void); /* boot-arg touchscreen=1: the phone's Goodix or FocalTech touch screen */-void redwood_buttons_init(void); /* boot-arg buttons=1: the phone's power and volume keys */-void redwood_ufs_init(void); /* ufs=2 to xnuloader: the phone's storage, read only, through the loader (ufs_shared_pa=) */-void redwood_ufs_report(const char *when); /* where reading the storage has spent its time so far */-bool redwood_ufs_dev(dev_t dev); /* one of the storage's devices */-int redwood_ufs_read_partition(const char *name, uint64_t offset, uint8_t *dst, uint64_t len, uint64_t *bytes); /* for drivers */-void redwood_battery_init(void); /* boot-arg battery=1: Qualcomm UEFI charger state shared by xnuloader */-int redwood_battery_temperature(void); /* the battery's temperature in C, -273 while it is not known */-/* one transfer at a time through the PMIC arbiter for this system (bsd/dev/redwood_buttons.c) */-void redwood_spmi_lock(void);-void redwood_spmi_unlock(void);-/*- * How the battery is, as the audio DSP's battery manager says (bsd/dev/redwood_adsp.c, with adsp=1):- * handed to bsd/dev/redwood_battery.c, which keeps it for the sysctls kern.redwood.battery_* and- * passes it on to iokit/Kernel/RedwoodBattery.cpp, the power source that iOS reads. The structure- * is repeated there (this header is not seen from iokit/), and `size` tells whether the two agree.- */-struct redwood_battery_state {- uint32_t size; /* sizeof(struct redwood_battery_state) */- int32_t percent_hundredths; /* the charge, 0..10000 */- int32_t voltage_uv;- int32_t current_ua; /* more than 0 while the battery takes charge */- int32_t temperature_hundredths; /* of a degree Celsius */- int32_t present; /* 1 if there is a battery */- int32_t external; /* 1 if a charger or a computer is on the USB port */- int32_t status; /* Linux's POWER_SUPPLY_STATUS_*: 1 charging, 2 discharging, 3 not charging, 4 full */- int32_t charge_uah, full_uah, design_uah, cycles; /* 0 when not known (yet) */- int32_t usb_type; /* Linux's POWER_SUPPLY_USB_TYPE_*: 1 a computer's port, 2 a charger, ... */- int32_t usb_voltage_uv, usb_current_ua; /* what the port gives */-};-void redwood_battery_report(const struct redwood_battery_state *state);-void redwood_net_init(void); /* en0, if there is something to carry its frames: sys/redwood_net.h */-void redwood_cpufreq_init(void); /* boot-arg cpufreq=1: the phone's processor at full speed */-void redwood_adreno_init(void); /* boot-arg adreno=N: the first N steps of waking the phone's GPU */-void redwood_adreno_quiesce(void); /* on the way back to the loader: the GPU block stopped, out of our memory */-void redwood_adreno_stop(void); /* before that, where the ending is no panic's: the GPU given back in order */-void redwood_adreno_minute(void); /* once a minute: a line about how warm the GPU is, if it is in use */-void redwood_wifi_init(void); /* boot-arg wifi=1: the phone's Wi-Fi; wifi_step=N: the first N steps of it */-void redwood_adsp_init(void); /* boot-arg adsp=1: the phone's audio DSP started and linked; adsp_step=N: the first N steps */-void redwood_mpss_init(void); /* boot-arg modem=1: the phone's modem started and linked; modem_step=N: the first N steps */-void redwood_wifi_stop(void); /* where a run ends in order: the Wi-Fi DSP, if it was started, shut down */-int redwood_wifi_say(const char *format, ...) __printflike(1, 2); /* a line of the Wi-Fi steps' log */-int redwood_wifi_tell(const char *format, ...) __printflike(1, 2); /* ... one that is said even with wifi=1 */-uint32_t redwood_wifi_option(const char *name); /* a boot-arg's number, or what wifi=1 stands for */-const uint8_t *redwood_wifi_file(const char *name, uint64_t *size); /* a file of fw/ in the small image, in place */-bool redwood_wlfw_exchange(uint32_t step); /* step 15 of wifi_step=N: redwood_wlfw.c */-bool redwood_wlfw_registers(uint64_t *address, uint32_t *size, bool *mission); /* ... and what it learnt for step 16 */-void redwood_wlfw_stop(uint32_t step); /* ... and its end, before the DSP is stopped */-void redwood_wifi_quiesce(void); /* on the way back to the loader: the Wi-Fi DSP, if it still runs, shut down */-/* ath11k's object and the kernel's side of it (bsd/dev/redwood_lx.c), and what that asks of the phone's radio */-int redwood_lx_start(void); /* the driver brought up on the radio as far as it is built: 0 or an errno */-void redwood_lx_stop(void); /* ... and down again, if it stayed up (a network joined) */-int redwood_lx_prepare(void); /* before all that: the memory the radio will be shown, taken; 0 or an errno */-void redwood_lx_net_early(void); /* ... and en0 made on the radio now, if the kernel was given its address */-bool redwood_wifi_dsp_is_up(void); /* the DSP that runs the radio's firmware has been started and has a link */-const uint8_t *redwood_wifi_driver_file(const char *name, uint64_t *size); /* a file by the name Linux has for it */-bool redwood_wifi_radio_map(uint64_t physical, uint64_t size, unsigned long long *address); /* memory shown to the radio */-bool redwood_wifi_radio_msi(unsigned long long *address, uint32_t *data, uint32_t *first_spi); /* where the radio raises its interrupts */-bool redwood_wifi_radio_address(uint8_t *address); /* the radio's own address (boot-arg wifi_mac), if one was given */-/* the network to join (fw/network of the small image): name and passphrase, buffer sizes in and lengths out */-bool redwood_wifi_network(uint8_t *name, unsigned *name_length, uint8_t *passphrase, unsigned *passphrase_length);--/*- * The GPU kept on (boot-arg adreno_keep=1), for iokit/Kernel/RedwoodGPU.cpp: see "the GPU kept on"- * in bsd/dev/redwood_adreno.c. One caller at a time.- */-bool redwood_gpu_ready(void);-bool redwood_gpu_parameter(uint32_t which, uint64_t *value);-uint64_t redwood_gpu_address(uint64_t size);-void redwood_gpu_address_free(uint64_t address, uint64_t size);-bool redwood_gpu_map(uint64_t address, uint64_t phys, bool read_only);-void redwood_gpu_mapped(void);-void redwood_gpu_unmap(uint64_t address, uint64_t size);-void redwood_gpu_to_memory(void *start, uint64_t size);-uint32_t redwood_gpu_submit(const uint64_t *addresses, const uint32_t *words, uint32_t count);-bool redwood_gpu_done(uint32_t fence);-uint32_t redwood_gpu_last(void);-void redwood_gpu_worked(uint64_t *microseconds, uint32_t *submissions, uint32_t by[7]);-void redwood_gpu_report(const char *why);-void redwood_gpu_stop(void);-#endif--#endif /* _SYS_REDWOOD_INPUT_H_ */diff --git a/xnu/files/bsd/sys/redwood_sparse.h b/xnu/files/bsd/sys/redwood_sparse.hdeleted file mode 100644index cff008a..0000000--- a/xnu/files/bsd/sys/redwood_sparse.h+++ /dev/null@@ -1,12 +0,0 @@-/*- * A block device over an image holding only some of its blocks: how the real iOS root- * volume is read on the phone, which cannot hold all of it. Only with boot-arg- * apfs_sparse=<offset in md0>. See bsd/dev/redwood_sparse.c.- */-#ifndef _SYS_REDWOOD_SPARSE_H_-#define _SYS_REDWOOD_SPARSE_H_--void redwood_sparse_init(void);-void redwood_sparse_report(void);--#endif /* _SYS_REDWOOD_SPARSE_H_ */diff --git a/xnu/files/bsd/sys/redwood_virtio_blk.h b/xnu/files/bsd/sys/redwood_virtio_blk.hdeleted file mode 100644index 74cb90d..0000000--- a/xnu/files/bsd/sys/redwood_virtio_blk.h+++ /dev/null@@ -1,14 +0,0 @@-/*- * A virtio block device for QEMU: a disk image on the host becomes /dev/rvblk0 in the- * guest. Only with boot-arg virtio_blk=1. See bsd/dev/redwood_virtio_blk.c.- */-#ifndef _SYS_REDWOOD_VIRTIO_BLK_H_-#define _SYS_REDWOOD_VIRTIO_BLK_H_--#include <stdbool.h>-#include <sys/types.h>--void redwood_virtio_blk_init(void);-bool redwood_virtio_blk_dev(dev_t dev); /* one of its devices */--#endif /* _SYS_REDWOOD_VIRTIO_BLK_H_ */diff --git a/xnu/files/iokit/Kernel/MiniIOMobileFramebuffer.cpp b/xnu/files/iokit/Kernel/MiniIOMobileFramebuffer.cppindex aedd919..407c8df 100644--- a/xnu/files/iokit/Kernel/MiniIOMobileFramebuffer.cpp+++ b/xnu/files/iokit/Kernel/MiniIOMobileFramebuffer.cpp@@ -37,7 +37,7 @@ extern struct vc_info vinfo; /* the boot framebuffer, as the text con#include "MiniIOSurface.h"-extern "C" void redwood_tl(const char * format, ...) __printflike(1, 2);+extern "C" void hakios_tl(const char * format, ...) __printflike(1, 2);/* IOConnectCallMethod selectors of the framebuffer user client (iOS 16.5) */enum {@@ -170,7 +170,7 @@ swapQueue(void)* Boot-arg touch_lat=1: a line for every swap handed over ("tl: s ID at US") and for every frame* put on the panel ("tl: v ID ready US shown US done US": the GPU done with it, its beat come, the* pixels in the panel's memory), in microseconds of mach_absolute_time, for measuring how long a- * touch takes to show (tools/latency.py; the touch's own lines: bsd/dev/redwood_input.c).+ * touch takes to show (tools/latency.py; the touch's own lines: bsd/dev/hakios.input.c).*/static TUNABLE(uint32_t, gTouchLat, "touch_lat", 0);@@ -474,7 +474,7 @@ IOMobileFramebuffer::start(IOService * provider)setProperty(kIOUserClientClassKey, "IOMobileFramebufferUserClient");/* for who draws with the GPU (userland/src/eagl.c): a frame need not be waited for before it is handed over */- setProperty("RedwoodWaitsForGPU", kOSBooleanTrue);+ setProperty("HakiosWaitsForGPU", kOSBooleanTrue);publishModes();setName("disp0");registerService();@@ -867,7 +867,7 @@ IOMobileFramebuffer::present(const uint8_t * swap)nanoseconds_to_absolutetime(FRAME_PAUSE * NSEC_PER_MSEC, &pause);clock_interval_to_deadline(SWAP_HELD_MS, kMillisecondScale, &deadline);if (gTouchLat) {- redwood_tl("tl: s %u at %llu\n", swapWord(swap, SWAP_ID), micros(now));+ hakios_tl("tl: s %u at %llu\n", swapWord(swap, SWAP_ID), micros(now));}IOLockLock(fSwapLock);fStatSwapsLate += fSwapTime != 0 && now - fSwapTime > period && now - fSwapTime < pause;@@ -1045,7 +1045,7 @@ IOMobileFramebuffer::show(const uint8_t * swap, MiniIOSurface ** surfaces)}fSwapsShown++;if (gTouchLat) {- redwood_tl("tl: v %u ready %llu shown %llu done %llu\n", swapWord(swap, SWAP_ID), micros(ready), micros(shown),+ hakios_tl("tl: v %u ready %llu shown %llu done %llu\n", swapWord(swap, SWAP_ID), micros(ready), micros(shown),micros(drawn));}if (layers != fLayersShown) {@@ -1351,7 +1351,7 @@ IOMobileFramebufferUserClient::externalMethod(uint32_t selector, IOExternalMethocase kFBMethodSwapWait: /* a swap is on the screen as soon as it is made */if (gTouchLat) {- redwood_tl("tl: w %llu %#llx %#llx at %llu\n", args->scalarInputCount > 0 ? in[0] : 0,+ hakios_tl("tl: w %llu %#llx %#llx at %llu\n", args->scalarInputCount > 0 ? in[0] : 0,args->scalarInputCount > 1 ? in[1] : 0, args->scalarInputCount > 2 ? in[2] : 0, micros(mach_absolute_time()));}return kIOReturnSuccess;diff --git a/xnu/files/iokit/Kernel/MiniIONetworkStack.cpp b/xnu/files/iokit/Kernel/MiniIONetworkStack.cppindex a2b963c..d7dd0e5 100644--- a/xnu/files/iokit/Kernel/MiniIONetworkStack.cpp+++ b/xnu/files/iokit/Kernel/MiniIONetworkStack.cpp@@ -4,7 +4,7 @@** The real one gives the BSD names (en0, en1, ...) to the IONetworkInterface objects of the* drivers, when the interface namer asks. Here interfaces are made with the BSD interface KPI- * (bsd/dev/redwood_net.c) and are born with their names, so there is never anything to name.+ * (bsd/dev/hakios.net.c) and are born with their names, so there is never anything to name.* But the namer wants this object all the same: until it has opened it, it does not say in* configd's store that the registry has gone quiet (the key Plugin:InterfaceNamer, "*QUIET*"),* and gives up only after five minutes ("*TIMEOUT*"). SystemConfiguration'sdiff --git a/xnu/files/iokit/Kernel/MiniIOSurface.h b/xnu/files/iokit/Kernel/MiniIOSurface.hindex 431423b..feccca0 100644--- a/xnu/files/iokit/Kernel/MiniIOSurface.h+++ b/xnu/files/iokit/Kernel/MiniIOSurface.h@@ -117,7 +117,7 @@ public:task_t clientTask; /* whose memory it is (not held: only compared) */mach_vm_address_t clientAddress; /* ... and where it is there */uint8_t * kpixels; /* where the pixel memory starts in the kernel, either way */- uint32_t drawn; /* the GPU's last submission that names the pixels (0: none; RedwoodGPU.cpp) */+ uint32_t drawn; /* the GPU's last submission that names the pixels (0: none; hakios.gpu.cpp) */struct minisurf_result info; /* addresses not filled in */struct minisurf_plane planes[MINISURF_MAX_PLANES];OSDictionary * values;@@ -163,7 +163,7 @@ MiniIOSurface * MiniIOSurfaceCopy(uint32_t sid);void MiniIOSurfaceCost(uint32_t * made, uint64_t * making, uint32_t * freed, uint64_t * freeing, uint32_t * again);/* Clear the memory that is kept of surfaces that are gone, for the next ones: when the caller has a moment. */void MiniIOSurfaceClearKept(void);-/* Wait, for so many milliseconds at most, until the GPU is done with a surface's pixels (RedwoodGPU.cpp). */+/* Wait, for so many milliseconds at most, until the GPU is done with a surface's pixels (hakios.gpu.cpp). */bool MiniIOSurfaceDrawn(MiniIOSurface * surface, uint64_t milliseconds);MiniIOSurface * MiniIOSurfaceCreateSimple(uint32_t width, uint32_t height, uint32_t pixelFormat);void MiniIOSurfaceDrop(MiniIOSurface * surface);diff --git a/xnu/files/iokit/Kernel/RedwoodBattery.cpp b/xnu/files/iokit/Kernel/hakios.battery.cppsimilarity index 78%rename from xnu/files/iokit/Kernel/RedwoodBattery.cpprename to xnu/files/iokit/Kernel/hakios.battery.cppindex 87223c2..eb98e6a 100644--- a/xnu/files/iokit/Kernel/RedwoodBattery.cpp+++ b/xnu/files/iokit/Kernel/hakios.battery.cpp@@ -1,5 +1,5 @@/*- * RedwoodBattery: the phone's battery as iOS looks for it, an IOPMPowerSource.+ * HakiosBattery: the phone's battery as iOS looks for it, an IOPMPowerSource.** powerd finds every service of the class IOPMPowerSource (it calls the first "InternalBattery-0"),* listens for its kIOPMMessageBatteryStatusHasChanged and then reads its properties: whether a@@ -9,9 +9,9 @@* and everything else follows from that: the status bar's battery, the lock screen's "Charging",* the Batteries widget, Settings > Battery.*- * What the values are comes from the audio DSP's battery manager (bsd/dev/redwood_adsp.c,- * with adsp=1, unless battmgr=0), by way of bsd/dev/redwood_battery.c, which calls- * RedwoodBatteryReport() with every reading; the first one makes the service. Nothing here asks+ * What the values are comes from the audio DSP's battery manager (bsd/dev/hakios.adsp.c,+ * with adsp=1, unless battmgr=0), by way of bsd/dev/hakios.battery.c, which calls+ * HakiosBatteryReport() with every reading; the first one makes the service. Nothing here asks* the charger anything or tells it anything.** As on Apple's newer batteries, CurrentCapacity is the percentage that the fuel gauge shows (and@@ -28,8 +28,8 @@#include <libkern/c++/OSNumber.h>#include <libkern/c++/OSSymbol.h>-/* The same as struct redwood_battery_state in bsd/sys/redwood_input.h, which is not seen from here. */-struct redwood_battery_state {+/* The same as struct hakios_battery_state in bsd/sys/hakios.input.h, which is not seen from here. */+struct hakios_battery_state {uint32_t size;int32_t percent_hundredths;int32_t voltage_uv;@@ -41,14 +41,14 @@ struct redwood_battery_state {int32_t usb_voltage_uv, usb_current_ua;};-extern "C" void RedwoodBatteryReport(const void * state, unsigned size);+extern "C" void HakiosBatteryReport(const void * state, unsigned size);-class RedwoodBattery : public IOPMPowerSource+class HakiosBattery : public IOPMPowerSource{- OSDeclareDefaultStructors(RedwoodBattery);+ OSDeclareDefaultStructors(HakiosBattery);public:- void report(const struct redwood_battery_state * b);+ void report(const struct hakios_battery_state * b);private:void number(const char * key, long long value);@@ -56,12 +56,12 @@ private:void object(const char * key, OSObject * value);};-OSDefineMetaClassAndStructors(RedwoodBattery, IOPMPowerSource);+OSDefineMetaClassAndStructors(HakiosBattery, IOPMPowerSource);-static RedwoodBattery * battery;+static HakiosBattery * battery;void-RedwoodBattery::number(const char * key, long long value)+HakiosBattery::number(const char * key, long long value){const OSSymbol * symbol = OSSymbol::withCString(key);OSNumber * n = OSNumber::withNumber((unsigned long long) value, 32);@@ -74,7 +74,7 @@ RedwoodBattery::number(const char * key, long long value)}void-RedwoodBattery::flag(const char * key, bool value)+HakiosBattery::flag(const char * key, bool value){const OSSymbol * symbol = OSSymbol::withCString(key);@@ -85,7 +85,7 @@ RedwoodBattery::flag(const char * key, bool value)}void-RedwoodBattery::object(const char * key, OSObject * value)+HakiosBattery::object(const char * key, OSObject * value){const OSSymbol * symbol = OSSymbol::withCString(key);@@ -113,7 +113,7 @@ family_code(int usb_type)}void-RedwoodBattery::report(const struct redwood_battery_state * b)+HakiosBattery::report(const struct hakios_battery_state * b){int percent = (b->percent_hundredths + 50) / 100;bool charging = b->external && b->status == 1; /* POWER_SUPPLY_STATUS_CHARGING */@@ -185,25 +185,25 @@ RedwoodBattery::report(const struct redwood_battery_state * b)updateStatus();}-/* With every reading of the battery (bsd/dev/redwood_battery.c); the first one makes the service. One caller at a time. */+/* With every reading of the battery (bsd/dev/hakios.battery.c); the first one makes the service. One caller at a time. */void-RedwoodBatteryReport(const void * state, unsigned size)+HakiosBatteryReport(const void * state, unsigned size){- const struct redwood_battery_state * b = (const struct redwood_battery_state *) state;+ const struct hakios_battery_state * b = (const struct hakios_battery_state *) state;IOService * platform;- if (size != sizeof(struct redwood_battery_state) || b->size != sizeof(struct redwood_battery_state)) {+ if (size != sizeof(struct hakios_battery_state) || b->size != sizeof(struct hakios_battery_state)) {static bool said;if (!said) {said = true;- IOLog("RedwoodBattery: the battery's state is %u bytes, not %lu: bsd/sys/redwood_input.h and this file disagree\n",- size, sizeof(struct redwood_battery_state));+ IOLog("HakiosBattery: the battery's state is %u bytes, not %lu: bsd/sys/hakios.input.h and this file disagree\n",+ size, sizeof(struct hakios_battery_state));}return;}if (battery == NULL) {- RedwoodBattery * made = OSTypeAlloc(RedwoodBattery);+ HakiosBattery * made = OSTypeAlloc(HakiosBattery);if ((platform = IOService::getPlatform()) == NULL || made == NULL || !made->init()) {OSSafeReleaseNULL(made);@@ -214,7 +214,7 @@ RedwoodBatteryReport(const void * state, unsigned size)made->release();return;}- made->setName("RedwoodBattery");+ made->setName("HakiosBattery");if (!made->start(platform)) {made->detach(platform);made->release();@@ -222,7 +222,7 @@ RedwoodBatteryReport(const void * state, unsigned size)}made->registerService();battery = made;- IOLog("RedwoodBattery: the battery's power source is up: %d%%, %s\n", (b->percent_hundredths + 50) / 100,+ IOLog("HakiosBattery: the battery's power source is up: %d%%, %s\n", (b->percent_hundredths + 50) / 100,b->external ? (b->status == 1 ? "charging" : "on a charger, not charging") : "not on a charger");return;}diff --git a/xnu/files/iokit/Kernel/RedwoodGPU.cpp b/xnu/files/iokit/Kernel/hakios.gpu.cppsimilarity index 82%rename from xnu/files/iokit/Kernel/RedwoodGPU.cpprename to xnu/files/iokit/Kernel/hakios.gpu.cppindex 8b2dc4d..26e8e97 100644--- a/xnu/files/iokit/Kernel/RedwoodGPU.cpp+++ b/xnu/files/iokit/Kernel/hakios.gpu.cpp@@ -1,11 +1,11 @@/*- * RedwoodGPU: the phone's Adreno for programs to draw with.+ * HakiosGPU: the phone's Adreno for programs to draw with.*- * bsd/dev/redwood_adreno.c wakes the GPU and, with boot-arg adreno_keep=1, keeps it on and+ * bsd/dev/hakios.adreno.c wakes the GPU and, with boot-arg adreno_keep=1, keeps it on and* starts this service. A program that opens it speaks the interface of Linux's msm DRM driver,* the one Mesa's freedreno knows: every request of that interface is a call of the user client* with the request's number as the selector and the request's structure passed in and back- * (userland: tools/mesa/redwood-drm, which stands in for libdrm inside Mesa). What Linux does+ * (userland: tools/mesa/hakios-drm, which stands in for libdrm inside Mesa). What Linux does* with mmap() on the device is the client memory of the type that is the buffer's handle.** What there is of the interface is what freedreno uses to draw: parameters, buffers (made,@@ -24,7 +24,7 @@* Not here yet: interrupts (waiting is asking again five times a millisecond), more than one* program's worth of care (every client's buffers are in the one address space; a client that* goes takes its own away), recovery of a GPU that has stopped answering (it is reported, see- * redwood_gpu_report(), and stays stopped), fences and buffers as file descriptors.+ * hakios_gpu_report(), and stays stopped), fences and buffers as file descriptors.*/#include <IOKit/IOLib.h>@@ -42,28 +42,28 @@#include "MiniIOSurface.h"-extern "C" void redwood_tl(const char * format, ...) __printflike(1, 2);+extern "C" void hakios_tl(const char * format, ...) __printflike(1, 2);extern "C" {-/* bsd/dev/redwood_adreno.c ("the GPU kept on"; declared in bsd/sys/redwood_input.h, which is not seen from here) */-bool redwood_gpu_ready(void);-bool redwood_gpu_parameter(uint32_t which, uint64_t * value);-uint64_t redwood_gpu_address(uint64_t size);-void redwood_gpu_address_free(uint64_t address, uint64_t size);-bool redwood_gpu_map(uint64_t address, uint64_t phys, bool read_only);-void redwood_gpu_mapped(void);-void redwood_gpu_unmap(uint64_t address, uint64_t size);-void redwood_gpu_to_memory(void * start, uint64_t size);-uint32_t redwood_gpu_submit(const uint64_t * addresses, const uint32_t * words, uint32_t count);+/* bsd/dev/hakios.adreno.c ("the GPU kept on"; declared in bsd/sys/hakios.input.h, which is not seen from here) */+bool hakios_gpu_ready(void);+bool hakios_gpu_parameter(uint32_t which, uint64_t * value);+uint64_t hakios_gpu_address(uint64_t size);+void hakios_gpu_address_free(uint64_t address, uint64_t size);+bool hakios_gpu_map(uint64_t address, uint64_t phys, bool read_only);+void hakios_gpu_mapped(void);+void hakios_gpu_unmap(uint64_t address, uint64_t size);+void hakios_gpu_to_memory(void * start, uint64_t size);+uint32_t hakios_gpu_submit(const uint64_t * addresses, const uint32_t * words, uint32_t count);extern uint32_t gpu_log;-bool redwood_gpu_done(uint32_t fence);-uint32_t redwood_gpu_last(void);-void redwood_gpu_worked(uint64_t * microseconds, uint32_t * submissions, uint32_t by[7]);-void redwood_gpu_report(const char * why);-void redwood_gpu_stop(void);--void RedwoodGPUStart(void);-void RedwoodGPUStop(void);+bool hakios_gpu_done(uint32_t fence);+uint32_t hakios_gpu_last(void);+void hakios_gpu_worked(uint64_t * microseconds, uint32_t * submissions, uint32_t by[7]);+void hakios_gpu_report(const char * why);+void hakios_gpu_stop(void);++void HakiosGPUStart(void);+void HakiosGPUStop(void);void MiniIOMobileFramebufferShow(const uint8_t * pixels, uint32_t width, uint32_t height, uint32_t rowBytes);}@@ -82,8 +82,8 @@ enum {kMsmSubmitQueueNew = 0x4a,kMsmSubmitQueueClose = 0x4b,kMsmSubmitQueueQuery = 0x4c,- kRedwoodSurface = 0x7e, /* ours: an IOSurface's memory as a buffer */- kRedwoodShow = 0x7f, /* ours: pixels of the caller's onto the panel, to see a test's result */+ kHakiosSurface = 0x7e, /* ours: an IOSurface's memory as a buffer */+ kHakiosShow = 0x7f, /* ours: pixels of the caller's onto the panel, to see a test's result */};struct msm_timespec {@@ -141,19 +141,19 @@ struct msm_submitqueue_query {struct drm_gem_close {uint32_t handle, pad;};-struct redwood_surface {+struct hakios_surface {uint32_t surface; /* the IOSurface's ID */- uint32_t handle; /* kRedwoodDescribe: no buffer is wanted; else, back: the buffer, */+ uint32_t handle; /* kHakiosDescribe: no buffer is wanted; else, back: the buffer, */uint64_t size; /* how big it is, */uint32_t offset, rowBytes; /* where the pixels start in it and how long a row of them is, */uint32_t width, height, pixelFormat, planes; /* and what they are */};-struct redwood_show {+struct hakios_show {uint64_t pixels;uint32_t width, height, rowBytes, pad;};-#define kRedwoodDescribe 0xffffffffu+#define kHakiosDescribe 0xffffffffu#define MSM_INFO_GET_OFFSET 0#define MSM_INFO_GET_IOVA 1@@ -172,7 +172,7 @@ struct redwood_show {#define GPU_ASK_AGAIN_US 200 /* while waiting for the core: how long between two looks at how far it is */#define GPU_PUSH_AGAIN_MS 4 /* a surface is pushed out of the cache again for a submission this long after the last */-static IOLock * gGPULock; /* around everything that is the GPU's (redwood_gpu_...) */+static IOLock * gGPULock; /* around everything that is the GPU's (hakios_gpu_...) */static bool gGPUReported;static bool gGPUCached; /* boot-arg gpu_cached=1 */@@ -193,7 +193,7 @@ gpuWait(uint32_t fence, uint64_t milliseconds)nanoseconds_to_absolutetime(milliseconds * NSEC_PER_MSEC, &patience);for (bool waited = false;; waited = true) {- if (redwood_gpu_done(fence)) {+ if (hakios_gpu_done(fence)) {if (waited) {gGPUStat.waits++;gGPUStat.waiting += mach_absolute_time() - began;@@ -209,7 +209,7 @@ gpuWait(uint32_t fence, uint64_t milliseconds)}if (milliseconds >= 1000 && !gGPUReported) {gGPUReported = true;- redwood_gpu_report("no answer");+ hakios_gpu_report("no answer");}return false;}@@ -222,7 +222,7 @@ MiniIOSurfaceDrawn(MiniIOSurface * surface, uint64_t milliseconds)if (fence != 0 && gGPULock != NULL) {IOLockLock(gGPULock);- done = !redwood_gpu_ready() || gpuWait(fence, milliseconds);+ done = !hakios_gpu_ready() || gpuWait(fence, milliseconds);IOLockUnlock(gGPULock);}return done;@@ -245,7 +245,7 @@ slowWait(const char * kind, uint64_t began)absolutetime_to_nanoseconds(now - began, &ns);if (ns >= NSEC_PER_MSEC) {absolutetime_to_nanoseconds(now, &at);- redwood_tl("tl: f %s %llu at %llu\n", kind, ns / 1000, at / 1000);+ hakios_tl("tl: f %s %llu at %llu\n", kind, ns / 1000, at / 1000);}}@@ -279,63 +279,63 @@ waitOver(const struct msm_timespec * when, uint32_t fence)if (told < 4) {told++;absolutetime_to_nanoseconds(mach_continuous_time(), &now);- IOLog("RedwoodGPU: a wait for submission %u, which is not done, until %lld.%09lld s, asked for at %llu.%09llu s: "+ IOLog("HakiosGPU: a wait for submission %u, which is not done, until %lld.%09lld s, asked for at %llu.%09llu s: ""over before it began\n", fence, when->seconds, when->nanoseconds, now / NSEC_PER_SEC, now % NSEC_PER_SEC);}}/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */-class RedwoodGPU : public IOService+class HakiosGPU : public IOService{- OSDeclareDefaultStructors(RedwoodGPU);+ OSDeclareDefaultStructors(HakiosGPU);public:virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;};-OSDefineMetaClassAndStructors(RedwoodGPU, IOService);+OSDefineMetaClassAndStructors(HakiosGPU, IOService);bool-RedwoodGPU::start(IOService * provider)+HakiosGPU::start(IOService * provider){if (!IOService::start(provider)) {return false;}- setProperty(kIOUserClientClassKey, "RedwoodGPUUserClient");- setName("RedwoodGPU");+ setProperty(kIOUserClientClassKey, "HakiosGPUUserClient");+ setName("HakiosGPU");registerService();return true;}void-RedwoodGPUStart(void)+HakiosGPUStart(void){IOService * provider = IOService::getPlatform();- RedwoodGPU * gpu;+ HakiosGPU * gpu;uint32_t cached = 0;gGPUCached = PE_parse_boot_argn("gpu_cached", &cached, sizeof(cached)) && cached != 0;gGPULock = IOLockAlloc();- gpu = OSTypeAlloc(RedwoodGPU);+ gpu = OSTypeAlloc(HakiosGPU);if (gpu == NULL || provider == NULL || !gpu->init() || !gpu->attach(provider)) {OSSafeReleaseNULL(gpu);- IOLog("RedwoodGPU: cannot create the service\n");+ IOLog("HakiosGPU: cannot create the service\n");return;}if (!gpu->start(provider)) {gpu->detach(provider);- IOLog("RedwoodGPU: the service did not start\n");+ IOLog("HakiosGPU: the service did not start\n");}gpu->release();}-/* The run is ending (redwood_adreno.c): nobody is in the middle of anything when the GPU goes. */+/* The run is ending (hakios.adreno.c): nobody is in the middle of anything when the GPU goes. */void-RedwoodGPUStop(void)+HakiosGPUStop(void){IOLockLock(gGPULock);- redwood_gpu_stop();+ hakios_gpu_stop();IOLockUnlock(gGPULock);}@@ -393,9 +393,9 @@ struct gpu_kept {#define GPU_KEEP_FROM (256u << 10) /* bytes: smaller ones are not worth it */static TUNABLE(uint32_t, gGPUKeep, "gpu_keep", 1); /* boot-arg gpu_keep=0 (a test): none kept; gpu_keep=2: kept ones cleared when given again */-class RedwoodGPUUserClient : public IOUserClient+class HakiosGPUUserClient : public IOUserClient{- OSDeclareDefaultStructors(RedwoodGPUUserClient);+ OSDeclareDefaultStructors(HakiosGPUUserClient);task_t fTask;struct gpu_buffer * fBuffers; /* handle n is fBuffers[n - 1] */@@ -417,10 +417,10 @@ class RedwoodGPUUserClient : public IOUserClientvoid dropKept(struct gpu_kept * k);void reap(void);IOReturn gemNew(struct msm_gem_new * request);- IOReturn surfaceBuffer(struct redwood_surface * request);+ IOReturn surfaceBuffer(struct hakios_surface * request);IOReturn gemInfo(struct msm_gem_info * request);IOReturn submit(struct msm_gem_submit * request);- IOReturn show(const struct redwood_show * request);+ IOReturn show(const struct hakios_show * request);public:virtual bool initWithTask(task_t owningTask, void * securityID, UInt32 type, OSDictionary * properties) APPLE_KEXT_OVERRIDE;@@ -432,10 +432,10 @@ public:IOExternalMethodDispatch * dispatch, OSObject * target, void * reference) APPLE_KEXT_OVERRIDE;};-OSDefineMetaClassAndStructors(RedwoodGPUUserClient, IOUserClient);+OSDefineMetaClassAndStructors(HakiosGPUUserClient, IOUserClient);bool-RedwoodGPUUserClient::initWithTask(task_t owningTask, void * securityID, UInt32 type, OSDictionary * properties)+HakiosGPUUserClient::initWithTask(task_t owningTask, void * securityID, UInt32 type, OSDictionary * properties){if (!IOUserClient::initWithTask(owningTask, securityID, type, properties)) {return false;@@ -445,9 +445,9 @@ RedwoodGPUUserClient::initWithTask(task_t owningTask, void * securityID, UInt32}bool-RedwoodGPUUserClient::start(IOService * provider)+HakiosGPUUserClient::start(IOService * provider){- if (!redwood_gpu_ready() || !IOUserClient::start(provider)) {+ if (!hakios_gpu_ready() || !IOUserClient::start(provider)) {return false;}fBuffers = IONewZero(struct gpu_buffer, GPU_BUFFERS);@@ -460,9 +460,9 @@ RedwoodGPUUserClient::start(IOService * provider)* written, and must not be somebody else's by then.*/void-RedwoodGPUUserClient::freeBuffer(struct gpu_buffer * b)+HakiosGPUUserClient::freeBuffer(struct gpu_buffer * b){- bool busy = redwood_gpu_ready() && b->fence != 0 && !redwood_gpu_done(b->fence);+ bool busy = hakios_gpu_ready() && b->fence != 0 && !hakios_gpu_done(b->fence);if (busy && fLeftCount == GPU_LEFT) {busy = !gpuWait(b->fence, 1000); /* (nowhere to keep it: this one is waited for) */@@ -486,13 +486,13 @@ RedwoodGPUUserClient::freeBuffer(struct gpu_buffer * b)b->surface->memory->retain();}if (said++ < 8) {- IOLog("RedwoodGPU: the GPU is not done with what it was given: a buffer of %llu bytes stays its own\n", b->size);+ IOLog("HakiosGPU: the GPU is not done with what it was given: a buffer of %llu bytes stays its own\n", b->size);}- } else if (b->surface == NULL && redwood_gpu_ready() && keep(b->memory, b->kernel, b->address, b->size, b->flags)) {+ } else if (b->surface == NULL && hakios_gpu_ready() && keep(b->memory, b->kernel, b->address, b->size, b->flags)) {b->memory = NULL; /* (now the kept one's) */- } else if (redwood_gpu_ready()) {- redwood_gpu_unmap(b->address, b->size);- redwood_gpu_address_free(b->address, b->size);+ } else if (hakios_gpu_ready()) {+ hakios_gpu_unmap(b->address, b->size);+ hakios_gpu_address_free(b->address, b->size);}if (b->memory != NULL) {b->memory->release();@@ -509,21 +509,21 @@ RedwoodGPUUserClient::freeBuffer(struct gpu_buffer * b)/* The buffers that were given back early and that the GPU is done with now: freed. With the lock held. */void-RedwoodGPUUserClient::reap(void)+HakiosGPUUserClient::reap(void){for (uint32_t i = 0; i < fLeftCount;) {struct gpu_left * left = &fLeft[i];- if (redwood_gpu_ready() && !redwood_gpu_done(left->fence)) {+ if (hakios_gpu_ready() && !hakios_gpu_done(left->fence)) {i++;continue;}- if (left->surface == NULL && redwood_gpu_ready() &&+ if (left->surface == NULL && hakios_gpu_ready() &&keep(left->memory, NULL, left->address, left->size, left->flags)) {left->memory = NULL;- } else if (redwood_gpu_ready()) {- redwood_gpu_unmap(left->address, left->size);- redwood_gpu_address_free(left->address, left->size);+ } else if (hakios_gpu_ready()) {+ hakios_gpu_unmap(left->address, left->size);+ hakios_gpu_address_free(left->address, left->size);}if (left->memory != NULL) {left->memory->release();@@ -536,13 +536,13 @@ RedwoodGPUUserClient::reap(void)}IOReturn-RedwoodGPUUserClient::clientClose(void)+HakiosGPUUserClient::clientClose(void){if (fBuffers != NULL) {IOLockLock(gGPULock);/* what the client had the GPU do last may still be going on, in these buffers */- if (redwood_gpu_ready()) {- gpuWait(redwood_gpu_last(), 1000);+ if (hakios_gpu_ready()) {+ gpuWait(hakios_gpu_last(), 1000);}for (uint32_t i = 0; i < GPU_BUFFERS; i++) {if (fBuffers[i].memory != NULL) {@@ -554,7 +554,7 @@ RedwoodGPUUserClient::clientClose(void)dropKept(&fKept[i]);}if (fLeftCount != 0) {- IOLog("RedwoodGPU: the GPU is not done with %u buffers of a program that is gone: they stay its own\n", fLeftCount);+ IOLog("HakiosGPU: the GPU is not done with %u buffers of a program that is gone: they stay its own\n", fLeftCount);}IOLockUnlock(gGPULock);}@@ -565,7 +565,7 @@ RedwoodGPUUserClient::clientClose(void)}void-RedwoodGPUUserClient::free(void)+HakiosGPUUserClient::free(void){if (fBuffers != NULL) {IODelete(fBuffers, struct gpu_buffer, GPU_BUFFERS);@@ -575,12 +575,12 @@ RedwoodGPUUserClient::free(void)}struct gpu_buffer *-RedwoodGPUUserClient::buffer(uint32_t handle)+HakiosGPUUserClient::buffer(uint32_t handle){if (handle == 0 || handle > GPU_BUFFERS || fBuffers[handle - 1].memory == NULL) {/* (a program that names a buffer it has given back draws into somebody else's next: worth knowing) */if (handle != 0 && fStrangers++ < 16) {- IOLog("RedwoodGPU: buffer %u is asked for and is not there\n", handle);+ IOLog("HakiosGPU: buffer %u is asked for and is not there\n", handle);}return NULL;}@@ -592,7 +592,7 @@ RedwoodGPUUserClient::buffer(uint32_t handle)* of it on (wired memory; both in whole pages). With the lock held; NULL: there is no room.*/struct gpu_buffer *-RedwoodGPUUserClient::newBuffer(IOMemoryDescriptor * memory, uint64_t from, uint64_t size, uint32_t flags, uint32_t * handle)+HakiosGPUUserClient::newBuffer(IOMemoryDescriptor * memory, uint64_t from, uint64_t size, uint32_t flags, uint32_t * handle){struct gpu_buffer * b = NULL;bool mapped = true;@@ -607,21 +607,21 @@ RedwoodGPUUserClient::newBuffer(IOMemoryDescriptor * memory, uint64_t from, uintbreak;}}- if (b == NULL || (b->address = redwood_gpu_address(size)) == 0) {- IOLog("RedwoodGPU: no %s left for a buffer of %llu bytes\n", b ? "addresses" : "handles", size);+ if (b == NULL || (b->address = hakios_gpu_address(size)) == 0) {+ IOLog("HakiosGPU: no %s left for a buffer of %llu bytes\n", b ? "addresses" : "handles", size);return NULL;}for (uint64_t offset = 0; offset < size && mapped; offset += 4096) {IOByteCount length = 0;addr64_t phys = memory->getPhysicalSegment(from + offset, &length, kIOMemoryMapperNone);- mapped = phys != 0 && redwood_gpu_map(b->address + offset, phys, flags & MSM_BO_GPU_READONLY);+ mapped = phys != 0 && hakios_gpu_map(b->address + offset, phys, flags & MSM_BO_GPU_READONLY);}- redwood_gpu_mapped();+ hakios_gpu_mapped();if (!mapped) {- redwood_gpu_unmap(b->address, size);- redwood_gpu_address_free(b->address, size);- IOLog("RedwoodGPU: a buffer of %llu bytes cannot be entered into the GPU's address space\n", size);+ hakios_gpu_unmap(b->address, size);+ hakios_gpu_address_free(b->address, size);+ IOLog("HakiosGPU: a buffer of %llu bytes cannot be entered into the GPU's address space\n", size);return NULL;}b->size = size;@@ -638,14 +638,14 @@ RedwoodGPUUserClient::newBuffer(IOMemoryDescriptor * memory, uint64_t from, uint/* With the lock held. */void-RedwoodGPUUserClient::dropKept(struct gpu_kept * k)+HakiosGPUUserClient::dropKept(struct gpu_kept * k){if (k->memory == NULL) {return;}- if (redwood_gpu_ready()) {- redwood_gpu_unmap(k->address, k->size);- redwood_gpu_address_free(k->address, k->size);+ if (hakios_gpu_ready()) {+ hakios_gpu_unmap(k->address, k->size);+ hakios_gpu_address_free(k->address, k->size);}k->memory->release();k->memory = NULL;@@ -654,7 +654,7 @@ RedwoodGPUUserClient::dropKept(struct gpu_kept * k)/* With the lock held, the GPU done with the buffer: kept if it is worth it (those kept longest make way). */bool-RedwoodGPUUserClient::keep(IOMemoryDescriptor * memory, uint8_t * kernel, uint64_t address, uint64_t size, uint32_t flags)+HakiosGPUUserClient::keep(IOMemoryDescriptor * memory, uint8_t * kernel, uint64_t address, uint64_t size, uint32_t flags){struct gpu_kept * place = NULL;@@ -689,7 +689,7 @@ RedwoodGPUUserClient::keep(IOMemoryDescriptor * memory, uint8_t * kernel, uint64}IOReturn-RedwoodGPUUserClient::gemNew(struct msm_gem_new * request)+HakiosGPUUserClient::gemNew(struct msm_gem_new * request){uint64_t size = round_page_64(request->size), began = mach_absolute_time();struct gpu_buffer * b;@@ -745,12 +745,12 @@ RedwoodGPUUserClient::gemNew(struct msm_gem_new * request)memory = IOBufferMemoryDescriptor::inTaskWithOptions(kernel_task, kIODirectionInOut | kIOMemoryKernelUserShared |(gGPUCached ? 0 : kIOMapWriteCombineCache), (vm_size_t) size, PAGE_SIZE);if (memory == NULL) {- IOLog("RedwoodGPU: no memory for a buffer of %llu bytes (%u buffers, %llu MB with this client)\n", size, fBufferCount,+ IOLog("HakiosGPU: no memory for a buffer of %llu bytes (%u buffers, %llu MB with this client)\n", size, fBufferCount,fBufferBytes >> 20);return kIOReturnNoMemory;}if (gGPUCached) {- redwood_gpu_to_memory(memory->getBytesNoCopy(), size);+ hakios_gpu_to_memory(memory->getBytesNoCopy(), size);}IOLockLock(gGPULock);@@ -774,10 +774,10 @@ RedwoodGPUUserClient::gemNew(struct msm_gem_new * request)* state on (MiniIOSurface.h). The surface is held for as long as the buffer is there. A surface* that is a buffer of this client's already is that buffer again, as with Linux's handles: so* the client must not be giving that buffer back at the same moment (freedreno asks under the- * lock it gives buffers back under). Asked only to describe (kRedwoodDescribe), no buffer is made.+ * lock it gives buffers back under). Asked only to describe (kHakiosDescribe), no buffer is made.*/IOReturn-RedwoodGPUUserClient::surfaceBuffer(struct redwood_surface * request)+HakiosGPUUserClient::surfaceBuffer(struct hakios_surface * request){MiniIOSurface * s = MiniIOSurfaceCopy(request->surface);struct gpu_buffer * b = NULL;@@ -806,7 +806,7 @@ RedwoodGPUUserClient::surfaceBuffer(struct redwood_surface * request)request->height = s->info.height;request->pixelFormat = s->info.pixelFormat;request->planes = s->info.planeCount;- if (request->handle == kRedwoodDescribe) {+ if (request->handle == kHakiosDescribe) {request->handle = 0;memory->release();MiniIOSurfaceDrop(s);@@ -841,7 +841,7 @@ RedwoodGPUUserClient::surfaceBuffer(struct redwood_surface * request)}IOReturn-RedwoodGPUUserClient::gemInfo(struct msm_gem_info * request)+HakiosGPUUserClient::gemInfo(struct msm_gem_info * request){struct gpu_buffer * b;IOReturn ret = kIOReturnSuccess;@@ -864,7 +864,7 @@ RedwoodGPUUserClient::gemInfo(struct msm_gem_info * request)}IOReturn-RedwoodGPUUserClient::submit(struct msm_gem_submit * request)+HakiosGPUUserClient::submit(struct msm_gem_submit * request){struct msm_gem_submit_bo * bos = NULL;struct msm_gem_submit_cmd * cmds = NULL;@@ -874,7 +874,7 @@ RedwoodGPUUserClient::submit(struct msm_gem_submit * request)IOReturn ret = kIOReturnBadArgument;if (request->nr_cmds == 0 || request->nr_cmds > GPU_SUBMIT_CMDS || request->nr_bos == 0 || request->nr_bos > GPU_SUBMIT_BOS) {- IOLog("RedwoodGPU: a submission of %u command buffers in %u buffers: not taken\n", request->nr_cmds, request->nr_bos);+ IOLog("HakiosGPU: a submission of %u command buffers in %u buffers: not taken\n", request->nr_cmds, request->nr_bos);return kIOReturnBadArgument;}bos = IONew(struct msm_gem_submit_bo, request->nr_bos);@@ -919,10 +919,10 @@ RedwoodGPUUserClient::submit(struct msm_gem_submit * request)} else if (!b->seen || !gGPUCached) {continue;}- redwood_gpu_to_memory(b->kernel, b->size);+ hakios_gpu_to_memory(b->kernel, b->size);gGPUStat.flushed += b->size;}- redwood_gpu_to_memory(NULL, 0); /* (and what was written last is in memory: a barrier) */+ hakios_gpu_to_memory(NULL, 0); /* (and what was written last is in memory: a barrier) */gGPUStat.flushing += mach_absolute_time() - began;gGPUStat.buffers += request->nr_bos;for (uint32_t i = 0; i < request->nr_cmds; i++) {@@ -933,7 +933,7 @@ RedwoodGPUUserClient::submit(struct msm_gem_submit * request)}if (b == NULL || cmds[i].nr_relocs != 0 || (cmds[i].size & 3) || (cmds[i].submit_offset & 3) ||(uint64_t) cmds[i].submit_offset + cmds[i].size > b->size) {- IOLog("RedwoodGPU: command buffer %u of a submission: buffer %u, offset %u, %u bytes, %u relocations: not taken\n",+ IOLog("HakiosGPU: command buffer %u of a submission: buffer %u, offset %u, %u bytes, %u relocations: not taken\n",i, cmds[i].submit_idx, cmds[i].submit_offset, cmds[i].size, cmds[i].nr_relocs);IOLockUnlock(gGPULock);goto out;@@ -941,7 +941,7 @@ RedwoodGPUUserClient::submit(struct msm_gem_submit * request)addresses[count] = b->address + cmds[i].submit_offset;words[count++] = cmds[i].size / 4;}- request->fence = redwood_gpu_submit(addresses, words, count);+ request->fence = hakios_gpu_submit(addresses, words, count);if (gpu_log && request->fence != 0) {/* "tl: Q FENCE at US: N buffers, B of 4 MB or more, W words of commands": what was given (tl: q: what it took) */uint32_t big = 0, all_words = 0;@@ -956,7 +956,7 @@ RedwoodGPUUserClient::submit(struct msm_gem_submit * request)all_words += words[i];}absolutetime_to_nanoseconds(mach_absolute_time(), &ns);- redwood_tl("tl: Q %u at %llu: %u buffers, %u big, %u words\n", request->fence, ns / 1000, request->nr_bos, big, all_words);+ hakios_tl("tl: Q %u at %llu: %u buffers, %u big, %u words\n", request->fence, ns / 1000, request->nr_bos, big, all_words);}if (request->flags & MSM_SUBMIT_FENCE_FD_OUT) {request->fence_fd = -1;@@ -980,10 +980,10 @@ RedwoodGPUUserClient::submit(struct msm_gem_submit * request)reap();if (request->fence == 0 && !gGPUReported) {gGPUReported = true;- redwood_gpu_report("the ring is full");+ hakios_gpu_report("the ring is full");}if (fSubmits++ < 4) {- IOLog("RedwoodGPU: submission %u: %u command buffers, the first at %#llx, %u words\n", request->fence, count,+ IOLog("HakiosGPU: submission %u: %u command buffers, the first at %#llx, %u words\n", request->fence, count,addresses[0], words[0]);}/* every five seconds in which something was submitted: how much, and what it cost here */@@ -1000,13 +1000,13 @@ RedwoodGPUUserClient::submit(struct msm_gem_submit * request)absolutetime_to_nanoseconds(gGPUStat.flushing, &flushing);absolutetime_to_nanoseconds(gGPUStat.waiting, &waiting);absolutetime_to_nanoseconds(gGPUStat.taking, &taking);- redwood_gpu_worked(&worked, &timed, by);+ hakios_gpu_worked(&worked, &timed, by);uint64_t making;absolutetime_to_nanoseconds(gGPUStat.making, &making);- IOLog("RedwoodGPU: buffers: %u made in %llu us each, %u kept ones given again (%llu MB kept)\n", gGPUStat.made,+ IOLog("HakiosGPU: buffers: %u made in %llu us each, %u kept ones given again (%llu MB kept)\n", gGPUStat.made,gGPUStat.made ? making / NSEC_PER_USEC / gGPUStat.made : 0, gGPUStat.given_again, fKeptBytes >> 20);- IOLog("RedwoodGPU: %u submissions in %llu ms: %u command buffers and %u buffers named, %llu KB out of the cache "+ IOLog("HakiosGPU: %u submissions in %llu ms: %u command buffers and %u buffers named, %llu KB out of the cache ""in %llu us a submission; the GPU worked %llu us on each of %u (%u under 0.1 ms, %u under 0.25, %u under 0.5, ""%u under 1, %u under 2, %u under 4, %u longer; %llu ms in all); %u waits of %llu us, %u over before they ""began; %u IOSurfaces taken as buffers in %llu us each; %u buffers, %llu MB\n",@@ -1032,7 +1032,7 @@ out:/* Pixels of the caller's (32 bits each, blue first) copied to the panel: for a test to show what it has drawn. */IOReturn-RedwoodGPUUserClient::show(const struct redwood_show * request)+HakiosGPUUserClient::show(const struct hakios_show * request){uint64_t size = (uint64_t) request->rowBytes * request->height;uint8_t * pixels;@@ -1056,7 +1056,7 @@ RedwoodGPUUserClient::show(const struct redwood_show * request)}IOReturn-RedwoodGPUUserClient::clientMemoryForType(UInt32 type, IOOptionBits * options, IOMemoryDescriptor ** memory)+HakiosGPUUserClient::clientMemoryForType(UInt32 type, IOOptionBits * options, IOMemoryDescriptor ** memory){struct gpu_buffer * b;IOReturn ret = kIOReturnBadArgument;@@ -1075,7 +1075,7 @@ RedwoodGPUUserClient::clientMemoryForType(UInt32 type, IOOptionBits * options, I}IOReturn-RedwoodGPUUserClient::externalMethod(uint32_t selector, IOExternalMethodArguments * args,+HakiosGPUUserClient::externalMethod(uint32_t selector, IOExternalMethodArguments * args,IOExternalMethodDispatch * dispatch, OSObject * target, void * reference){union {@@ -1089,8 +1089,8 @@ RedwoodGPUUserClient::externalMethod(uint32_t selector, IOExternalMethodArgumentstruct msm_submitqueue queue;struct msm_submitqueue_query query;struct drm_gem_close close;- struct redwood_surface surface;- struct redwood_show show;+ struct hakios_surface surface;+ struct hakios_show show;} r;size_t size = args->structureInputSize;struct gpu_buffer * b;@@ -1100,7 +1100,7 @@ RedwoodGPUUserClient::externalMethod(uint32_t selector, IOExternalMethodArgumentif (args->structureInput == NULL || size > sizeof(r) || fBuffers == NULL) {return kIOReturnBadArgument;}- if (!redwood_gpu_ready() && selector != kRedwoodShow) {+ if (!hakios_gpu_ready() && selector != kHakiosShow) {return kIOReturnNotReady; /* given back: the run is ending */}bzero(&r, sizeof(r));@@ -1108,7 +1108,7 @@ RedwoodGPUUserClient::externalMethod(uint32_t selector, IOExternalMethodArgumentswitch (selector) {case kMsmGetParam:- ret = redwood_gpu_parameter(r.param.param, &r.param.value) ? kIOReturnSuccess : kIOReturnBadArgument;+ ret = hakios_gpu_parameter(r.param.param, &r.param.value) ? kIOReturnSuccess : kIOReturnBadArgument;break;case kMsmSetParam: /* the program's name, for Linux's lists of who uses the GPU */case kMsmGemCpuFini:@@ -1124,10 +1124,10 @@ RedwoodGPUUserClient::externalMethod(uint32_t selector, IOExternalMethodArgumentwaitBegan = mach_absolute_time();IOLockLock(gGPULock);patience = (r.cpuPrep.op & MSM_PREP_NOSYNC) ? 0 : millisecondsUntil(&r.cpuPrep.timeout);- if (!gpuWait(redwood_gpu_last(), patience)) {+ if (!gpuWait(hakios_gpu_last(), patience)) {ret = kIOReturnBusy;if (patience == 0 && !(r.cpuPrep.op & MSM_PREP_NOSYNC)) {- waitOver(&r.cpuPrep.timeout, redwood_gpu_last());+ waitOver(&r.cpuPrep.timeout, hakios_gpu_last());}}IOLockUnlock(gGPULock);@@ -1171,14 +1171,14 @@ RedwoodGPUUserClient::externalMethod(uint32_t selector, IOExternalMethodArgument}IOLockUnlock(gGPULock);break;- case kRedwoodSurface:+ case kHakiosSurface:ret = surfaceBuffer(&r.surface);break;- case kRedwoodShow:+ case kHakiosShow:ret = show(&r.show);break;default:- IOLog("RedwoodGPU: request %#x (%zu bytes) is not known here\n", selector, size);+ IOLog("HakiosGPU: request %#x (%zu bytes) is not known here\n", selector, size);ret = kIOReturnUnsupported;break;}diff --git a/xnu/files/iokit/Kernel/RedwoodWLAN.cpp b/xnu/files/iokit/Kernel/hakios.wlan.cppsimilarity index 79%rename from xnu/files/iokit/Kernel/RedwoodWLAN.cpprename to xnu/files/iokit/Kernel/hakios.wlan.cppindex 89d8840..8dcd233 100644--- a/xnu/files/iokit/Kernel/RedwoodWLAN.cpp+++ b/xnu/files/iokit/Kernel/hakios.wlan.cpp@@ -1,14 +1,14 @@/*- * RedwoodWLAN: the registry entries by which iOS finds the Wi-Fi interface.+ * HakiosWLAN: the registry entries by which iOS finds the Wi-Fi interface.*- * en0 is made with the BSD interface KPI (bsd/dev/redwood_net.c) and has no IOKit object behind+ * en0 is made with the BSD interface KPI (bsd/dev/hakios.net.c) and has no IOKit object behind* it of its own; iOS looks for two, as IO80211Family would have made them:** - wifid's device is whatever service has the property IO80211InterfaceRole =* "Infrastructure", and IO80211.framework binds to an interface through a service whose* IOInterfaceName is the interface's name. The service has no user client, on purpose:* the framework's attempt to open one fails, it says "Falling back to IOCTL path", and- * from then on every request is an ioctl on a socket, which bsd/dev/redwood_apple80211.c+ * from then on every request is an ioctl on a socket, which bsd/dev/hakios.apple80211.c* answers.* - SystemConfiguration (SCNetworkInterfaceCopyAll) lists the network interfaces it finds as* objects of the class IONetworkInterface, and calls one a Wi-Fi interface when its parent@@ -30,7 +30,7 @@#include <libkern/c++/OSData.h>#include <libkern/c++/OSNumber.h>-extern "C" void RedwoodWLANStart(const char * interface, const uint8_t * address);+extern "C" void HakiosWLANStart(const char * interface, const uint8_t * address);class IO80211Controller : public IOService{@@ -46,25 +46,25 @@ class IONetworkInterface : public IOServiceOSDefineMetaClassAndStructors(IONetworkInterface, IOService);-class RedwoodWLAN : public IONetworkInterface+class HakiosWLAN : public IONetworkInterface{- OSDeclareDefaultStructors(RedwoodWLAN);+ OSDeclareDefaultStructors(HakiosWLAN);public:virtual IOReturn newUserClient(task_t owningTask, void * securityID, UInt32 type, OSDictionary * properties,IOUserClient ** handler) APPLE_KEXT_OVERRIDE;};-OSDefineMetaClassAndStructors(RedwoodWLAN, IONetworkInterface);+OSDefineMetaClassAndStructors(HakiosWLAN, IONetworkInterface);/* There is none (see the top); that somebody asked shows that the service was found. */IOReturn-RedwoodWLAN::newUserClient(task_t owningTask, void * securityID, UInt32 type, OSDictionary * properties, IOUserClient ** handler)+HakiosWLAN::newUserClient(task_t owningTask, void * securityID, UInt32 type, OSDictionary * properties, IOUserClient ** handler){static unsigned said;if (said++ < 8) {- IOLog("RedwoodWLAN: a user client of type %u is asked for: there is none\n", (unsigned) type);+ IOLog("HakiosWLAN: a user client of type %u is asked for: there is none\n", (unsigned) type);}return kIOReturnUnsupported;}@@ -89,18 +89,18 @@ publish(IOService * service, IOService * provider, const char * name)/* Once, when the interface of a radio exists. */void-RedwoodWLANStart(const char * interface, const uint8_t * address)+HakiosWLANStart(const char * interface, const uint8_t * address){IOService * platform = IOService::getPlatform();IO80211Controller * controller = OSTypeAlloc(IO80211Controller);- RedwoodWLAN * wlan = OSTypeAlloc(RedwoodWLAN);+ HakiosWLAN * wlan = OSTypeAlloc(HakiosWLAN);OSData * mac;OSNumber * number;if (platform == NULL || controller == NULL || wlan == NULL || !controller->init() || !wlan->init()) {OSSafeReleaseNULL(controller);OSSafeReleaseNULL(wlan);- IOLog("RedwoodWLAN: cannot create the services\n");+ IOLog("HakiosWLAN: cannot create the services\n");return;}if ((mac = OSData::withBytes(address, 6)) != NULL) {@@ -108,9 +108,9 @@ RedwoodWLANStart(const char * interface, const uint8_t * address)mac->release();}controller->setProperty("IOBuiltin", true);- if ((controller = (IO80211Controller *) publish(controller, platform, "RedwoodWLANController")) == NULL) {+ if ((controller = (IO80211Controller *) publish(controller, platform, "HakiosWLANController")) == NULL) {wlan->release();- IOLog("RedwoodWLAN: the controller did not start\n");+ IOLog("HakiosWLAN: the controller did not start\n");return;}@@ -128,8 +128,8 @@ RedwoodWLANStart(const char * interface, const uint8_t * address)wlan->setProperty("IOBuiltin", true);wlan->setProperty("IOPrimaryInterface", true);wlan->setProperty("IO80211InterfaceRole", "Infrastructure");- if (publish(wlan, controller, "RedwoodWLAN") == NULL) {- IOLog("RedwoodWLAN: the service did not start\n");+ if (publish(wlan, controller, "HakiosWLAN") == NULL) {+ IOLog("HakiosWLAN: the service did not start\n");} else {wlan->release();}diff --git a/xnu/files/osfmk/arm64/loader_return.c b/xnu/files/osfmk/arm64/loader_return.cindex bde30ee..9dcd99b 100644--- a/xnu/files/osfmk/arm64/loader_return.c+++ b/xnu/files/osfmk/arm64/loader_return.c@@ -44,22 +44,22 @@ extern void gic_v3_irq_cpu_shutdown(void);void loader_log_putc(char c);void loader_return(void);-extern void redwood_adreno_quiesce(void);-extern void redwood_adreno_stop(void);-extern void redwood_adreno_minute(void);-extern void redwood_wifi_stop(void);-extern void redwood_wifi_quiesce(void);-extern void redwood_adsp_stop(void);-extern void redwood_adsp_quiesce(void);-extern void redwood_mpss_stop(void);-extern void redwood_mpss_quiesce(void);-extern void redwood_ddr_quiesce(void);-extern void redwood_haptic_quiesce(void);-extern void redwood_torch_quiesce(void);-extern void redwood_camera_quiesce(void);-extern void redwood_mic_quiesce(void);-extern void redwood_ufs_quiesce(void);-extern void redwood_var_save_on_return(void); /* bsd/dev/redwood_ufs.c: the data volume into the flash */+extern void hakios_adreno_quiesce(void);+extern void hakios_adreno_stop(void);+extern void hakios_adreno_minute(void);+extern void hakios_wifi_stop(void);+extern void hakios_wifi_quiesce(void);+extern void hakios_adsp_stop(void);+extern void hakios_adsp_quiesce(void);+extern void hakios_mpss_stop(void);+extern void hakios_mpss_quiesce(void);+extern void hakios_ddr_quiesce(void);+extern void hakios_haptic_quiesce(void);+extern void hakios_torch_quiesce(void);+extern void hakios_camera_quiesce(void);+extern void hakios_mic_quiesce(void);+extern void hakios_ufs_quiesce(void);+extern void hakios_var_save_on_return(void); /* bsd/dev/hakios.ufs.c: the data volume into the flash */void loader_checkpoint(uint64_t n);/* Also referenced from the early exception vector in start.s. */@@ -207,7 +207,7 @@ struct loader_live {* loader to hand to the host once the kernel is back. { physical address, bytes, kernel address }.*/uint64_t loader_recording[3];-/* ... and of the sound (/dev/redwood-audio makes one with boot-arg rec_sound). */+/* ... and of the sound (/dev/hakios-audio makes one with boot-arg rec_sound). */uint64_t loader_sound[3];struct loader_live loader_live = {@@ -371,16 +371,16 @@ loader_return(void)*/psci_smp_stop_others();#endif- redwood_ufs_quiesce(); /* this kernel's requests to the storage done, UEFI's list as it was, for the log */- redwood_adreno_quiesce(); /* the GPU block, if it was started, has tables in memory that is about to be reused */- redwood_wifi_quiesce(); /* the Wi-Fi DSP, if it still runs (a panic), is not left to itself */- redwood_adsp_quiesce(); /* nor the audio DSP */- redwood_mpss_quiesce(); /* nor the modem */- redwood_ddr_quiesce(); /* and the vote for the memory's bandwidth taken away */- redwood_haptic_quiesce(); /* the vibration motor's chip back into reset, if it was let out */- redwood_torch_quiesce(); /* the flashlight off, if it was lit */- redwood_camera_quiesce(); /* the camera powered down, if it was powered up */- redwood_mic_quiesce(); /* (what the microphones' path did, said again: it happens in the log's middle) */+ hakios_ufs_quiesce(); /* this kernel's requests to the storage done, UEFI's list as it was, for the log */+ hakios_adreno_quiesce(); /* the GPU block, if it was started, has tables in memory that is about to be reused */+ hakios_wifi_quiesce(); /* the Wi-Fi DSP, if it still runs (a panic), is not left to itself */+ hakios_adsp_quiesce(); /* nor the audio DSP */+ hakios_mpss_quiesce(); /* nor the modem */+ hakios_ddr_quiesce(); /* and the vote for the memory's bandwidth taken away */+ hakios_haptic_quiesce(); /* the vibration motor's chip back into reset, if it was let out */+ hakios_torch_quiesce(); /* the flashlight off, if it was lit */+ hakios_camera_quiesce(); /* the camera powered down, if it was powered up */+ hakios_mic_quiesce(); /* (what the microphones' path did, said again: it happens in the log's middle) *//** A panic's text is first collected in the panic buffer and only later* flushed to the console; if the console itself is what failed, that@@ -439,11 +439,11 @@ loader_return_timer(__unused thread_call_param_t p0, __unused thread_call_param_}PE_parse_boot_argn("return_panic", &as_panic, sizeof(as_panic));if (!as_panic) {- redwood_var_save_on_return(); /* the data volume kept, while the system is still whole */- redwood_adreno_stop(); /* a GPU kept for the system is given back while there is a thread to wait in */- redwood_wifi_stop(); /* and the Wi-Fi DSP, if it runs, shut down */- redwood_adsp_stop(); /* and the audio DSP */- redwood_mpss_stop(); /* and the modem */+ hakios_var_save_on_return(); /* the data volume kept, while the system is still whole */+ hakios_adreno_stop(); /* a GPU kept for the system is given back while there is a thread to wait in */+ hakios_wifi_stop(); /* and the Wi-Fi DSP, if it runs, shut down */+ hakios_adsp_stop(); /* and the audio DSP */+ hakios_mpss_stop(); /* and the modem */}if (PE_parse_boot_argn("return_cpu", &cpu, sizeof(cpu)) && cpu <= (uint32_t)ml_get_max_cpu_number() &&cpu_xcall((int)cpu, loader_return_test, (void *)(uintptr_t)(as_panic ? 2 : 1)) == KERN_SUCCESS) {@@ -486,10 +486,10 @@ loader_stop_poll(__unused thread_call_param_t p0, __unused thread_call_param_t pfor (const char *c = banner; *c; c++) {loader_log_putc(*c);}- redwood_var_save_on_return();- redwood_adreno_stop();- redwood_wifi_stop();- redwood_adsp_stop();+ hakios_var_save_on_return();+ hakios_adreno_stop();+ hakios_wifi_stop();+ hakios_adsp_stop();loader_return();}clock_interval_to_deadline(1, NSEC_PER_SEC, &deadline);@@ -531,11 +531,11 @@ extern void MiniIOSurfaceUsage(uint32_t *count, uint64_t *bytes);* daemons, and once none is left and it is below the second, whatever is next in line -- the* window server included.*/-void redwood_memory_line(char *buf, size_t len);+void hakios_memory_line(char *buf, size_t len);-/* The line itself (also kern.redwood_memory, for a job list to keep: bsd/miscfs/apfs/apfs_vfsops.c) */+/* The line itself (also kern.hakios_memory, for a job list to keep: bsd/miscfs/apfs/apfs_vfsops.c) */void-redwood_memory_line(char *buf, size_t len)+hakios_memory_line(char *buf, size_t len){#define MB(pages) ((unsigned int)(((uint64_t)(pages) * PAGE_SIZE) >> 20))uint32_t surfaces = 0;@@ -558,9 +558,9 @@ memory_report(void){char line[256];- redwood_memory_line(line, sizeof(line));+ hakios_memory_line(line, sizeof(line));printf("%s", line);- redwood_adreno_minute(); /* (and how warm the GPU is, if it is in use) */+ hakios_adreno_minute(); /* (and how warm the GPU is, if it is in use) */}/* Every HV_WDT_PET_SECONDS: feed the watchdog if there is one, and show any watching loader a sign of life. */diff --git a/xnu/files/osfmk/arm64/user_exception_trace.c b/xnu/files/osfmk/arm64/user_exception_trace.cindex 2701fb2..5805cda 100644--- a/xnu/files/osfmk/arm64/user_exception_trace.c+++ b/xnu/files/osfmk/arm64/user_exception_trace.c@@ -406,7 +406,7 @@ again:}}-/* The same at once, for whoever asks (a debugging key sequence, see bsd/dev/redwood_virtio_input.c). */+/* The same at once, for whoever asks (a debugging key sequence, see bsd/dev/hakios.virtio_input.c). */void ustacks_now(const char *name);voiddiff --git a/xnu/redwood.patch b/xnu/hakios.patchsimilarity index 97%rename from xnu/redwood.patchrename to xnu/hakios.patchindex 2f6b425..34b35d6 100644--- a/xnu/redwood.patch+++ b/xnu/hakios.patch@@ -62,46 +62,46 @@ index a4d25040f38f..aad72993d139 100644kern_debug.o_INCFLAGS += -I$(SRCROOT)/osfmkdiff --git a/bsd/conf/files b/bsd/conf/files-index 44274016a4cf..08878fedb36e 100644+index 44274016a4cf..432af34d4c22 100644--- a/bsd/conf/files+++ b/bsd/conf/files@@ -109,6 +109,39 @@ bsd/dev/munge.c optional config_requires_u32_mungingbsd/dev/unix_startup.c standardbsd/dev/monotonic.c optional monotonic-+bsd/dev/redwood_input.c standard-+bsd/dev/redwood_virtio_input.c standard-+bsd/dev/redwood_goodix.c standard-+bsd/dev/redwood_buttons.c standard-+bsd/dev/redwood_battery.c standard-+bsd/dev/redwood_ufs.c standard-+bsd/dev/redwood_ufshc.c standard-+bsd/dev/redwood_net.c standard-+bsd/dev/redwood_virtio_net.c standard-+bsd/dev/redwood_apple80211.c standard-+bsd/dev/redwood_cpufreq.c standard-+bsd/dev/redwood_adreno.c standard-+bsd/dev/redwood_audio.c standard-+bsd/dev/redwood_virtio_sound.c standard-+bsd/dev/redwood_speaker.c standard-+bsd/dev/redwood_guard.c standard-+bsd/dev/redwood_haptic.c standard-+bsd/dev/redwood_torch.c standard-+bsd/dev/redwood_camera.c standard-+bsd/dev/redwood_mic.c standard-+bsd/dev/redwood_wifi.c standard-+bsd/dev/redwood_adsp.c standard-+bsd/dev/redwood_mpss.c standard-+bsd/dev/redwood_image.c standard-+bsd/dev/redwood_virtio_blk.c standard-+bsd/dev/redwood_sparse.c standard-+bsd/dev/redwood_apfs_check.c optional apfs-+bsd/dev/redwood_sound.c standard-+bsd/dev/redwood_qmi.c standard-+bsd/dev/redwood_nas.c standard-+bsd/dev/redwood_wlfw.c standard-+bsd/dev/redwood_lx.c standard-+bsd/dev/redwood_sta.c standard++bsd/dev/hakios.input.c standard++bsd/dev/hakios.virtio_input.c standard++bsd/dev/hakios.goodix.c standard++bsd/dev/hakios.buttons.c standard++bsd/dev/hakios.battery.c standard++bsd/dev/hakios.ufs.c standard++bsd/dev/hakios.ufshc.c standard++bsd/dev/hakios.net.c standard++bsd/dev/hakios.virtio_net.c standard++bsd/dev/hakios.apple80211.c standard++bsd/dev/hakios.cpufreq.c standard++bsd/dev/hakios.adreno.c standard++bsd/dev/hakios.audio.c standard++bsd/dev/hakios.virtio_sound.c standard++bsd/dev/hakios.speaker.c standard++bsd/dev/hakios.guard.c standard++bsd/dev/hakios.haptic.c standard++bsd/dev/hakios.torch.c standard++bsd/dev/hakios.camera.c standard++bsd/dev/hakios.mic.c standard++bsd/dev/hakios.wifi.c standard++bsd/dev/hakios.adsp.c standard++bsd/dev/hakios.mpss.c standard++bsd/dev/hakios.image.c standard++bsd/dev/hakios.virtio_blk.c standard++bsd/dev/hakios.sparse.c standard++bsd/dev/hakios.apfs_check.c optional apfs++bsd/dev/hakios.sound.c standard++bsd/dev/hakios.qmi.c standard++bsd/dev/hakios.nas.c standard++bsd/dev/hakios.wlfw.c standard++bsd/dev/hakios.lx.c standard++bsd/dev/hakios.sta.c standardbsd/dev/dev_perfmon.c optional config_perfmonbsd/libkern/crc32.c standard@@ -355,19 +355,19 @@ index 3e6bffa8c48e..43cffb98bdcc 100644mdevremoveall(void){diff --git a/bsd/kern/bsd_init.c b/bsd/kern/bsd_init.c-index 4df41ba1f61b..16cf4fd8d8f1 100644+index 4df41ba1f61b..4a6e0ccfc590 100644--- a/bsd/kern/bsd_init.c+++ b/bsd/kern/bsd_init.c@@ -147,6 +147,13 @@#include <net/if_ether.h> /* for ether_family_init() */#include <net/if_gif.h> /* for gif_init() */#include <miscfs/devfs/devfsdefs.h> /* for devfs_kernel_mount() */-+#include <sys/redwood_input.h>-+#include <sys/redwood_audio.h>-+#include <sys/redwood_virtio_blk.h>-+#include <sys/redwood_sparse.h>++#include <sys/hakios.input.h>++#include <sys/hakios.audio.h>++#include <sys/hakios.virtio_blk.h>++#include <sys/hakios.sparse.h>+#if APFS-+#include <sys/redwood_apfs_check.h>++#include <sys/hakios.apfs_check.h>+#endif#include <vm/vm_kern.h> /* for kmem_suballoc() */#include <sys/proc_uuid_policy.h> /* proc_uuid_policy_init() */@@ -385,13 +385,13 @@ index 4df41ba1f61b..16cf4fd8d8f1 100644bsd_init_kprintf("calling devfs_kernel_mount\n");devfs_kernel_mount(mounthere);-+ redwood_input_init(); /* /dev/redwood-touch */-+ redwood_audio_init(); /* /dev/redwood-audio */-+ redwood_virtio_blk_init(); /* /dev/rvblk0, a disk image of the host (QEMU) */-+ redwood_sparse_init(); /* /dev/rsp0, part of an image too big to hold */++ hakios_input_init(); /* /dev/hakios-touch */++ hakios_audio_init(); /* /dev/hakios-audio */++ hakios_virtio_blk_init(); /* /dev/rvblk0, a disk image of the host (QEMU) */++ hakios_sparse_init(); /* /dev/rsp0, part of an image too big to hold */+#if APFS+ /* mounts and walks /dev/rvblk0 once userland has /private/var up */-+ redwood_apfs_check_init();++ hakios_apfs_check_init();+#endif}#endif /* DEVFS */@@ -410,7 +410,7 @@ index 95192dd62449..b00da803b5b4 100644/*diff --git a/bsd/kern/kern_exec.c b/bsd/kern/kern_exec.c-index 1d71c66629fb..3e1737c21b86 100644+index 1d71c66629fb..1d5025f32b88 100644--- a/bsd/kern/kern_exec.c+++ b/bsd/kern/kern_exec.c@@ -1157,6 +1157,9 @@ SYSCTL_PROC(_vm, OID_AUTO, shared_region_control,@@ -519,7 +519,7 @@ index 1d71c66629fb..3e1737c21b86 100644- }-+ /*-+ * redwood: two of the three checks below cannot be passed in this port, and both stand in++ * hakios: two of the three checks below cannot be passed in this port, and both stand in+ * the way of something ordinary. The entitlement is one nobody carries here (nothing is+ * signed, AMFI is a stub), and the persona is one nobody makes -- yet a package manager+ * becomes root by asking for exactly this: Sileo spawns apt and dpkg into persona 99 with@@ -560,7 +560,7 @@ index 1d71c66629fb..3e1737c21b86 100644+ if (persona == NULL) {+ /*-+ * redwood: there are no personas in this port -- nothing makes them, and++ * hakios: there are no personas in this port -- nothing makes them, and+ * kpersona_find_by_type() answers "no such process" to everyone who asks. iOS's own+ * programs get along without them, but a package manager becomes root by way of one:+ * Sileo asks posix_spawn for persona 99 with OVERRIDE and uid 0 (its APTWrapper), and@@ -751,7 +751,7 @@ index 1d71c66629fb..3e1737c21b86 100644/** Update the new process's signature-dependent process state.diff --git a/bsd/kern/kern_memorystatus.c b/bsd/kern/kern_memorystatus.c-index 1750d3a52d3c..9947cb2421da 100644+index 1750d3a52d3c..0373d0dd160f 100644--- a/bsd/kern/kern_memorystatus.c+++ b/bsd/kern/kern_memorystatus.c@@ -222,6 +222,15 @@ MACRO_END@@ -759,7 +759,7 @@ index 1750d3a52d3c..9947cb2421da 100644/* General tunables */+/*-+ * redwood: the memory there is to manage. max_mem is the whole of the kernel's memory window, and++ * hakios: the memory there is to manage. max_mem is the whole of the kernel's memory window, and+ * here more than half of that window is the system image -- a RAM disk the kernel boots from, which+ * is nobody's to use or to give back. Thresholds that are per cent of max_mem had idle daemons+ * killed with a quarter of the usable memory still available, and the window server not long after.@@ -813,7 +813,7 @@ index 1750d3a52d3c..9947cb2421da 100644}diff --git a/bsd/kern/kern_priv.c b/bsd/kern/kern_priv.c-index 88adf2dda936..2b2f528d2273 100644+index 88adf2dda936..e29e09fc0f0b 100644--- a/bsd/kern/kern_priv.c+++ b/bsd/kern/kern_priv.c@@ -82,6 +82,19 @@ priv_check_cred(kauth_cred_t cred, int priv, int flags)@@ -821,7 +821,7 @@ index 88adf2dda936..2b2f528d2273 100644int error;+ /*-+ * redwood: nothing is signed here and no process carries an entitlement (AMFI is a stub), so++ * hakios: nothing is signed here and no process carries an entitlement (AMFI is a stub), so+ * every privilege that an entitlement would answer for is refused -- and iOS leans on one of+ * them for ordinary work. A daemon that goes to the network on behalf of an application+ * (trustd checking the certificate for whoever opened the connection, nsurlsessiond carrying@@ -949,7 +949,7 @@ index dce802fc36f1..e2e6b3a3f3db 100644user_ssize_t rlen;off_t pgoff;diff --git a/bsd/miscfs/bindfs/bind_vfsops.c b/bsd/miscfs/bindfs/bind_vfsops.c-index 412f9ecfc22c..f6595c0401a3 100644+index 412f9ecfc22c..1788b8698ebd 100644--- a/bsd/miscfs/bindfs/bind_vfsops.c+++ b/bsd/miscfs/bindfs/bind_vfsops.c@@ -139,8 +139,12 @@ bindfs_mount(struct mount * mp, __unused vnode_t devvp, user_addr_t user_data, v@@ -959,7 +959,7 @@ index 412f9ecfc22c..f6595c0401a3 100644- /* check entitlement */- if (!IOCurrentTaskHasEntitlement(BINDFS_ENTITLEMENT)) {+ /*-+ * check entitlement -- redwood: or process 1, the port's own init, unsigned, which binds++ * check entitlement -- hakios: or process 1, the port's own init, unsigned, which binds+ * its choice of launchd jobs and the like onto the read-only iOS root volume before it+ * hands over to launchd (userland/src/init.c, root_apfs=)+ */@@ -1504,7 +1504,7 @@ index 1ed75eea2052..54c5e12d2271 100644# MACH_RELEASE = [ MACH_BASE config_skip_precise_user_kernel_time debugger_for_zone_info ]# MACH_DEV = [ MACH_BASE config_io_accounting importance_trace ]diff --git a/iokit/Kernel/IOPMrootDomain.cpp b/iokit/Kernel/IOPMrootDomain.cpp-index 4a06407aea5f..69a4bcf1839d 100644+index 4a06407aea5f..2d2383953f7f 100644--- a/iokit/Kernel/IOPMrootDomain.cpp+++ b/iokit/Kernel/IOPMrootDomain.cpp@@ -555,7 +555,16 @@ static uint32_t gDarkWakeFlags = kDarkWakeFlagPromotionEarly;@@ -1513,7 +1513,7 @@ index 4a06407aea5f..69a4bcf1839d 100644static uint32_t gNoIdleFlag = 0;-static uint32_t gSleepDisabledFlag = 0;+/*-+ * redwood: the system does not sleep. There is nothing here to sleep into and nothing that would++ * hakios: the system does not sleep. There is nothing here to sleep into and nothing that would+ * wake it: with the screen locked, powerd asks for system sleep within seconds, and that request+ * ended in IOCPUSleepKernel() -- with one processor it came straight back out, again and again+ * (every time a round of sleep and wake notifications to all the system); with more than one it@@ -1720,7 +1720,7 @@ index 5219fb0d9ed6..29978e9cff43 100644}}diff --git a/iokit/conf/files b/iokit/conf/files-index 5fb0a52062e0..6c430c2b23c7 100644+index 5fb0a52062e0..c07be8d9e0b0 100644--- a/iokit/conf/files+++ b/iokit/conf/files@@ -79,6 +79,14 @@ iokit/Kernel/IOSubMemoryDescriptor.cpp optional iokitcpp@@ -1730,9 +1730,9 @@ index 5fb0a52062e0..6c430c2b23c7 100644+iokit/Kernel/GenericARMPE.cpp optional iokitcpp+iokit/Kernel/MiniIOSurface.cpp optional iokitcpp+iokit/Kernel/MiniIOMobileFramebuffer.cpp optional iokitcpp-+iokit/Kernel/RedwoodGPU.cpp optional iokitcpp-+iokit/Kernel/RedwoodWLAN.cpp optional iokitcpp-+iokit/Kernel/RedwoodBattery.cpp optional iokitcpp++iokit/Kernel/hakios.gpu.cpp optional iokitcpp++iokit/Kernel/hakios.wlan.cpp optional iokitcpp++iokit/Kernel/hakios.battery.cpp optional iokitcpp+iokit/Kernel/MiniAppleKeyStore.cpp optional iokitcpp+iokit/Kernel/MiniIONetworkStack.cpp optional iokitcppiokit/Kernel/IOPlatformIO.cpp optional iokitcpp@@ -1842,7 +1842,7 @@ index bc39e19b3b8e..0a72a2d43908 100644ifeq ($(origin HOST_CODESIGN_ALLOCATE),undefined)export HOST_CODESIGN_ALLOCATE := $(shell $(XCRUN) -sdk $(HOST_SDKROOT) -find codesign_allocate)diff --git a/makedefs/MakeInc.def b/makedefs/MakeInc.def-index 5bd6f23dd10c..14e0f17409f5 100644+index 5bd6f23dd10c..252d50062da4 100644--- a/makedefs/MakeInc.def+++ b/makedefs/MakeInc.def@@ -60,7 +60,7 @@ MACHINE_FLAGS_ARM64_T8101 = -DARM64_BOARD_CONFIG_T8101 -mcpu=apple-a14@@ -1860,9 +1860,9 @@ index 5bd6f23dd10c..14e0f17409f5 100644LD_KERNEL_LIBS = -lcc_kext-LD_KERNEL_ARCHIVES = $(LDFLAGS_KERNEL_SDK) -lfirehose_kernel+LD_KERNEL_ARCHIVES = $(LDFLAGS_KERNEL_SDK) -lfirehose_kernel -lpthread_kext-+# Darwin-on-redwood: objects made outside this tree, linked when the build is given any (the-+# Wi-Fi driver, see bsd/dev/redwood_lx.c)-+LD_KERNEL_ARCHIVES += $(REDWOOD_OBJECTS)++# Darwin-on-hakios: objects made outside this tree, linked when the build is given any (the++# Wi-Fi driver, see bsd/dev/hakios.lx.c)++LD_KERNEL_ARCHIVES += $(HAKIOS_OBJECTS)# Link opensource binary libraryifneq ($(filter T6000 T8101 VMAPPLE T6000 T8101 VMAPPLE,$(CURRENT_MACHINE_CONFIG)),)LDFLAGS_KERNEL_ONLY += -rdynamic -Wl,-force_load,$(KDKROOT)/System/Library/KernelSupport/lib$(CURRENT_MACHINE_CONFIG).os.$(CURRENT_KERNEL_CONFIG).a@@ -2068,7 +2068,7 @@ index 39daaf8db949..64ceb1a5f201 100644}os_atomic_clear_exclusive();diff --git a/osfmk/arm/pmap/pmap.c b/osfmk/arm/pmap/pmap.c-index fc2096fa0010..5011ab612305 100644+index fc2096fa0010..8f198ed1b820 100644--- a/osfmk/arm/pmap/pmap.c+++ b/osfmk/arm/pmap/pmap.c@@ -93,6 +93,8 @@@@ -2096,7 +2096,7 @@ index fc2096fa0010..5011ab612305 100644ppnum_t pp){- flush_dcache((vm_offset_t) (pp << PAGE_SHIFT), PAGE_SIZE, TRUE);-+ /* (redwood: the page number is 32 bits wide and memory goes on above 4 GB: widen before shifting) */++ /* (hakios: the page number is 32 bits wide and memory goes on above 4 GB: widen before shifting) */+ flush_dcache((vm_offset_t) pp << PAGE_SHIFT, PAGE_SIZE, TRUE);}@@ -2181,7 +2181,7 @@ index 94e91306b143..0ec1323086b7 100644#endifdiff --git a/osfmk/arm64/machine_routines.c b/osfmk/arm64/machine_routines.c-index e76e7e70ab9c..4f540f8caf43 100644+index e76e7e70ab9c..828a51171c7e 100644--- a/osfmk/arm64/machine_routines.c+++ b/osfmk/arm64/machine_routines.c@@ -734,6 +734,9 @@ ml_get_machine_mem(void)@@ -2189,7 +2189,7 @@ index e76e7e70ab9c..4f540f8caf43 100644}+extern void loader_return(void);-+extern void redwood_adreno_stop(void);++extern void hakios_adreno_stop(void);+__attribute__((noreturn))void@@ -2199,7 +2199,7 @@ index e76e7e70ab9c..4f540f8caf43 100644PEHaltRestart(kPEHaltCPU);}+ /* No platform driver powers the machine off: hand control (and the log) back to the loader. */-+ redwood_adreno_stop();++ hakios_adreno_stop();+ loader_return();while (1) {;@@ -2286,7 +2286,7 @@ index e76e7e70ab9c..4f540f8caf43 100644+ }+}+-+/* How long processor cpu_id has been idle since it started, in mach_absolute_time() units (redwood_cpufreq.c's cpuload). */++/* How long processor cpu_id has been idle since it started, in mach_absolute_time() units (hakios.cpufreq.c's cpuload). */+bool ml_cpu_idle_time(int cpu_id, uint64_t *idle);++booldiff --git a/xnuloader/loader.c b/xnuloader/loader.cindex 2a30e85..ab5a781 100644--- a/xnuloader/loader.c+++ b/xnuloader/loader.c@@ -1445,13 +1445,13 @@ ufs_survey(void)* resident, and this loader already serves the kernel from core 0 while the kernel runs on another* (the battery). So the kernel asks for blocks through a page both can see, and core 0 reads them* with that driver's ReadBlocks into a buffer both can see. The kernel's side is- * bsd/dev/redwood_ufs.c; it gets the page's address as ufs_shared_pa= on its command line.+ * bsd/dev/hakios.ufs.c; it gets the page's address as ufs_shared_pa= on its command line.** Reads, and -- with ufs_write=1 on the command line -- writes into one partition and nowhere* else: the port's own darwin, proved by its GPT entry (name, both GUIDs, first and last LBA, its* logical unit), and in it only past everything the build writes from the computer, so that no* answer to the kernel can reach Android's partitions, the iOS volume or the cryptexes. The- * refusals are here, in the kernel (bsd/dev/redwood_ufs.c) and in UEFI's own driver, which gives+ * refusals are here, in the kernel (bsd/dev/hakios.ufs.c) and in UEFI's own driver, which gives* out a partition's BlockIo and bounds it: a request has to pass all three.** Each side writes its own cache lines only: the kernel the request, core 0 the answer (and the@@ -2838,9 +2838,9 @@ run_kernel(int have_checkpoint, uint64_t checkpoint)uint64_t this_mpidr = READ_SYSREG(MPIDR_EL1) & 0xFFFFFF, kernel_mpidr = this_mpidr;/* "cpus=N" or "cpumask=M" there too: the kernel may have more cores than the one it starts on */int more_cores = 0, battery_requested = 0, ufs_requested = 0;- /* "torch=N" (not 0) there too: the phone's flashlight is the kernel's (bsd/dev/redwood_torch.c) */+ /* "torch=N" (not 0) there too: the phone's flashlight is the kernel's (bsd/dev/hakios.torch.c) */int torch_requested = 0;- /* "cam=5" there too: the phone's wide camera is iOS's (bsd/dev/redwood_camera.c) */+ /* "cam=5" there too: the phone's wide camera is iOS's (bsd/dev/hakios.camera.c) */int camera_requested = 0;/* (the loader stays for run after run: what the last run's arguments said must not hold for this one) */gamut_p3 = 0;