From 478b3b99d2669c3d33e01c01193c2baa797303dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 21 Oct 2026 09:10:33 +0200 Subject: [PATCH] libc: update OpenBSD headers to 8.0 --- .../aarch64-openbsd-none/arm64/_types.h | 6 +- .../aarch64-openbsd-none/arm64/armreg.h | 10 +- .../include/aarch64-openbsd-none/arm64/bus.h | 28 +- .../aarch64-openbsd-none/arm64/codepatch.h | 72 +++ .../include/aarch64-openbsd-none/arm64/cpu.h | 16 +- .../aarch64-openbsd-none/arm64/hibernate.h | 38 ++ .../arm64/hibernate_var.h | 79 +++ .../aarch64-openbsd-none/arm64/simplebusvar.h | 4 +- .../aarch64-openbsd-none/arm64/vmmvar.h | 4 +- .../aarch64-openbsd-none/machine/_types.h | 6 +- .../aarch64-openbsd-none/machine/armreg.h | 10 +- .../aarch64-openbsd-none/machine/bus.h | 28 +- .../aarch64-openbsd-none/machine/codepatch.h | 72 +++ .../aarch64-openbsd-none/machine/cpu.h | 16 +- .../aarch64-openbsd-none/machine/hibernate.h | 38 ++ .../machine/hibernate_var.h | 79 +++ .../machine/simplebusvar.h | 4 +- .../aarch64-openbsd-none/machine/vmmvar.h | 4 +- .../include/arm-openbsd-eabi/arm/_types.h | 6 +- lib/libc/include/arm-openbsd-eabi/arm/cpu.h | 4 +- .../include/arm-openbsd-eabi/arm/cpuconf.h | 53 -- .../include/arm-openbsd-eabi/arm/cpufunc.h | 3 +- lib/libc/include/arm-openbsd-eabi/arm/fiq.h | 69 --- lib/libc/include/arm-openbsd-eabi/arm/pmap.h | 3 +- .../include/generic-openbsd/arpa/telnet.h | 4 +- lib/libc/include/generic-openbsd/imsg.h | 13 +- lib/libc/include/generic-openbsd/limits.h | 4 +- lib/libc/include/generic-openbsd/math.h | 6 +- lib/libc/include/generic-openbsd/md5.h | 8 +- .../generic-openbsd/miscfs/fuse/fusefs.h | 14 +- .../generic-openbsd/miscfs/fuse/fusefs_node.h | 10 +- lib/libc/include/generic-openbsd/net/art.h | 5 +- lib/libc/include/generic-openbsd/net/bpf.h | 14 +- lib/libc/include/generic-openbsd/net/if.h | 3 +- lib/libc/include/generic-openbsd/net/if_ppp.h | 4 +- .../include/generic-openbsd/net/if_sppp.h | 4 +- .../include/generic-openbsd/net/if_trunk.h | 13 +- lib/libc/include/generic-openbsd/net/if_var.h | 6 +- .../include/generic-openbsd/net/pfvar_priv.h | 4 +- .../include/generic-openbsd/net/pipex_local.h | 4 +- .../include/generic-openbsd/net/trunklacp.h | 316 ----------- .../generic-openbsd/net80211/ieee80211.h | 17 +- .../net80211/ieee80211_ioctl.h | 9 +- .../generic-openbsd/net80211/ieee80211_node.h | 7 +- .../generic-openbsd/net80211/ieee80211_var.h | 4 +- .../include/generic-openbsd/netinet/in_var.h | 6 +- .../include/generic-openbsd/netinet/ip_ipsp.h | 11 +- .../generic-openbsd/netinet/ip_mroute.h | 6 +- .../include/generic-openbsd/netinet/ip_var.h | 12 +- .../generic-openbsd/netinet6/ip6_mroute.h | 6 +- .../generic-openbsd/netinet6/ip6_var.h | 19 +- .../include/generic-openbsd/nfs/nfs_var.h | 12 +- .../include/generic-openbsd/nfs/nfsm_subs.h | 89 ++- lib/libc/include/generic-openbsd/resolv.h | 4 +- lib/libc/include/generic-openbsd/rmd160.h | 8 +- lib/libc/include/generic-openbsd/rpc/auth.h | 4 +- lib/libc/include/generic-openbsd/sha1.h | 8 +- lib/libc/include/generic-openbsd/sha2.h | 22 +- lib/libc/include/generic-openbsd/spawn.h | 7 +- lib/libc/include/generic-openbsd/sys/buf.h | 11 +- lib/libc/include/generic-openbsd/sys/device.h | 8 +- lib/libc/include/generic-openbsd/sys/dkio.h | 6 +- lib/libc/include/generic-openbsd/sys/exec.h | 12 +- .../include/generic-openbsd/sys/exec_elf.h | 14 +- lib/libc/include/generic-openbsd/sys/file.h | 3 +- .../include/generic-openbsd/sys/fusebuf.h | 454 +++++++++++++--- .../include/generic-openbsd/sys/hibernate.h | 6 +- lib/libc/include/generic-openbsd/sys/limits.h | 7 +- lib/libc/include/generic-openbsd/sys/mbuf.h | 25 +- lib/libc/include/generic-openbsd/sys/mount.h | 7 +- lib/libc/include/generic-openbsd/sys/msg.h | 9 +- lib/libc/include/generic-openbsd/sys/namei.h | 12 +- lib/libc/include/generic-openbsd/sys/param.h | 4 +- lib/libc/include/generic-openbsd/sys/pledge.h | 7 +- lib/libc/include/generic-openbsd/sys/proc.h | 5 +- lib/libc/include/generic-openbsd/sys/queue.h | 6 +- lib/libc/include/generic-openbsd/sys/sem.h | 24 +- lib/libc/include/generic-openbsd/sys/shm.h | 20 +- .../include/generic-openbsd/sys/socketvar.h | 4 +- .../include/generic-openbsd/sys/syscall.h | 10 +- .../include/generic-openbsd/sys/syscallargs.h | 11 +- lib/libc/include/generic-openbsd/sys/systm.h | 4 +- lib/libc/include/generic-openbsd/sys/tty.h | 4 +- .../include/generic-openbsd/sys/videoio.h | 8 +- lib/libc/include/generic-openbsd/unistd.h | 7 +- .../include/generic-openbsd/uvm/uvm_extern.h | 6 +- .../include/generic-openbsd/uvm/uvm_page.h | 4 +- .../include/generic-openbsd/uvm/uvm_pager.h | 3 +- .../generic-openbsd/uvm/uvm_pmemrange.h | 52 +- .../include/generic-openbsd/uvm/uvm_swap.h | 10 +- .../generic-openbsd/uvm/uvm_swap_encrypt.h | 7 +- .../machine/_float.h | 0 .../machine/cdefs.h | 0 .../machine/disklabel.h | 0 .../machine/fenv.h | 0 .../machine/loadfile_machdep.h | 0 .../mips64-openbsd-none/machine/octeonvar.h | 4 +- .../machine/reloc.h | 0 .../machine/tcb.h | 0 .../mips64/_float.h | 0 .../mips64/_types.h | 6 +- .../mips64/archtype.h | 0 .../mips64/asm.h | 0 .../mips64/atomic.h | 0 .../mips64/autoconf.h | 0 .../mips64/cache.h | 0 .../mips64/cdefs.h | 0 .../mips64/cpu.h | 0 .../mips64/cpustate.h | 0 .../mips64/db_machdep.h | 0 .../mips64/elf.h | 0 .../mips64/endian.h | 0 .../mips64/exec.h | 0 .../mips64/fenv.h | 0 .../mips64/fpu.h | 0 .../mips64/frame.h | 0 .../mips64/ieee.h | 0 .../mips64/ieeefp.h | 0 .../mips64/kcore.h | 0 .../mips64/limits.h | 0 .../mips64/loongson2.h | 0 .../mips64/loongson3.h | 0 .../mips64/memconf.h | 0 .../mips64/mips_cpu.h | 0 .../mips64/mips_opcode.h | 0 .../mips64/mplock.h | 0 .../mips64/mutex.h | 0 .../mips64/param.h | 0 .../mips64/pcb.h | 0 .../mips64/pmap.h | 0 .../mips64/proc.h | 0 .../mips64/profile.h | 0 .../mips64/pte.h | 0 .../mips64/ptrace.h | 0 .../mips64/reg.h | 0 .../mips64/regdef.h | 0 .../mips64/regnum.h | 0 .../mips64/reloc.h | 0 .../mips64/setjmp.h | 0 .../mips64/signal.h | 0 .../mips64/spinlock.h | 0 .../mips64/sysarch.h | 0 .../mips64/tcb.h | 0 .../mips64/timetc.h | 0 .../mips64/trap.h | 0 .../mips64/vmparam.h | 0 .../mips64-openbsd-none/octeon/octeonvar.h | 4 +- .../include/mips64el-openbsd-none/frame.h | 3 - .../mips64el-openbsd-none/loongson/_float.h | 3 - .../mips64el-openbsd-none/loongson/_types.h | 3 - .../mips64el-openbsd-none/loongson/apmvar.h | 127 ----- .../mips64el-openbsd-none/loongson/asm.h | 9 - .../mips64el-openbsd-none/loongson/atomic.h | 3 - .../mips64el-openbsd-none/loongson/autoconf.h | 124 ----- .../mips64el-openbsd-none/loongson/bus.h | 513 ------------------ .../mips64el-openbsd-none/loongson/cdefs.h | 3 - .../mips64el-openbsd-none/loongson/conf.h | 42 -- .../mips64el-openbsd-none/loongson/cpu.h | 103 ---- .../mips64el-openbsd-none/loongson/cpustate.h | 3 - .../loongson/db_machdep.h | 3 - .../loongson/disklabel.h | 16 - .../mips64el-openbsd-none/loongson/elf.h | 3 - .../mips64el-openbsd-none/loongson/endian.h | 3 - .../mips64el-openbsd-none/loongson/exec.h | 3 - .../mips64el-openbsd-none/loongson/fenv.h | 3 - .../mips64el-openbsd-none/loongson/fpu.h | 3 - .../mips64el-openbsd-none/loongson/frame.h | 3 - .../mips64el-openbsd-none/loongson/ieee.h | 3 - .../mips64el-openbsd-none/loongson/ieeefp.h | 3 - .../mips64el-openbsd-none/loongson/intr.h | 193 ------- .../loongson/isa_machdep.h | 51 -- .../mips64el-openbsd-none/loongson/kcore.h | 3 - .../mips64el-openbsd-none/loongson/limits.h | 3 - .../loongson/loadfile_machdep.h | 49 -- .../loongson/loongson2.h | 3 - .../loongson/loongson3.h | 3 - .../mips64el-openbsd-none/loongson/memconf.h | 3 - .../loongson/mips_opcode.h | 3 - .../mips64el-openbsd-none/loongson/mplock.h | 3 - .../mips64el-openbsd-none/loongson/mutex.h | 3 - .../mips64el-openbsd-none/loongson/param.h | 27 - .../mips64el-openbsd-none/loongson/pcb.h | 3 - .../loongson/pci_machdep.h | 101 ---- .../mips64el-openbsd-none/loongson/pmap.h | 3 - .../mips64el-openbsd-none/loongson/pmon.h | 209 ------- .../mips64el-openbsd-none/loongson/proc.h | 3 - .../mips64el-openbsd-none/loongson/profile.h | 3 - .../mips64el-openbsd-none/loongson/pte.h | 3 - .../mips64el-openbsd-none/loongson/ptrace.h | 3 - .../mips64el-openbsd-none/loongson/reg.h | 3 - .../mips64el-openbsd-none/loongson/regdef.h | 3 - .../mips64el-openbsd-none/loongson/regnum.h | 3 - .../mips64el-openbsd-none/loongson/reloc.h | 5 - .../mips64el-openbsd-none/loongson/setjmp.h | 3 - .../mips64el-openbsd-none/loongson/signal.h | 3 - .../mips64el-openbsd-none/loongson/spinlock.h | 3 - .../mips64el-openbsd-none/loongson/sysarch.h | 3 - .../mips64el-openbsd-none/loongson/tcb.h | 3 - .../mips64el-openbsd-none/loongson/timetc.h | 23 - .../mips64el-openbsd-none/loongson/trap.h | 3 - .../mips64el-openbsd-none/loongson/vmparam.h | 11 - .../mips64el-openbsd-none/machine/_types.h | 3 - .../mips64el-openbsd-none/machine/apmvar.h | 127 ----- .../mips64el-openbsd-none/machine/asm.h | 9 - .../mips64el-openbsd-none/machine/atomic.h | 3 - .../mips64el-openbsd-none/machine/autoconf.h | 124 ----- .../mips64el-openbsd-none/machine/bus.h | 513 ------------------ .../mips64el-openbsd-none/machine/conf.h | 42 -- .../mips64el-openbsd-none/machine/cpu.h | 103 ---- .../mips64el-openbsd-none/machine/cpustate.h | 3 - .../machine/db_machdep.h | 3 - .../mips64el-openbsd-none/machine/elf.h | 3 - .../mips64el-openbsd-none/machine/endian.h | 3 - .../mips64el-openbsd-none/machine/exec.h | 3 - .../mips64el-openbsd-none/machine/fpu.h | 3 - .../mips64el-openbsd-none/machine/frame.h | 3 - .../mips64el-openbsd-none/machine/ieee.h | 3 - .../mips64el-openbsd-none/machine/ieeefp.h | 3 - .../mips64el-openbsd-none/machine/intr.h | 193 ------- .../machine/isa_machdep.h | 51 -- .../mips64el-openbsd-none/machine/kcore.h | 3 - .../mips64el-openbsd-none/machine/limits.h | 3 - .../mips64el-openbsd-none/machine/loongson2.h | 3 - .../mips64el-openbsd-none/machine/loongson3.h | 3 - .../mips64el-openbsd-none/machine/memconf.h | 3 - .../machine/mips_opcode.h | 3 - .../mips64el-openbsd-none/machine/mplock.h | 3 - .../mips64el-openbsd-none/machine/mutex.h | 3 - .../mips64el-openbsd-none/machine/param.h | 27 - .../mips64el-openbsd-none/machine/pcb.h | 3 - .../machine/pci_machdep.h | 101 ---- .../mips64el-openbsd-none/machine/pmap.h | 3 - .../mips64el-openbsd-none/machine/pmon.h | 209 ------- .../mips64el-openbsd-none/machine/proc.h | 3 - .../mips64el-openbsd-none/machine/profile.h | 3 - .../mips64el-openbsd-none/machine/pte.h | 3 - .../mips64el-openbsd-none/machine/ptrace.h | 3 - .../mips64el-openbsd-none/machine/reg.h | 3 - .../mips64el-openbsd-none/machine/regdef.h | 3 - .../mips64el-openbsd-none/machine/regnum.h | 3 - .../mips64el-openbsd-none/machine/setjmp.h | 3 - .../mips64el-openbsd-none/machine/signal.h | 3 - .../mips64el-openbsd-none/machine/spinlock.h | 3 - .../mips64el-openbsd-none/machine/sysarch.h | 3 - .../mips64el-openbsd-none/machine/timetc.h | 23 - .../mips64el-openbsd-none/machine/trap.h | 3 - .../mips64el-openbsd-none/machine/vmparam.h | 11 - .../powerpc-openbsd-eabihf/powerpc/_types.h | 7 +- .../powerpc-openbsd-eabihf/powerpc/elf.h | 3 +- .../powerpc64-openbsd-none/machine/_types.h | 6 +- .../powerpc64-openbsd-none/machine/elf.h | 3 +- .../powerpc64-openbsd-none/powerpc64/_types.h | 6 +- .../powerpc64-openbsd-none/powerpc64/elf.h | 3 +- .../riscv64-openbsd-none/machine/_types.h | 6 +- .../riscv64-openbsd-none/machine/bus.h | 20 +- .../riscv64-openbsd-none/machine/cpu.h | 23 +- .../riscv64-openbsd-none/machine/elf.h | 66 ++- .../riscv64-openbsd-none/machine/pcb.h | 10 +- .../riscv64-openbsd-none/machine/reg.h | 10 +- .../riscv64-openbsd-none/machine/riscvreg.h | 32 +- .../riscv64-openbsd-none/riscv64/_types.h | 6 +- .../riscv64-openbsd-none/riscv64/bus.h | 20 +- .../riscv64-openbsd-none/riscv64/cpu.h | 23 +- .../riscv64-openbsd-none/riscv64/elf.h | 66 ++- .../riscv64-openbsd-none/riscv64/pcb.h | 10 +- .../riscv64-openbsd-none/riscv64/reg.h | 10 +- .../riscv64-openbsd-none/riscv64/riscvreg.h | 32 +- .../sparc64-openbsd-none/machine/_types.h | 6 +- .../sparc64-openbsd-none/sparc64/_types.h | 6 +- .../include/x86-openbsd-none/i386/_types.h | 6 +- .../include/x86-openbsd-none/i386/i82489reg.h | 4 +- .../x86-openbsd-none/i386/specialreg.h | 5 +- .../include/x86-openbsd-none/machine/_types.h | 6 +- .../x86-openbsd-none/machine/i82489reg.h | 4 +- .../x86-openbsd-none/machine/specialreg.h | 5 +- .../x86_64-openbsd-none/amd64/_types.h | 6 +- .../include/x86_64-openbsd-none/amd64/bus.h | 4 +- .../include/x86_64-openbsd-none/amd64/cpu.h | 3 +- .../x86_64-openbsd-none/amd64/cpufunc.h | 9 +- .../include/x86_64-openbsd-none/amd64/ghcb.h | 32 +- .../x86_64-openbsd-none/amd64/i82489reg.h | 37 +- .../x86_64-openbsd-none/amd64/pci_machdep.h | 3 +- .../include/x86_64-openbsd-none/amd64/pmap.h | 41 +- .../x86_64-openbsd-none/amd64/specialreg.h | 20 +- .../x86_64-openbsd-none/amd64/vmmvar.h | 40 +- .../x86_64-openbsd-none/amd64/vmparam.h | 4 +- .../x86_64-openbsd-none/machine/_types.h | 6 +- .../include/x86_64-openbsd-none/machine/bus.h | 4 +- .../include/x86_64-openbsd-none/machine/cpu.h | 3 +- .../x86_64-openbsd-none/machine/cpufunc.h | 9 +- .../x86_64-openbsd-none/machine/ghcb.h | 32 +- .../x86_64-openbsd-none/machine/i82489reg.h | 37 +- .../x86_64-openbsd-none/machine/pci_machdep.h | 3 +- .../x86_64-openbsd-none/machine/pmap.h | 41 +- .../x86_64-openbsd-none/machine/specialreg.h | 20 +- .../x86_64-openbsd-none/machine/vmmvar.h | 40 +- .../x86_64-openbsd-none/machine/vmparam.h | 4 +- tools/process_headers.zig | 2 - 298 files changed, 1795 insertions(+), 4477 deletions(-) create mode 100644 lib/libc/include/aarch64-openbsd-none/arm64/codepatch.h create mode 100644 lib/libc/include/aarch64-openbsd-none/arm64/hibernate.h create mode 100644 lib/libc/include/aarch64-openbsd-none/arm64/hibernate_var.h create mode 100644 lib/libc/include/aarch64-openbsd-none/machine/codepatch.h create mode 100644 lib/libc/include/aarch64-openbsd-none/machine/hibernate.h create mode 100644 lib/libc/include/aarch64-openbsd-none/machine/hibernate_var.h delete mode 100644 lib/libc/include/arm-openbsd-eabi/arm/cpuconf.h delete mode 100644 lib/libc/include/arm-openbsd-eabi/arm/fiq.h delete mode 100644 lib/libc/include/generic-openbsd/net/trunklacp.h rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/machine/_float.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/machine/cdefs.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/machine/disklabel.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/machine/fenv.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/machine/loadfile_machdep.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/machine/reloc.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/machine/tcb.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/_float.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/_types.h (97%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/archtype.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/asm.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/atomic.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/autoconf.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/cache.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/cdefs.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/cpu.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/cpustate.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/db_machdep.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/elf.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/endian.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/exec.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/fenv.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/fpu.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/frame.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/ieee.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/ieeefp.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/kcore.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/limits.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/loongson2.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/loongson3.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/memconf.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/mips_cpu.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/mips_opcode.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/mplock.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/mutex.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/param.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/pcb.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/pmap.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/proc.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/profile.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/pte.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/ptrace.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/reg.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/regdef.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/regnum.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/reloc.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/setjmp.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/signal.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/spinlock.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/sysarch.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/tcb.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/timetc.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/trap.h (100%) rename lib/libc/include/{generic-openbsd => mips64-openbsd-none}/mips64/vmparam.h (100%) delete mode 100644 lib/libc/include/mips64el-openbsd-none/frame.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/_float.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/_types.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/apmvar.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/asm.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/atomic.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/autoconf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/bus.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/cdefs.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/conf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/cpu.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/cpustate.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/db_machdep.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/disklabel.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/elf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/endian.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/exec.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/fenv.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/fpu.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/frame.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/ieee.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/ieeefp.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/intr.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/isa_machdep.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/kcore.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/limits.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/loadfile_machdep.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/loongson2.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/loongson3.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/memconf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/mips_opcode.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/mplock.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/mutex.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/param.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/pcb.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/pci_machdep.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/pmap.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/pmon.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/proc.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/profile.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/pte.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/ptrace.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/reg.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/regdef.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/regnum.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/reloc.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/setjmp.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/signal.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/spinlock.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/sysarch.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/tcb.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/timetc.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/trap.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/loongson/vmparam.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/_types.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/apmvar.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/asm.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/atomic.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/autoconf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/bus.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/conf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/cpu.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/cpustate.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/db_machdep.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/elf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/endian.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/exec.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/fpu.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/frame.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/ieee.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/ieeefp.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/intr.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/isa_machdep.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/kcore.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/limits.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/loongson2.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/loongson3.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/memconf.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/mips_opcode.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/mplock.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/mutex.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/param.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/pcb.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/pci_machdep.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/pmap.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/pmon.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/proc.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/profile.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/pte.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/ptrace.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/reg.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/regdef.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/regnum.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/setjmp.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/signal.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/spinlock.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/sysarch.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/timetc.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/trap.h delete mode 100644 lib/libc/include/mips64el-openbsd-none/machine/vmparam.h diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/_types.h b/lib/libc/include/aarch64-openbsd-none/arm64/_types.h index 2de0c9d512a5cd8909f2554e476c0b32d5a29a6c..771a22bfda18eddb09cb53f2481cffed03f1ea7e 100644 --- a/lib/libc/include/aarch64-openbsd-none/arm64/_types.h +++ b/lib/libc/include/aarch64-openbsd-none/arm64/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.6 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.7 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -123,11 +123,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/armreg.h b/lib/libc/include/aarch64-openbsd-none/arm64/armreg.h index 7483ae8dd70dfe08ce0937eca6d89902fba892cd..941fed486708b7b047ac227701d513f94e053156 100644 --- a/lib/libc/include/aarch64-openbsd-none/arm64/armreg.h +++ b/lib/libc/include/aarch64-openbsd-none/arm64/armreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: armreg.h,v 1.44 2025/07/22 09:20:41 kettenis Exp $ */ +/* $OpenBSD: armreg.h,v 1.45 2026/05/04 20:43:42 kettenis Exp $ */ /*- * Copyright (c) 2013, 2014 Andrew Turner * Copyright (c) 2015 The FreeBSD Foundation @@ -119,6 +119,14 @@ #define CTR_ILINE_MASK (0xf << CTR_ILINE_SHIFT) #define CTR_ILINE_SIZE(reg) (((reg) & CTR_ILINE_MASK) >> CTR_ILINE_SHIFT) +/* CurrentEL - Current Exception Level */ +#define CURRENTEL_EL_SHIFT 2 +#define CURRENTEL_EL_MASK (0x3 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL0 (0x0 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL1 (0x1 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL2 (0x2 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL3 (0x3 << CURRENTEL_EL_SHIFT) + /* MPIDR_EL1 - Multiprocessor Affinity Register */ #define MPIDR_AFF3 (0xFFULL << 32) #define MPIDR_AFF2 (0xFFULL << 16) diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/bus.h b/lib/libc/include/aarch64-openbsd-none/arm64/bus.h index 70ad145593e80527ec3be3aa799403b1d0f88d5e..a359fa758b64422295c45787bf999d2b20fc2905 100644 --- a/lib/libc/include/aarch64-openbsd-none/arm64/bus.h +++ b/lib/libc/include/aarch64-openbsd-none/arm64/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.11 2024/11/18 05:32:39 jsg Exp $ */ +/* $OpenBSD: bus.h,v 1.13 2026/06/22 07:54:19 deraadt Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. * @@ -349,8 +349,8 @@ struct uio; #define BUS_DMASYNC_PREREAD 0x0004 #define BUS_DMASYNC_PREWRITE 0x0008 -typedef struct machine_bus_dma_tag *bus_dma_tag_t; -typedef struct machine_bus_dmamap *bus_dmamap_t; +typedef struct bus_dma_tag *bus_dma_tag_t; +typedef struct bus_dmamap *bus_dmamap_t; /* * bus_dma_segment_t @@ -358,14 +358,15 @@ typedef struct machine_bus_dmamap *bus_dmamap_t; * Describes a single contiguous DMA transaction. Values * are suitable for programming into DMA registers. */ -struct machine_bus_dma_segment { +struct bus_dma_segment { bus_addr_t ds_addr; /* DMA address */ bus_size_t ds_len; /* length of transfer */ paddr_t _ds_paddr; /* CPU address */ vaddr_t _ds_vaddr; /* CPU address */ + vaddr_t _ds_bounce_va; /* mapped bounced data */ }; -typedef struct machine_bus_dma_segment bus_dma_segment_t; +typedef struct bus_dma_segment bus_dma_segment_t; /* * bus_dma_tag_t @@ -374,7 +375,7 @@ typedef struct machine_bus_dma_segment bus_dma_segment_t; * DMA for a given bus. */ -struct machine_bus_dma_tag { +struct bus_dma_tag { void *_cookie; /* cookie used in the guts */ int _flags; /* misc. flags */ @@ -393,7 +394,8 @@ struct machine_bus_dma_tag { int (*_dmamap_load_raw)(bus_dma_tag_t , bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int (*_dmamap_load_buffer)(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, + int *, int *, int); void (*_dmamap_unload)(bus_dma_tag_t , bus_dmamap_t); void (*_dmamap_sync)(bus_dma_tag_t , bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -451,6 +453,8 @@ struct machine_bus_dma_tag { #define bus_dmamem_mmap(t, sg, n, o, p, f) \ (*(t)->_dmamem_mmap)((t), (sg), (n), (o), (p), (f)) +void bus_dma_init(void); + int _dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); void _dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); @@ -461,7 +465,8 @@ int _dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); int _dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int _dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, int *, + int *, int); void _dmamap_unload(bus_dma_tag_t, bus_dmamap_t); void _dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -481,7 +486,7 @@ int _dmamem_alloc_range(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, * * Describes a DMA mapping. */ -struct machine_bus_dmamap { +struct bus_dmamap { /* * PRIVATE MEMBERS: not for use by machine-independent code. */ @@ -493,6 +498,11 @@ struct machine_bus_dmamap { void *_dm_cookie; /* cookie for bus-specific functions */ + struct vm_page **_dm_pages; /* replacement pages */ + vaddr_t _dm_pgva; /* those above -- mapped */ + int _dm_npages; /* number of pages allocated */ + int _dm_nused; /* number of pages replaced */ + /* * PUBLIC MEMBERS: these are used by machine-independent code. */ diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/codepatch.h b/lib/libc/include/aarch64-openbsd-none/arm64/codepatch.h new file mode 100644 index 0000000000000000000000000000000000000000..849b50725410584d3addc86cb9e9a7dda433070e --- /dev/null +++ b/lib/libc/include/aarch64-openbsd-none/arm64/codepatch.h @@ -0,0 +1,72 @@ +/* $OpenBSD: codepatch.h,v 1.1 2026/06/23 11:45:54 kettenis Exp $ */ +/* + * Copyright (c) 2014-2015 Stefan Fritsch + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _MACHINE_CODEPATCH_H_ +#define _MACHINE_CODEPATCH_H_ + +#include + +#ifndef _LOCORE + +/* code in this section will be unmapped after boot */ +#define __cptext __attribute__((section(".cptext"))) + +__cptext void *codepatch_maprw(vaddr_t *nva, vaddr_t dest); +__cptext void codepatch_unmaprw(vaddr_t nva); +__cptext void codepatch_fill_nop(void *caddr, uint16_t len); +__cptext void codepatch_nop(uint16_t tag); +void codepatch_disable(void); + +#endif /* !_LOCORE */ + +/* + * Mark the start of some code snippet to be patched. + */ +#define CODEPATCH_START 998: +/* + * Mark the end of some code to be patched, and assign the given tag. + */ +#define CODEPATCH_END2(startnum,tag) \ + 999: \ + .section .codepatch, "a" ;\ + .quad startnum##b ;\ + .short (999b - startnum##b) ;\ + .short tag ;\ + .int 0 ;\ + .previous +#define CODEPATCH_END(tag) CODEPATCH_END2(998,tag) + +#define CPTAG_REPEAT_TLBI 1 + + +/* Would be neat if these could be in something like .cptext */ +#define CODEPATCH_CODE(symbol, instructions...) \ + .section .rodata; \ + .globl symbol; \ +symbol: instructions; \ + .size symbol, . - symbol + +/* provide a (short) variable with the length of the patch */ +#define CODEPATCH_CODE_LEN(symbol, instructions...) \ + CODEPATCH_CODE(symbol, instructions); \ +996: .globl symbol##_len; \ + .align 2; \ +symbol##_len: \ + .short 996b - symbol; \ + .size symbol##_len, 2 + +#endif /* _MACHINE_CODEPATCH_H_ */ \ No newline at end of file diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/cpu.h b/lib/libc/include/aarch64-openbsd-none/arm64/cpu.h index 172be4326fd49576fbd2335e2cb6498d56d919ef..1d396b8467afbe1989518872b5ceacaa4cdccf41 100644 --- a/lib/libc/include/aarch64-openbsd-none/arm64/cpu.h +++ b/lib/libc/include/aarch64-openbsd-none/arm64/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.55 2026/04/03 14:20:23 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.57 2026/09/06 20:02:12 kettenis Exp $ */ /* * Copyright (c) 2016 Dale Rahn * @@ -37,7 +37,8 @@ #define CPU_ID_AA64SMFR0 10 #define CPU_ID_AA64ZFR0 11 #define CPU_LIDACTION 12 -#define CPU_MAXID 13 /* number of valid machdep ids */ +#define CPU_LED_BLINK 13 /* int: blink leds? */ +#define CPU_MAXID 14 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ @@ -53,6 +54,7 @@ { "id_aa64smfr0", CTLTYPE_QUAD }, \ { "id_aa64zfr0", CTLTYPE_QUAD }, \ { "lidaction", CTLTYPE_INT }, \ + { "led_blink", CTLTYPE_INT }, \ } #ifdef _KERNEL @@ -200,6 +202,8 @@ struct cpu_info { #define CPUF_PRESENT (1<<4) #define CPUF_GO (1<<5) #define CPUF_RUNNING (1<<6) +#define CPUF_PARK (1<<7) +#define CPUF_PARKED (1<<8) static inline struct cpu_info * curcpu(void) @@ -357,6 +361,14 @@ void cpu_wfi(void); void delay (unsigned); #define DELAY(x) delay(x) +struct blink_led { + void (*bl_func)(void *, int); + void *bl_arg; + SLIST_ENTRY(blink_led) bl_next; +}; + +void blink_led_register(struct blink_led *); + #endif /* _KERNEL */ #ifdef MULTIPROCESSOR diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/hibernate.h b/lib/libc/include/aarch64-openbsd-none/arm64/hibernate.h new file mode 100644 index 0000000000000000000000000000000000000000..015fdcd1597f8eaa013b0a8c2028a3a673821e27 --- /dev/null +++ b/lib/libc/include/aarch64-openbsd-none/arm64/hibernate.h @@ -0,0 +1,38 @@ +/* $OpenBSD: hibernate.h,v 1.1 2026/09/06 18:25:22 mglocker Exp $ */ + +/* + * Copyright (c) 2011 Mike Larkin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +/* arm64 hibernate support structures and functions */ + +int get_hibernate_info_md(union hibernate_info *); +void hibernate_flush(void); +void hibernate_enter_resume_mapping(vaddr_t, paddr_t, int); +int hibernate_inflate_skip(union hibernate_info *, paddr_t); +int hibernate_suspend(void); +void hibernate_switch_stack_machdep(void); +void hibernate_resume_machdep(vaddr_t); +void hibernate_activate_resume_pt_machdep(void); +void hibernate_enable_intr_machdep(void); +void hibernate_disable_intr_machdep(void); +#ifdef MULTIPROCESSOR +void hibernate_quiesce_cpus(void); +#endif /* MULTIPROCESSOR */ + +/* arm64-only extras (see hibernate_var.h for the piglet save layout) */ +void hibernate_dcache_flush_machdep(void); \ No newline at end of file diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/hibernate_var.h b/lib/libc/include/aarch64-openbsd-none/arm64/hibernate_var.h new file mode 100644 index 0000000000000000000000000000000000000000..1eb26562b5ce455ec64cd7d8374a0bb7bc2a8e3d --- /dev/null +++ b/lib/libc/include/aarch64-openbsd-none/arm64/hibernate_var.h @@ -0,0 +1,79 @@ +/* $OpenBSD: hibernate_var.h,v 1.2 2026/09/19 17:27:09 kettenis Exp $ */ + +/* + * Copyright (c) 2011 Mike Larkin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LOCORE +extern vaddr_t global_piglet_va; +extern paddr_t global_piglet_pa; +#endif + +#define PIGLET_PAGE_MASK (~((1ULL << 21) - 1)) + +/* + * On arm64 the resume page tables use both TTBR0 and TTBR1. The + * TTBR0 (PT0) page tables start at L0 and cover the first 4MB of the + * piglet with 4KB pages (such that pages in the piglet can be + * accessed using their offset) and also covers identy mappings for + * the pig, the piglet and kernel using 2MB mappings. The TTBR1 (PT1) + * page tables covers mappings for the piglet and kernel using normal + * kernel VAs. + */ +#define HIBERNATE_PT0_L0_PAGE (PAGE_SIZE * 512) /* TTBR0 root */ +#define HIBERNATE_PT0_L1_LOW (PAGE_SIZE * 513) +#define HIBERNATE_PT0_L2_LOW (PAGE_SIZE * 514) +#define HIBERNATE_PT0_L3_LOW (PAGE_SIZE * 515) /* 2 pages */ +#define HIBERNATE_PT0_L1_HI (PAGE_SIZE * 517) +#define HIBERNATE_PT1_L1_PAGE (PAGE_SIZE * 518) /* TTBR1 root */ + +/* Pool of L2 pages per distinct PT0_L1_LOW/PT0_L1_HI/PT1_L1 slot */ +#define HIBERNATE_PT0_L2_LOW_POOL (PAGE_SIZE * 520) +#define HIBERNATE_PT0_L2_LOW_POOL_COUNT 16 +#define HIBERNATE_PT0_L2_HI_POOL (PAGE_SIZE * 536) +#define HIBERNATE_PT0_L2_HI_POOL_COUNT 16 +#define HIBERNATE_PT1_L2_POOL (PAGE_SIZE * 552) +#define HIBERNATE_PT1_L2_POOL_COUNT 16 + +/* 3 pages for stack */ +#define HIBERNATE_STACK_PAGE (PAGE_SIZE * 570) + +#define HIBERNATE_INFLATE_PAGE (PAGE_SIZE * 571) + +/* + * On arm64 we can't access low VA using the normal kernel page + * tables. Since the hiballoc page is used before we install the + * resume page tables, use the normal kernel VA for access. + */ +#define HIBERNATE_HIBALLOC_PAGE (global_piglet_va + PAGE_SIZE * 572) + +/* Use 4MB hibernation chunks */ +#define HIBERNATE_CHUNK_SIZE 0x400000 + +#define HIBERNATE_CHUNK_TABLE_SIZE 0x200000 + +#define HIBERNATE_STACK_OFFSET 0x0F00 + +/* + * Minimum amount of memory for hibernate support. This is used in early boot + * when deciding if we can preallocate the piglet. If the machine does not + * have at least HIBERNATE_MIN_MEMORY RAM, we won't support hibernate. This + * avoids late allocation issues due to fragmented memory and failure to + * hibernate. We need to be able to allocate 32MB contiguous memory, aligned + * to 2MB. + * + * The default minimum required memory is 512MB (1ULL << 29). + */ +#define HIBERNATE_MIN_MEMORY (1ULL << 29) \ No newline at end of file diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/simplebusvar.h b/lib/libc/include/aarch64-openbsd-none/arm64/simplebusvar.h index be1336cf1fd4ba321e6e4eb532efd73cc0cbd0b4..a3fda16ece76743ae6f7b982089565cbb118e923 100644 --- a/lib/libc/include/aarch64-openbsd-none/arm64/simplebusvar.h +++ b/lib/libc/include/aarch64-openbsd-none/arm64/simplebusvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebusvar.h,v 1.1 2023/09/22 01:10:43 jsg Exp $ */ +/* $OpenBSD: simplebusvar.h,v 1.2 2026/06/22 07:54:19 deraadt Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * @@ -25,7 +25,7 @@ struct simplebus_softc { int sc_pacells; int sc_pscells; struct bus_space sc_bus; - struct machine_bus_dma_tag sc_dma; + struct bus_dma_tag sc_dma; int *sc_ranges; int sc_rangeslen; int *sc_dmaranges; diff --git a/lib/libc/include/aarch64-openbsd-none/arm64/vmmvar.h b/lib/libc/include/aarch64-openbsd-none/arm64/vmmvar.h index 7d156212804edf9de37feede5696c6b645c4013c..91f394a04de08f5b4b3b0de57a199e058bba49c2 100644 --- a/lib/libc/include/aarch64-openbsd-none/arm64/vmmvar.h +++ b/lib/libc/include/aarch64-openbsd-none/arm64/vmmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmmvar.h,v 1.3 2025/08/03 10:17:33 tb Exp $ */ +/* $OpenBSD: vmmvar.h,v 1.4 2026/09/19 17:21:52 dv Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -63,7 +63,6 @@ struct vm_exit { struct vm_intr_params { /* Input parameters to VMM_IOC_INTR */ - uint32_t vip_vm_id; uint32_t vip_vcpu_id; uint16_t vip_intr; }; @@ -76,7 +75,6 @@ struct vm_rwregs_params { * Input/output parameters to VMM_IOC_READREGS / * VMM_IOC_WRITEREGS */ - uint32_t vrwp_vm_id; uint32_t vrwp_vcpu_id; uint64_t vrwp_mask; struct vcpu_reg_state vrwp_regs; diff --git a/lib/libc/include/aarch64-openbsd-none/machine/_types.h b/lib/libc/include/aarch64-openbsd-none/machine/_types.h index 2de0c9d512a5cd8909f2554e476c0b32d5a29a6c..771a22bfda18eddb09cb53f2481cffed03f1ea7e 100644 --- a/lib/libc/include/aarch64-openbsd-none/machine/_types.h +++ b/lib/libc/include/aarch64-openbsd-none/machine/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.6 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.7 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -123,11 +123,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/aarch64-openbsd-none/machine/armreg.h b/lib/libc/include/aarch64-openbsd-none/machine/armreg.h index 7483ae8dd70dfe08ce0937eca6d89902fba892cd..941fed486708b7b047ac227701d513f94e053156 100644 --- a/lib/libc/include/aarch64-openbsd-none/machine/armreg.h +++ b/lib/libc/include/aarch64-openbsd-none/machine/armreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: armreg.h,v 1.44 2025/07/22 09:20:41 kettenis Exp $ */ +/* $OpenBSD: armreg.h,v 1.45 2026/05/04 20:43:42 kettenis Exp $ */ /*- * Copyright (c) 2013, 2014 Andrew Turner * Copyright (c) 2015 The FreeBSD Foundation @@ -119,6 +119,14 @@ #define CTR_ILINE_MASK (0xf << CTR_ILINE_SHIFT) #define CTR_ILINE_SIZE(reg) (((reg) & CTR_ILINE_MASK) >> CTR_ILINE_SHIFT) +/* CurrentEL - Current Exception Level */ +#define CURRENTEL_EL_SHIFT 2 +#define CURRENTEL_EL_MASK (0x3 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL0 (0x0 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL1 (0x1 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL2 (0x2 << CURRENTEL_EL_SHIFT) +#define CURRENTEL_EL_EL3 (0x3 << CURRENTEL_EL_SHIFT) + /* MPIDR_EL1 - Multiprocessor Affinity Register */ #define MPIDR_AFF3 (0xFFULL << 32) #define MPIDR_AFF2 (0xFFULL << 16) diff --git a/lib/libc/include/aarch64-openbsd-none/machine/bus.h b/lib/libc/include/aarch64-openbsd-none/machine/bus.h index 70ad145593e80527ec3be3aa799403b1d0f88d5e..a359fa758b64422295c45787bf999d2b20fc2905 100644 --- a/lib/libc/include/aarch64-openbsd-none/machine/bus.h +++ b/lib/libc/include/aarch64-openbsd-none/machine/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.11 2024/11/18 05:32:39 jsg Exp $ */ +/* $OpenBSD: bus.h,v 1.13 2026/06/22 07:54:19 deraadt Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. * @@ -349,8 +349,8 @@ struct uio; #define BUS_DMASYNC_PREREAD 0x0004 #define BUS_DMASYNC_PREWRITE 0x0008 -typedef struct machine_bus_dma_tag *bus_dma_tag_t; -typedef struct machine_bus_dmamap *bus_dmamap_t; +typedef struct bus_dma_tag *bus_dma_tag_t; +typedef struct bus_dmamap *bus_dmamap_t; /* * bus_dma_segment_t @@ -358,14 +358,15 @@ typedef struct machine_bus_dmamap *bus_dmamap_t; * Describes a single contiguous DMA transaction. Values * are suitable for programming into DMA registers. */ -struct machine_bus_dma_segment { +struct bus_dma_segment { bus_addr_t ds_addr; /* DMA address */ bus_size_t ds_len; /* length of transfer */ paddr_t _ds_paddr; /* CPU address */ vaddr_t _ds_vaddr; /* CPU address */ + vaddr_t _ds_bounce_va; /* mapped bounced data */ }; -typedef struct machine_bus_dma_segment bus_dma_segment_t; +typedef struct bus_dma_segment bus_dma_segment_t; /* * bus_dma_tag_t @@ -374,7 +375,7 @@ typedef struct machine_bus_dma_segment bus_dma_segment_t; * DMA for a given bus. */ -struct machine_bus_dma_tag { +struct bus_dma_tag { void *_cookie; /* cookie used in the guts */ int _flags; /* misc. flags */ @@ -393,7 +394,8 @@ struct machine_bus_dma_tag { int (*_dmamap_load_raw)(bus_dma_tag_t , bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int (*_dmamap_load_buffer)(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, + int *, int *, int); void (*_dmamap_unload)(bus_dma_tag_t , bus_dmamap_t); void (*_dmamap_sync)(bus_dma_tag_t , bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -451,6 +453,8 @@ struct machine_bus_dma_tag { #define bus_dmamem_mmap(t, sg, n, o, p, f) \ (*(t)->_dmamem_mmap)((t), (sg), (n), (o), (p), (f)) +void bus_dma_init(void); + int _dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); void _dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); @@ -461,7 +465,8 @@ int _dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); int _dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int _dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, int *, + int *, int); void _dmamap_unload(bus_dma_tag_t, bus_dmamap_t); void _dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -481,7 +486,7 @@ int _dmamem_alloc_range(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, * * Describes a DMA mapping. */ -struct machine_bus_dmamap { +struct bus_dmamap { /* * PRIVATE MEMBERS: not for use by machine-independent code. */ @@ -493,6 +498,11 @@ struct machine_bus_dmamap { void *_dm_cookie; /* cookie for bus-specific functions */ + struct vm_page **_dm_pages; /* replacement pages */ + vaddr_t _dm_pgva; /* those above -- mapped */ + int _dm_npages; /* number of pages allocated */ + int _dm_nused; /* number of pages replaced */ + /* * PUBLIC MEMBERS: these are used by machine-independent code. */ diff --git a/lib/libc/include/aarch64-openbsd-none/machine/codepatch.h b/lib/libc/include/aarch64-openbsd-none/machine/codepatch.h new file mode 100644 index 0000000000000000000000000000000000000000..849b50725410584d3addc86cb9e9a7dda433070e --- /dev/null +++ b/lib/libc/include/aarch64-openbsd-none/machine/codepatch.h @@ -0,0 +1,72 @@ +/* $OpenBSD: codepatch.h,v 1.1 2026/06/23 11:45:54 kettenis Exp $ */ +/* + * Copyright (c) 2014-2015 Stefan Fritsch + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _MACHINE_CODEPATCH_H_ +#define _MACHINE_CODEPATCH_H_ + +#include + +#ifndef _LOCORE + +/* code in this section will be unmapped after boot */ +#define __cptext __attribute__((section(".cptext"))) + +__cptext void *codepatch_maprw(vaddr_t *nva, vaddr_t dest); +__cptext void codepatch_unmaprw(vaddr_t nva); +__cptext void codepatch_fill_nop(void *caddr, uint16_t len); +__cptext void codepatch_nop(uint16_t tag); +void codepatch_disable(void); + +#endif /* !_LOCORE */ + +/* + * Mark the start of some code snippet to be patched. + */ +#define CODEPATCH_START 998: +/* + * Mark the end of some code to be patched, and assign the given tag. + */ +#define CODEPATCH_END2(startnum,tag) \ + 999: \ + .section .codepatch, "a" ;\ + .quad startnum##b ;\ + .short (999b - startnum##b) ;\ + .short tag ;\ + .int 0 ;\ + .previous +#define CODEPATCH_END(tag) CODEPATCH_END2(998,tag) + +#define CPTAG_REPEAT_TLBI 1 + + +/* Would be neat if these could be in something like .cptext */ +#define CODEPATCH_CODE(symbol, instructions...) \ + .section .rodata; \ + .globl symbol; \ +symbol: instructions; \ + .size symbol, . - symbol + +/* provide a (short) variable with the length of the patch */ +#define CODEPATCH_CODE_LEN(symbol, instructions...) \ + CODEPATCH_CODE(symbol, instructions); \ +996: .globl symbol##_len; \ + .align 2; \ +symbol##_len: \ + .short 996b - symbol; \ + .size symbol##_len, 2 + +#endif /* _MACHINE_CODEPATCH_H_ */ \ No newline at end of file diff --git a/lib/libc/include/aarch64-openbsd-none/machine/cpu.h b/lib/libc/include/aarch64-openbsd-none/machine/cpu.h index 172be4326fd49576fbd2335e2cb6498d56d919ef..1d396b8467afbe1989518872b5ceacaa4cdccf41 100644 --- a/lib/libc/include/aarch64-openbsd-none/machine/cpu.h +++ b/lib/libc/include/aarch64-openbsd-none/machine/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.55 2026/04/03 14:20:23 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.57 2026/09/06 20:02:12 kettenis Exp $ */ /* * Copyright (c) 2016 Dale Rahn * @@ -37,7 +37,8 @@ #define CPU_ID_AA64SMFR0 10 #define CPU_ID_AA64ZFR0 11 #define CPU_LIDACTION 12 -#define CPU_MAXID 13 /* number of valid machdep ids */ +#define CPU_LED_BLINK 13 /* int: blink leds? */ +#define CPU_MAXID 14 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ @@ -53,6 +54,7 @@ { "id_aa64smfr0", CTLTYPE_QUAD }, \ { "id_aa64zfr0", CTLTYPE_QUAD }, \ { "lidaction", CTLTYPE_INT }, \ + { "led_blink", CTLTYPE_INT }, \ } #ifdef _KERNEL @@ -200,6 +202,8 @@ struct cpu_info { #define CPUF_PRESENT (1<<4) #define CPUF_GO (1<<5) #define CPUF_RUNNING (1<<6) +#define CPUF_PARK (1<<7) +#define CPUF_PARKED (1<<8) static inline struct cpu_info * curcpu(void) @@ -357,6 +361,14 @@ void cpu_wfi(void); void delay (unsigned); #define DELAY(x) delay(x) +struct blink_led { + void (*bl_func)(void *, int); + void *bl_arg; + SLIST_ENTRY(blink_led) bl_next; +}; + +void blink_led_register(struct blink_led *); + #endif /* _KERNEL */ #ifdef MULTIPROCESSOR diff --git a/lib/libc/include/aarch64-openbsd-none/machine/hibernate.h b/lib/libc/include/aarch64-openbsd-none/machine/hibernate.h new file mode 100644 index 0000000000000000000000000000000000000000..015fdcd1597f8eaa013b0a8c2028a3a673821e27 --- /dev/null +++ b/lib/libc/include/aarch64-openbsd-none/machine/hibernate.h @@ -0,0 +1,38 @@ +/* $OpenBSD: hibernate.h,v 1.1 2026/09/06 18:25:22 mglocker Exp $ */ + +/* + * Copyright (c) 2011 Mike Larkin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +/* arm64 hibernate support structures and functions */ + +int get_hibernate_info_md(union hibernate_info *); +void hibernate_flush(void); +void hibernate_enter_resume_mapping(vaddr_t, paddr_t, int); +int hibernate_inflate_skip(union hibernate_info *, paddr_t); +int hibernate_suspend(void); +void hibernate_switch_stack_machdep(void); +void hibernate_resume_machdep(vaddr_t); +void hibernate_activate_resume_pt_machdep(void); +void hibernate_enable_intr_machdep(void); +void hibernate_disable_intr_machdep(void); +#ifdef MULTIPROCESSOR +void hibernate_quiesce_cpus(void); +#endif /* MULTIPROCESSOR */ + +/* arm64-only extras (see hibernate_var.h for the piglet save layout) */ +void hibernate_dcache_flush_machdep(void); \ No newline at end of file diff --git a/lib/libc/include/aarch64-openbsd-none/machine/hibernate_var.h b/lib/libc/include/aarch64-openbsd-none/machine/hibernate_var.h new file mode 100644 index 0000000000000000000000000000000000000000..1eb26562b5ce455ec64cd7d8374a0bb7bc2a8e3d --- /dev/null +++ b/lib/libc/include/aarch64-openbsd-none/machine/hibernate_var.h @@ -0,0 +1,79 @@ +/* $OpenBSD: hibernate_var.h,v 1.2 2026/09/19 17:27:09 kettenis Exp $ */ + +/* + * Copyright (c) 2011 Mike Larkin + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LOCORE +extern vaddr_t global_piglet_va; +extern paddr_t global_piglet_pa; +#endif + +#define PIGLET_PAGE_MASK (~((1ULL << 21) - 1)) + +/* + * On arm64 the resume page tables use both TTBR0 and TTBR1. The + * TTBR0 (PT0) page tables start at L0 and cover the first 4MB of the + * piglet with 4KB pages (such that pages in the piglet can be + * accessed using their offset) and also covers identy mappings for + * the pig, the piglet and kernel using 2MB mappings. The TTBR1 (PT1) + * page tables covers mappings for the piglet and kernel using normal + * kernel VAs. + */ +#define HIBERNATE_PT0_L0_PAGE (PAGE_SIZE * 512) /* TTBR0 root */ +#define HIBERNATE_PT0_L1_LOW (PAGE_SIZE * 513) +#define HIBERNATE_PT0_L2_LOW (PAGE_SIZE * 514) +#define HIBERNATE_PT0_L3_LOW (PAGE_SIZE * 515) /* 2 pages */ +#define HIBERNATE_PT0_L1_HI (PAGE_SIZE * 517) +#define HIBERNATE_PT1_L1_PAGE (PAGE_SIZE * 518) /* TTBR1 root */ + +/* Pool of L2 pages per distinct PT0_L1_LOW/PT0_L1_HI/PT1_L1 slot */ +#define HIBERNATE_PT0_L2_LOW_POOL (PAGE_SIZE * 520) +#define HIBERNATE_PT0_L2_LOW_POOL_COUNT 16 +#define HIBERNATE_PT0_L2_HI_POOL (PAGE_SIZE * 536) +#define HIBERNATE_PT0_L2_HI_POOL_COUNT 16 +#define HIBERNATE_PT1_L2_POOL (PAGE_SIZE * 552) +#define HIBERNATE_PT1_L2_POOL_COUNT 16 + +/* 3 pages for stack */ +#define HIBERNATE_STACK_PAGE (PAGE_SIZE * 570) + +#define HIBERNATE_INFLATE_PAGE (PAGE_SIZE * 571) + +/* + * On arm64 we can't access low VA using the normal kernel page + * tables. Since the hiballoc page is used before we install the + * resume page tables, use the normal kernel VA for access. + */ +#define HIBERNATE_HIBALLOC_PAGE (global_piglet_va + PAGE_SIZE * 572) + +/* Use 4MB hibernation chunks */ +#define HIBERNATE_CHUNK_SIZE 0x400000 + +#define HIBERNATE_CHUNK_TABLE_SIZE 0x200000 + +#define HIBERNATE_STACK_OFFSET 0x0F00 + +/* + * Minimum amount of memory for hibernate support. This is used in early boot + * when deciding if we can preallocate the piglet. If the machine does not + * have at least HIBERNATE_MIN_MEMORY RAM, we won't support hibernate. This + * avoids late allocation issues due to fragmented memory and failure to + * hibernate. We need to be able to allocate 32MB contiguous memory, aligned + * to 2MB. + * + * The default minimum required memory is 512MB (1ULL << 29). + */ +#define HIBERNATE_MIN_MEMORY (1ULL << 29) \ No newline at end of file diff --git a/lib/libc/include/aarch64-openbsd-none/machine/simplebusvar.h b/lib/libc/include/aarch64-openbsd-none/machine/simplebusvar.h index be1336cf1fd4ba321e6e4eb532efd73cc0cbd0b4..a3fda16ece76743ae6f7b982089565cbb118e923 100644 --- a/lib/libc/include/aarch64-openbsd-none/machine/simplebusvar.h +++ b/lib/libc/include/aarch64-openbsd-none/machine/simplebusvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebusvar.h,v 1.1 2023/09/22 01:10:43 jsg Exp $ */ +/* $OpenBSD: simplebusvar.h,v 1.2 2026/06/22 07:54:19 deraadt Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * @@ -25,7 +25,7 @@ struct simplebus_softc { int sc_pacells; int sc_pscells; struct bus_space sc_bus; - struct machine_bus_dma_tag sc_dma; + struct bus_dma_tag sc_dma; int *sc_ranges; int sc_rangeslen; int *sc_dmaranges; diff --git a/lib/libc/include/aarch64-openbsd-none/machine/vmmvar.h b/lib/libc/include/aarch64-openbsd-none/machine/vmmvar.h index 7d156212804edf9de37feede5696c6b645c4013c..91f394a04de08f5b4b3b0de57a199e058bba49c2 100644 --- a/lib/libc/include/aarch64-openbsd-none/machine/vmmvar.h +++ b/lib/libc/include/aarch64-openbsd-none/machine/vmmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmmvar.h,v 1.3 2025/08/03 10:17:33 tb Exp $ */ +/* $OpenBSD: vmmvar.h,v 1.4 2026/09/19 17:21:52 dv Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -63,7 +63,6 @@ struct vm_exit { struct vm_intr_params { /* Input parameters to VMM_IOC_INTR */ - uint32_t vip_vm_id; uint32_t vip_vcpu_id; uint16_t vip_intr; }; @@ -76,7 +75,6 @@ struct vm_rwregs_params { * Input/output parameters to VMM_IOC_READREGS / * VMM_IOC_WRITEREGS */ - uint32_t vrwp_vm_id; uint32_t vrwp_vcpu_id; uint64_t vrwp_mask; struct vcpu_reg_state vrwp_regs; diff --git a/lib/libc/include/arm-openbsd-eabi/arm/_types.h b/lib/libc/include/arm-openbsd-eabi/arm/_types.h index 5693a7cce191aee040d1f79333eb2acc864b21b4..b28c257440efaf2340fb047dcf498da193b7f540 100644 --- a/lib/libc/include/arm-openbsd-eabi/arm/_types.h +++ b/lib/libc/include/arm-openbsd-eabi/arm/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.21 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.22 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,11 +122,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/arm-openbsd-eabi/arm/cpu.h b/lib/libc/include/arm-openbsd-eabi/arm/cpu.h index eb81d8ee82a3c7d763b12e66d81716042339f7dd..d4fd383dd8bc058d9699ece5c1aa102ac27c9ab2 100644 --- a/lib/libc/include/arm-openbsd-eabi/arm/cpu.h +++ b/lib/libc/include/arm-openbsd-eabi/arm/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.67 2024/06/09 21:15:29 jca Exp $ */ +/* $OpenBSD: cpu.h,v 1.68 2026/05/25 01:56:50 jsg Exp $ */ /* $NetBSD: cpu.h,v 1.34 2003/06/23 11:01:08 martin Exp $ */ /* @@ -94,8 +94,6 @@ * Kernel-only definitions */ -#include - #include #include #include diff --git a/lib/libc/include/arm-openbsd-eabi/arm/cpuconf.h b/lib/libc/include/arm-openbsd-eabi/arm/cpuconf.h deleted file mode 100644 index a1576f6511212c3f3bf01979593548316e2775d4..0000000000000000000000000000000000000000 --- a/lib/libc/include/arm-openbsd-eabi/arm/cpuconf.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $OpenBSD: cpuconf.h,v 1.20 2024/11/07 08:12:12 miod Exp $ */ -/* $NetBSD: cpuconf.h,v 1.7 2003/05/23 00:57:24 ichiro Exp $ */ - -/* - * Copyright (c) 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _ARM_CPUCONF_H_ -#define _ARM_CPUCONF_H_ - -/* - * Define which MMU classes are configured: - * - * ARM_MMU_V7 v6/v7 MMU with XP bit enabled subpage - * protection is not used, TEX/AP is used instead. - */ - -#define ARM_MMU_V7 1 - -#define ARM_NMMUS (ARM_MMU_V7) - -#endif /* _ARM_CPUCONF_H_ */ \ No newline at end of file diff --git a/lib/libc/include/arm-openbsd-eabi/arm/cpufunc.h b/lib/libc/include/arm-openbsd-eabi/arm/cpufunc.h index 07d18177ae0d230fc161e8fb8502b07a9074f1aa..80a9f51314a3e8715873dd92256c0042990d2602 100644 --- a/lib/libc/include/arm-openbsd-eabi/arm/cpufunc.h +++ b/lib/libc/include/arm-openbsd-eabi/arm/cpufunc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpufunc.h,v 1.34 2023/05/30 08:30:00 jsg Exp $ */ +/* $OpenBSD: cpufunc.h,v 1.35 2026/05/25 01:56:50 jsg Exp $ */ /* $NetBSD: cpufunc.h,v 1.29 2003/09/06 09:08:35 rearnsha Exp $ */ /* @@ -46,7 +46,6 @@ #ifdef _KERNEL #include -#include struct cpu_functions { diff --git a/lib/libc/include/arm-openbsd-eabi/arm/fiq.h b/lib/libc/include/arm-openbsd-eabi/arm/fiq.h deleted file mode 100644 index 4abafaa056c8f9d2a01de2363150a5392fe32e40..0000000000000000000000000000000000000000 --- a/lib/libc/include/arm-openbsd-eabi/arm/fiq.h +++ /dev/null @@ -1,69 +0,0 @@ -/* $OpenBSD: fiq.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */ -/* $NetBSD: fiq.h,v 1.1 2001/12/20 01:20:23 thorpej Exp $ */ - -/* - * Copyright (c) 2001 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _ARM_FIQ_H_ -#define _ARM_FIQ_H_ - -#include - -struct fiqregs { - u_int fr_r8; /* FIQ mode r8 */ - u_int fr_r9; /* FIQ mode r9 */ - u_int fr_r10; /* FIQ mode r10 */ - u_int fr_r11; /* FIQ mode r11 */ - u_int fr_r12; /* FIQ mode r12 */ - u_int fr_r13; /* FIQ mode r13 */ -}; - -struct fiqhandler { - TAILQ_ENTRY(fiqhandler) fh_list;/* link in the FIQ handler stack */ - void *fh_func; /* FIQ handler routine */ - size_t fh_size; /* size of FIQ handler */ - int fh_flags; /* flags; see below */ - struct fiqregs *fh_regs; /* pointer to regs structure */ -}; - -#define FH_CANPUSH 0x01 /* can push this handler out of the way */ - -int fiq_claim(struct fiqhandler *); -void fiq_release(struct fiqhandler *); - -void fiq_getregs(struct fiqregs *); -void fiq_setregs(struct fiqregs *); - -#endif /* _ARM_FIQ_H_ */ \ No newline at end of file diff --git a/lib/libc/include/arm-openbsd-eabi/arm/pmap.h b/lib/libc/include/arm-openbsd-eabi/arm/pmap.h index 4e717b13d1c87ab0d01ff92c7b66ecabba5dc390..02657eaf48f3762ec19e35bf1c5d0b9fac9f5a1a 100644 --- a/lib/libc/include/arm-openbsd-eabi/arm/pmap.h +++ b/lib/libc/include/arm-openbsd-eabi/arm/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.57 2024/11/07 08:12:12 miod Exp $ */ +/* $OpenBSD: pmap.h,v 1.58 2026/05/25 01:56:50 jsg Exp $ */ /* $NetBSD: pmap.h,v 1.76 2003/09/06 09:10:46 rearnsha Exp $ */ /* @@ -71,7 +71,6 @@ #ifdef _KERNEL -#include #include #ifndef _LOCORE #include diff --git a/lib/libc/include/generic-openbsd/arpa/telnet.h b/lib/libc/include/generic-openbsd/arpa/telnet.h index f0094f2af20ecdae47ca5e0bc28ec7c417c55828..2793d82df1d984efee26981f950510a6dc307799 100644 --- a/lib/libc/include/generic-openbsd/arpa/telnet.h +++ b/lib/libc/include/generic-openbsd/arpa/telnet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: telnet.h,v 1.7 2003/06/02 19:34:12 millert Exp $ */ +/* $OpenBSD: telnet.h,v 1.8 2026/09/05 08:22:03 jsg Exp $ */ /* $NetBSD: telnet.h,v 1.4 1994/10/26 00:56:46 cgd Exp $ */ /* @@ -96,7 +96,7 @@ extern char *telcmds[]; #define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */ #define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */ #define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */ -#define TELOPT_XASCII 17 /* extended ascic character set */ +#define TELOPT_XASCII 17 /* extended ASCII character set */ #define TELOPT_LOGOUT 18 /* force logout */ #define TELOPT_BM 19 /* byte macro */ #define TELOPT_DET 20 /* data entry terminal */ diff --git a/lib/libc/include/generic-openbsd/imsg.h b/lib/libc/include/generic-openbsd/imsg.h index bda67b7085ad49bbc30a6d9da0c7a7d9dab89e70..e5960af613baf8783a1a6cfde5c48cb45353dadb 100644 --- a/lib/libc/include/generic-openbsd/imsg.h +++ b/lib/libc/include/generic-openbsd/imsg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.h,v 1.24 2025/06/05 08:55:07 tb Exp $ */ +/* $OpenBSD: imsg.h,v 1.25 2026/09/04 18:47:43 claudio Exp $ */ /* * Copyright (c) 2023 Claudio Jeker @@ -46,6 +46,8 @@ struct msgbuf; struct imsgbuf { struct msgbuf *w; + void (*cb)(struct imsgbuf *, void *); + void *userdata; pid_t pid; uint32_t maxsize; int fd; @@ -127,6 +129,7 @@ int ibuf_write(int, struct msgbuf *); int msgbuf_write(int, struct msgbuf *); int ibuf_read(int, struct msgbuf *); int msgbuf_read(int, struct msgbuf *); +uint32_t msgbuf_readlen(struct msgbuf *); struct ibuf *msgbuf_get(struct msgbuf *); struct ibufqueue *ibufq_new(void); @@ -140,14 +143,17 @@ void ibufq_flush(struct ibufqueue *); /* imsg.c */ int imsgbuf_init(struct imsgbuf *, int); void imsgbuf_allow_fdpass(struct imsgbuf *imsgbuf); +void imsgbuf_set_close_callback(struct imsgbuf *, + void (*)(struct imsgbuf *, void *)); int imsgbuf_set_maxsize(struct imsgbuf *, uint32_t); +void *imsgbuf_set_userdata(struct imsgbuf *, void *); +void *imsgbuf_get_userdata(struct imsgbuf *); int imsgbuf_read(struct imsgbuf *); int imsgbuf_write(struct imsgbuf *); int imsgbuf_flush(struct imsgbuf *); void imsgbuf_clear(struct imsgbuf *); uint32_t imsgbuf_queuelen(struct imsgbuf *); int imsgbuf_get(struct imsgbuf *, struct imsg *); -ssize_t imsg_get(struct imsgbuf *, struct imsg *); int imsg_ibufq_pop(struct ibufqueue *, struct imsg *); void imsg_ibufq_push(struct ibufqueue *, struct imsg *); int imsg_get_ibuf(struct imsg *, struct ibuf *); @@ -164,10 +170,9 @@ int imsg_compose(struct imsgbuf *, uint32_t, uint32_t, pid_t, int, const void *, size_t); int imsg_composev(struct imsgbuf *, uint32_t, uint32_t, pid_t, int, const struct iovec *, int); -int imsg_compose_ibuf(struct imsgbuf *, uint32_t, uint32_t, pid_t, - struct ibuf *); struct ibuf *imsg_create(struct imsgbuf *, uint32_t, uint32_t, pid_t, size_t); int imsg_add(struct ibuf *, const void *, size_t); +int imsg_add_strbuf(struct ibuf *, const char *, size_t); void imsg_close(struct imsgbuf *, struct ibuf *); void imsg_free(struct imsg *); int imsg_set_maxsize(struct ibuf *, size_t); diff --git a/lib/libc/include/generic-openbsd/limits.h b/lib/libc/include/generic-openbsd/limits.h index 7b9702ce670d18632e5ff2aec3b89f53445c8727..6c35d700c5275148338215ea60ed766e06b69b24 100644 --- a/lib/libc/include/generic-openbsd/limits.h +++ b/lib/libc/include/generic-openbsd/limits.h @@ -1,4 +1,4 @@ -/* $OpenBSD: limits.h,v 1.19 2015/01/20 22:09:50 tedu Exp $ */ +/* $OpenBSD: limits.h,v 1.20 2026/08/10 20:10:19 daniel Exp $ */ /* $NetBSD: limits.h,v 1.7 1994/10/26 00:56:00 cgd Exp $ */ /* @@ -55,7 +55,7 @@ #define _POSIX_SYMLOOP_MAX 8 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 #define _POSIX_THREAD_KEYS_MAX 128 -#define _POSIX_THREAD_THREADS_MAX 4 +#define _POSIX_THREAD_THREADS_MAX 64 #if __POSIX_VISIBLE >= 200112 #define _POSIX_CLOCKRES_MIN 20000000 diff --git a/lib/libc/include/generic-openbsd/math.h b/lib/libc/include/generic-openbsd/math.h index 9cad4b0f74b0a6b368b653a74f3060bab3813896..92d553e0410b75cb84dfed83fe8d6eb1dff77696 100644 --- a/lib/libc/include/generic-openbsd/math.h +++ b/lib/libc/include/generic-openbsd/math.h @@ -1,4 +1,4 @@ -/* $OpenBSD: math.h,v 1.36 2018/03/10 20:52:58 kettenis Exp $ */ +/* $OpenBSD: math.h,v 1.37 2026/08/03 22:19:15 daniel Exp $ */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -146,7 +146,7 @@ extern char __nan[]; extern int signgam; #endif /* __BSD_VISIBLE || __XPG_VISIBLE */ -#if __POSIX_VISIBLE >= 201403 +#if __XPG_VISIBLE >= 800 #define M_El 2.718281828459045235360287471352662498L /* e */ #define M_LOG2El 1.442695040888963407359924681001892137L /* log 2e */ #define M_LOG10El 0.434294481903251827651128918916605082L /* log 10e */ @@ -160,7 +160,7 @@ extern int signgam; #define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ #define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ #define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ -#endif /* __POSIX_VISIBLE >= 201403 */ +#endif /* __XPG_VISIBLE >= 800 */ #if __BSD_VISIBLE #define HUGE MAXFLOAT diff --git a/lib/libc/include/generic-openbsd/md5.h b/lib/libc/include/generic-openbsd/md5.h index a4623a50efaeed57507e81853e64fcd4debe8dcf..e1e6679ad82ad2e4f0a1a33e04b3c3a536cbe2dc 100644 --- a/lib/libc/include/generic-openbsd/md5.h +++ b/lib/libc/include/generic-openbsd/md5.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.h,v 1.17 2012/12/05 23:19:57 deraadt Exp $ */ +/* $OpenBSD: md5.h,v 1.18 2026/08/31 15:09:14 tb Exp $ */ /* * This code implements the MD5 message-digest algorithm. @@ -29,18 +29,12 @@ __BEGIN_DECLS void MD5Init(MD5_CTX *); void MD5Update(MD5_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); -void MD5Pad(MD5_CTX *); void MD5Final(u_int8_t [MD5_DIGEST_LENGTH], MD5_CTX *) __attribute__((__bounded__(__minbytes__,1,MD5_DIGEST_LENGTH))); -void MD5Transform(u_int32_t [4], const u_int8_t [MD5_BLOCK_LENGTH]) - __attribute__((__bounded__(__minbytes__,1,4))) - __attribute__((__bounded__(__minbytes__,2,MD5_BLOCK_LENGTH))); char *MD5End(MD5_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH))); char *MD5File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH))); -char *MD5FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH))); char *MD5Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,MD5_DIGEST_STRING_LENGTH))); diff --git a/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs.h b/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs.h index 12210d6f608f90b556b902fa1890a8c0224b64ea..e046424460162174f8417f42a21116c2323924c5 100644 --- a/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs.h +++ b/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fusefs.h,v 1.15 2025/09/08 17:25:46 helg Exp $ */ +/* $OpenBSD: fusefs.h,v 1.17 2026/06/20 13:45:13 helg Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon * @@ -41,6 +41,7 @@ struct fusefs_mnt { struct mount *mp; uint32_t undef_op; int max_read; + int max_write; int sess_init; int allow_other; dev_t dev; @@ -74,12 +75,13 @@ void fuse_device_cleanup(dev_t); void fuse_device_queue_fbuf(dev_t, struct fusebuf *); void fuse_device_set_fmp(struct fusefs_mnt *, int); -/* - * The root inode is the root of the file system. Inode 0 can't be used for - * normal purposes. - */ -#define FUSE_ROOTINO ((ino_t)1) #define VFSTOFUSEFS(mp) ((struct fusefs_mnt *)((mp)->mnt_data)) +#ifdef FUSE_DEBUG +#define DPRINTF(fmt, arg...) printf("%s: " fmt, "fusefs", ##arg) +#else +#define DPRINTF(fmt, arg...) +#endif + #endif /* _KERNEL */ #endif /* __FUSEFS_H__ */ \ No newline at end of file diff --git a/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs_node.h b/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs_node.h index ee144d1f9f7dc23f7d401f95483dfec83d664a34..4797e2e97ef5f096a4048dd6a4901ba46ac4c3c9 100644 --- a/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs_node.h +++ b/lib/libc/include/generic-openbsd/miscfs/fuse/fusefs_node.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fusefs_node.h,v 1.6 2026/01/22 11:53:31 helg Exp $ */ +/* $OpenBSD: fusefs_node.h,v 1.9 2026/07/10 14:43:48 helg Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon * @@ -37,8 +37,7 @@ struct fusefs_mnt; struct fusefs_node { LIST_ENTRY(fusefs_node) i_hash; /* Hash chain */ struct vnode *i_vnode;/* Vnode associated with this inode. */ - struct fusefs_mnt *i_ump; - dev_t i_dev; /* Device associated with the inode. */ + struct fusefs_mnt *i_fmp; ino_t i_number; /* The identity of the inode. */ ino_t i_parent_cache;/* Parent inode (only dirs). */ struct lockf_state *i_lockf; /* Byte-level lock state. */ @@ -49,6 +48,9 @@ struct fusefs_node { /** meta **/ off_t filesize; + + /** lookup count needed by FUSE_FORGET **/ + uint64_t nlookup; }; #ifdef ITOV @@ -62,7 +64,7 @@ struct fusefs_node { #define VTOI(vp) ((struct fusefs_node *)(vp)->v_data) void fuse_ihashinit(void); -struct vnode *fuse_ihashget(dev_t, ino_t); +struct vnode *fuse_ihashget(const struct fusefs_mnt *, ino_t); int fuse_ihashins(struct fusefs_node *); void fuse_ihashrem(struct fusefs_node *); diff --git a/lib/libc/include/generic-openbsd/net/art.h b/lib/libc/include/generic-openbsd/net/art.h index bf621de830142e49154bfba6f526b88c6fea6d79..d64c10b4e4f6e927c402e4f4733c6637efff2991 100644 --- a/lib/libc/include/generic-openbsd/net/art.h +++ b/lib/libc/include/generic-openbsd/net/art.h @@ -1,4 +1,4 @@ -/* $OpenBSD: art.h,v 1.28 2025/07/10 05:28:13 dlg Exp $ */ +/* $OpenBSD: art.h,v 1.29 2026/04/23 01:28:03 jsg Exp $ */ /* * Copyright (c) 2015 Martin Pieuchot @@ -161,9 +161,6 @@ void art_iter_close(struct art_iter *); (_an) != NULL; \ (_an) = art_iter_next((_ai))) -int art_walk(struct art *, - int (*)(struct art_node *, void *), void *); - #endif /* _KERNEL */ #endif /* _NET_ART_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-openbsd/net/bpf.h b/lib/libc/include/generic-openbsd/net/bpf.h index a8a2dba58598b94880789b59bc417f427c08ee95..e01c35672858c244771b18d5c631d2f0bd3d715f 100644 --- a/lib/libc/include/generic-openbsd/net/bpf.h +++ b/lib/libc/include/generic-openbsd/net/bpf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.h,v 1.75 2025/11/16 02:20:08 dlg Exp $ */ +/* $OpenBSD: bpf.h,v 1.78 2026/09/10 18:31:39 claudio Exp $ */ /* $NetBSD: bpf.h,v 1.15 1996/12/13 07:57:33 mikel Exp $ */ /* @@ -52,7 +52,10 @@ typedef u_int32_t bpf_u_int32; #define BPF_ALIGNMENT sizeof(u_int32_t) #define BPF_WORDALIGN(x) (((x) + (BPF_ALIGNMENT - 1)) & ~(BPF_ALIGNMENT - 1)) +#ifdef _KERNEL #define BPF_MAXINSNS 512 +#endif + #define BPF_MAXBUFSIZE (2 * 1024 * 1024) #define BPF_MINBUFSIZE 32 @@ -309,18 +312,20 @@ struct bpf_ops { #define BPF_JUMP(code, k, jt, jf) { (u_int16_t)(code), jt, jf, k } __BEGIN_DECLS +#ifndef _KERNEL u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int) __bounded((__buffer__, 2, 4)); u_int _bpf_filter(const struct bpf_insn *, const struct bpf_ops *, const void *, u_int); +#endif /* _KERNEL */ __END_DECLS #ifdef _KERNEL struct ifnet; struct mbuf; -int bpf_validate(struct bpf_insn *, int); +int bpf_validate(struct bpf_insn *, u_int); int bpf_mtap(caddr_t, const struct mbuf *, u_int); int bpf_mtap_hdr(caddr_t, const void *, u_int, const struct mbuf *, u_int); int bpf_mtap_af(caddr_t, u_int32_t, const struct mbuf *, u_int); @@ -333,7 +338,10 @@ void *bpfxattach(caddr_t *, const char *, struct ifnet *, u_int, u_int); void bpfsdetach(void *); void bpfilterattach(int); -u_int bpf_mfilter(const struct bpf_insn *, const struct mbuf *, u_int); +u_int _bpf_lfilter(const struct bpf_insn *, u_int, const struct bpf_ops *, + const void *, u_int); + +u_int bpf_mfilter(const struct bpf_program *, const struct mbuf *, u_int); #endif /* _KERNEL */ /* diff --git a/lib/libc/include/generic-openbsd/net/if.h b/lib/libc/include/generic-openbsd/net/if.h index a309550f9557c7aed9062f263d585a265e6e2759..b550d74d3693d45cd1b9e7087c9423a5f82b1707 100644 --- a/lib/libc/include/generic-openbsd/net/if.h +++ b/lib/libc/include/generic-openbsd/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.223 2025/12/09 03:33:06 dlg Exp $ */ +/* $OpenBSD: if.h,v 1.224 2026/06/23 14:40:40 bluhm Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -232,6 +232,7 @@ struct if_status_description { #define IFXF_AUTOCONF4 0x80 /* [N] v4 autoconf (aka dhcp) enabled */ #define IFXF_MONITOR 0x100 /* [N] only used for bpf */ #define IFXF_LRO 0x200 /* [N] TCP large recv offload */ +#define IFXF_MBUF_64BIT 0x400 /* [I] mbuf with 64 bit DMA supported */ #define IFXF_CANTCHANGE \ (IFXF_MPSAFE|IFXF_CLONED) diff --git a/lib/libc/include/generic-openbsd/net/if_ppp.h b/lib/libc/include/generic-openbsd/net/if_ppp.h index 75f3eb5918ddb42b6572673761f13c471ecdb331..7247832a49ab8bf3115c3d80a84c60e0100c63e0 100644 --- a/lib/libc/include/generic-openbsd/net/if_ppp.h +++ b/lib/libc/include/generic-openbsd/net/if_ppp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ppp.h,v 1.10 2022/01/02 22:36:03 jsg Exp $ */ +/* $OpenBSD: if_ppp.h,v 1.11 2026/05/16 13:27:03 daniel Exp $ */ /* $NetBSD: if_ppp.h,v 1.11 1996/03/15 02:28:05 paulus Exp $ */ /* @@ -146,7 +146,7 @@ struct ifpppcstatsreq { #define SIOCGPPPCSTATS _IOWR('i', 122, struct ifpppcstatsreq) #ifdef _KERNEL -void pppattach(void); +void pppattach(int); int pppoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); void pppintr(void); diff --git a/lib/libc/include/generic-openbsd/net/if_sppp.h b/lib/libc/include/generic-openbsd/net/if_sppp.h index 484feeaee3088ec90a01d206d80b7a86033901d3..9eaa5729c8fe318d2b2b6ad59aaad6c0f3a32df1 100644 --- a/lib/libc/include/generic-openbsd/net/if_sppp.h +++ b/lib/libc/include/generic-openbsd/net/if_sppp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sppp.h,v 1.32 2025/11/02 08:04:04 dlg Exp $ */ +/* $OpenBSD: if_sppp.h,v 1.33 2026/05/16 13:27:03 daniel Exp $ */ /* $NetBSD: if_sppp.h,v 1.2.2.1 1999/04/04 06:57:39 explorer Exp $ */ /* @@ -236,7 +236,7 @@ void sppp_input (struct ifnet *ifp, struct mbuf *m); int sppp_proto_up(struct ifnet *ifp, uint16_t); /* Workaround */ -void spppattach (struct ifnet *ifp); +void spppattach (int); int sppp_ioctl(struct ifnet *ifp, u_long cmd, void *data); struct mbuf *sppp_dequeue (struct ifnet *ifp); diff --git a/lib/libc/include/generic-openbsd/net/if_trunk.h b/lib/libc/include/generic-openbsd/net/if_trunk.h index 4cd0a91a48fabb91e0e99ee762b77319cd4492b0..bbe88d0067ec9955cf85a715ba43e0eae0dce925 100644 --- a/lib/libc/include/generic-openbsd/net/if_trunk.h +++ b/lib/libc/include/generic-openbsd/net/if_trunk.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.h,v 1.33 2025/11/24 23:40:00 dlg Exp $ */ +/* $OpenBSD: if_trunk.h,v 1.34 2026/05/08 03:36:04 jsg Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Reyk Floeter @@ -88,6 +88,17 @@ struct lacp_opreq { u_int8_t partner_state; }; +#define LACP_STATE_BITS \ + "\020" \ + "\001ACTIVITY" \ + "\002TIMEOUT" \ + "\003AGGREGATION" \ + "\004SYNC" \ + "\005COLLECTING" \ + "\006DISTRIBUTING" \ + "\007DEFAULTED" \ + "\010EXPIRED" + /* Trunk port settings */ struct trunk_reqport { char rp_ifname[IFNAMSIZ]; /* name of the trunk */ diff --git a/lib/libc/include/generic-openbsd/net/if_var.h b/lib/libc/include/generic-openbsd/net/if_var.h index d672bc61bf1cf5cafff0d4f052c671de8a4f7310..ce6c9a5a127cca10018db70f651fe1acf6812c8b 100644 --- a/lib/libc/include/generic-openbsd/net/if_var.h +++ b/lib/libc/include/generic-openbsd/net/if_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_var.h,v 1.148 2026/03/22 23:14:00 bluhm Exp $ */ +/* $OpenBSD: if_var.h,v 1.149 2026/06/23 18:50:43 bluhm Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -166,8 +166,8 @@ struct ifnet { /* and the entries */ int if_pcount; /* [N] # of promiscuous listeners */ unsigned int if_bridgeidx; /* [K] used by bridge ports */ caddr_t if_bpf; /* packet filter structure */ - caddr_t if_mcast; /* used by multicast code */ - caddr_t if_mcast6; /* used by IPv6 multicast code */ + struct vif *if_mcast; /* used by multicast code */ + struct mif6 *if_mcast6; /* used by IPv6 multicast code */ caddr_t if_pf_kif; /* pf interface abstraction */ union { /* carp if list (used by IFT_ETHER) */ diff --git a/lib/libc/include/generic-openbsd/net/pfvar_priv.h b/lib/libc/include/generic-openbsd/net/pfvar_priv.h index e33bd69e28de7e4dd12b4c9864af468adabc530d..c82574816e0daff467092f777484ce28adcaa35d 100644 --- a/lib/libc/include/generic-openbsd/net/pfvar_priv.h +++ b/lib/libc/include/generic-openbsd/net/pfvar_priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar_priv.h,v 1.42 2026/02/05 03:26:00 dlg Exp $ */ +/* $OpenBSD: pfvar_priv.h,v 1.43 2026/09/10 12:28:04 deraadt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -682,7 +682,7 @@ u_int16_t pf_pkt_hash(sa_family_t, uint8_t, void pf_status_init(void); void pf_status_clear(void); -void pf_status_read(struct pf_status *); +int pf_status_read(struct pf_status *); #endif /* _KERNEL */ diff --git a/lib/libc/include/generic-openbsd/net/pipex_local.h b/lib/libc/include/generic-openbsd/net/pipex_local.h index 9fe5ec3d67732a240672b1347c46b8f7e029a822..01e72be5c073b1b31e59721928563bc3e293dd3e 100644 --- a/lib/libc/include/generic-openbsd/net/pipex_local.h +++ b/lib/libc/include/generic-openbsd/net/pipex_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex_local.h,v 1.54 2025/03/02 21:28:32 bluhm Exp $ */ +/* $OpenBSD: pipex_local.h,v 1.55 2026/04/24 13:25:44 jsg Exp $ */ /* * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -468,7 +468,7 @@ int pipex_ccp_output (struct pipex_session *, int, int); struct mbuf *adjust_tcp_mss (struct mbuf *, int); struct mbuf *ip_is_idle_packet (struct mbuf *, int *); -void pipex_session_log (struct pipex_session *, int, const char *, ...) __attribute__((__format__(__printf__,3,4))); +void pipex_session_log (struct pipex_session *, int, const char *, ...) __attribute__((__format__(__kprintf__,3,4))); uint32_t pipex_sockaddr_hash_key(struct sockaddr *); int pipex_sockaddr_compar_addr(struct sockaddr *, struct sockaddr *); void pipex_timer_start (void); diff --git a/lib/libc/include/generic-openbsd/net/trunklacp.h b/lib/libc/include/generic-openbsd/net/trunklacp.h deleted file mode 100644 index 597e804bbcb3be879206483e9d46b988c6a3ec0d..0000000000000000000000000000000000000000 --- a/lib/libc/include/generic-openbsd/net/trunklacp.h +++ /dev/null @@ -1,316 +0,0 @@ -/* $OpenBSD: trunklacp.h,v 1.14 2018/08/12 23:50:31 ccardenas Exp $ */ -/* $NetBSD: ieee8023ad_impl.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */ - -/* - * Copyright (c)2005 YAMAMOTO Takashi, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/net/ieee8023ad_lacp.h,v 1.11 2008/03/17 01:26:44 thompsa Exp $ - */ - -#ifndef _NET_TRUNKLACP_H_ -#define _NET_TRUNKLACP_H_ - -/* - * IEEE802.3 slow protocols (on-wire) definitions. - * XXX should be elsewhere. - */ -#define SLOWPROTOCOLS_SUBTYPE_LACP 1 -#define SLOWPROTOCOLS_SUBTYPE_MARKER 2 - -/* - * default administrative values - */ -#define LACP_DEFAULT_MODE 1 /* Active Mode */ -#define LACP_DEFAULT_TIMEOUT 0 /* Slow Timeout */ -#define LACP_DEFAULT_SYSTEM_PRIO 0x8000 /* Medium Priority */ -#define LACP_LOW_SYSTEM_PRIO 0xffff -#define LACP_HIGH_SYSTEM_PRIO 0x0001 -#define LACP_DEFAULT_PORT_PRIO 0x8000 /* Medium Priority */ -#define LACP_LOW_PORT_PRIO 0xffff -#define LACP_HIGH_PORT_PRIO 0x0001 -#define LACP_DEFAULT_IFQ_PRIO 6 - -struct slowprothdr { - u_int8_t sph_subtype; - u_int8_t sph_version; -} __packed; - -/* TLV on-wire structure. */ -struct tlvhdr { - u_int8_t tlv_type; - u_int8_t tlv_length; - /* u_int8_t tlv_value[]; */ -} __packed; - -/* ... and our implementation. */ -#define TLV_SET(tlv, type, length) \ - do { \ - (tlv)->tlv_type = (type); \ - (tlv)->tlv_length = sizeof(*tlv) + (length); \ - } while (/*CONSTCOND*/0) - -struct tlv_template { - u_int8_t tmpl_type; - u_int8_t tmpl_length; -}; - -struct lacp_systemid { - u_int16_t lsi_prio; - u_int8_t lsi_mac[6]; -} __packed; - -struct lacp_portid { - u_int16_t lpi_prio; - u_int16_t lpi_portno; -} __packed; - -struct lacp_peerinfo { - struct lacp_systemid lip_systemid; - u_int16_t lip_key; - struct lacp_portid lip_portid; - u_int8_t lip_state; - u_int8_t lip_resv[3]; -} __packed; - -struct lacp_collectorinfo { - u_int16_t lci_maxdelay; - u_int8_t lci_resv[12]; -} __packed; - -struct lacpdu { - struct ether_header ldu_eh; - struct slowprothdr ldu_sph; - - struct tlvhdr ldu_tlv_actor; - struct lacp_peerinfo ldu_actor; - struct tlvhdr ldu_tlv_partner; - struct lacp_peerinfo ldu_partner; - struct tlvhdr ldu_tlv_collector; - struct lacp_collectorinfo ldu_collector; - struct tlvhdr ldu_tlv_term; - u_int8_t ldu_resv[50]; -} __packed; - -/* - * IEEE802.3ad marker protocol (on-wire) definitions. - */ -struct lacp_markerinfo { - u_int16_t mi_rq_port; - u_int8_t mi_rq_system[ETHER_ADDR_LEN]; - u_int32_t mi_rq_xid; - u_int8_t mi_pad[2]; -} __packed; - -#define LACP_STATE_BITS \ - "\020" \ - "\001ACTIVITY" \ - "\002TIMEOUT" \ - "\003AGGREGATION" \ - "\004SYNC" \ - "\005COLLECTING" \ - "\006DISTRIBUTING" \ - "\007DEFAULTED" \ - "\010EXPIRED" - -#ifdef _KERNEL - -/* - * IEEE802.3ad LACP implementation details. - */ -#define LACP_TIMER_CURRENT_WHILE 0 -#define LACP_TIMER_PERIODIC 1 -#define LACP_TIMER_WAIT_WHILE 2 -#define LACP_NTIMER 3 - -#define LACP_TIMER_ARM(port, timer, val) \ - (port)->lp_timer[(timer)] = (val) -#define LACP_TIMER_DISARM(port, timer) \ - (port)->lp_timer[(timer)] = 0 -#define LACP_TIMER_ISARMED(port, timer) \ - ((port)->lp_timer[(timer)] > 0) - -/* - * IEEE802.3ad LACP protocol definitions. - */ -#define LACP_STATE_ACTIVITY (1<<0) -#define LACP_STATE_TIMEOUT (1<<1) -#define LACP_STATE_AGGREGATION (1<<2) -#define LACP_STATE_SYNC (1<<3) -#define LACP_STATE_COLLECTING (1<<4) -#define LACP_STATE_DISTRIBUTING (1<<5) -#define LACP_STATE_DEFAULTED (1<<6) -#define LACP_STATE_EXPIRED (1<<7) - -#define LACP_PORT_NTT 0x00000001 -#define LACP_PORT_MARK 0x00000002 - -struct markerdu { - struct ether_header mdu_eh; - struct slowprothdr mdu_sph; - - struct tlvhdr mdu_tlv; - struct lacp_markerinfo mdu_info; - struct tlvhdr mdu_tlv_term; - u_int8_t mdu_resv[90]; -} __packed; - -#define MARKER_TYPE_INFO 0x01 -#define MARKER_TYPE_RESPONSE 0x02 - -enum lacp_selected { - LACP_UNSELECTED, - LACP_STANDBY, /* not used in this implementation */ - LACP_SELECTED, -}; - -enum lacp_mux_state { - LACP_MUX_DETACHED, - LACP_MUX_WAITING, - LACP_MUX_ATTACHED, - LACP_MUX_COLLECTING, - LACP_MUX_DISTRIBUTING, -}; - -#define LACP_MAX_PORTS 32 - -struct lacp_portmap { - int pm_count; - struct lacp_port *pm_map[LACP_MAX_PORTS]; -}; - -struct lacp_port { - TAILQ_ENTRY(lacp_port) lp_dist_q; - LIST_ENTRY(lacp_port) lp_next; - struct lacp_softc *lp_lsc; - struct trunk_port *lp_trunk; - struct ifnet *lp_ifp; - struct lacp_peerinfo lp_partner; - struct lacp_peerinfo lp_actor; - struct lacp_markerinfo lp_marker; -#define lp_state lp_actor.lip_state -#define lp_key lp_actor.lip_key -#define lp_systemid lp_actor.lip_systemid - struct timeval lp_last_lacpdu; - int lp_lacpdu_sent; - enum lacp_mux_state lp_mux_state; - enum lacp_selected lp_selected; - int lp_flags; - u_int lp_media; /* XXX redundant */ - int lp_timer[LACP_NTIMER]; - struct mbuf_queue lp_mq; - - struct lacp_aggregator *lp_aggregator; -}; - -struct lacp_aggregator { - TAILQ_ENTRY(lacp_aggregator) la_q; - int la_refcnt; /* num of ports which selected us */ - int la_nports; /* num of distributing ports */ - TAILQ_HEAD(, lacp_port) la_ports; /* distributing ports */ - struct lacp_peerinfo la_partner; - struct lacp_peerinfo la_actor; - int la_pending; /* number of ports in wait_while */ -}; - -struct lacp_admin_def { - u_int8_t lad_mode; /* active or passive */ - u_int8_t lad_timeout; /* fast or slow */ - u_int16_t lad_prio; /* system priority */ - u_int16_t lad_portprio; /* port priority */ - u_int8_t lad_ifqprio; /* ifq priority */ -}; - -struct lacp_softc { - struct trunk_softc *lsc_softc; - struct lacp_aggregator *lsc_active_aggregator; - TAILQ_HEAD(, lacp_aggregator) lsc_aggregators; - int lsc_suppress_distributing; - struct timeout lsc_transit_callout; - struct timeout lsc_callout; - LIST_HEAD(, lacp_port) lsc_ports; - struct lacp_portmap lsc_pmap[2]; - volatile u_int lsc_activemap; - SIPHASH_KEY lsc_hashkey; - struct task lsc_input; - struct lacp_admin_def lsc_admin_defaults; -#define lsc_mode lsc_admin_defaults.lad_mode -#define lsc_timeout lsc_admin_defaults.lad_timeout -#define lsc_sys_prio lsc_admin_defaults.lad_prio -#define lsc_port_prio lsc_admin_defaults.lad_portprio -#define lsc_ifq_prio lsc_admin_defaults.lad_ifqprio -}; - -#define LACP_TYPE_ACTORINFO 1 -#define LACP_TYPE_PARTNERINFO 2 -#define LACP_TYPE_COLLECTORINFO 3 - -/* timeout values (in sec) */ -#define LACP_FAST_PERIODIC_TIME (1) -#define LACP_SLOW_PERIODIC_TIME (30) -#define LACP_SHORT_TIMEOUT_TIME (3 * LACP_FAST_PERIODIC_TIME) -#define LACP_LONG_TIMEOUT_TIME (3 * LACP_SLOW_PERIODIC_TIME) -#define LACP_CHURN_DETECTION_TIME (60) -#define LACP_AGGREGATE_WAIT_TIME (2) -#define LACP_TRANSIT_DELAY 3000 /* in msec */ - -#define LACP_STATE_EQ(s1, s2, mask) \ - ((((s1) ^ (s2)) & (mask)) == 0) - -#define LACP_SYS_PRI(peer) (peer).lip_systemid.lsi_prio - -#define LACP_PORT(_lp) ((struct lacp_port *)(_lp)->tp_psc) -#define LACP_SOFTC(_sc) ((struct lacp_softc *)(_sc)->tr_psc) - -int lacp_input(struct trunk_port *, struct mbuf *); -struct trunk_port *lacp_select_tx_port(struct trunk_softc *, struct mbuf *); -int lacp_attach(struct trunk_softc *); -int lacp_detach(struct trunk_softc *); -void lacp_init(struct trunk_softc *); -void lacp_stop(struct trunk_softc *); -int lacp_port_create(struct trunk_port *); -void lacp_port_destroy(struct trunk_port *); -void lacp_linkstate(struct trunk_port *); -void lacp_req(struct trunk_softc *, caddr_t); -void lacp_portreq(struct trunk_port *, caddr_t); -u_int lacp_port_status(struct trunk_port *); - -/* following constants don't include terminating NUL */ -#define LACP_MACSTR_MAX (2*6 + 5) -#define LACP_SYSTEMPRIOSTR_MAX (4) -#define LACP_SYSTEMIDSTR_MAX (LACP_SYSTEMPRIOSTR_MAX + 1 + LACP_MACSTR_MAX) -#define LACP_PORTPRIOSTR_MAX (4) -#define LACP_PORTNOSTR_MAX (4) -#define LACP_PORTIDSTR_MAX (LACP_PORTPRIOSTR_MAX + 1 + LACP_PORTNOSTR_MAX) -#define LACP_KEYSTR_MAX (4) -#define LACP_PARTNERSTR_MAX \ - (1 + LACP_SYSTEMIDSTR_MAX + 1 + LACP_KEYSTR_MAX + 1 \ - + LACP_PORTIDSTR_MAX + 1) -#define LACP_LAGIDSTR_MAX \ - (1 + LACP_PARTNERSTR_MAX + 1 + LACP_PARTNERSTR_MAX + 1) -#define LACP_STATESTR_MAX (255) /* XXX */ - -#endif /* _KERNEL */ - -#endif /* _NET_TRUNKLACP_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-openbsd/net80211/ieee80211.h b/lib/libc/include/generic-openbsd/net80211/ieee80211.h index ab4838200fc797bed98868369fb5d5f41629bd36..e36b001318aeeb6d763480c797bc070871e71470 100644 --- a/lib/libc/include/generic-openbsd/net80211/ieee80211.h +++ b/lib/libc/include/generic-openbsd/net80211/ieee80211.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211.h,v 1.66 2026/03/29 21:16:21 kirill Exp $ */ +/* $OpenBSD: ieee80211.h,v 1.67 2026/05/28 10:50:47 kirill Exp $ */ /* $NetBSD: ieee80211.h,v 1.6 2004/04/30 23:51:53 dyoung Exp $ */ /*- @@ -193,6 +193,21 @@ struct ieee80211_htframe_addr4 { /* 11n */ #define IEEE80211_QOS_EOSP 0x0010 #define IEEE80211_QOS_TID 0x000f +#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD 0x80 + +#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO 0x01 +#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VI 0x02 +#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BK 0x04 +#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BE 0x08 +#define IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK 0x0f + +#define IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL 0x00 +#define IEEE80211_WMM_IE_STA_QOSINFO_SP_2 0x01 +#define IEEE80211_WMM_IE_STA_QOSINFO_SP_4 0x02 +#define IEEE80211_WMM_IE_STA_QOSINFO_SP_6 0x03 +#define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK 0x03 +#define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT 5 + /* * Control frames. */ diff --git a/lib/libc/include/generic-openbsd/net80211/ieee80211_ioctl.h b/lib/libc/include/generic-openbsd/net80211/ieee80211_ioctl.h index 9221d2afd7703428ccb4d09e265db0e6e826a62f..4df48ef849c38f8cceabb6e626c1909790d6f8e9 100644 --- a/lib/libc/include/generic-openbsd/net80211/ieee80211_ioctl.h +++ b/lib/libc/include/generic-openbsd/net80211/ieee80211_ioctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_ioctl.h,v 1.45 2026/03/26 12:15:01 kirill Exp $ */ +/* $OpenBSD: ieee80211_ioctl.h,v 1.46 2026/05/28 10:50:47 kirill Exp $ */ /* $NetBSD: ieee80211_ioctl.h,v 1.7 2004/04/30 22:51:04 dyoung Exp $ */ /*- @@ -410,7 +410,9 @@ struct ieee80211_nodereq_all { #define IEEE80211_F_HOSTAPMASK 0x00000003 #define IEEE80211_F_STAYAUTH 0x00000004 /* CONF: ignore deauth */ #define IEEE80211_F_NOMIMO 0x00000008 /* CONF: disable MIMO */ -#define IEEE80211_F_USERBITS "\20\01HIDENWID\02NOBRIDGE\03STAYAUTH\04NOMIMO" +#define IEEE80211_F_UAPSD 0x00000010 /* CONF: enable u-APSD */ +#define IEEE80211_F_USERBITS "\20\01HIDENWID\02NOBRIDGE\03STAYAUTH\04NOMIMO" \ + "\05UAPSD" struct ieee80211_flags { const char *f_name; @@ -421,7 +423,8 @@ struct ieee80211_flags { { "hidenwid", IEEE80211_F_HIDENWID }, \ { "nobridge", IEEE80211_F_NOBRIDGE }, \ { "stayauth", IEEE80211_F_STAYAUTH }, \ - { "nomimo", IEEE80211_F_NOMIMO } \ + { "nomimo", IEEE80211_F_NOMIMO }, \ + { "uapsd", IEEE80211_F_UAPSD } \ } #define SIOCG80211FLAGS _IOWR('i', 216, struct ifreq) diff --git a/lib/libc/include/generic-openbsd/net80211/ieee80211_node.h b/lib/libc/include/generic-openbsd/net80211/ieee80211_node.h index 30b74d46caa5e893592536058debbc10eb11bb5e..61405688b4036e60abf74dce2fda38976060740c 100644 --- a/lib/libc/include/generic-openbsd/net80211/ieee80211_node.h +++ b/lib/libc/include/generic-openbsd/net80211/ieee80211_node.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.h,v 1.101 2026/03/29 21:16:21 kirill Exp $ */ +/* $OpenBSD: ieee80211_node.h,v 1.103 2026/09/19 19:36:43 stsp Exp $ */ /* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */ /*- @@ -306,6 +306,8 @@ struct ieee80211_node { /* power saving mode */ u_int8_t ni_pwrsave; struct mbuf_queue ni_savedq; /* packets queued for pspoll */ + u_int8_t ni_uapsd_ac; + u_int8_t ni_uapsd_maxsp; /* RSN */ struct timeout ni_eapol_to; @@ -446,6 +448,7 @@ struct ieee80211_node { #define IEEE80211_NODE_HE 0x200000 /* HE negotiated */ #define IEEE80211_NODE_HECAP 0x400000 /* claims to support HE */ #define IEEE80211_NODE_CSA 0x800000 /* channel switch announced */ +#define IEEE80211_NODE_UAPSD 0x1000000 /* uAPSD negotiated */ /* If not NULL, this function gets called when ni_refcnt hits zero. */ void (*ni_unref_cb)(struct ieee80211com *, @@ -675,6 +678,8 @@ void ieee80211_clean_nodes(struct ieee80211com *, int); void ieee80211_setup_htcaps(struct ieee80211_node *, const uint8_t *, uint8_t); void ieee80211_clear_htcaps(struct ieee80211_node *); +uint8_t ieee80211_node_ht_secondary_channel_offset(struct ieee80211_node *); +uint8_t ieee80211_node_vht_channel_width(struct ieee80211_node *); int ieee80211_setup_htop(struct ieee80211_node *, const uint8_t *, uint8_t, int); void ieee80211_setup_vhtcaps(struct ieee80211_node *, const uint8_t *, diff --git a/lib/libc/include/generic-openbsd/net80211/ieee80211_var.h b/lib/libc/include/generic-openbsd/net80211/ieee80211_var.h index 3311152aaa4a472f07553dfe5d56278206e68d89..c48d070b81187765534dd63806d643575d269391 100644 --- a/lib/libc/include/generic-openbsd/net80211/ieee80211_var.h +++ b/lib/libc/include/generic-openbsd/net80211/ieee80211_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_var.h,v 1.114 2026/03/19 16:50:32 chris Exp $ */ +/* $OpenBSD: ieee80211_var.h,v 1.115 2026/05/28 10:50:47 kirill Exp $ */ /* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */ /*- @@ -344,6 +344,8 @@ struct ieee80211com { u_int ic_edca_txop_count[EDCA_NUM_AC]; struct timeval ic_edca_txop_time[EDCA_NUM_AC]; u_int16_t ic_tid_noack; + u_int8_t ic_uapsd_ac; + u_int8_t ic_uapsd_maxsp; u_int8_t ic_globalcnt[EAPOL_KEY_NONCE_LEN]; u_int8_t ic_nonce[EAPOL_KEY_NONCE_LEN]; u_int8_t ic_psk[IEEE80211_PMK_LEN]; diff --git a/lib/libc/include/generic-openbsd/netinet/in_var.h b/lib/libc/include/generic-openbsd/netinet/in_var.h index 23f4cef8b2e4dc2cafad2e031ca2e4224543440e..edf0bcbf7bf6dee03c8c205e67a1298b951dab51 100644 --- a/lib/libc/include/generic-openbsd/netinet/in_var.h +++ b/lib/libc/include/generic-openbsd/netinet/in_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_var.h,v 1.47 2026/03/22 23:14:00 bluhm Exp $ */ +/* $OpenBSD: in_var.h,v 1.48 2026/07/30 14:57:46 bluhm Exp $ */ /* $NetBSD: in_var.h,v 1.16 1996/02/13 23:42:15 christos Exp $ */ /* @@ -82,8 +82,6 @@ struct in_aliasreq { }; #ifdef _KERNEL -struct router_info; - /* * Internet multicast address structure. There is one of these for each IP * multicast group to which this host belongs on a given network interface. @@ -98,8 +96,6 @@ struct in_multi { u_int inm_state; /* [m] state of membership */ u_int inm_timer; /* [m] IGMP membership report */ - - struct router_info *inm_rti; /* router version info */ }; static __inline struct in_multi * diff --git a/lib/libc/include/generic-openbsd/netinet/ip_ipsp.h b/lib/libc/include/generic-openbsd/netinet/ip_ipsp.h index a77dc4b4ce9f4e13a317aa0883c2bd061ec15b07..4808407dc2760322cdbd6753c0452a296a37b3a8 100644 --- a/lib/libc/include/generic-openbsd/netinet/ip_ipsp.h +++ b/lib/libc/include/generic-openbsd/netinet/ip_ipsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.h,v 1.249 2025/05/09 19:53:41 mvs Exp $ */ +/* $OpenBSD: ip_ipsp.h,v 1.251 2026/08/12 18:23:14 bluhm Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -248,7 +248,7 @@ struct ipsec_ids { RBT_ENTRY(ipsec_ids) id_node_flow; /* [F] */ struct ipsec_id *id_local; /* [I] */ struct ipsec_id *id_remote; /* [I] */ - u_int32_t id_flow; /* [I] */ + uint32_t id_flow; /* [I] */ u_int id_refcount; /* [F] */ u_int id_gc_ttl; /* [F] */ }; @@ -425,8 +425,9 @@ struct tdb { /* tunnel descriptor block */ #define TDB_REPLAYWASTE 32 #define TDB_REPLAYMAX (2100+TDB_REPLAYWASTE) - u_int64_t tdb_rpl; /* Replay counter */ - u_int32_t tdb_seen[howmany(TDB_REPLAYMAX, 32)]; /* Anti-replay window */ + u_int64_t tdb_rpl; /* [m] Replay counter */ + u_int32_t tdb_seen[howmany(TDB_REPLAYMAX, 32)]; + /* [m] Anti-replay window */ u_int8_t tdb_iv[4]; /* Used for HALF-IV ESP */ @@ -711,7 +712,7 @@ int ipsp_aux_match(struct tdb *, struct ipsec_ids *, struct sockaddr_encap *, struct sockaddr_encap *); int ipsp_ids_match(struct ipsec_ids *, struct ipsec_ids *); struct ipsec_ids *ipsp_ids_insert(struct ipsec_ids *); -struct ipsec_ids *ipsp_ids_lookup(u_int32_t); +struct ipsec_ids *ipsp_ids_lookup(uint32_t); void ipsp_ids_free(struct ipsec_ids *); void ipsp_init(void); diff --git a/lib/libc/include/generic-openbsd/netinet/ip_mroute.h b/lib/libc/include/generic-openbsd/netinet/ip_mroute.h index d800b3c872b1a07061a227d092e39622ecdf55a3..13f7eac9fa2de6655842076f34cfbd4b4ef1ea82 100644 --- a/lib/libc/include/generic-openbsd/netinet/ip_mroute.h +++ b/lib/libc/include/generic-openbsd/netinet/ip_mroute.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_mroute.h,v 1.34 2025/05/09 14:43:47 jan Exp $ */ +/* $OpenBSD: ip_mroute.h,v 1.35 2026/06/24 12:33:49 bluhm Exp $ */ /* $NetBSD: ip_mroute.h,v 1.23 2004/04/21 17:49:46 itojun Exp $ */ #ifndef _NETINET_IP_MROUTE_H_ @@ -165,6 +165,8 @@ struct mrtstat { u_long mrts_q_overflow; /* pkts dropped - Q overflow */ u_long mrts_pkt2large; /* pkts dropped - size > BKT SIZE */ u_long mrts_upq_sockfull; /* upcalls dropped - socket full */ + u_long mrts_time_to_live; /* ip ttl not above 1 */ + u_long mrts_source_route; /* packet from source-routed tunnel */ }; #ifdef _KERNEL @@ -183,6 +185,8 @@ enum mrtstat_counters { mrts_q_overflow, mrts_pkt2large, mrts_upq_sockfull, + mrts_time_to_live, + mrts_source_route, mrts_ncounters }; diff --git a/lib/libc/include/generic-openbsd/netinet/ip_var.h b/lib/libc/include/generic-openbsd/netinet/ip_var.h index 69ef765c4f46c0e17dc381625b4d8dabcf3d2705..d75fa82583662f3636ea776df6ccd0f16145e73f 100644 --- a/lib/libc/include/generic-openbsd/netinet/ip_var.h +++ b/lib/libc/include/generic-openbsd/netinet/ip_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_var.h,v 1.123 2025/07/31 09:05:11 mvs Exp $ */ +/* $OpenBSD: ip_var.h,v 1.127 2026/08/11 14:28:59 bluhm Exp $ */ /* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */ /* @@ -191,9 +191,10 @@ struct ipqent { */ struct ipq { LIST_ENTRY(ipq) ipq_q; /* to other reass headers */ + u_int ipq_rdomain; /* routing domain for reassembly */ + u_int16_t ipq_id; /* sequence id for reassembly */ u_int8_t ipq_ttl; /* time for reass q to live */ u_int8_t ipq_p; /* protocol of this fragment */ - u_int16_t ipq_id; /* sequence id for reassembly */ struct ipqehead ipq_fragq; /* to ip fragment queue */ struct in_addr ipq_src, ipq_dst; }; @@ -247,10 +248,12 @@ int ip_getmoptions(int, struct ip_moptions *, struct mbuf *); void ip_init(void); struct mbuf* ip_insertoptions(struct mbuf *, struct mbuf *, int *); +int ip_mrouter_active(u_int); int ip_mforward(struct mbuf *, struct ifnet *, int); int ip_optcopy(struct ip *, struct ip *); int ip_output(struct mbuf *, struct mbuf *, struct route *, int, - struct ip_moptions *, const struct ipsec_level *, u_int32_t); + struct ip_moptions *, const struct ipsec_level *, uint32_t); +void ip_randomid_init(void); u_int16_t ip_randomid(void); void ip_send(struct mbuf *); @@ -281,9 +284,6 @@ int rip_disconnect(struct socket *); int rip_shutdown(struct socket *); int rip_send(struct socket *, struct mbuf *, struct mbuf *, struct mbuf *); -#ifdef MROUTING -extern struct socket *ip_mrouter[]; /* multicast routing daemon */ -#endif #endif /* _KERNEL */ #endif /* _NETINET_IP_VAR_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-openbsd/netinet6/ip6_mroute.h b/lib/libc/include/generic-openbsd/netinet6/ip6_mroute.h index d88ea2ab61e24ec452c4391dfca96feea98841e1..7eba4ef36613f1b758d50e4f520da7272110934b 100644 --- a/lib/libc/include/generic-openbsd/netinet6/ip6_mroute.h +++ b/lib/libc/include/generic-openbsd/netinet6/ip6_mroute.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.h,v 1.25 2025/05/19 04:54:04 jan Exp $ */ +/* $OpenBSD: ip6_mroute.h,v 1.27 2026/09/17 15:56:59 bluhm Exp $ */ /* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */ /* @@ -146,6 +146,7 @@ struct mrt6stat { u_int64_t mrt6s_q_overflow; /* pkts dropped - Q overflow */ u_int64_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */ u_int64_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */ + u_int64_t mrt6s_hop_limit; /* ip6 hlim not above one */ }; /* @@ -206,6 +207,7 @@ enum mrt6stat_counters { mrt6s_q_overflow, mrt6s_pkt2large, mrt6s_upq_sockfull, + mrt6s_hop_limit, mrt6s_ncounters }; @@ -220,6 +222,8 @@ mrt6stat_inc(enum mrt6stat_counters c) /* How frequent should we look for expired entries (in seconds). */ #define MCAST_EXPIRE_TIMEOUT 30 +extern int ip6_mrtproto; + /* * The kernel's multicast-interface structure. */ diff --git a/lib/libc/include/generic-openbsd/netinet6/ip6_var.h b/lib/libc/include/generic-openbsd/netinet6/ip6_var.h index 2a2112f56713dd07e212970530cb8eaf1441254b..ca2af523ef390a901ad90d2fca58e2e82a338010 100644 --- a/lib/libc/include/generic-openbsd/netinet6/ip6_var.h +++ b/lib/libc/include/generic-openbsd/netinet6/ip6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_var.h,v 1.129 2025/12/31 04:10:00 jsg Exp $ */ +/* $OpenBSD: ip6_var.h,v 1.132 2026/09/17 15:56:59 bluhm Exp $ */ /* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */ /* @@ -138,6 +138,7 @@ struct ip6q { struct in6_addr ip6q_src, ip6q_dst; int ip6q_unfrglen; /* len of unfragmentable part */ int ip6q_nfrag; /* # of fragments */ + u_int ip6q_rdomain; /* routing domain for reassembly */ u_int32_t ip6q_ident; /* fragment identification */ u_int8_t ip6q_nxt; /* ip6f_nxt in first fragment */ u_int8_t ip6q_ecn; @@ -164,15 +165,7 @@ struct ip6_moptions { * Control options for outgoing packets */ -/* Routing header related info */ -struct ip6po_rhinfo { - struct ip6_rthdr *ip6po_rhi_rthdr; /* Routing header */ - struct route ip6po_rhi_route; /* Route to the 1st hop */ -}; -#define ip6po_rthdr ip6po_rhinfo.ip6po_rhi_rthdr -#define ip6po_route ip6po_rhinfo.ip6po_rhi_route - -struct ip6_pktopts { +struct ip6_pktopts { /* Hoplimit for outgoing packets */ int ip6po_hlim; @@ -185,9 +178,6 @@ struct ip6_pktopts { /* Destination options header (before a routing header) */ struct ip6_dest *ip6po_dest1; - /* Routing header related info. */ - struct ip6po_rhinfo ip6po_rhinfo; - /* Destination options header (after a routing header) */ struct ip6_dest *ip6po_dest2; @@ -310,6 +300,7 @@ int ip6_unknown_opt(struct mbuf **, u_int8_t *, int); int ip6_get_prevhdr(struct mbuf *, int); int ip6_nexthdr(struct mbuf *, int, int, int *); int ip6_lasthdr(struct mbuf *, int, int, int *); +int ip6_mrouter_active(u_int); int ip6_mforward(struct ip6_hdr *, struct ifnet *, struct mbuf *, int); int ip6_process_hopopts(struct mbuf **, u_int8_t *, int, u_int32_t *, u_int32_t *); @@ -371,7 +362,7 @@ struct tdb; int ip6_output_ipsec_lookup(struct mbuf *, const struct ipsec_level *, struct tdb **); int ip6_output_ipsec_send(struct tdb *, struct mbuf *, struct route *, - u_int, int, int); + u_int, int); #endif /* IPSEC */ #endif /* _KERNEL */ diff --git a/lib/libc/include/generic-openbsd/nfs/nfs_var.h b/lib/libc/include/generic-openbsd/nfs/nfs_var.h index 73c6f8e0cdbb43eb5927908536922b7194119bf9..c08ec88530215e61817621082ed6b8c30c93d965 100644 --- a/lib/libc/include/generic-openbsd/nfs/nfs_var.h +++ b/lib/libc/include/generic-openbsd/nfs/nfs_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_var.h,v 1.66 2024/09/09 03:50:14 jsg Exp $ */ +/* $OpenBSD: nfs_var.h,v 1.71 2026/06/09 02:55:17 jsg Exp $ */ /* $NetBSD: nfs_var.h,v 1.3 1996/02/18 11:53:54 fvdl Exp $ */ /* @@ -68,8 +68,6 @@ int nfs_writerpc(struct vnode *, struct uio *, int *, int *); int nfs_removeit(struct sillyrename *); int nfs_writebp(struct buf *, int); -#define nfs_ioctl ((int (*)(void *))enoioctl) - /* nfs_serv.c */ int nfsrv3_access(struct nfsrv_descript *, struct nfssvc_sock *, struct proc *, struct mbuf **); @@ -148,15 +146,15 @@ int nfs_namei(struct nameidata *, fhandle_t *, int, struct nfssvc_sock *, struct proc *); void nfsm_adj(struct mbuf *, int, int); void nfsm_srvwcc(struct nfsrv_descript *, int, struct vattr *, int, - struct vattr *, struct nfsm_info *); + struct vattr *, struct mbuf **); void nfsm_srvpostop_attr(struct nfsrv_descript *, int, struct vattr *, - struct nfsm_info *); + struct mbuf **); void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *, struct nfs_fattr *); int nfsrv_fhtovp(fhandle_t *, int, struct vnode **, struct ucred *, struct nfssvc_sock *, struct mbuf *, int *); int netaddr_match(int, union nethostaddr *, struct mbuf *); -int nfsm_srvsattr(struct mbuf **, struct vattr *, struct mbuf *, caddr_t *); +int nfsm_srvsattr(struct nfsrv_descript *, struct vattr *); /* nfs_subs.c */ struct mbuf *nfsm_reqhead(int); @@ -183,7 +181,7 @@ void nfs_add_tobecommitted_range(struct vnode *, struct buf *); void nfs_del_tobecommitted_range(struct vnode *, struct buf *); void nfs_merge_commit_ranges(struct vnode *); int nfsrv_errmap(struct nfsrv_descript *, int); -void nfsm_fhtom(struct nfsm_info *, struct vnode *, int); +void nfsm_fhtom(struct mbuf **, struct vnode *, int); void nfsm_srvfhtom(struct mbuf **, fhandle_t *, int); /* nfs_syscalls.c */ diff --git a/lib/libc/include/generic-openbsd/nfs/nfsm_subs.h b/lib/libc/include/generic-openbsd/nfs/nfsm_subs.h index d6dcf14622e683ea8715f68fd08e2e90657a5f88..d9349fcdc947a2d09c3e549e731d1e6523fb068b 100644 --- a/lib/libc/include/generic-openbsd/nfs/nfsm_subs.h +++ b/lib/libc/include/generic-openbsd/nfs/nfsm_subs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nfsm_subs.h,v 1.49 2024/09/11 12:22:34 claudio Exp $ */ +/* $OpenBSD: nfsm_subs.h,v 1.52 2026/06/09 02:52:26 jsg Exp $ */ /* $NetBSD: nfsm_subs.h,v 1.10 1996/03/20 21:59:56 fvdl Exp $ */ /* @@ -48,7 +48,6 @@ struct nfsm_info { /* Setting up / Tearing down. */ struct mbuf *nmi_md; - struct mbuf *nmi_mb; caddr_t nmi_dpos; int nmi_v3; @@ -56,6 +55,30 @@ struct nfsm_info { int *nmi_errorp; }; +static inline void * +nfsd_dissect(struct nfsrv_descript *nfsd, int s, int *errorp) +{ + caddr_t ret; + int avail, error; + + avail = mtod(nfsd->nd_md, caddr_t) + nfsd->nd_md->m_len - + nfsd->nd_dpos; + if (avail >= s) { + ret = nfsd->nd_dpos; + nfsd->nd_dpos += s; + return ret; + } + error = nfsm_disct(&nfsd->nd_md, &nfsd->nd_dpos, s, avail, &ret); + if (error != 0) { + m_freem(nfsd->nd_mrep); + nfsd->nd_mrep = NULL; + *errorp = error; + return NULL; + } else { + return ret; + } +} + static inline void * nfsm_dissect(struct nfsm_info *infop, int s) { @@ -82,6 +105,27 @@ nfsm_dissect(struct nfsm_info *infop, int s) #define nfsm_rndup(a) (((a)+3)&(~0x3)) +static inline int +nfsd_adv(struct nfsrv_descript *nfsd, int s, int *errorp) +{ + int avail, error; + + avail = mtod(nfsd->nd_md, caddr_t) + nfsd->nd_md->m_len - + nfsd->nd_dpos; + if (avail >= s) { + nfsd->nd_dpos += s; + return 0; + } + error = nfs_adv(&nfsd->nd_md, &nfsd->nd_dpos, s, avail); + if (error != 0) { + m_freem(nfsd->nd_mrep); + nfsd->nd_mrep = NULL; + *errorp = error; + return error; + } + return 0; +} + static inline int nfsm_adv(struct nfsm_info *infop, int s) { @@ -133,6 +177,24 @@ nfsm_postop_attr(struct nfsm_info *infop, struct vnode **vpp, int *attrflagp) return 0; } +static inline int +nfsd_strsiz(struct nfsrv_descript *nfsd, int *lenp, int maxlen, int *errorp) +{ + uint32_t *tl = (uint32_t *)nfsd_dissect(nfsd, NFSX_UNSIGNED, errorp); + int len; + if (tl == NULL) + return 1; + len = fxdr_unsigned(int32_t, *tl); + if (len < 0 || len > maxlen) { + m_freem(nfsd->nd_mrep); + nfsd->nd_mrep = NULL; + *errorp = EBADRPC; + return 1; + } + *lenp = len; + return 0; +} + static inline int nfsm_strsiz(struct nfsm_info *infop, int *lenp, int maxlen) { @@ -151,6 +213,24 @@ nfsm_strsiz(struct nfsm_info *infop, int *lenp, int maxlen) return 0; } +static inline int +nfsd_mtouio(struct nfsrv_descript *nfsd, struct uio *uiop, int len, int *errorp) +{ + int error; + + if (len <= 0) + return 0; + + error = nfsm_mbuftouio(&nfsd->nd_md, uiop, len, &nfsd->nd_dpos); + if (error != 0) { + m_freem(nfsd->nd_mrep); + nfsd->nd_mrep = NULL; + *errorp = error; + return error; + } + return 0; +} + static inline int nfsm_mtouio(struct nfsm_info *infop, struct uio *uiop, int len) { @@ -170,7 +250,8 @@ nfsm_mtouio(struct nfsm_info *infop, struct uio *uiop, int len) } static inline int -nfsm_strtom(struct nfsm_info *infop, char *str, size_t len, size_t maxlen) +nfsm_strtom(struct nfsm_info *infop, struct mbuf **mb, + char *str, size_t len, size_t maxlen) { if (len > maxlen) { m_freem(infop->nmi_mreq); @@ -178,7 +259,7 @@ nfsm_strtom(struct nfsm_info *infop, char *str, size_t len, size_t maxlen) *infop->nmi_errorp = ENAMETOOLONG; return 1; } - nfsm_strtombuf(&infop->nmi_mb, str, len); + nfsm_strtombuf(mb, str, len); return 0; } diff --git a/lib/libc/include/generic-openbsd/resolv.h b/lib/libc/include/generic-openbsd/resolv.h index 87b870b02894dd7d24a999ac9a3963634ac497ad..adbde36729074bea7c19dd3f50cd5b8ed22f9be8 100644 --- a/lib/libc/include/generic-openbsd/resolv.h +++ b/lib/libc/include/generic-openbsd/resolv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: resolv.h,v 1.23 2021/11/22 20:18:27 jca Exp $ */ +/* $OpenBSD: resolv.h,v 1.24 2026/09/05 08:18:23 jsg Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -177,7 +177,7 @@ struct __res_state_ext { #define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/ #define RES_USEVC 0x00000008 /* use virtual circuit */ #define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */ -#define RES_IGNTC 0x00000020 /* ignore trucation errors */ +#define RES_IGNTC 0x00000020 /* ignore truncation errors */ #define RES_RECURSE 0x00000040 /* recursion desired */ #define RES_DEFNAMES 0x00000080 /* use default domain name */ #define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */ diff --git a/lib/libc/include/generic-openbsd/rmd160.h b/lib/libc/include/generic-openbsd/rmd160.h index b227c3fc78447b5831389bd78a6fc1900b3af26a..3ccd7dd793750942174d0959e0375aa8175affb2 100644 --- a/lib/libc/include/generic-openbsd/rmd160.h +++ b/lib/libc/include/generic-openbsd/rmd160.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rmd160.h,v 1.17 2012/12/05 23:19:57 deraadt Exp $ */ +/* $OpenBSD: rmd160.h,v 1.18 2026/08/31 15:09:14 tb Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -38,20 +38,14 @@ typedef struct RMD160Context { __BEGIN_DECLS void RMD160Init(RMD160_CTX *); -void RMD160Transform(u_int32_t [5], const u_int8_t [RMD160_BLOCK_LENGTH]) - __attribute__((__bounded__(__minbytes__,1,5))) - __attribute__((__bounded__(__minbytes__,2,RMD160_BLOCK_LENGTH))); void RMD160Update(RMD160_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); -void RMD160Pad(RMD160_CTX *); void RMD160Final(u_int8_t [RMD160_DIGEST_LENGTH], RMD160_CTX *) __attribute__((__bounded__(__minbytes__,1,RMD160_DIGEST_LENGTH))); char *RMD160End(RMD160_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH))); char *RMD160File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH))); -char *RMD160FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH))); char *RMD160Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,RMD160_DIGEST_STRING_LENGTH))); diff --git a/lib/libc/include/generic-openbsd/rpc/auth.h b/lib/libc/include/generic-openbsd/rpc/auth.h index 60b558ed39030e72f5588819c38d0041a8fc86b1..4d1ab5a16adc11f792f3960dabd0f1f7a1e0b866 100644 --- a/lib/libc/include/generic-openbsd/rpc/auth.h +++ b/lib/libc/include/generic-openbsd/rpc/auth.h @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.h,v 1.9 2022/02/14 03:38:59 guenther Exp $ */ +/* $OpenBSD: auth.h,v 1.10 2026/09/05 08:36:42 jsg Exp $ */ /* $NetBSD: auth.h,v 1.7 1995/04/29 05:27:55 cgd Exp $ */ /* @@ -105,7 +105,7 @@ typedef struct __rpc_auth { void (*ah_nextverf)(struct __rpc_auth *); /* nextverf & serialize */ int (*ah_marshal)(struct __rpc_auth *, XDR *); - /* validate varifier */ + /* validate verifier */ int (*ah_validate)(struct __rpc_auth *, struct opaque_auth *); /* refresh credentials */ diff --git a/lib/libc/include/generic-openbsd/sha1.h b/lib/libc/include/generic-openbsd/sha1.h index f98d41c8e5c7dd0b69d4cb6a215781a15388635f..548ccdbe5f599ca1fc1dfc13ddb207f1d2fa9310 100644 --- a/lib/libc/include/generic-openbsd/sha1.h +++ b/lib/libc/include/generic-openbsd/sha1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1.h,v 1.24 2012/12/05 23:19:57 deraadt Exp $ */ +/* $OpenBSD: sha1.h,v 1.25 2026/08/31 15:09:14 tb Exp $ */ /* * SHA-1 in C @@ -21,10 +21,6 @@ typedef struct { __BEGIN_DECLS void SHA1Init(SHA1_CTX *); -void SHA1Pad(SHA1_CTX *); -void SHA1Transform(u_int32_t [5], const u_int8_t [SHA1_BLOCK_LENGTH]) - __attribute__((__bounded__(__minbytes__,1,5))) - __attribute__((__bounded__(__minbytes__,2,SHA1_BLOCK_LENGTH))); void SHA1Update(SHA1_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); void SHA1Final(u_int8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *) @@ -33,8 +29,6 @@ char *SHA1End(SHA1_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH))); char *SHA1File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH))); -char *SHA1FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH))); char *SHA1Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA1_DIGEST_STRING_LENGTH))); diff --git a/lib/libc/include/generic-openbsd/sha2.h b/lib/libc/include/generic-openbsd/sha2.h index 79bc16e3fbe05240115509596717ce85cbe450e1..cb67d173a14ae8aa8cdb96bebbab34b0ad6cec65 100644 --- a/lib/libc/include/generic-openbsd/sha2.h +++ b/lib/libc/include/generic-openbsd/sha2.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sha2.h,v 1.10 2016/09/03 17:00:29 tedu Exp $ */ +/* $OpenBSD: sha2.h,v 1.11 2026/08/31 15:09:14 tb Exp $ */ /* * FILE: sha2.h @@ -68,86 +68,66 @@ typedef struct _SHA2_CTX { __BEGIN_DECLS void SHA224Init(SHA2_CTX *); -void SHA224Transform(u_int32_t state[8], const u_int8_t [SHA224_BLOCK_LENGTH]); void SHA224Update(SHA2_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); -void SHA224Pad(SHA2_CTX *); void SHA224Final(u_int8_t [SHA224_DIGEST_LENGTH], SHA2_CTX *) __attribute__((__bounded__(__minbytes__,1,SHA224_DIGEST_LENGTH))); char *SHA224End(SHA2_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,SHA224_DIGEST_STRING_LENGTH))); char *SHA224File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,SHA224_DIGEST_STRING_LENGTH))); -char *SHA224FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,SHA224_DIGEST_STRING_LENGTH))); char *SHA224Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA224_DIGEST_STRING_LENGTH))); void SHA256Init(SHA2_CTX *); -void SHA256Transform(u_int32_t state[8], const u_int8_t [SHA256_BLOCK_LENGTH]); void SHA256Update(SHA2_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); -void SHA256Pad(SHA2_CTX *); void SHA256Final(u_int8_t [SHA256_DIGEST_LENGTH], SHA2_CTX *) __attribute__((__bounded__(__minbytes__,1,SHA256_DIGEST_LENGTH))); char *SHA256End(SHA2_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH))); char *SHA256File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH))); -char *SHA256FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH))); char *SHA256Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA256_DIGEST_STRING_LENGTH))); void SHA384Init(SHA2_CTX *); -void SHA384Transform(u_int64_t state[8], const u_int8_t [SHA384_BLOCK_LENGTH]); void SHA384Update(SHA2_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); -void SHA384Pad(SHA2_CTX *); void SHA384Final(u_int8_t [SHA384_DIGEST_LENGTH], SHA2_CTX *) __attribute__((__bounded__(__minbytes__,1,SHA384_DIGEST_LENGTH))); char *SHA384End(SHA2_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH))); char *SHA384File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH))); -char *SHA384FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH))); char *SHA384Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA384_DIGEST_STRING_LENGTH))); void SHA512Init(SHA2_CTX *); -void SHA512Transform(u_int64_t state[8], const u_int8_t [SHA512_BLOCK_LENGTH]); void SHA512Update(SHA2_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); -void SHA512Pad(SHA2_CTX *); void SHA512Final(u_int8_t [SHA512_DIGEST_LENGTH], SHA2_CTX *) __attribute__((__bounded__(__minbytes__,1,SHA512_DIGEST_LENGTH))); char *SHA512End(SHA2_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH))); char *SHA512File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH))); -char *SHA512FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH))); char *SHA512Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA512_DIGEST_STRING_LENGTH))); void SHA512_256Init(SHA2_CTX *); -void SHA512_256Transform(u_int64_t state[8], const u_int8_t [SHA512_256_BLOCK_LENGTH]); void SHA512_256Update(SHA2_CTX *, const u_int8_t *, size_t) __attribute__((__bounded__(__string__,2,3))); -void SHA512_256Pad(SHA2_CTX *); void SHA512_256Final(u_int8_t [SHA512_256_DIGEST_LENGTH], SHA2_CTX *) __attribute__((__bounded__(__minbytes__,1,SHA512_256_DIGEST_LENGTH))); char *SHA512_256End(SHA2_CTX *, char *) __attribute__((__bounded__(__minbytes__,2,SHA512_256_DIGEST_STRING_LENGTH))); char *SHA512_256File(const char *, char *) __attribute__((__bounded__(__minbytes__,2,SHA512_256_DIGEST_STRING_LENGTH))); -char *SHA512_256FileChunk(const char *, char *, off_t, off_t) - __attribute__((__bounded__(__minbytes__,2,SHA512_256_DIGEST_STRING_LENGTH))); char *SHA512_256Data(const u_int8_t *, size_t, char *) __attribute__((__bounded__(__string__,1,2))) __attribute__((__bounded__(__minbytes__,3,SHA512_256_DIGEST_STRING_LENGTH))); diff --git a/lib/libc/include/generic-openbsd/spawn.h b/lib/libc/include/generic-openbsd/spawn.h index 79f2dd47b76777d8cbe5634bcd9d3c5a423e949d..75d968544e98485af381364fa994e0b5fb270bda 100644 --- a/lib/libc/include/generic-openbsd/spawn.h +++ b/lib/libc/include/generic-openbsd/spawn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: spawn.h,v 1.3 2015/05/20 22:50:07 millert Exp $ */ +/* $OpenBSD: spawn.h,v 1.4 2026/08/31 15:12:32 tb Exp $ */ /*- * Copyright (c) 2008 Ed Schouten * All rights reserved. @@ -69,6 +69,11 @@ int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *__restrict, int, const char *__restrict, int, mode_t); int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, int); int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int); +#if __POSIX_VISIBLE >= 202405 +int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t *__restrict, + const char *__restrict); +int posix_spawn_file_actions_addfchdir(posix_spawn_file_actions_t *, int); +#endif /* * Spawn attributes diff --git a/lib/libc/include/generic-openbsd/sys/buf.h b/lib/libc/include/generic-openbsd/sys/buf.h index 864be56101f94a9a80c7f036588a5c4f073b1a86..e4b6a934a90ff7b21e569d126c639fe7792d3d70 100644 --- a/lib/libc/include/generic-openbsd/sys/buf.h +++ b/lib/libc/include/generic-openbsd/sys/buf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.h,v 1.120 2025/08/14 16:13:52 beck Exp $ */ +/* $OpenBSD: buf.h,v 1.123 2026/08/03 03:27:45 jsg Exp $ */ /* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */ /* @@ -120,7 +120,6 @@ struct buf { LIST_ENTRY(buf) b_list; /* All allocated buffers. */ LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */ TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */ - int cache; /* which cache are we in */ struct proc *b_proc; /* Associated proc; NULL if kernel. */ volatile long b_flags; /* B_* flags. */ long b_bufsize; /* Allocated buffer size. */ @@ -193,13 +192,12 @@ struct bufcache { #define B_WARM 0x00800000 /* buffer is or has been on the warm queue */ #define B_COLD 0x01000000 /* buffer is on the cold queue */ #define B_BC 0x02000000 /* buffer is managed by the cache */ -#define B_DMA 0x04000000 /* buffer is DMA reachable */ #define B_BITS "\20\001AGE\002NEEDCOMMIT\003ASYNC\004BAD\005BUSY" \ "\006CACHE\007CALL\010DELWRI\011DONE\012EINTR\013ERROR" \ "\014INVAL\015NOCACHE\016PHYS\017RAW\020READ" \ "\021WANTED\022WRITEINPROG\023XXX(FORMAT)\024DEFERRED" \ - "\025SCANNED\026DAEMON\027RELEASED\030WARM\031COLD\032BC\033DMA" + "\025SCANNED\026DAEMON\027RELEASED\030WARM\031COLD\032BC" /* * Zero out the buffer's data area. @@ -262,9 +260,7 @@ struct buf *incore(struct vnode *, daddr_t); void bufcache_take(struct buf *); void bufcache_release(struct buf *); -int buf_flip_high(struct buf *); -void buf_flip_dma(struct buf *); -struct buf *bufcache_getcleanbuf(int, int); +struct buf *bufcache_getcleanbuf(int); struct buf *bufcache_getdirtybuf(void); /* @@ -284,7 +280,6 @@ int buf_dealloc_mem(struct buf *); void buf_fix_mapping(struct buf *, vsize_t); void buf_alloc_pages(struct buf *, vsize_t); void buf_free_pages(struct buf *); -int buf_realloc_pages(struct buf *, struct uvm_constraint_range *, int); void minphys(struct buf *bp); int physio(void (*strategy)(struct buf *), dev_t dev, int flags, diff --git a/lib/libc/include/generic-openbsd/sys/device.h b/lib/libc/include/generic-openbsd/sys/device.h index 6968593939f6b10b78ae954ab496b2cd88eaa07a..62721c1aeddc2194dc424cf48ebbcdb160e10121 100644 --- a/lib/libc/include/generic-openbsd/sys/device.h +++ b/lib/libc/include/generic-openbsd/sys/device.h @@ -1,4 +1,4 @@ -/* $OpenBSD: device.h,v 1.71 2026/03/11 16:18:42 kettenis Exp $ */ +/* $OpenBSD: device.h,v 1.72 2026/09/07 21:30:59 kettenis Exp $ */ /* $NetBSD: device.h,v 1.15 1996/04/09 20:55:24 cgd Exp $ */ /* @@ -202,11 +202,13 @@ void config_pending_decr(void); void config_mountroot(struct device *, void (*)(struct device *)); void config_process_deferred_mountroot(void); -int request_sleep(int); -int sleep_state(void *, int); +extern int sleep_mode; #define SLEEP_RESUME 0 #define SLEEP_SUSPEND 1 #define SLEEP_HIBERNATE 2 + +int request_sleep(int); +int sleep_state(void *, int); void sleep_mp(void); void resume_mp(void); int sleep_showstate(void *v, int sleepmode); diff --git a/lib/libc/include/generic-openbsd/sys/dkio.h b/lib/libc/include/generic-openbsd/sys/dkio.h index 853dc8a4479272f1bb230e4308f7c230df703bc7..3b12ca4758fb360f172c17fbd21ec22dd7ff6848 100644 --- a/lib/libc/include/generic-openbsd/sys/dkio.h +++ b/lib/libc/include/generic-openbsd/sys/dkio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dkio.h,v 1.14 2025/11/13 20:59:14 deraadt Exp $ */ +/* $OpenBSD: dkio.h,v 1.15 2026/06/24 17:03:06 krw Exp $ */ /* $NetBSD: dkio.h,v 1.1 1996/01/30 18:21:48 thorpej Exp $ */ /* @@ -50,10 +50,6 @@ #define DIOCGPDINFO _IOR('d', 114, struct disklabel)/* get physical */ #define DIOCRLDINFO _IO('d', 115) /* reload disklabel */ -/* XXX temporary to support the transition to more partitions */ -#define O_disklabel offsetof(struct disklabel, d_partitions[MAXPARTITIONS16]) -#define O_DIOCGDINFO _IOC(IOC_OUT, 'd', 101, O_disklabel) - struct dk_inquiry { char vendor[64]; char product[128]; diff --git a/lib/libc/include/generic-openbsd/sys/exec.h b/lib/libc/include/generic-openbsd/sys/exec.h index 368dde8a363073e3da78abe00dffaa511e363e1c..54bf7f6de8194703447ee7579c36d26e902ebbdb 100644 --- a/lib/libc/include/generic-openbsd/sys/exec.h +++ b/lib/libc/include/generic-openbsd/sys/exec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.h,v 1.57 2025/05/24 06:49:16 deraadt Exp $ */ +/* $OpenBSD: exec.h,v 1.61 2026/09/17 19:45:07 dgl Exp $ */ /* $NetBSD: exec.h,v 1.59 1996/02/09 18:25:09 christos Exp $ */ /*- @@ -106,9 +106,8 @@ struct exec_vmcmd_set { struct exec_vmcmd evs_start[EXEC_DEFAULT_VMCMD_SETSIZE]; }; -struct elf_args; struct exec_package { - char *ep_name; /* file's name */ + const char *ep_name; /* file's name */ void *ep_hdr; /* file's exec header */ u_int ep_hdrlen; /* length of ep_hdr */ u_int ep_hdrvalid; /* bytes of ep_hdr that are valid */ @@ -123,16 +122,19 @@ struct exec_package { u_long ep_maxsaddr; /* proc's max stack addr ("top") */ u_long ep_minsaddr; /* proc's min stack addr ("bottom") */ u_long ep_ssize; /* size of process's stack */ - u_long ep_entry; /* process's entry point */ + u_long ep_entry; /* process's (maybe ld.so) point */ + u_long ep_entrymain; /* process's (main) entry point */ + u_long ep_phdraddr; /* process's elf phdr location */ + u_long ep_interpaddr; /* process's ld.so location */ u_int ep_flags; /* flags; see below. */ char **ep_fa; /* a fake args vector for scripts */ int ep_fd; /* a file descriptor we're holding */ - struct elf_args *ep_args; /* ELF info */ void *ep_auxinfo; /* userspace auxinfo address */ char *ep_interp; /* name of interpreter if any */ vaddr_t ep_pinstart, ep_pinend; /* executable region */ u_int *ep_pins; /* array of system call offsets */ int ep_npins; /* entries in array */ + char *ep_execpath; /* execve path on userland stack */ }; #define EXEC_INDIR 0x0001 /* script handling already done */ #define EXEC_HASFD 0x0002 /* holding a shell script */ diff --git a/lib/libc/include/generic-openbsd/sys/exec_elf.h b/lib/libc/include/generic-openbsd/sys/exec_elf.h index 2d39ed037dd2a72523c8790b385251f9485b098c..58701092e43c514bf6c47df907bfcdfb295f879b 100644 --- a/lib/libc/include/generic-openbsd/sys/exec_elf.h +++ b/lib/libc/include/generic-openbsd/sys/exec_elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.h,v 1.108 2025/07/31 16:09:59 kettenis Exp $ */ +/* $OpenBSD: exec_elf.h,v 1.112 2026/09/16 03:22:35 deraadt Exp $ */ /* * Copyright (c) 1995, 1996 Erik Theisen. All rights reserved. * @@ -734,16 +734,8 @@ enum AuxID { AUX_sun_gid = 2002, /* egid */ AUX_sun_rgid = 2003, /* rgid */ AUX_openbsd_timekeep = 4000, /* userland clock_gettime */ + AUX_openbsd_execpath = 4001, /* realpath'd executable path */ }; - -struct elf_args { - u_long arg_entry; /* program entry point */ - u_long arg_interp; /* Interpreter load address */ - u_long arg_phaddr; /* program header address */ - u_long arg_phentsize; /* Size of program header */ - u_long arg_phnum; /* Number of program headers */ -}; - #endif #if !defined(ELFSIZE) && defined(ARCH_ELFSIZE) @@ -822,7 +814,7 @@ extern Elf_Dyn _DYNAMIC[]; /* * How many entries are in the AuxInfo array we pass to the process? */ -#define ELF_AUX_ENTRIES 11 +#define ELF_AUX_ENTRIES 12 #define ELF_AUX_WORDS (sizeof(AuxInfo) * ELF_AUX_ENTRIES / sizeof(char *)) #define ELFROUNDSIZE sizeof(Elf_Word) diff --git a/lib/libc/include/generic-openbsd/sys/file.h b/lib/libc/include/generic-openbsd/sys/file.h index 047f0514c373b9dd096763c8697f209ec56fe107..1ce84f1bd951761e4120c5a0c9c78b8d99290217 100644 --- a/lib/libc/include/generic-openbsd/sys/file.h +++ b/lib/libc/include/generic-openbsd/sys/file.h @@ -1,4 +1,4 @@ -/* $OpenBSD: file.h,v 1.66 2022/06/20 01:39:44 visa Exp $ */ +/* $OpenBSD: file.h,v 1.67 2026/09/19 17:21:52 dv Exp $ */ /* $NetBSD: file.h,v 1.11 1995/03/26 20:24:13 jtc Exp $ */ /* @@ -46,6 +46,7 @@ #define DTYPE_KQUEUE 4 /* event queue */ #define DTYPE_DMABUF 5 /* DMA buffer (for DRM) */ #define DTYPE_SYNC 6 /* sync file (for DRM) */ +#define DTYPE_VMM 7 /* vmm(4) virtual machine */ #ifdef _KERNEL struct proc; diff --git a/lib/libc/include/generic-openbsd/sys/fusebuf.h b/lib/libc/include/generic-openbsd/sys/fusebuf.h index 80e4e3d9424988078c3eb9f608654b18ae6dd0c2..7d1aa8bba8950064a4e4930176d1de2cfd1293a2 100644 --- a/lib/libc/include/generic-openbsd/sys/fusebuf.h +++ b/lib/libc/include/generic-openbsd/sys/fusebuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fusebuf.h,v 1.16 2025/09/06 06:15:52 helg Exp $ */ +/* $OpenBSD: fusebuf.h,v 1.17 2026/06/17 13:29:01 helg Exp $ */ /* * Copyright (c) 2013 Sylvestre Gallon * Copyright (c) 2013 Martin Pieuchot @@ -19,36 +19,25 @@ #ifndef _SYS_FUSEBUF_H_ #define _SYS_FUSEBUF_H_ +#include + /* * Maximum size of the read or write buffer sent from the kernel for VFS * syscalls: read, readdir, readlink, write. */ #define FUSEBUFMAXSIZE (4096*1024) -/* header at beginning of each fusebuf: */ -struct fb_hdr { - SIMPLEQ_ENTRY(fusebuf) fh_next; /* next buffer in chain */ - size_t fh_len; /* Amount of data */ - int fh_err; /* errno to pass back */ - int fh_type; /* type of data */ - ino_t fh_ino; /* Inode of this fusebuf */ - uint64_t fh_uuid; /* Uuid to track the answer */ - pid_t fh_tid; /* calling proc thread id */ - uid_t fh_uid; /* calling proc uid */ - gid_t fh_gid; /* calling proc gid */ - mode_t fh_umask; /* calling proc umask */ -}; +/** Linux FUSE kernel interface major version we somewhat emulate. */ +#define FUSE_KERNEL_VERSION 7 -/* header for fuse file operations (like read/write/mkdir): */ -struct fb_io { - uint64_t fi_fd; /* fd where the io is performed */ - ino_t fi_ino; /* ino for the io */ - off_t fi_off; /* offset for the io */ - size_t fi_len; /* Length of data */ - mode_t fi_mode; /* mode for fd */ - uint32_t fi_flags; /* flags on transfer */ - dev_t fi_rdev; /* dev for mknod */ -}; +/** Linux FUSE kernel interface minor version we somewhat emulate. */ +#define FUSE_KERNEL_MINOR_VERSION 19 + +/* + * The root inode is the root of the mounted FUSE file system. + * Also note that inode 0 can't be used for normal purposes. + */ +#define FUSE_ROOT_ID ((ino_t)1) /* * An operation is issued by the kernel through fuse(4) when the @@ -62,43 +51,6 @@ struct fb_io { * When the userland file system answers to this operation it uses * the same ID (fh_uuid). */ -struct fusebuf { - struct fb_hdr fb_hdr; - union { - struct statvfs FD_stat; /* vfs statfs */ - struct stat FD_attr; /* for attr vnops */ - struct fb_io FD_io; /* for file io vnops */ - } FD; - uint8_t *fb_dat; /* data's */ -}; - -#define fb_next fb_hdr.fh_next -#define fb_len fb_hdr.fh_len -#define fb_err fb_hdr.fh_err -#define fb_type fb_hdr.fh_type -#define fb_ino fb_hdr.fh_ino -#define fb_uuid fb_hdr.fh_uuid -#define fb_tid fb_hdr.fh_tid -#define fb_uid fb_hdr.fh_uid -#define fb_gid fb_hdr.fh_gid -#define fb_umask fb_hdr.fh_umask - -#define fb_stat FD.FD_stat -#define fb_attr FD.FD_attr -#define fb_io_fd FD.FD_io.fi_fd -#define fb_io_ino FD.FD_io.fi_ino -#define fb_io_off FD.FD_io.fi_off -#define fb_io_len FD.FD_io.fi_len -#define fb_io_mode FD.FD_io.fi_mode -#define fb_io_flags FD.FD_io.fi_flags -#define fb_io_rdev FD.FD_io.fi_rdev - -/* - * Macros for type conversion - * fbtod(fb,t) - convert fusebuf pointer to data pointer of correct - * type - */ -#define fbtod(fb,t) ((t)((fb)->fb_dat)) /* flags needed by setattr */ #define FUSE_FATTR_MODE (1 << 0) @@ -107,42 +59,368 @@ struct fusebuf { #define FUSE_FATTR_SIZE (1 << 3) #define FUSE_FATTR_ATIME (1 << 4) #define FUSE_FATTR_MTIME (1 << 5) -#define FUSE_FATTR_FH (1 << 6) /* fusebuf types */ -#define FBT_LOOKUP 0 -#define FBT_GETATTR 1 -#define FBT_SETATTR 2 -#define FBT_READLINK 3 -#define FBT_SYMLINK 4 -#define FBT_MKNOD 5 -#define FBT_MKDIR 6 -#define FBT_UNLINK 7 -#define FBT_RMDIR 8 -#define FBT_RENAME 9 -#define FBT_LINK 10 -#define FBT_OPEN 11 -#define FBT_READ 12 -#define FBT_WRITE 13 -#define FBT_STATFS 14 -#define FBT_RELEASE 16 -#define FBT_FSYNC 17 -#define FBT_FLUSH 18 -#define FBT_INIT 19 -#define FBT_OPENDIR 20 -#define FBT_READDIR 21 -#define FBT_RELEASEDIR 22 -#define FBT_FSYNCDIR 23 -#define FBT_ACCESS 24 -#define FBT_DESTROY 26 -#define FBT_RECLAIM 27 +#define FUSE_LOOKUP 1 +#define FUSE_GETATTR 3 +#define FUSE_SETATTR 4 +#define FUSE_READLINK 5 +#define FUSE_SYMLINK 6 +#define FUSE_MKNOD 8 +#define FUSE_MKDIR 9 +#define FUSE_UNLINK 10 +#define FUSE_RMDIR 11 +#define FUSE_RENAME 12 +#define FUSE_LINK 13 +#define FUSE_OPEN 14 +#define FUSE_READ 15 +#define FUSE_WRITE 16 +#define FUSE_STATFS 17 +#define FUSE_RELEASE 18 +#define FUSE_FSYNC 20 +#define FUSE_FLUSH 25 +#define FUSE_INIT 26 +#define FUSE_OPENDIR 27 +#define FUSE_READDIR 28 +#define FUSE_RELEASEDIR 29 +#define FUSE_DESTROY 38 +#define FUSE_FORGET 2 + +struct fuse_attr { + uint64_t ino; + uint64_t size; + uint64_t blocks; + uint64_t atime; + uint64_t mtime; + uint64_t ctime; + uint32_t atimensec; + uint32_t mtimensec; + uint32_t ctimensec; + uint32_t mode; + uint32_t nlink; + uint32_t uid; + uint32_t gid; + uint32_t rdev; + uint32_t blksize; + uint32_t padding; +}; + + +struct fuse_entry_out { + uint64_t nodeid; /* Inode number */ + uint64_t generation; /* Not implemented */ + uint64_t entry_valid; /* Not implemented */ + uint64_t attr_valid; /* Not implemented */ + uint32_t entry_valid_nsec; /* Not implemented */ + uint32_t attr_valid_nsec; /* Not implemented */ + struct fuse_attr attr; +}; + +struct fuse_forget_in { + uint64_t nlookup; +}; + +struct fuse_getattr_in { + uint32_t getattr_flags; /* Not implemented */ + uint32_t dummy; + uint64_t fh; /* Not implemented */ +}; + +struct fuse_attr_out { + uint64_t attr_valid; /* Not implemented */ + uint32_t attr_valid_nsec; /* Not implemented */ + uint32_t dummy; + struct fuse_attr attr; +}; + +struct fuse_mknod_in { + uint32_t mode; + uint32_t rdev; + uint32_t umask; + uint32_t padding; +}; + +struct fuse_mkdir_in { + uint32_t mode; + uint32_t umask; +}; + +struct fuse_rename_in { + uint64_t newdir; +}; + +struct fuse_link_in { + uint64_t oldnodeid; +}; + +struct fuse_setattr_in { + uint32_t valid; + uint32_t padding; + uint64_t fh; + uint64_t size; + uint64_t lock_owner; + uint64_t atime; + uint64_t mtime; + uint64_t unused2; + uint32_t atimensec; + uint32_t mtimensec; + uint32_t unused3; + uint32_t mode; + uint32_t unused4; + uint32_t uid; + uint32_t gid; + uint32_t unused5; +}; + +struct fuse_open_in { + uint32_t flags; + uint32_t unused; +}; + +struct fuse_open_out { + uint64_t fh; + uint32_t open_flags; + uint32_t padding; +}; + +struct fuse_release_in { + uint64_t fh; + uint32_t flags; + uint32_t release_flags; + uint64_t lock_owner; +}; + +struct fuse_flush_in { + uint64_t fh; + uint32_t unused; + uint32_t padding; + uint64_t lock_owner; +}; + +struct fuse_read_in { + uint64_t fh; + uint64_t offset; + uint32_t size; + uint32_t read_flags; + uint64_t lock_owner; + uint32_t flags; + uint32_t padding; +}; + +struct fuse_write_in { + uint64_t fh; + uint64_t offset; + uint32_t size; + uint32_t write_flags; + uint64_t lock_owner; + uint32_t flags; + uint32_t padding; +}; + +struct fuse_write_out { + uint32_t size; + uint32_t padding; +}; + +struct fuse_kstatfs { + uint64_t blocks; + uint64_t bfree; + uint64_t bavail; + uint64_t files; + uint64_t ffree; + uint32_t bsize; + uint32_t namelen; + uint32_t frsize; + uint32_t padding; + uint32_t spare[6]; +}; + +struct fuse_statfs_out { + struct fuse_kstatfs st; +}; + +struct fuse_fsync_in { + uint64_t fh; + uint32_t fsync_flags; //XXX + uint32_t padding; +}; + +struct fuse_init_in { + uint32_t major; + uint32_t minor; + uint32_t max_readahead; + uint32_t flags; +}; + +struct fuse_init_out { + uint32_t major; + uint32_t minor; + uint32_t max_readahead; /* Not implemented */ + uint32_t flags; /* Not implemented */ + uint16_t max_background; /* Not implemented */ + uint16_t congestion_threshold; /* Not implemented */ + uint32_t max_write; +}; + +struct fuse_in_header { + uint32_t len; + uint32_t opcode; + uint64_t unique; + uint64_t nodeid; + uint32_t uid; + uint32_t gid; + uint32_t pid; + uint32_t padding; +}; + +struct fuse_out_header { + uint32_t len; + int32_t error; + uint64_t unique; +}; + +struct fuse_dirent { + uint64_t ino; + uint64_t off; + uint32_t namelen; + uint32_t type; + char name[]; /* unterminated string */ +}; + +#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) +#define FUSE_DIRENT_ALIGN(x) \ + (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1)) +#define FUSE_DIRENT_SIZE(d) \ + FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) #ifdef _KERNEL +/* + * An operation is issued by the kernel through fuse(4) when the + * userland file system needs to execute an action (mkdir(2), + * link(2), etc). + * + * When the userland file system answers to this operation it uses + * the same ID (fb_uuid). + */ +struct fusebuf { + SIMPLEQ_ENTRY(fusebuf) next; /* next buffer in chain */ + struct fuse_in_header hdr; + int32_t error; /* error returned by daemon */ + size_t op_in_len; /* size of input */ + size_t op_out_len; /* size of output */ + uint8_t op_out_buf; /* whether to expect data */ + union { + union { + struct fuse_forget_in forget; + struct fuse_getattr_in getattr; + struct fuse_setattr_in setattr; + struct fuse_mknod_in mknod; + struct fuse_mkdir_in mkdir; + struct fuse_rename_in rename; + struct fuse_link_in link; + struct fuse_open_in open; + struct fuse_read_in read; + struct fuse_write_in write; + struct fuse_release_in release; + struct fuse_fsync_in fsync; + struct fuse_flush_in flush; + struct fuse_init_in init; + } in; + union { + struct fuse_entry_out entry; + struct fuse_attr_out attr; + struct fuse_open_out open; + struct fuse_write_out write; + struct fuse_statfs_out statfs; + struct fuse_init_out init; + } out; + } op; + uint64_t dat_len; + uint8_t *dat; +}; + +#define fb_dat dat +#define fb_next next +#define fb_err error +#define fb_len dat_len +#define fb_type hdr.opcode +#define fb_uuid hdr.unique +#define fb_ino hdr.nodeid +#define fb_tid hdr.pid +#define fb_uid hdr.uid +#define fb_gid hdr.gid + /* fusebuf prototypes */ struct fusebuf *fb_setup(size_t, ino_t, int, struct proc *); int fb_queue(dev_t, struct fusebuf *); void fb_delete(struct fusebuf *); +#else /* _KERNEL */ + +/* + * Userland fusebuf more directly maps to the protocol binary layout for each + * file operation request (input). This consists of a header followed by an + * optional input struct with data immediately following either the header or + * input struct. + * + * FUSE_LOOKUP: hdr, dat (filename) + * FUSE_GETATTR: hdr, getattr + * FUSE_SETATTR: hdr, setattr + * FUSE_READLINK: hdr + * FUSE_SYMLINK: hdr, dat (source\0target) + * FUSE_MKNOD: hdr, mknod, dat (filename) + * FUSE_MKDIR: hdr, mkdir, dat (dirname) + * FUSE_UNLINK: hdr, dat (filename) + * FUSE_RMDIR: hdr, dat (dirname) + * FUSE_RENAME: hdr, rename, dat (oldname\0newname) + * FUSE_LINK: hdr, dat (source\0target) + * FUSE_OPEN: hdr, open + * FUSE_READ: hdr, read + * FUSE_WRITE: hdr, write, dat + * FUSE_STATFS: hdr, statfs + * FUSE_RELEASE: hdr, release + * FUSE_FSYNC: hdr, fsync + * FUSE_FLUSH: hdr, flush + * FUSE_INIT: hdr, init + * FUSE_OPENDIR: hdr, open + * FUSE_READDIR: hdr, read + * FUSE_RELEASEDIR: hdr, release + * FUSE_DESTROY: hdr + * FUSE_FORGET: hdr, forget + */ +struct fusebuf { + struct fuse_in_header hdr; + union { + struct fuse_forget_in forget; + struct fuse_getattr_in getattr; + struct fuse_setattr_in setattr; + struct fuse_mknod_in mknod; + struct fuse_mkdir_in mkdir; + struct fuse_rename_in rename; + struct fuse_link_in link; + struct fuse_open_in open; + struct fuse_read_in read; + struct fuse_write_in write; + struct fuse_release_in release; + struct fuse_fsync_in fsync; + struct fuse_flush_in flush; + struct fuse_init_in init; + } in; +}; + +#define fb_type hdr.opcode +#define fb_uuid hdr.unique +#define fb_ino hdr.nodeid +#define fb_tid hdr.pid +#define fb_uid hdr.uid +#define fb_gid hdr.gid + +/* + * Macro to get the additional data for operations that have it. + * The data starts immediately after the related input struct. + */ +#define fb_dat(in) (((char *)&(in)) + sizeof(in)) + #endif /* _KERNEL */ #endif /* _SYS_FUSEBUF_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-openbsd/sys/hibernate.h b/lib/libc/include/generic-openbsd/sys/hibernate.h index d7e3176f1963c598c1e8a9eb63ddeaaab119db83..0be10c19c33850631feb9f7e54bffc1c9a9d8435 100644 --- a/lib/libc/include/generic-openbsd/sys/hibernate.h +++ b/lib/libc/include/generic-openbsd/sys/hibernate.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hibernate.h,v 1.51 2025/07/05 09:24:37 jsg Exp $ */ +/* $OpenBSD: hibernate.h,v 1.52 2026/09/06 18:26:41 mglocker Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt @@ -150,6 +150,10 @@ void hibernate_unpack_image(union hibernate_info *); void hibernate_populate_resume_pt(union hibernate_info *, paddr_t, paddr_t); int hibernate_alloc(void); void hibernate_free(void); + +/* MD pmap setup/teardown for suspend-time HIBERNATE_HIBALLOC_PAGE access. */ +int hibernate_pmap_setup_md(void); +void hibernate_pmap_teardown_md(void); void hib_getentropy(char **, size_t *); int hibernate_write(union hibernate_info *, daddr_t, vaddr_t, size_t, int); diff --git a/lib/libc/include/generic-openbsd/sys/limits.h b/lib/libc/include/generic-openbsd/sys/limits.h index fc119cae3527483b3c191097f04ab899b793f554..d0d0c3e1e53f030e2281d112e9295c45800fddfa 100644 --- a/lib/libc/include/generic-openbsd/sys/limits.h +++ b/lib/libc/include/generic-openbsd/sys/limits.h @@ -1,4 +1,4 @@ -/* $OpenBSD: limits.h,v 1.10 2012/06/30 20:21:10 guenther Exp $ */ +/* $OpenBSD: limits.h,v 1.11 2026/09/26 15:02:53 deraadt Exp $ */ /* * Copyright (c) 2002 Marc Espie. * @@ -79,11 +79,6 @@ /* min value for a signed long long */ #endif -#if __BSD_VISIBLE -# define UID_MAX UINT_MAX /* max value for a uid_t */ -# define GID_MAX UINT_MAX /* max value for a gid_t */ -#endif - #if __XPG_VISIBLE || __POSIX_VISIBLE >= 200809 # ifdef __LP64__ # define LONG_BIT 64 diff --git a/lib/libc/include/generic-openbsd/sys/mbuf.h b/lib/libc/include/generic-openbsd/sys/mbuf.h index bcfcfc048ff810a656d7326b1a6052230db862b5..2bf93ba649ae97b54bcc298a4e1e65bb52fcffc7 100644 --- a/lib/libc/include/generic-openbsd/sys/mbuf.h +++ b/lib/libc/include/generic-openbsd/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.269 2026/02/05 03:26:00 dlg Exp $ */ +/* $OpenBSD: mbuf.h,v 1.271 2026/07/03 11:51:57 dlg Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -145,8 +145,6 @@ struct mbuf_ext { void *ext_arg; u_int ext_free_fn; /* index of free function */ u_int ext_size; /* size of buffer, for ext_free_fn */ - struct mbuf *ext_nextref; - struct mbuf *ext_prevref; #ifdef DEBUG const char *ext_ofile; const char *ext_nfile; @@ -282,13 +280,22 @@ struct mbuf { #define MCLREFDEBUGO(m, file, line) #endif -#define MCLISREFERENCED(m) ((m)->m_ext.ext_nextref != (m)) +int m_ext_refs_shared(struct mbuf *); -#define MCLADDREFERENCE(o, n) m_extref((o), (n)) +static inline int +m_extreferenced(struct mbuf *m) +{ + extern u_int m_extfree_refs_fn; + + if (m->m_ext.ext_free_fn != m_extfree_refs_fn) + return (0); + + return (m_ext_refs_shared(m)); +} + +#define MCLISREFERENCED(m) m_extreferenced(m) #define MCLINITREFERENCE(m) do { \ - (m)->m_ext.ext_prevref = (m); \ - (m)->m_ext.ext_nextref = (m); \ MCLREFDEBUGO((m), __FILE__, __LINE__); \ MCLREFDEBUGN((m), NULL, 0); \ } while (/* CONSTCOND */ 0) @@ -439,8 +446,8 @@ int m_leadingspace(struct mbuf *); int m_trailingspace(struct mbuf *); void m_align(struct mbuf *, int); struct mbuf *m_clget(struct mbuf *, int, u_int); -void m_extref(struct mbuf *, struct mbuf *); void m_pool_init(struct pool *, u_int, u_int, const char *); +void m_pool_noconstraints(void); u_int m_pool_used(void); void m_extfree_pool(caddr_t, u_int, void *); void m_adj(struct mbuf *, int); @@ -454,8 +461,8 @@ int m_apply(struct mbuf *, int, int, int (*)(caddr_t, caddr_t, unsigned int), caddr_t); struct mbuf *m_dup_pkt(struct mbuf *, unsigned int, int); int m_dup_pkthdr(struct mbuf *, struct mbuf *, int); - void m_microtime(const struct mbuf *, struct timeval *); +void mbuf_dma_64bit_enable(void); static inline struct mbuf * m_freemp(struct mbuf **mp) diff --git a/lib/libc/include/generic-openbsd/sys/mount.h b/lib/libc/include/generic-openbsd/sys/mount.h index f863cb68ff9deb64084136409d1683b48ad75b9f..41bd00610a59c54e5bd89f210625016eecf151a6 100644 --- a/lib/libc/include/generic-openbsd/sys/mount.h +++ b/lib/libc/include/generic-openbsd/sys/mount.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.h,v 1.153 2025/01/02 01:19:22 dlg Exp $ */ +/* $OpenBSD: mount.h,v 1.154 2026/06/10 00:04:38 beck Exp $ */ /* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */ /* @@ -478,14 +478,9 @@ struct bcachestats { int64_t numreads; /* total reads started */ int64_t cachehits; /* total reads found in cache */ int64_t busymapped; /* number of busy and mapped buffers */ - int64_t dmapages; /* dma reachable pages in buffer cache */ - int64_t highpages; /* pages above dma region */ int64_t delwribufs; /* delayed write buffers */ int64_t kvaslots; /* kva slots total */ int64_t kvaslots_avail; /* available kva slots */ - int64_t highflips; /* total flips to above DMA */ - int64_t highflops; /* total failed flips to above DMA */ - int64_t dmaflips; /* total flips from high to DMA */ }; #ifdef _KERNEL extern struct bcachestats bcstats; diff --git a/lib/libc/include/generic-openbsd/sys/msg.h b/lib/libc/include/generic-openbsd/sys/msg.h index a7a4f3a5ba62dc92ec476ca934bf2975075eac8e..995b6848f5a21843257d08c0229d52d30ff11c1c 100644 --- a/lib/libc/include/generic-openbsd/sys/msg.h +++ b/lib/libc/include/generic-openbsd/sys/msg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: msg.h,v 1.24 2024/10/27 22:08:25 jsg Exp $ */ +/* $OpenBSD: msg.h,v 1.26 2026/07/08 19:39:33 mvs Exp $ */ /* $NetBSD: msg.h,v 1.9 1996/02/09 18:25:18 christos Exp $ */ /* @@ -77,7 +77,9 @@ struct que { /* for que_flags */ #define MSGQ_READERS 0x01 #define MSGQ_WRITERS 0x02 -#define MSGQ_DYING 0x04 +#define MSGQ_RCVWAIT 0x04 +#define MSGQ_RCVWAITING 0x08 +#define MSGQ_DYING 0x10 #define QREF(q) (q)->que_references++ @@ -104,9 +106,6 @@ struct msginfo { msgssz, /* size of a message segment (see notes above) */ msgseg; /* number of message segments */ }; -#ifdef SYSVMSG -extern struct msginfo msginfo; -#endif int sysctl_sysvmsg(int *, u_int, void *, size_t *); diff --git a/lib/libc/include/generic-openbsd/sys/namei.h b/lib/libc/include/generic-openbsd/sys/namei.h index 1a313cc8623771c49ac41d0ee65ed6cd63c40f14..d18f3c4839028ea7419fbfba2e41a19ce3da353c 100644 --- a/lib/libc/include/generic-openbsd/sys/namei.h +++ b/lib/libc/include/generic-openbsd/sys/namei.h @@ -1,4 +1,4 @@ -/* $OpenBSD: namei.h,v 1.51 2026/03/08 16:41:19 deraadt Exp $ */ +/* $OpenBSD: namei.h,v 1.55 2026/09/17 18:51:39 deraadt Exp $ */ /* $NetBSD: namei.h,v 1.11 1996/02/09 18:25:20 christos Exp $ */ /* @@ -51,13 +51,9 @@ struct nameidata { const char *ni_dirp; /* pathname pointer */ int ni_dirfd; /* dirfd from *at() functions */ enum uio_seg ni_segflg; /* location of pathname */ - /* u_long ni_nameiop; namei operation */ - /* u_long ni_flags; flags to namei */ - /* struct proc *ni_proc; process requesting lookup */ /* * Arguments to lookup. */ - /* struct ucred *ni_cred; credentials */ struct vnode *ni_startdir; /* starting directory */ struct vnode *ni_rootdir; /* logical root directory */ uint64_t ni_pledge; /* expected pledge for namei */ @@ -144,11 +140,14 @@ struct nameidata { #define ISLASTCN 0x008000 /* this is last component of pathname */ #define ISSYMLINK 0x010000 /* symlink needs interpretation */ #define REALPATH 0x020000 /* save pathname buffer for realpath */ +#define BPU_LOCALTIME 0x040000 /* /etc/localtime may cross 1 symlink */ #define REQUIREDIR 0x080000 /* must be a directory */ #define STRIPSLASHES 0x100000 /* strip trailing slashes */ #define PDIRUNLOCK 0x200000 /* vfs_lookup() unlocked parent dir */ #define BYPASSUNVEIL 0x400000 /* bypass pledgepath check */ #define KERNELPATH 0x800000 /* access file as kernel, not process */ +#define BPU_ZONEINFO 0x1000000 /* /usr/share/zoneinfo prohibits symlinks */ +#define EXECPATH 0x2000000 /* like REALPATH, but can give up */ /* * Initialization of an nameidata structure. @@ -209,6 +208,7 @@ struct unveil *unveil_lookup(struct vnode *, struct process *, ssize_t *); void unveil_start_relative(struct proc *, struct nameidata *, struct vnode *); void unveil_check_component(struct proc *, struct nameidata *, struct vnode *); int unveil_check_final(struct proc *, struct nameidata *); +int checkzoneinfopath(const char *); extern struct pool namei_pool; @@ -269,7 +269,7 @@ struct nchstats { #define UNVEIL_CREATE 0x04 #define UNVEIL_EXEC 0x08 #define UNVEIL_USERSET 0x10 -#define UNVEIL_PLEDGEOPEN 0X20 +#define UNVEIL_PLEDGEOPEN 0x20 #define UNVEIL_MASK 0x0f #endif /* !_SYS_NAMEI_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-openbsd/sys/param.h b/lib/libc/include/generic-openbsd/sys/param.h index dcc616bf77ac893787a794ddd071ea40618c0651..878c6471f835ef96c8cab67d4608183df372f8ba 100644 --- a/lib/libc/include/generic-openbsd/sys/param.h +++ b/lib/libc/include/generic-openbsd/sys/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.146 2026/03/11 02:27:20 deraadt Exp $ */ +/* $OpenBSD: param.h,v 1.147 2026/07/16 06:21:08 deraadt Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -220,4 +220,4 @@ #endif #define FSCALE (1<<_FSHIFT) -#endif /* !_SYS_PARAM_H_ */ +#endif /* !_SYS_PARAM_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-openbsd/sys/pledge.h b/lib/libc/include/generic-openbsd/sys/pledge.h index e16767ea08f2de1bf44f3bcf6c46098b4e0dfed5..a1432e86fdbef4bb3445b13664be9e4449d2d44f 100644 --- a/lib/libc/include/generic-openbsd/sys/pledge.h +++ b/lib/libc/include/generic-openbsd/sys/pledge.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pledge.h,v 1.53 2026/02/26 07:42:25 deraadt Exp $ */ +/* $OpenBSD: pledge.h,v 1.55 2026/09/19 17:21:52 dv Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -124,11 +124,12 @@ int pledge_sysctl(struct proc *p, int namelen, int *name, void *new); int pledge_chown(struct proc *p, uid_t, gid_t); int pledge_adjtime(struct proc *p, const void *v); int pledge_sendit(struct proc *p, const void *to); -int pledge_sockopt(struct proc *p, int set, int level, int optname); +struct protosw; +int pledge_sockopt(struct proc *p, int set, const struct protosw *pr, + int level, int optname); int pledge_socket(struct proc *p, int domain, unsigned int state); int pledge_ioctl(struct proc *p, long com, struct file *); int pledge_ioctl_drm(struct proc *p, long com, dev_t device); -int pledge_ioctl_vmm(struct proc *p, long com); int pledge_ioctl_psp(struct proc *p, long com); int pledge_flock(struct proc *p); int pledge_fcntl(struct proc *p, int cmd); diff --git a/lib/libc/include/generic-openbsd/sys/proc.h b/lib/libc/include/generic-openbsd/sys/proc.h index e1d6e62bbcd2aded9d002533dbc3bff23a9500f9..a776f8924fdcd65ac3cfd80748d61997c54acedf 100644 --- a/lib/libc/include/generic-openbsd/sys/proc.h +++ b/lib/libc/include/generic-openbsd/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.397 2025/08/18 04:15:35 dlg Exp $ */ +/* $OpenBSD: proc.h,v 1.401 2026/09/19 17:53:49 gnezdo Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -52,6 +52,7 @@ #include /* For struct sigio */ #include /* For struct refcnt */ #include +#include /* For struct ptrace_state */ #ifdef _KERNEL #include @@ -207,7 +208,7 @@ struct process { pid_t ps_ppid; /* [K|m] Cached parent pid */ int ps_ptmask; /* Ptrace event mask */ - struct ptrace_state *ps_ptstat;/* Ptrace state */ + struct ptrace_state ps_ptstat; /* Ptrace state */ struct process *ps_opptr; /* [K|m] Old parent during ptrace. */ struct rusage *ps_ru; /* sum of stats for dead threads. */ diff --git a/lib/libc/include/generic-openbsd/sys/queue.h b/lib/libc/include/generic-openbsd/sys/queue.h index db4f22bee5fe900e4910ee72a0f4fd3ca17691c5..bfbbd69d126d249fe877d4ee1948a6fb8be49184 100644 --- a/lib/libc/include/generic-openbsd/sys/queue.h +++ b/lib/libc/include/generic-openbsd/sys/queue.h @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.h,v 1.46 2020/12/30 13:33:12 millert Exp $ */ +/* $OpenBSD: queue.h,v 1.47 2026/06/12 01:04:42 millert Exp $ */ /* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ /* @@ -589,9 +589,9 @@ struct { \ } while (0) #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((elm), field)) == NULL)\ + if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((listelm), field)) == NULL)\ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_NEXT((elm), field) = (elm); \ + STAILQ_NEXT((listelm), field) = (elm); \ } while (0) #define STAILQ_REMOVE_HEAD(head, field) do { \ diff --git a/lib/libc/include/generic-openbsd/sys/sem.h b/lib/libc/include/generic-openbsd/sys/sem.h index 621ec97144d460939494ecd9ce65e002ec40763f..895cbaf5160a4dbcd8d2531eb749134e8c40089d 100644 --- a/lib/libc/include/generic-openbsd/sys/sem.h +++ b/lib/libc/include/generic-openbsd/sys/sem.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sem.h,v 1.26 2024/10/26 05:39:03 jsg Exp $ */ +/* $OpenBSD: sem.h,v 1.31 2026/08/20 16:14:20 sthen Exp $ */ /* $NetBSD: sem.h,v 1.8 1996/02/09 18:25:29 christos Exp $ */ /* @@ -103,6 +103,7 @@ union semun { #ifdef _KERNEL #include +#include /* * Kernel implementation stuff @@ -110,6 +111,20 @@ union semun { #define SEMVMX 32767 /* semaphore maximum value */ #define SEMAEM 16384 /* adjust on exit max value */ +/* + * In-kernel semaphore implementation + */ +struct semid_ds_kern { + struct ipc_perm sem_perm; /* operation permission struct */ + struct sem *sem_base; /* pointer to first semaphore in set */ + unsigned short sem_nsems; /* number of sems in set */ + time_t sem_otime; /* last operation time */ + time_t sem_ctime; /* last change time */ + /* Times measured in secs since */ + /* 00:00:00 GMT, Jan. 1, 1970 */ + struct refcnt sem_refcnt; +}; + /* * Undo structure (one per process) */ @@ -144,16 +159,17 @@ struct sem_sysctl_info { struct semid_ds semids[1]; }; +extern struct rwlock sysvsem_lock; extern struct seminfo seminfo; /* * Configuration parameters */ #ifndef SEMMNI -#define SEMMNI 10 /* # of semaphore identifiers */ +#define SEMMNI 25 /* # of semaphore identifiers */ #endif #ifndef SEMMNS -#define SEMMNS 60 /* # of semaphores in system */ +#define SEMMNS 350 /* # of semaphores in system */ #endif #ifndef SEMUME #define SEMUME 10 /* max # of undo entries per process */ @@ -173,7 +189,7 @@ extern struct seminfo seminfo; /* actual size of an undo structure */ #define SEMUSZ (sizeof(struct sem_undo)+sizeof(struct undo)*SEMUME) -extern struct semid_ds **sema; /* semaphore id list */ +extern struct semid_ds_kern **sema; /* semaphore id list */ void seminit(void); void semexit(struct process *); diff --git a/lib/libc/include/generic-openbsd/sys/shm.h b/lib/libc/include/generic-openbsd/sys/shm.h index b3e2acabdab4686e95b27c888e7eff78087aa951..4e8ce9bfab2ef8039536551d0a77a3bc344eef7f 100644 --- a/lib/libc/include/generic-openbsd/sys/shm.h +++ b/lib/libc/include/generic-openbsd/sys/shm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: shm.h,v 1.31 2024/10/26 05:39:03 jsg Exp $ */ +/* $OpenBSD: shm.h,v 1.33 2026/09/16 16:37:39 mvs Exp $ */ /* $NetBSD: shm.h,v 1.20 1996/04/09 20:55:35 cgd Exp $ */ /* @@ -126,8 +126,24 @@ struct shm_sysctl_info { #endif /* __BSD_VISIBLE */ #ifdef _KERNEL +extern struct rwlock sysvshm_lock; extern struct shminfo shminfo; -extern struct shmid_ds **shmsegs; +extern struct shmid_ds_kern **shmsegs; + +struct shmid_ds_kern { + struct ipc_perm shm_perm; /* operation permission structure */ + int shm_segsz; /* size of segment in bytes */ + pid_t shm_lpid; /* process ID of last shm op */ + pid_t shm_cpid; /* process ID of creator */ + uint64_t shm_nattch; /* number of current attaches */ + time_t shm_atime; /* time of last shmat() */ + long __shm_atimensec; + time_t shm_dtime; /* time of last shmdt() */ + long __shm_dtimensec; + time_t shm_ctime; /* time of last change by shmctl() */ + long __shm_ctimensec; + void *shm_internal; /* implementation specific data */ +}; struct vmspace; diff --git a/lib/libc/include/generic-openbsd/sys/socketvar.h b/lib/libc/include/generic-openbsd/sys/socketvar.h index 6837a7cee95899454d071bb561713c826480cd34..c683bff5cbd3e85df782e79628631f53df69f924 100644 --- a/lib/libc/include/generic-openbsd/sys/socketvar.h +++ b/lib/libc/include/generic-openbsd/sys/socketvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: socketvar.h,v 1.160 2025/10/24 15:09:56 bluhm Exp $ */ +/* $OpenBSD: socketvar.h,v 1.161 2026/06/11 12:50:52 bluhm Exp $ */ /* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */ /*- @@ -68,7 +68,7 @@ TAILQ_HEAD(soqhead, socket); */ struct sosplice { struct socket *ssp_socket; /* [mr ms] send data to drain socket */ - struct socket *ssp_soback; /* [ms ms] back ref to source socket */ + struct socket *ssp_soback; /* [mr ms] back ref to source socket */ off_t ssp_len; /* [mr] number of bytes spliced */ off_t ssp_max; /* [I] maximum number of bytes */ struct timeval ssp_idletv; /* [I] idle timeout */ diff --git a/lib/libc/include/generic-openbsd/sys/syscall.h b/lib/libc/include/generic-openbsd/sys/syscall.h index 4ae1c5bab76e4b8f808296c3c220b59e33f0de97..4c36c17d49f4909050b6ef816201125770a5d39b 100644 --- a/lib/libc/include/generic-openbsd/sys/syscall.h +++ b/lib/libc/include/generic-openbsd/sys/syscall.h @@ -1,10 +1,10 @@ -/* $OpenBSD: syscall.h,v 1.284 2026/03/08 16:41:35 deraadt Exp $ */ +/* $OpenBSD: syscall.h,v 1.286 2026/08/12 15:05:21 naddy Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.271 2026/03/08 16:41:21 deraadt Exp + * created from; OpenBSD: syscalls.master,v 1.272 2026/06/02 21:46:21 deraadt Exp */ /* syscall: "exit" ret: "void" args: "int" */ @@ -426,7 +426,7 @@ /* syscall: "setsid" ret: "int" args: */ #define SYS_setsid 147 -/* syscall: "quotactl" ret: "int" args: "const char *" "int" "int" "char *" */ +/* syscall: "quotactl" ret: "int" args: "const char *" "int" "int" "void *" */ #define SYS_quotactl 148 /* 149 is obsolete oquota */ @@ -452,9 +452,7 @@ /* 162 is obsolete ogetdomainname */ /* 163 is obsolete osetdomainname */ -/* syscall: "__tmpfd" ret: "int" args: "int" */ -#define SYS___tmpfd 164 - + /* 164 is obsolete __tmpfd */ /* syscall: "sysarch" ret: "int" args: "int" "void *" */ #define SYS_sysarch 165 diff --git a/lib/libc/include/generic-openbsd/sys/syscallargs.h b/lib/libc/include/generic-openbsd/sys/syscallargs.h index bd45b93a35c17878bb805a3512d003745f6ce8b0..e77248f30e51ab608c6caa1376cd77fb9b39d4a9 100644 --- a/lib/libc/include/generic-openbsd/sys/syscallargs.h +++ b/lib/libc/include/generic-openbsd/sys/syscallargs.h @@ -1,10 +1,10 @@ -/* $OpenBSD: syscallargs.h,v 1.287 2026/03/08 16:41:35 deraadt Exp $ */ +/* $OpenBSD: syscallargs.h,v 1.289 2026/08/12 15:05:21 naddy Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from; OpenBSD: syscalls.master,v 1.271 2026/03/08 16:41:21 deraadt Exp + * created from; OpenBSD: syscalls.master,v 1.272 2026/06/02 21:46:21 deraadt Exp */ #ifdef syscallarg @@ -726,7 +726,7 @@ struct sys_quotactl_args { syscallarg(const char *) path; syscallarg(int) cmd; syscallarg(int) uid; - syscallarg(char *) arg; + syscallarg(void *) arg; }; struct sys_ypconnect_args { @@ -762,10 +762,6 @@ struct sys_getfh_args { syscallarg(fhandle_t *) fhp; }; -struct sys___tmpfd_args { - syscallarg(int) flags; -}; - struct sys_sysarch_args { syscallarg(int) op; syscallarg(void *) parms; @@ -1323,7 +1319,6 @@ int sys_pinsyscalls(struct proc *, void *, register_t *); int sys_mimmutable(struct proc *, void *, register_t *); int sys_waitid(struct proc *, void *, register_t *); int sys_getfh(struct proc *, void *, register_t *); -int sys___tmpfd(struct proc *, void *, register_t *); int sys_sysarch(struct proc *, void *, register_t *); int sys_lseek(struct proc *, void *, register_t *); int sys_truncate(struct proc *, void *, register_t *); diff --git a/lib/libc/include/generic-openbsd/sys/systm.h b/lib/libc/include/generic-openbsd/sys/systm.h index 1a1aad82305068730915fd4bd3697be3e474b50e..e477c103f3d74a80060c9212b59acc1c3a81d185 100644 --- a/lib/libc/include/generic-openbsd/sys/systm.h +++ b/lib/libc/include/generic-openbsd/sys/systm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: systm.h,v 1.177 2025/07/28 05:08:35 dlg Exp $ */ +/* $OpenBSD: systm.h,v 1.179 2026/04/22 01:51:37 jsg Exp $ */ /* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */ /*- @@ -149,8 +149,6 @@ extern void (*v_putc)(int); /* Virtual console putc routine */ */ int nullop(void *); int enodev(void); -int enosys(void); -int enoioctl(void); int enxio(void); int eopnotsupp(void *); diff --git a/lib/libc/include/generic-openbsd/sys/tty.h b/lib/libc/include/generic-openbsd/sys/tty.h index cb60f9347624f9ea4ec815dff28c280fd8b4507c..f919d24125264b2f9f8bf8380f52cda78b27525f 100644 --- a/lib/libc/include/generic-openbsd/sys/tty.h +++ b/lib/libc/include/generic-openbsd/sys/tty.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.h,v 1.45 2025/09/25 08:46:50 mvs Exp $ */ +/* $OpenBSD: tty.h,v 1.46 2026/08/06 20:38:02 claudio Exp $ */ /* $NetBSD: tty.h,v 1.30.4.1 1996/06/02 09:08:13 mrg Exp $ */ /*- @@ -146,7 +146,7 @@ struct itty { short t_lowat; short t_column; int t_state; - struct session *t_session; + pid_t t_session_id; pid_t t_pgrp_pg_id; u_char t_line; }; diff --git a/lib/libc/include/generic-openbsd/sys/videoio.h b/lib/libc/include/generic-openbsd/sys/videoio.h index c996daac60e8e210539c85e18076aa1b96f4599d..5f9ef309add7101f861634b7f35dbf4d2cc9ef4e 100644 --- a/lib/libc/include/generic-openbsd/sys/videoio.h +++ b/lib/libc/include/generic-openbsd/sys/videoio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: videoio.h,v 1.29 2026/02/19 20:42:45 kirill Exp $ */ +/* $OpenBSD: videoio.h,v 1.31 2026/09/13 11:04:09 kirill Exp $ */ /* * Video for Linux Two header file @@ -577,6 +577,8 @@ enum v4l2_mpeg_video_intra_refresh_period_type { V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC = 1, }; +#define V4L2_CID_MPEG_VIDEO_BACKGROUND_DETECTION (V4L2_CID_CODEC_BASE + 238) + /* CIDs for the MPEG-2 Part 2 (H.262) codec */ #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270) enum v4l2_mpeg_video_mpeg2_level { @@ -4498,6 +4500,10 @@ struct v4l2_pix_format { #define V4L2_META_FMT_MALI_C55_PARAMS v4l2_fourcc('C', '5', '5', 'P') /* ARM Mali-C55 Parameters */ #define V4L2_META_FMT_MALI_C55_STATS v4l2_fourcc('C', '5', '5', 'S') /* ARM Mali-C55 3A Statistics */ +/* Vendor specific - used for Dreamchip RPP-X1 ISP */ +#define V4L2_META_FMT_RPPX1_PARAMS v4l2_fourcc('D', 'R', '1', 'P') /* Dreamchip RPP-X1 Parameters */ +#define V4L2_META_FMT_RPPX1_STATS v4l2_fourcc('D', 'R', '1', 'S') /* Dreamchip RPP-X1 Statistics */ + /* priv field value to indicates that subsequent fields are valid. */ #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe diff --git a/lib/libc/include/generic-openbsd/unistd.h b/lib/libc/include/generic-openbsd/unistd.h index 913233cd683c97fc83f6d581ea6060116b02520f..906ae0f69fc1d4b96a72b583338be347039e6fa1 100644 --- a/lib/libc/include/generic-openbsd/unistd.h +++ b/lib/libc/include/generic-openbsd/unistd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unistd.h,v 1.113 2025/10/07 12:02:21 brynet Exp $ */ +/* $OpenBSD: unistd.h,v 1.115 2026/08/31 15:21:18 deraadt Exp $ */ /* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ /*- @@ -346,6 +346,9 @@ char *getcwd(char *, size_t) __attribute__((__bounded__(__string__,1,2))); gid_t getegid(void); uid_t geteuid(void); +#if __BSD_VISIBLE +int getexecpath(char *, size_t); +#endif gid_t getgid(void); int getgroups(int, gid_t *); char *getlogin(void); @@ -508,7 +511,7 @@ int mkstemps(char *, int); int nfssvc(int, void *); int profil(void *, size_t, size_t, unsigned long, unsigned int, int) __attribute__ ((__bounded__(__string__,1,2))); -int quotactl(const char *, int, int, char *); +int quotactl(const char *, int, int, void *); int rcmd(char **, int, const char *, const char *, const char *, int *); int rcmd_af(char **, int, const char *, diff --git a/lib/libc/include/generic-openbsd/uvm/uvm_extern.h b/lib/libc/include/generic-openbsd/uvm/uvm_extern.h index 9df72a98c1d8a3c19bbb3295a43589b263194b8c..9dc24fa48689c5f6883162007532db3bebae28ba 100644 --- a/lib/libc/include/generic-openbsd/uvm/uvm_extern.h +++ b/lib/libc/include/generic-openbsd/uvm/uvm_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_extern.h,v 1.187 2025/11/13 10:55:51 mpi Exp $ */ +/* $OpenBSD: uvm_extern.h,v 1.190 2026/07/24 15:03:50 kettenis Exp $ */ /* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */ /* @@ -139,7 +139,6 @@ typedef int vm_prot_t; #define UVM_PLA_NOWAIT 0x0002 /* can't sleep (need one of the two) */ #define UVM_PLA_ZERO 0x0004 /* zero all pages before returning */ #define UVM_PLA_TRYCONTIG 0x0008 /* try to allocate contig physmem */ -#define UVM_PLA_FAILOK 0x0010 /* caller can handle failure */ #define UVM_PLA_NOWAKE 0x0020 /* don't wake page daemon on failure */ #define UVM_PLA_USERESERVE 0x0040 /* can allocate from kernel reserve */ @@ -358,6 +357,7 @@ extern const struct kmem_pa_mode kp_zero; extern const struct kmem_pa_mode kp_dma; extern const struct kmem_pa_mode kp_dma_contig; extern const struct kmem_pa_mode kp_dma_zero; +extern const struct kmem_pa_mode kp_mbuf_contig; extern const struct kmem_pa_mode kp_pageable; extern const struct kmem_pa_mode kp_none; @@ -398,8 +398,6 @@ int uvm_pagealloc_multi(struct uvm_object *, voff_t, vsize_t, int); void uvm_pagerealloc(struct vm_page *, struct uvm_object *, voff_t); -int uvm_pagerealloc_multi(struct uvm_object *, voff_t, - vsize_t, int, struct uvm_constraint_range *); /* Actually, uvm_page_physload takes PF#s which need their own type */ void uvm_page_physload(paddr_t, paddr_t, paddr_t, paddr_t, int); diff --git a/lib/libc/include/generic-openbsd/uvm/uvm_page.h b/lib/libc/include/generic-openbsd/uvm/uvm_page.h index 14629231014481b2bffea926ef851dd3865eb1f1..9952b659041182f5bda3f047fa89a851c150f656 100644 --- a/lib/libc/include/generic-openbsd/uvm/uvm_page.h +++ b/lib/libc/include/generic-openbsd/uvm/uvm_page.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.h,v 1.73 2025/03/10 18:54:38 mpi Exp $ */ +/* $OpenBSD: uvm_page.h,v 1.74 2026/07/11 13:13:16 kettenis Exp $ */ /* $NetBSD: uvm_page.h,v 1.19 2000/12/28 08:24:55 chs Exp $ */ /* @@ -158,7 +158,7 @@ struct vm_page { #define PQ_AOBJ 0x00200000 /* page is part of an anonymous uvm_object */ #define PQ_SWAPBACKED (PQ_ANON|PQ_AOBJ) -#define PQ_ENCRYPT 0x00400000 /* page needs {en,de}cryption */ +#define PQ_ENCRYPT 0x00400000 /* page needs {en,de}cryption */ #define PQ_MASK 0x00ff0000 #define PG_PMAP0 0x01000000 /* Used by some pmaps. */ diff --git a/lib/libc/include/generic-openbsd/uvm/uvm_pager.h b/lib/libc/include/generic-openbsd/uvm/uvm_pager.h index 1196c6a4ec4d98d5a67e4e91f601c65491d2ccd3..5f92a77b6dc022237b714e6141826961bf723217 100644 --- a/lib/libc/include/generic-openbsd/uvm/uvm_pager.h +++ b/lib/libc/include/generic-openbsd/uvm/uvm_pager.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pager.h,v 1.34 2025/12/18 16:05:18 mpi Exp $ */ +/* $OpenBSD: uvm_pager.h,v 1.35 2026/07/07 17:32:56 kettenis Exp $ */ /* $NetBSD: uvm_pager.h,v 1.20 2000/11/27 08:40:05 chs Exp $ */ /* @@ -130,6 +130,7 @@ vaddr_t uvm_pagermapin(struct vm_page **, int, int); void uvm_pagermapout(vaddr_t, int); struct vm_page **uvm_mk_pcluster(struct uvm_object *, struct vm_page **, int *, struct vm_page *, int, voff_t, voff_t); +int uvm_pseg_reserve_available(void); /* Flags to uvm_pagermapin() */ #define UVMPAGER_MAPIN_WAITOK 0x01 /* it's okay to wait */ diff --git a/lib/libc/include/generic-openbsd/uvm/uvm_pmemrange.h b/lib/libc/include/generic-openbsd/uvm/uvm_pmemrange.h index c34dfba7b2032391940ac0bfaf939130a0988d9c..c7926385cf3a454a458fbf1f8a833d0a5e0d809e 100644 --- a/lib/libc/include/generic-openbsd/uvm/uvm_pmemrange.h +++ b/lib/libc/include/generic-openbsd/uvm/uvm_pmemrange.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pmemrange.h,v 1.20 2026/01/28 21:09:41 deraadt Exp $ */ +/* $OpenBSD: uvm_pmemrange.h,v 1.21 2026/07/24 15:03:50 kettenis Exp $ */ /* * Copyright (c) 2009 Ariane van der Steldt @@ -56,53 +56,6 @@ struct uvm_pmemrange { /* pmr, sorted by address */ }; -/* - * Description of failing memory allocation. - * - * Every descriptor corresponds to a request for the page daemon to release - * pages in a given memory range. There is one global descriptor for nowait - * allocations, all others are sitting on the stack of processes waiting for - * physical pages. - * - * There are multiple ways physical pages can become available: - * [1] unmanaged pages are released by shrinkers (bufbackoff(), drmbackoff()...) - * [2] page daemon drops them (we notice because they are freed) - * [3] a process calls free or exit - * - * The buffer cache and page daemon can decide that they don't have the - * ability to make pages available in the requested range. In that case, - * the FAIL bit will be set. - * XXX There's a possibility that a page is no longer on the queues but - * XXX has not yet been freed, or that a page was busy. - * XXX Also, wired pages are not considered for paging, so they could - * XXX cause a failure that may be recoverable. - * - * Locks used to protect struct members in this file: - * F uvm_lock_fpageq - * I immutable after creation - */ -struct uvm_pmalloc { - TAILQ_ENTRY(uvm_pmalloc) pmq; /* [F] next request */ - struct uvm_constraint_range pm_constraint; /* [I] memory range */ - psize_t pm_size; /* [I] # pages */ - int pm_flags; /* [F] states flags */ -}; - -/* - * Indicate to the page daemon that a nowait call failed and it should - * recover at least some memory in the most restricted region (assumed - * to be dma_constraint). - */ -extern struct uvm_pmalloc nowait_pma; /* [F] */ - - -/* - * uvm_pmalloc flags. - */ -#define UVM_PMA_LINKED 0x01 /* uvm_pmalloc is on list */ -#define UVM_PMA_FAIL 0x10 /* page daemon cannot free pages */ -#define UVM_PMA_FREED 0x20 /* at least one page in the range was freed */ - RBT_HEAD(uvm_pmemrange_addr, uvm_pmemrange); TAILQ_HEAD(uvm_pmemrange_use, uvm_pmemrange); @@ -112,9 +65,6 @@ TAILQ_HEAD(uvm_pmemrange_use, uvm_pmemrange); struct uvm_pmr_control { struct uvm_pmemrange_addr addr; struct uvm_pmemrange_use use; - - /* Only changed while fpageq is locked. */ - TAILQ_HEAD(, uvm_pmalloc) allocs; }; void uvm_pmr_freepages(struct vm_page *, psize_t); diff --git a/lib/libc/include/generic-openbsd/uvm/uvm_swap.h b/lib/libc/include/generic-openbsd/uvm/uvm_swap.h index 1f2600c4a9c86b722d5405a4ac9f790ebd850f83..16a6fefdfa580c814e498f69ec3e99d3f94503e1 100644 --- a/lib/libc/include/generic-openbsd/uvm/uvm_swap.h +++ b/lib/libc/include/generic-openbsd/uvm/uvm_swap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.h,v 1.22 2026/04/11 01:36:23 deraadt Exp $ */ +/* $OpenBSD: uvm_swap.h,v 1.23 2026/07/11 13:13:16 kettenis Exp $ */ /* $NetBSD: uvm_swap.h,v 1.5 2000/01/11 06:57:51 chs Exp $ */ /* @@ -37,7 +37,8 @@ #ifdef _KERNEL -int uvm_swap_dropcluster(struct vm_page **, int, int); +int uvm_swap_dropcluster(struct vm_page **, int, int, + vaddr_t); int uvm_swap_get(struct vm_page *, int, int); int uvm_swap_put(int, struct vm_page **, int, int); int uvm_swap_alloc(int *, boolean_t); @@ -46,12 +47,17 @@ void uvm_swap_markbad(int, int); int uvm_swapisfilled(void); int uvm_swapisfull(void); void uvm_swap_freepages(struct vm_page **, int); +struct swapdev *uvm_swap_getsdp(int); #ifdef HIBERNATE int uvm_hibswap(dev_t, u_long *, u_long *); #endif /* HIBERNATE */ #ifdef UVM_SWAP_ENCRYPT void uvm_swap_initcrypt_all(void); void uvm_swap_finicrypt_all(void); +void uvm_swap_encryptpg(struct swapdev *, caddr_t, caddr_t, + int); +int uvm_swap_decryptpg(struct swapdev *, caddr_t, caddr_t, + int); #endif extern volatile int seb_free; diff --git a/lib/libc/include/generic-openbsd/uvm/uvm_swap_encrypt.h b/lib/libc/include/generic-openbsd/uvm/uvm_swap_encrypt.h index 3b46dfa05b324c725d9d175606202262dab643f0..131ed4d2e16f5a157155cdee406d0caef1fa0279 100644 --- a/lib/libc/include/generic-openbsd/uvm/uvm_swap_encrypt.h +++ b/lib/libc/include/generic-openbsd/uvm/uvm_swap_encrypt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap_encrypt.h,v 1.14 2024/11/07 09:04:55 jsg Exp $ */ +/* $OpenBSD: uvm_swap_encrypt.h,v 1.15 2026/08/13 21:08:17 kettenis Exp $ */ /* * Copyright 1999 Niels Provos @@ -51,6 +51,11 @@ struct swap_key { u_int16_t refcount; /* pages that still need it */ }; +extern int (*swap_key_prepare_fcn)(struct swap_key *, int); +extern void (*swap_key_cleanup_fcn)(void); +extern void (*swap_encrypt_fcn)(caddr_t, caddr_t, u_int64_t, size_t); +extern void (*swap_decrypt_fcn)(caddr_t, caddr_t, u_int64_t, size_t); + int swap_encrypt_ctl(int *, u_int, void *, size_t *, void *, size_t, struct proc *); diff --git a/lib/libc/include/generic-openbsd/machine/_float.h b/lib/libc/include/mips64-openbsd-none/machine/_float.h similarity index 100% rename from lib/libc/include/generic-openbsd/machine/_float.h rename to lib/libc/include/mips64-openbsd-none/machine/_float.h diff --git a/lib/libc/include/generic-openbsd/machine/cdefs.h b/lib/libc/include/mips64-openbsd-none/machine/cdefs.h similarity index 100% rename from lib/libc/include/generic-openbsd/machine/cdefs.h rename to lib/libc/include/mips64-openbsd-none/machine/cdefs.h diff --git a/lib/libc/include/generic-openbsd/machine/disklabel.h b/lib/libc/include/mips64-openbsd-none/machine/disklabel.h similarity index 100% rename from lib/libc/include/generic-openbsd/machine/disklabel.h rename to lib/libc/include/mips64-openbsd-none/machine/disklabel.h diff --git a/lib/libc/include/generic-openbsd/machine/fenv.h b/lib/libc/include/mips64-openbsd-none/machine/fenv.h similarity index 100% rename from lib/libc/include/generic-openbsd/machine/fenv.h rename to lib/libc/include/mips64-openbsd-none/machine/fenv.h diff --git a/lib/libc/include/generic-openbsd/machine/loadfile_machdep.h b/lib/libc/include/mips64-openbsd-none/machine/loadfile_machdep.h similarity index 100% rename from lib/libc/include/generic-openbsd/machine/loadfile_machdep.h rename to lib/libc/include/mips64-openbsd-none/machine/loadfile_machdep.h diff --git a/lib/libc/include/mips64-openbsd-none/machine/octeonvar.h b/lib/libc/include/mips64-openbsd-none/machine/octeonvar.h index 14faf6c185d4774e1375b1e04165437d0e9c297b..482ffa78db08f91d624afbf750e25be29bfa3bba 100644 --- a/lib/libc/include/mips64-openbsd-none/machine/octeonvar.h +++ b/lib/libc/include/mips64-openbsd-none/machine/octeonvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: octeonvar.h,v 1.55 2025/12/30 22:55:07 jsg Exp $ */ +/* $OpenBSD: octeonvar.h,v 1.56 2026/07/13 13:41:25 kirill Exp $ */ /* $NetBSD: maltavar.h,v 1.3 2002/03/18 10:10:16 simonb Exp $ */ /*- @@ -96,7 +96,7 @@ struct octeon_config { #define OCTEON_POOL_NELEMS_PKT 4096 #define OCTEON_POOL_NELEMS_WQE 4096 -#define OCTEON_POOL_NELEMS_CMD 32 +#define OCTEON_POOL_NELEMS_CMD 256 #define OCTEON_POOL_NELEMS_SG 4096 #define OCTEON_POOL_NELEMS_XXX_4 0 #define OCTEON_POOL_NELEMS_XXX_5 0 diff --git a/lib/libc/include/generic-openbsd/machine/reloc.h b/lib/libc/include/mips64-openbsd-none/machine/reloc.h similarity index 100% rename from lib/libc/include/generic-openbsd/machine/reloc.h rename to lib/libc/include/mips64-openbsd-none/machine/reloc.h diff --git a/lib/libc/include/generic-openbsd/machine/tcb.h b/lib/libc/include/mips64-openbsd-none/machine/tcb.h similarity index 100% rename from lib/libc/include/generic-openbsd/machine/tcb.h rename to lib/libc/include/mips64-openbsd-none/machine/tcb.h diff --git a/lib/libc/include/generic-openbsd/mips64/_float.h b/lib/libc/include/mips64-openbsd-none/mips64/_float.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/_float.h rename to lib/libc/include/mips64-openbsd-none/mips64/_float.h diff --git a/lib/libc/include/generic-openbsd/mips64/_types.h b/lib/libc/include/mips64-openbsd-none/mips64/_types.h similarity index 97% rename from lib/libc/include/generic-openbsd/mips64/_types.h rename to lib/libc/include/mips64-openbsd-none/mips64/_types.h index ca5dbe7d7bd2cd6ed9e0a8e483923646b7111780..261df280d0f0e67255ca1bdb05b98bc91c0d8012 100644 --- a/lib/libc/include/generic-openbsd/mips64/_types.h +++ b/lib/libc/include/mips64-openbsd-none/mips64/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.25 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.26 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -127,11 +127,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/generic-openbsd/mips64/archtype.h b/lib/libc/include/mips64-openbsd-none/mips64/archtype.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/archtype.h rename to lib/libc/include/mips64-openbsd-none/mips64/archtype.h diff --git a/lib/libc/include/generic-openbsd/mips64/asm.h b/lib/libc/include/mips64-openbsd-none/mips64/asm.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/asm.h rename to lib/libc/include/mips64-openbsd-none/mips64/asm.h diff --git a/lib/libc/include/generic-openbsd/mips64/atomic.h b/lib/libc/include/mips64-openbsd-none/mips64/atomic.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/atomic.h rename to lib/libc/include/mips64-openbsd-none/mips64/atomic.h diff --git a/lib/libc/include/generic-openbsd/mips64/autoconf.h b/lib/libc/include/mips64-openbsd-none/mips64/autoconf.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/autoconf.h rename to lib/libc/include/mips64-openbsd-none/mips64/autoconf.h diff --git a/lib/libc/include/generic-openbsd/mips64/cache.h b/lib/libc/include/mips64-openbsd-none/mips64/cache.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/cache.h rename to lib/libc/include/mips64-openbsd-none/mips64/cache.h diff --git a/lib/libc/include/generic-openbsd/mips64/cdefs.h b/lib/libc/include/mips64-openbsd-none/mips64/cdefs.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/cdefs.h rename to lib/libc/include/mips64-openbsd-none/mips64/cdefs.h diff --git a/lib/libc/include/generic-openbsd/mips64/cpu.h b/lib/libc/include/mips64-openbsd-none/mips64/cpu.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/cpu.h rename to lib/libc/include/mips64-openbsd-none/mips64/cpu.h diff --git a/lib/libc/include/generic-openbsd/mips64/cpustate.h b/lib/libc/include/mips64-openbsd-none/mips64/cpustate.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/cpustate.h rename to lib/libc/include/mips64-openbsd-none/mips64/cpustate.h diff --git a/lib/libc/include/generic-openbsd/mips64/db_machdep.h b/lib/libc/include/mips64-openbsd-none/mips64/db_machdep.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/db_machdep.h rename to lib/libc/include/mips64-openbsd-none/mips64/db_machdep.h diff --git a/lib/libc/include/generic-openbsd/mips64/elf.h b/lib/libc/include/mips64-openbsd-none/mips64/elf.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/elf.h rename to lib/libc/include/mips64-openbsd-none/mips64/elf.h diff --git a/lib/libc/include/generic-openbsd/mips64/endian.h b/lib/libc/include/mips64-openbsd-none/mips64/endian.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/endian.h rename to lib/libc/include/mips64-openbsd-none/mips64/endian.h diff --git a/lib/libc/include/generic-openbsd/mips64/exec.h b/lib/libc/include/mips64-openbsd-none/mips64/exec.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/exec.h rename to lib/libc/include/mips64-openbsd-none/mips64/exec.h diff --git a/lib/libc/include/generic-openbsd/mips64/fenv.h b/lib/libc/include/mips64-openbsd-none/mips64/fenv.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/fenv.h rename to lib/libc/include/mips64-openbsd-none/mips64/fenv.h diff --git a/lib/libc/include/generic-openbsd/mips64/fpu.h b/lib/libc/include/mips64-openbsd-none/mips64/fpu.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/fpu.h rename to lib/libc/include/mips64-openbsd-none/mips64/fpu.h diff --git a/lib/libc/include/generic-openbsd/mips64/frame.h b/lib/libc/include/mips64-openbsd-none/mips64/frame.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/frame.h rename to lib/libc/include/mips64-openbsd-none/mips64/frame.h diff --git a/lib/libc/include/generic-openbsd/mips64/ieee.h b/lib/libc/include/mips64-openbsd-none/mips64/ieee.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/ieee.h rename to lib/libc/include/mips64-openbsd-none/mips64/ieee.h diff --git a/lib/libc/include/generic-openbsd/mips64/ieeefp.h b/lib/libc/include/mips64-openbsd-none/mips64/ieeefp.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/ieeefp.h rename to lib/libc/include/mips64-openbsd-none/mips64/ieeefp.h diff --git a/lib/libc/include/generic-openbsd/mips64/kcore.h b/lib/libc/include/mips64-openbsd-none/mips64/kcore.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/kcore.h rename to lib/libc/include/mips64-openbsd-none/mips64/kcore.h diff --git a/lib/libc/include/generic-openbsd/mips64/limits.h b/lib/libc/include/mips64-openbsd-none/mips64/limits.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/limits.h rename to lib/libc/include/mips64-openbsd-none/mips64/limits.h diff --git a/lib/libc/include/generic-openbsd/mips64/loongson2.h b/lib/libc/include/mips64-openbsd-none/mips64/loongson2.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/loongson2.h rename to lib/libc/include/mips64-openbsd-none/mips64/loongson2.h diff --git a/lib/libc/include/generic-openbsd/mips64/loongson3.h b/lib/libc/include/mips64-openbsd-none/mips64/loongson3.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/loongson3.h rename to lib/libc/include/mips64-openbsd-none/mips64/loongson3.h diff --git a/lib/libc/include/generic-openbsd/mips64/memconf.h b/lib/libc/include/mips64-openbsd-none/mips64/memconf.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/memconf.h rename to lib/libc/include/mips64-openbsd-none/mips64/memconf.h diff --git a/lib/libc/include/generic-openbsd/mips64/mips_cpu.h b/lib/libc/include/mips64-openbsd-none/mips64/mips_cpu.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/mips_cpu.h rename to lib/libc/include/mips64-openbsd-none/mips64/mips_cpu.h diff --git a/lib/libc/include/generic-openbsd/mips64/mips_opcode.h b/lib/libc/include/mips64-openbsd-none/mips64/mips_opcode.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/mips_opcode.h rename to lib/libc/include/mips64-openbsd-none/mips64/mips_opcode.h diff --git a/lib/libc/include/generic-openbsd/mips64/mplock.h b/lib/libc/include/mips64-openbsd-none/mips64/mplock.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/mplock.h rename to lib/libc/include/mips64-openbsd-none/mips64/mplock.h diff --git a/lib/libc/include/generic-openbsd/mips64/mutex.h b/lib/libc/include/mips64-openbsd-none/mips64/mutex.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/mutex.h rename to lib/libc/include/mips64-openbsd-none/mips64/mutex.h diff --git a/lib/libc/include/generic-openbsd/mips64/param.h b/lib/libc/include/mips64-openbsd-none/mips64/param.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/param.h rename to lib/libc/include/mips64-openbsd-none/mips64/param.h diff --git a/lib/libc/include/generic-openbsd/mips64/pcb.h b/lib/libc/include/mips64-openbsd-none/mips64/pcb.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/pcb.h rename to lib/libc/include/mips64-openbsd-none/mips64/pcb.h diff --git a/lib/libc/include/generic-openbsd/mips64/pmap.h b/lib/libc/include/mips64-openbsd-none/mips64/pmap.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/pmap.h rename to lib/libc/include/mips64-openbsd-none/mips64/pmap.h diff --git a/lib/libc/include/generic-openbsd/mips64/proc.h b/lib/libc/include/mips64-openbsd-none/mips64/proc.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/proc.h rename to lib/libc/include/mips64-openbsd-none/mips64/proc.h diff --git a/lib/libc/include/generic-openbsd/mips64/profile.h b/lib/libc/include/mips64-openbsd-none/mips64/profile.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/profile.h rename to lib/libc/include/mips64-openbsd-none/mips64/profile.h diff --git a/lib/libc/include/generic-openbsd/mips64/pte.h b/lib/libc/include/mips64-openbsd-none/mips64/pte.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/pte.h rename to lib/libc/include/mips64-openbsd-none/mips64/pte.h diff --git a/lib/libc/include/generic-openbsd/mips64/ptrace.h b/lib/libc/include/mips64-openbsd-none/mips64/ptrace.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/ptrace.h rename to lib/libc/include/mips64-openbsd-none/mips64/ptrace.h diff --git a/lib/libc/include/generic-openbsd/mips64/reg.h b/lib/libc/include/mips64-openbsd-none/mips64/reg.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/reg.h rename to lib/libc/include/mips64-openbsd-none/mips64/reg.h diff --git a/lib/libc/include/generic-openbsd/mips64/regdef.h b/lib/libc/include/mips64-openbsd-none/mips64/regdef.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/regdef.h rename to lib/libc/include/mips64-openbsd-none/mips64/regdef.h diff --git a/lib/libc/include/generic-openbsd/mips64/regnum.h b/lib/libc/include/mips64-openbsd-none/mips64/regnum.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/regnum.h rename to lib/libc/include/mips64-openbsd-none/mips64/regnum.h diff --git a/lib/libc/include/generic-openbsd/mips64/reloc.h b/lib/libc/include/mips64-openbsd-none/mips64/reloc.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/reloc.h rename to lib/libc/include/mips64-openbsd-none/mips64/reloc.h diff --git a/lib/libc/include/generic-openbsd/mips64/setjmp.h b/lib/libc/include/mips64-openbsd-none/mips64/setjmp.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/setjmp.h rename to lib/libc/include/mips64-openbsd-none/mips64/setjmp.h diff --git a/lib/libc/include/generic-openbsd/mips64/signal.h b/lib/libc/include/mips64-openbsd-none/mips64/signal.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/signal.h rename to lib/libc/include/mips64-openbsd-none/mips64/signal.h diff --git a/lib/libc/include/generic-openbsd/mips64/spinlock.h b/lib/libc/include/mips64-openbsd-none/mips64/spinlock.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/spinlock.h rename to lib/libc/include/mips64-openbsd-none/mips64/spinlock.h diff --git a/lib/libc/include/generic-openbsd/mips64/sysarch.h b/lib/libc/include/mips64-openbsd-none/mips64/sysarch.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/sysarch.h rename to lib/libc/include/mips64-openbsd-none/mips64/sysarch.h diff --git a/lib/libc/include/generic-openbsd/mips64/tcb.h b/lib/libc/include/mips64-openbsd-none/mips64/tcb.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/tcb.h rename to lib/libc/include/mips64-openbsd-none/mips64/tcb.h diff --git a/lib/libc/include/generic-openbsd/mips64/timetc.h b/lib/libc/include/mips64-openbsd-none/mips64/timetc.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/timetc.h rename to lib/libc/include/mips64-openbsd-none/mips64/timetc.h diff --git a/lib/libc/include/generic-openbsd/mips64/trap.h b/lib/libc/include/mips64-openbsd-none/mips64/trap.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/trap.h rename to lib/libc/include/mips64-openbsd-none/mips64/trap.h diff --git a/lib/libc/include/generic-openbsd/mips64/vmparam.h b/lib/libc/include/mips64-openbsd-none/mips64/vmparam.h similarity index 100% rename from lib/libc/include/generic-openbsd/mips64/vmparam.h rename to lib/libc/include/mips64-openbsd-none/mips64/vmparam.h diff --git a/lib/libc/include/mips64-openbsd-none/octeon/octeonvar.h b/lib/libc/include/mips64-openbsd-none/octeon/octeonvar.h index 14faf6c185d4774e1375b1e04165437d0e9c297b..482ffa78db08f91d624afbf750e25be29bfa3bba 100644 --- a/lib/libc/include/mips64-openbsd-none/octeon/octeonvar.h +++ b/lib/libc/include/mips64-openbsd-none/octeon/octeonvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: octeonvar.h,v 1.55 2025/12/30 22:55:07 jsg Exp $ */ +/* $OpenBSD: octeonvar.h,v 1.56 2026/07/13 13:41:25 kirill Exp $ */ /* $NetBSD: maltavar.h,v 1.3 2002/03/18 10:10:16 simonb Exp $ */ /*- @@ -96,7 +96,7 @@ struct octeon_config { #define OCTEON_POOL_NELEMS_PKT 4096 #define OCTEON_POOL_NELEMS_WQE 4096 -#define OCTEON_POOL_NELEMS_CMD 32 +#define OCTEON_POOL_NELEMS_CMD 256 #define OCTEON_POOL_NELEMS_SG 4096 #define OCTEON_POOL_NELEMS_XXX_4 0 #define OCTEON_POOL_NELEMS_XXX_5 0 diff --git a/lib/libc/include/mips64el-openbsd-none/frame.h b/lib/libc/include/mips64el-openbsd-none/frame.h deleted file mode 100644 index d14827e33c0e4797ab96d1648b847715e058d110..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/frame.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: frame.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/_float.h b/lib/libc/include/mips64el-openbsd-none/loongson/_float.h deleted file mode 100644 index 6c9717939fcba76197bbb74f2517fbf45ecfe782..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/_float.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: _float.h,v 1.1 2012/06/26 16:12:44 deraadt Exp $ */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/_types.h b/lib/libc/include/mips64el-openbsd-none/loongson/_types.h deleted file mode 100644 index 327e3d3e38ff025d3e5bc0b211c50354c5887659..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/_types.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: _types.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/apmvar.h b/lib/libc/include/mips64el-openbsd-none/loongson/apmvar.h deleted file mode 100644 index 6e12da5dc5156fdd65bd30db86544c07540d1233..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/apmvar.h +++ /dev/null @@ -1,127 +0,0 @@ -/* $OpenBSD: apmvar.h,v 1.8 2026/04/09 05:03:42 miod Exp $ */ - -/* - * Copyright (c) 2001 Alexander Guy - * Copyright (c) 1995 John T. Kohl - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef _MACHINE_APMVAR_H_ -#define _MACHINE_APMVAR_H_ - -#include - -/* Advanced Power Management (v1.0 and v1.1 specification) - * functions/defines/etc. - */ - -/* These definitions make up the heart of the user-land interface - * to the APM devices. - */ - -#define APM_AC_OFF 0x00 -#define APM_AC_ON 0x01 -#define APM_AC_BACKUP 0x02 -#define APM_AC_UNKNOWN 0xff -#define APM_BATT_HIGH 0x00 -#define APM_BATT_LOW 0x01 -#define APM_BATT_CRITICAL 0x02 -#define APM_BATT_CHARGING 0x03 -#define APM_BATT_UNKNOWN 0xff -#define APM_BATT_LIFE_UNKNOWN 0xff - -#define APM_NOEVENT 0x0000 -#define APM_STANDBY_REQ 0x0001 -#define APM_SUSPEND_REQ 0x0002 -#define APM_NORMAL_RESUME 0x0003 -#define APM_CRIT_RESUME 0x0004 /* suspend/resume happened - without us */ -#define APM_BATTERY_LOW 0x0005 -#define APM_POWER_CHANGE 0x0006 -#define APM_UPDATE_TIME 0x0007 -#define APM_CRIT_SUSPEND_REQ 0x0008 -#define APM_USER_STANDBY_REQ 0x0009 -#define APM_USER_SUSPEND_REQ 0x000A -#define APM_SYS_STANDBY_RESUME 0x000B -#define APM_CAPABILITY_CHANGE 0x000C /* apm v1.2 */ -#define APM_USER_HIBERNATE_REQ 0x000D -#define APM_EVENT_MASK 0xffff - -#define APM_EVENT_COMPOSE(t,i) ((((i) & 0x7fff) << 16)|((t) & APM_EVENT_MASK)) -#define APM_EVENT_TYPE(e) ((e) & APM_EVENT_MASK) -#define APM_EVENT_INDEX(e) ((e) >> 16) - -/* - * LP (Laptop Package) - * - * Copyright (C) 1994 by HOSOKAWA Tatsumi - * - * This software may be used, modified, copied, and distributed, in - * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its - * use. - * - * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) - */ - -#define APM_BATTERY_ABSENT 4 - -struct apm_power_info { - u_char battery_state; - u_char ac_state; - u_char battery_life; - u_char spare1; - u_int minutes_left; /* estimate */ - u_int spare2[6]; -}; - -struct apm_ctl { - u_int dev; - u_int mode; -}; - -#define APM_IOC_REJECT _IOW('A', 0, struct apm_event_info) /* reject request # */ -#define APM_IOC_STANDBY _IO('A', 1) /* put system into standby */ -#define APM_IOC_SUSPEND _IO('A', 2) /* put system into suspend */ -#define APM_IOC_GETPOWER _IOR('A', 3, struct apm_power_info) /* fetch battery state */ -#define APM_IOC_DEV_CTL _IOW('A', 5, struct apm_ctl) /* put device into mode */ -#define APM_IOC_PRN_CTL _IOW('A', 6, int ) /* driver power status msg */ -#define APM_PRINT_ON 0 /* driver power status displayed */ -#define APM_PRINT_OFF 1 /* driver power status not displayed */ -#define APM_PRINT_PCT 2 /* driver power status only displayed - if the percentage changes */ -#define APM_IOC_STANDBY_REQ _IO('A', 7) /* request standby */ -#define APM_IOC_SUSPEND_REQ _IO('A', 8) /* request suspend */ -#define APM_IOC_HIBERNATE _IO('A', 9) /* put system into hibernate */ - -#ifdef _KERNEL -void apm_setinfohook(int (*)(struct apm_power_info *)); -int apm_record_event(u_int, const char *, const char *); -#endif - -#endif /* _MACHINE_APMVAR_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/asm.h b/lib/libc/include/mips64el-openbsd-none/loongson/asm.h deleted file mode 100644 index 63eab175139b6d2bd0759f45c617f72e4bbce5da..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/asm.h +++ /dev/null @@ -1,9 +0,0 @@ -/* $OpenBSD: asm.h,v 1.2 2016/11/18 15:38:14 visa Exp $ */ -/* public domain */ - -#ifdef MULTIPROCESSOR -#define HW_GET_CPU_INFO(ci, tmp) \ - dmfc0 ci, COP_0_ERROR_PC -#endif - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/atomic.h b/lib/libc/include/mips64el-openbsd-none/loongson/atomic.h deleted file mode 100644 index 19aa2fd4f69b6d46c4242ab34787707f57884869..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/atomic.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: atomic.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/autoconf.h b/lib/libc/include/mips64el-openbsd-none/loongson/autoconf.h deleted file mode 100644 index 7292105a5be85a5d60330b6b3dc1cbd65797fa34..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/autoconf.h +++ /dev/null @@ -1,124 +0,0 @@ -/* $OpenBSD: autoconf.h,v 1.17 2017/05/21 13:00:53 visa Exp $ */ - -/* - * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - * Definitions used by autoconfiguration. - */ - -#ifndef _MACHINE_AUTOCONF_H_ -#define _MACHINE_AUTOCONF_H_ - -#include - -struct bonito_config; -struct htb_config; -struct mips_isa_chipset; - -/* - * List of legacy I/O ranges. - */ -struct legacy_io_range { - bus_addr_t start; - bus_size_t end; /* inclusive */ -}; - -/* - * Per platform information. - */ -struct platform { - int system_type; -#define LOONGSON_2E 0x0000 /* Generic Loongson 2E system */ -#define LOONGSON_YEELOONG 0x0001 /* Lemote Yeeloong */ -#define LOONGSON_GDIUM 0x0002 /* EMTEC Gdium Liberty */ -#define LOONGSON_FULOONG 0x0003 /* Lemote Fuloong */ -#define LOONGSON_LYNLOONG 0x0004 /* Lemote Lynloong */ -#define LOONGSON_EBT700 0x0005 /* eBenton EBT700 */ -#define LOONGSON_3A 0x0066 /* Loongson 2Gq or 3A based system */ - - char *vendor; - char *product; - - const struct bonito_config *bonito_config; - const struct htb_config *htb_config; - struct mips_isa_chipset *isa_chipset; - const struct legacy_io_range *legacy_io_ranges; - - void (*setup)(void); - void (*device_register)(struct device *, - void *); - - void (*powerdown)(void); - void (*reset)(void); - int (*suspend)(void); - int (*resume)(void); - -#ifdef MULTIPROCESSOR - void (*config_secondary_cpus)( - struct device *, cfprint_t); - void (*boot_secondary_cpu)( - struct cpu_info *); - int (*ipi_establish)(int (*)(void *), - cpuid_t); - void (*ipi_set)(cpuid_t); - void (*ipi_clear)(cpuid_t); -#endif /* MULTIPROCESSOR */ -}; - -#define LOONGSON_MAXCPUS 16 - -extern const struct platform *sys_platform; -extern void *loongson_videobios; -extern uint loongson_cpumask; -extern uint loongson_ver; -extern int nnodes; - -#ifdef MULTIPROCESSOR -extern uint64_t cpu_spinup_a0; -extern uint64_t cpu_spinup_sp; -#endif - -struct mainbus_attach_args { - const char *maa_name; -}; - -extern struct device *bootdv; -extern char bootdev[]; -extern enum devclass bootdev_class; - -extern bus_space_tag_t early_mem_t; -extern bus_space_tag_t early_io_t; - -#define REGVAL8(x) *((volatile uint8_t *)PHYS_TO_XKPHYS((x), CCA_NC)) -#define REGVAL32(x) *((volatile uint32_t *)PHYS_TO_XKPHYS((x), CCA_NC)) -#define REGVAL64(x) *((volatile uint64_t *)PHYS_TO_XKPHYS((x), CCA_NC)) - -#define REGVAL(x) REGVAL32(x) - -#include - -#endif /* _MACHINE_AUTOCONF_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/bus.h b/lib/libc/include/mips64el-openbsd-none/loongson/bus.h deleted file mode 100644 index 24430920dde3d01df663b8b0efaeecf2cf9e31e8..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/bus.h +++ /dev/null @@ -1,513 +0,0 @@ -/* $OpenBSD: bus.h,v 1.8 2020/04/14 17:35:28 kettenis Exp $ */ - -/* - * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _MACHINE_BUS_H_ -#define _MACHINE_BUS_H_ - -#ifdef __STDC__ -#define CAT(a,b) a##b -#define CAT3(a,b,c) a##b##c -#else -#define CAT(a,b) a/**/b -#define CAT3(a,b,c) a/**/b/**/c -#endif - -/* - * Bus access types. - */ -struct mips_bus_space; -typedef u_long bus_addr_t; -typedef u_long bus_size_t; -typedef u_long bus_space_handle_t; -typedef struct mips_bus_space *bus_space_tag_t; - -struct mips_bus_space { - bus_addr_t bus_base; - void *bus_private; - u_int8_t (*_space_read_1)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_1)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int8_t); - u_int16_t (*_space_read_2)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_2)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int16_t); - u_int32_t (*_space_read_4)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_4)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int32_t); - u_int64_t (*_space_read_8)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_8)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int64_t); - void (*_space_read_raw_2)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, u_int8_t *, bus_size_t); - void (*_space_write_raw_2)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const u_int8_t *, bus_size_t); - void (*_space_read_raw_4)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, u_int8_t *, bus_size_t); - void (*_space_write_raw_4)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const u_int8_t *, bus_size_t); - void (*_space_read_raw_8)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, u_int8_t *, bus_size_t); - void (*_space_write_raw_8)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const u_int8_t *, bus_size_t); - int (*_space_map)(bus_space_tag_t , bus_addr_t, - bus_size_t, int, bus_space_handle_t *); - void (*_space_unmap)(bus_space_tag_t, bus_space_handle_t, - bus_size_t); - int (*_space_subregion)(bus_space_tag_t, bus_space_handle_t, - bus_size_t, bus_size_t, bus_space_handle_t *); - void * (*_space_vaddr)(bus_space_tag_t, bus_space_handle_t); - paddr_t (*_space_mmap)(bus_space_tag_t, bus_addr_t, off_t, - int, int); -}; - -#define bus_space_read_1(t, h, o) (*(t)->_space_read_1)((t), (h), (o)) -#define bus_space_read_2(t, h, o) (*(t)->_space_read_2)((t), (h), (o)) -#define bus_space_read_4(t, h, o) (*(t)->_space_read_4)((t), (h), (o)) -#define bus_space_read_8(t, h, o) (*(t)->_space_read_8)((t), (h), (o)) - -#define bus_space_write_1(t, h, o, v) (*(t)->_space_write_1)((t), (h), (o), (v)) -#define bus_space_write_2(t, h, o, v) (*(t)->_space_write_2)((t), (h), (o), (v)) -#define bus_space_write_4(t, h, o, v) (*(t)->_space_write_4)((t), (h), (o), (v)) -#define bus_space_write_8(t, h, o, v) (*(t)->_space_write_8)((t), (h), (o), (v)) - -#define bus_space_read_raw_multi_2(t, h, a, b, l) \ - (*(t)->_space_read_raw_2)((t), (h), (a), (b), (l)) -#define bus_space_read_raw_multi_4(t, h, a, b, l) \ - (*(t)->_space_read_raw_4)((t), (h), (a), (b), (l)) -#define bus_space_read_raw_multi_8(t, h, a, b, l) \ - (*(t)->_space_read_raw_8)((t), (h), (a), (b), (l)) - -#define bus_space_write_raw_multi_2(t, h, a, b, l) \ - (*(t)->_space_write_raw_2)((t), (h), (a), (b), (l)) -#define bus_space_write_raw_multi_4(t, h, a, b, l) \ - (*(t)->_space_write_raw_4)((t), (h), (a), (b), (l)) -#define bus_space_write_raw_multi_8(t, h, a, b, l) \ - (*(t)->_space_write_raw_8)((t), (h), (a), (b), (l)) - -#define bus_space_map(t, o, s, c, p) (*(t)->_space_map)((t), (o), (s), (c), (p)) -#define bus_space_unmap(t, h, s) (*(t)->_space_unmap)((t), (h), (s)) -#define bus_space_subregion(t, h, o, s, p) \ - (*(t)->_space_subregion)((t), (h), (o), (s), (p)) - -#define BUS_SPACE_MAP_CACHEABLE 0x01 -#define BUS_SPACE_MAP_LINEAR 0x02 -#define BUS_SPACE_MAP_PREFETCHABLE 0x04 - -#define bus_space_vaddr(t, h) (*(t)->_space_vaddr)((t), (h)) -#define bus_space_mmap(t, a, o, p, f) \ - (*(t)->_space_mmap)((t), (a), (o), (p), (f)) - -/*----------------------------------------------------------------------------*/ -#define bus_space_read_multi(n,m) \ -static __inline void \ -CAT(bus_space_read_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_size_t o, CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) \ - *x++ = CAT(bus_space_read_,n)(bst, bsh, o); \ -} - -bus_space_read_multi(1,8) -bus_space_read_multi(2,16) -bus_space_read_multi(4,32) -bus_space_read_multi(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_read_region(n,m) \ -static __inline void \ -CAT(bus_space_read_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_addr_t ba, CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) { \ - *x++ = CAT(bus_space_read_,n)(bst, bsh, ba); \ - ba += (n); \ - } \ -} - -bus_space_read_region(1,8) -bus_space_read_region(2,16) -bus_space_read_region(4,32) -bus_space_read_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_read_raw_region(n,m) \ -static __inline void \ -CAT(bus_space_read_raw_region_,n)(bus_space_tag_t bst, \ - bus_space_handle_t bsh, \ - bus_addr_t ba, u_int8_t *x, size_t cnt) \ -{ \ - cnt >>= ((n) >> 1); \ - while (cnt--) { \ - CAT(bus_space_read_raw_multi_,n)(bst, bsh, ba, x, (n)); \ - ba += (n); \ - x += (n); \ - } \ -} - -bus_space_read_raw_region(2,16) -bus_space_read_raw_region(4,32) -bus_space_read_raw_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_write_multi(n,m) \ -static __inline void \ -CAT(bus_space_write_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_size_t o, const CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) \ - CAT(bus_space_write_,n)(bst, bsh, o, *x++); \ -} - -bus_space_write_multi(1,8) -bus_space_write_multi(2,16) -bus_space_write_multi(4,32) -bus_space_write_multi(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_write_region(n,m) \ -static __inline void \ -CAT(bus_space_write_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_addr_t ba, const CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) { \ - CAT(bus_space_write_,n)(bst, bsh, ba, *x++); \ - ba += (n); \ - } \ -} - -bus_space_write_region(1,8) -bus_space_write_region(2,16) -bus_space_write_region(4,32) -bus_space_write_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_write_raw_region(n,m) \ -static __inline void \ -CAT(bus_space_write_raw_region_,n)(bus_space_tag_t bst, \ - bus_space_handle_t bsh, \ - bus_addr_t ba, const u_int8_t *x, size_t cnt) \ -{ \ - cnt >>= ((n) >> 1); \ - while (cnt--) { \ - CAT(bus_space_write_raw_multi_,n)(bst, bsh, ba, x, (n)); \ - ba += (n); \ - x += (n); \ - } \ -} - -bus_space_write_raw_region(2,16) -bus_space_write_raw_region(4,32) -bus_space_write_raw_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_set_region(n,m) \ -static __inline void \ -CAT(bus_space_set_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_addr_t ba, CAT3(u_int,m,_t) x, size_t cnt) \ -{ \ - while (cnt--) { \ - CAT(bus_space_write_,n)(bst, bsh, ba, x); \ - ba += (n); \ - } \ -} - -bus_space_set_region(1,8) -bus_space_set_region(2,16) -bus_space_set_region(4,32) -bus_space_set_region(8,64) - -/*----------------------------------------------------------------------------*/ -static __inline void -bus_space_copy_1(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - char *s = (char *)(h1 + o1); - char *d = (char *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - - -static __inline void -bus_space_copy_2(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - short *s = (short *)(h1 + o1); - short *d = (short *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - -static __inline void -bus_space_copy_4(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - int *s = (int *)(h1 + o1); - int *d = (int *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - -static __inline void -bus_space_copy_8(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - int64_t *s = (int64_t *)(h1 + o1); - int64_t *d = (int64_t *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - -int generic_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int, - bus_space_handle_t *); -void generic_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t); -int generic_space_region(bus_space_tag_t, bus_space_handle_t, bus_size_t, - bus_size_t, bus_space_handle_t *); -void *generic_space_vaddr(bus_space_tag_t, bus_space_handle_t); -uint8_t generic_space_read_1(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint16_t generic_space_read_2(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint32_t generic_space_read_4(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint64_t generic_space_read_8(bus_space_tag_t, bus_space_handle_t, bus_size_t); -void generic_space_read_raw_2(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void generic_space_write_1(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint8_t); -void generic_space_write_2(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint16_t); -void generic_space_write_4(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint32_t); -void generic_space_write_8(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint64_t); -void generic_space_write_raw_2(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -void generic_space_read_raw_4(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void generic_space_write_raw_4(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -void generic_space_read_raw_8(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void generic_space_write_raw_8(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -paddr_t generic_space_mmap(bus_space_tag_t, bus_addr_t, off_t, int, int); - -/*----------------------------------------------------------------------------*/ -/* - * Bus read/write barrier methods. - * - * void bus_space_barrier(bus_space_tag_t tag, - * bus_space_handle_t bsh, bus_size_t offset, - * bus_size_t len, int flags); - * - */ -static inline void -bus_space_barrier(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset, - bus_size_t length, int flags) -{ - __asm__ volatile ("sync" ::: "memory"); -} -#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ -#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ - -#define BUS_DMA_WAITOK 0x0000 -#define BUS_DMA_NOWAIT 0x0001 -#define BUS_DMA_ALLOCNOW 0x0002 -#define BUS_DMA_COHERENT 0x0008 -#define BUS_DMA_BUS1 0x0010 /* placeholders for bus functions... */ -#define BUS_DMA_BUS2 0x0020 -#define BUS_DMA_BUS3 0x0040 -#define BUS_DMA_BUS4 0x0080 -#define BUS_DMA_READ 0x0100 /* mapping is device -> memory only */ -#define BUS_DMA_WRITE 0x0200 /* mapping is memory -> device only */ -#define BUS_DMA_STREAMING 0x0400 /* hint: sequential, unidirectional */ -#define BUS_DMA_ZERO 0x0800 /* zero memory in dmamem_alloc */ -#define BUS_DMA_NOCACHE 0x1000 -#define BUS_DMA_64BIT 0x2000 /* device handles 64bit dva */ - -/* Forwards needed by prototypes below. */ -struct mbuf; -struct proc; -struct uio; - -#define BUS_DMASYNC_POSTREAD 0x0001 -#define BUS_DMASYNC_POSTWRITE 0x0002 -#define BUS_DMASYNC_PREREAD 0x0004 -#define BUS_DMASYNC_PREWRITE 0x0008 - -typedef struct machine_bus_dma_tag *bus_dma_tag_t; -typedef struct machine_bus_dmamap *bus_dmamap_t; - -/* - * bus_dma_segment_t - * - * Describes a single contiguous DMA transaction. Values - * are suitable for programming into DMA registers. - */ -struct machine_bus_dma_segment { - bus_addr_t ds_addr; /* DMA address */ - bus_size_t ds_len; /* length of transfer */ - - paddr_t _ds_paddr; /* CPU address */ - vaddr_t _ds_vaddr; /* CPU address */ -}; -typedef struct machine_bus_dma_segment bus_dma_segment_t; - -/* - * bus_dma_tag_t - * - * A machine-dependent opaque type describing the implementation of - * DMA for a given bus. - */ - -struct machine_bus_dma_tag { - void *_cookie; /* cookie used in the guts */ - - /* - * DMA mapping methods. - */ - int (*_dmamap_create)(bus_dma_tag_t , bus_size_t, int, - bus_size_t, bus_size_t, int, bus_dmamap_t *); - void (*_dmamap_destroy)(bus_dma_tag_t , bus_dmamap_t); - int (*_dmamap_load)(bus_dma_tag_t , bus_dmamap_t, void *, - bus_size_t, struct proc *, int); - int (*_dmamap_load_mbuf)(bus_dma_tag_t , bus_dmamap_t, - struct mbuf *, int); - int (*_dmamap_load_uio)(bus_dma_tag_t , bus_dmamap_t, - struct uio *, int); - int (*_dmamap_load_raw)(bus_dma_tag_t , bus_dmamap_t, - bus_dma_segment_t *, int, bus_size_t, int); - int (*_dmamap_load_buffer)(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); - void (*_dmamap_unload)(bus_dma_tag_t , bus_dmamap_t); - void (*_dmamap_sync)(bus_dma_tag_t , bus_dmamap_t, - bus_addr_t, bus_size_t, int); - - /* - * DMA memory utility functions. - */ - int (*_dmamem_alloc)(bus_dma_tag_t, bus_size_t, bus_size_t, - bus_size_t, bus_dma_segment_t *, int, int *, int); - void (*_dmamem_free)(bus_dma_tag_t, bus_dma_segment_t *, int); - int (*_dmamem_map)(bus_dma_tag_t, bus_dma_segment_t *, - int, size_t, caddr_t *, int); - void (*_dmamem_unmap)(bus_dma_tag_t, caddr_t, size_t); - paddr_t (*_dmamem_mmap)(bus_dma_tag_t, bus_dma_segment_t *, - int, off_t, int, int); - - /* - * internal memory address translation information. - */ - bus_addr_t (*_pa_to_device)(paddr_t); - paddr_t (*_device_to_pa)(bus_addr_t); - bus_addr_t _dma_mask; -}; - -#define bus_dmamap_create(t, s, n, m, b, f, p) \ - (*(t)->_dmamap_create)((t), (s), (n), (m), (b), (f), (p)) -#define bus_dmamap_destroy(t, p) \ - (*(t)->_dmamap_destroy)((t), (p)) -#define bus_dmamap_load(t, m, b, s, p, f) \ - (*(t)->_dmamap_load)((t), (m), (b), (s), (p), (f)) -#define bus_dmamap_load_mbuf(t, m, b, f) \ - (*(t)->_dmamap_load_mbuf)((t), (m), (b), (f)) -#define bus_dmamap_load_uio(t, m, u, f) \ - (*(t)->_dmamap_load_uio)((t), (m), (u), (f)) -#define bus_dmamap_load_raw(t, m, sg, n, s, f) \ - (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) -#define bus_dmamap_unload(t, p) \ - (*(t)->_dmamap_unload)((t), (p)) -#define bus_dmamap_sync(t, p, a, l, o) \ - (void)((t)->_dmamap_sync ? \ - (*(t)->_dmamap_sync)((t), (p), (a), (l), (o)) : (void)0) - -#define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ - (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) -#define bus_dmamem_free(t, sg, n) \ - (*(t)->_dmamem_free)((t), (sg), (n)) -#define bus_dmamem_map(t, sg, n, s, k, f) \ - (*(t)->_dmamem_map)((t), (sg), (n), (s), (k), (f)) -#define bus_dmamem_unmap(t, k, s) \ - (*(t)->_dmamem_unmap)((t), (k), (s)) -#define bus_dmamem_mmap(t, sg, n, o, p, f) \ - (*(t)->_dmamem_mmap)((t), (sg), (n), (o), (p), (f)) - -int _dmamap_create(bus_dma_tag_t, bus_size_t, int, - bus_size_t, bus_size_t, int, bus_dmamap_t *); -void _dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); -int _dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int); -int _dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t, struct mbuf *, int); -int _dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); -int _dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, - bus_dma_segment_t *, int, bus_size_t, int); -int _dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); -void _dmamap_unload(bus_dma_tag_t, bus_dmamap_t); -void _dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, - bus_size_t, int); - -int _dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, - bus_size_t, bus_dma_segment_t *, int, int *, int); -void _dmamem_free(bus_dma_tag_t, bus_dma_segment_t *, int); -int _dmamem_map(bus_dma_tag_t, bus_dma_segment_t *, - int, size_t, caddr_t *, int); -void _dmamem_unmap(bus_dma_tag_t, caddr_t, size_t); -paddr_t _dmamem_mmap(bus_dma_tag_t, bus_dma_segment_t *, int, off_t, int, int); -int _dmamem_alloc_range(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, - bus_dma_segment_t *, int, int *, int, paddr_t, paddr_t); - -/* - * bus_dmamap_t - * - * Describes a DMA mapping. - */ -struct machine_bus_dmamap { - /* - * PRIVATE MEMBERS: not for use by machine-independent code. - */ - bus_size_t _dm_size; /* largest DMA transfer mappable */ - int _dm_segcnt; /* number of segs this map can map */ - bus_size_t _dm_maxsegsz; /* largest possible segment */ - bus_size_t _dm_boundary; /* don't cross this */ - int _dm_flags; /* misc. flags */ - - void *_dm_cookie; /* cookie for bus-specific functions */ - - /* - * PUBLIC MEMBERS: these are used by machine-independent code. - */ - bus_size_t dm_mapsize; /* size of the mapping */ - int dm_nsegs; /* # valid segments in mapping */ - bus_dma_segment_t dm_segs[1]; /* segments; variable length */ -}; - -#endif /* _MACHINE_BUS_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/cdefs.h b/lib/libc/include/mips64el-openbsd-none/loongson/cdefs.h deleted file mode 100644 index e44353fedfe1e56cc82b7f74e8e03f3753c98167..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/cdefs.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: cdefs.h,v 1.2 2013/03/28 17:30:45 martynas Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/conf.h b/lib/libc/include/mips64el-openbsd-none/loongson/conf.h deleted file mode 100644 index 8eafed12d4280fe87a48ef344db8d720d17edd55..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/conf.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: conf.h,v 1.4 2022/06/28 14:43:50 visa Exp $ */ -/* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */ - -/* - * Copyright (c) 1996 Christos Zoulas. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Christos Zoulas. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include - -/* open, close, write, ioctl, kqueue */ -#define cdev_apm_init(c,n) { \ - dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ - (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ - (dev_type_stop((*))) enodev, 0, \ - (dev_type_mmap((*))) enodev, 0, 0, dev_init(c,n,kqfilter) } - -cdev_decl(apm); \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/cpu.h b/lib/libc/include/mips64el-openbsd-none/loongson/cpu.h deleted file mode 100644 index d3d84bf3dbf9833456225af945c4fb8a2d57af25..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/cpu.h +++ /dev/null @@ -1,103 +0,0 @@ -/* $OpenBSD: cpu.h,v 1.8 2017/07/30 16:05:24 visa Exp $ */ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Copyright (C) 1989 Digital Equipment Corporation. - * Permission to use, copy, modify, and distribute this software and - * its documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appears in all copies. - * Digital Equipment Corporation makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * from: @(#)cpu.h 8.4 (Berkeley) 1/4/94 - */ - -#ifdef _KERNEL - -#if defined(MULTIPROCESSOR) && !defined(_LOCORE) -#define MAXCPUS 4 -struct cpu_info; -struct cpu_info *hw_getcurcpu(void); -void hw_setcurcpu(struct cpu_info *); -void hw_cpu_boot_secondary(struct cpu_info *); -void hw_cpu_hatch(struct cpu_info *); -void hw_cpu_spinup_trampoline(struct cpu_info *); -int hw_ipi_intr_establish(int (*)(void *), u_long); -void hw_ipi_intr_set(u_long); -void hw_ipi_intr_clear(u_long); -#endif /* MULTIPROCESSOR && !_LOCORE */ - -#if defined(CPU_LOONGSON2) && !defined(CPU_LOONGSON3) -#define Mips_SyncCache(ci) \ - Loongson2_SyncCache((ci)) -#define Mips_InvalidateICache(ci, va, l) \ - Loongson2_InvalidateICache((ci), (va), (l)) -#define Mips_InvalidateICachePage(ci, va) \ - Loongson2_InvalidateICachePage((ci), (va)) -#define Mips_SyncICache(ci) \ - Loongson2_SyncICache((ci)) -#define Mips_SyncDCachePage(ci, va, pa) \ - Loongson2_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCachePage(ci, va, pa) \ - Loongson2_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCache(ci, va, l) \ - Loongson2_HitSyncDCache((ci), (va), (l)) -#define Mips_IOSyncDCache(ci, va, l, h) \ - Loongson2_IOSyncDCache((ci), (va), (l), (h)) -#define Mips_HitInvalidateDCache(ci, va, l) \ - Loongson2_HitInvalidateDCache((ci), (va), (l)) -#endif - -#if defined(CPU_LOONGSON3) && !defined(CPU_LOONGSON2) -#define Mips_SyncCache(ci) \ - Loongson3_SyncCache((ci)) -#define Mips_InvalidateICache(ci, va, l) \ - Loongson3_InvalidateICache((ci), (va), (l)) -#define Mips_InvalidateICachePage(ci, va) \ - Loongson3_InvalidateICachePage((ci), (va)) -#define Mips_SyncICache(ci) \ - Loongson3_SyncICache((ci)) -#define Mips_SyncDCachePage(ci, va, pa) \ - Loongson3_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCachePage(ci, va, pa) \ - Loongson3_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCache(ci, va, l) \ - Loongson3_HitSyncDCache((ci), (va), (l)) -#define Mips_IOSyncDCache(ci, va, l, h) \ - Loongson3_IOSyncDCache((ci), (va), (l), (h)) -#define Mips_HitInvalidateDCache(ci, va, l) \ - Loongson3_HitInvalidateDCache((ci), (va), (l)) -#endif - -#endif /* _KERNEL */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/cpustate.h b/lib/libc/include/mips64el-openbsd-none/loongson/cpustate.h deleted file mode 100644 index f5aff1a41b0821e4223149081bd09917bbd5ead5..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/cpustate.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: cpustate.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/db_machdep.h b/lib/libc/include/mips64el-openbsd-none/loongson/db_machdep.h deleted file mode 100644 index 3759d833718e73d1721d3c9d4e719e76c39fe568..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/db_machdep.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: db_machdep.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/disklabel.h b/lib/libc/include/mips64el-openbsd-none/loongson/disklabel.h deleted file mode 100644 index e7758205f60b4f71e05e646714431838d70a82a1..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/disklabel.h +++ /dev/null @@ -1,16 +0,0 @@ -/* $OpenBSD: disklabel.h,v 1.3 2015/09/30 15:35:30 krw Exp $ */ -/* public domain */ - -/* - * Standard MBR partition scheme, with the label in the second sector - * of the OpenBSD partition. - */ - -#ifndef _MACHINE_DISKLABEL_H_ -#define _MACHINE_DISKLABEL_H_ - -#define LABELSECTOR 1 /* sector containing label */ -#define LABELOFFSET 0 /* offset of label in sector */ -#define MAXPARTITIONS 16 /* number of partitions */ - -#endif /* _MACHINE_DISKLABEL_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/elf.h b/lib/libc/include/mips64el-openbsd-none/loongson/elf.h deleted file mode 100644 index 5918df727bdaf3cd8ab2b3b7df5c61cdc0b8b8ef..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/elf.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: elf.h,v 1.1 2024/07/14 19:33:59 miod Exp $ */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/endian.h b/lib/libc/include/mips64el-openbsd-none/loongson/endian.h deleted file mode 100644 index 2e7392a0828e58ea0353f15ea21bca2453d884eb..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/endian.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: endian.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/exec.h b/lib/libc/include/mips64el-openbsd-none/loongson/exec.h deleted file mode 100644 index 53433783f0c0157fda10cb49ac0566fd0ae354c1..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/exec.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: exec.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/fenv.h b/lib/libc/include/mips64el-openbsd-none/loongson/fenv.h deleted file mode 100644 index 08e89fbf323e30d7c88ccce0eb090e4c2cfa5f30..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/fenv.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: fenv.h,v 1.2 2013/06/01 21:20:54 jasper Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/fpu.h b/lib/libc/include/mips64el-openbsd-none/loongson/fpu.h deleted file mode 100644 index 19ee8af41438ceaa59169b2355572d0256f33272..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/fpu.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: fpu.h,v 1.1 2010/09/17 00:34:04 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/frame.h b/lib/libc/include/mips64el-openbsd-none/loongson/frame.h deleted file mode 100644 index d14827e33c0e4797ab96d1648b847715e058d110..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/frame.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: frame.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/ieee.h b/lib/libc/include/mips64el-openbsd-none/loongson/ieee.h deleted file mode 100644 index d390acb3c59f1631bcb889841e5f9d27e9520a2f..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/ieee.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: ieee.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/ieeefp.h b/lib/libc/include/mips64el-openbsd-none/loongson/ieeefp.h deleted file mode 100644 index 17e880358e20378250fc45526d8c18fa0aef70a6..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/ieeefp.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: ieeefp.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/intr.h b/lib/libc/include/mips64el-openbsd-none/loongson/intr.h deleted file mode 100644 index 64d103bc39aa71a0cb565ab4655c9d7eec4cbc21..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/intr.h +++ /dev/null @@ -1,193 +0,0 @@ -/* $OpenBSD: intr.h,v 1.19 2025/05/10 10:01:03 visa Exp $ */ - -/* - * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef _MACHINE_INTR_H_ -#define _MACHINE_INTR_H_ - -#define __USE_MI_SOFTINTR - -#include - -/* - * The interrupt level ipl is a logical level; per-platform interrupt - * code will turn it into the appropriate hardware interrupt masks - * values. - * - * Interrupt sources on the CPU are kept enabled regardless of the - * current ipl value; individual hardware sources interrupting while - * logically masked are masked on the fly, remembered as pending, and - * unmasked at the first splx() opportunity. - * - * An exception to this rule is the clock interrupt. Clock interrupts - * are always allowed to happen, but will (of course!) not be serviced - * if logically masked. The reason for this is that clocks usually sit on - * INT5 and cannot be easily masked if external hardware masking is used. - */ - -/* Interrupt priority `levels'; not mutually exclusive. */ -#define IPL_NONE 0 /* nothing */ -#define IPL_SOFTINT 1 /* soft interrupts */ -#define IPL_SOFTCLOCK 1 /* soft clock interrupts */ -#define IPL_SOFTNET 2 /* soft network interrupts */ -#define IPL_SOFTTTY 3 /* soft terminal interrupts */ -#define IPL_SOFTHIGH IPL_SOFTTTY /* highest level of soft interrupts */ -#define IPL_BIO 4 /* block I/O */ -#define IPL_AUDIO IPL_BIO -#define IPL_NET 5 /* network */ -#define IPL_TTY 6 /* terminal */ -#define IPL_VM 7 /* memory allocation */ -#define IPL_CLOCK 8 /* clock */ -#define IPL_STATCLOCK IPL_CLOCK -#define IPL_SCHED 9 /* everything */ -#define IPL_HIGH 9 /* everything */ -#define IPL_IPI 10 /* interprocessor interrupt */ -#define NIPLS 11 /* number of levels */ - -#define IPL_MPFLOOR IPL_TTY - -/* Interrupt priority 'flags'. */ -#define IPL_MPSAFE 0x100 - -/* Interrupt sharing types. */ -#define IST_NONE 0 /* none */ -#define IST_PULSE 1 /* pulsed */ -#define IST_EDGE 2 /* edge-triggered */ -#define IST_LEVEL 3 /* level-triggered */ - -#ifndef _LOCORE - -void softintr(int); - -#define splbio() splraise(IPL_BIO) -#define splnet() splraise(IPL_NET) -#define spltty() splraise(IPL_TTY) -#define splaudio() splraise(IPL_AUDIO) -#define splclock() splraise(IPL_CLOCK) -#define splvm() splraise(IPL_VM) -#define splhigh() splraise(IPL_HIGH) - -#define splsoftclock() splraise(IPL_SOFTCLOCK) -#define splsoftnet() splraise(IPL_SOFTNET) -#define splstatclock() splhigh() - -#define splsched() splhigh() -#define spl0() spllower(0) - -void splinit(void); - -#ifdef DIAGNOSTIC -/* - * Although this function is implemented in MI code, it must be in this MD - * header because we don't want this header to include MI includes. - */ -void splassert_fail(int, int, const char *); -extern int splassert_ctl; -void splassert_check(int, const char *); -#define splassert(__wantipl) do { \ - if (splassert_ctl > 0) { \ - splassert_check(__wantipl, __func__); \ - } \ -} while (0) -#define splsoftassert(wantipl) splassert(wantipl) -#else -#define splassert(X) -#define splsoftassert(X) -#endif - -void register_splx_handler(void (*)(int)); -int splraise(int); -void splx(int); -int spllower(int); - -/* - * Interrupt control struct used by interrupt dispatchers - * to hold interrupt handler info. - */ - -#include - -struct intrhand { - struct intrhand *ih_next; - int (*ih_fun)(void *); - void *ih_arg; - int ih_level; - int ih_irq; - int ih_flags; -#define IH_MPSAFE 0x01 - struct evcount ih_count; -}; - -void intr_barrier(void *); - -/* - * Low level interrupt dispatcher registration data. - */ - -/* Schedule priorities for base interrupts (CPU) */ -#define INTPRI_IPI 0 -#define INTPRI_CLOCK 1 -/* other values are system-specific */ - -#define NLOWINT 4 /* Number of low level registrations possible */ - -extern uint32_t idle_mask; - -struct trapframe; -void set_intr(int, uint32_t, uint32_t(*)(uint32_t, struct trapframe *)); - -uint32_t updateimask(uint32_t); -void dosoftint(void); - -#ifdef MULTIPROCESSOR -extern uint32_t ipi_mask; -#define ENABLEIPI() updateimask(~ipi_mask) -#endif - -struct pic { - void (*pic_eoi)(int); - void (*pic_mask)(int); - void (*pic_unmask)(int); -}; - -#ifdef CPU_LOONGSON3 - -void loongson3_intr_init(void); -void *loongson3_intr_establish(int, int, int (*)(void *), void*, - const char *); -void loongson3_intr_disestablish(void *); -void *loongson3_ht_intr_establish(int, int, int (*)(void *), void*, - const char *); -void loongson3_ht_intr_disestablish(void *); - -void loongson3_register_ht_pic(const struct pic *); - -#endif /* CPU_LOONGSON3 */ - -#endif /* _LOCORE */ - -#endif /* _MACHINE_INTR_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/isa_machdep.h b/lib/libc/include/mips64el-openbsd-none/loongson/isa_machdep.h deleted file mode 100644 index 201c218bd3fb5231555a293b7d1d2c3625772613..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/isa_machdep.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: isa_machdep.h,v 1.2 2010/05/08 21:59:56 miod Exp $ */ - -/* - * Copyright (c) 2007 Miodrag Vallat. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice, this permission notice, and the disclaimer below - * appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _MACHINE_ISA_MACHDEP_H_ -#define _MACHINE_ISA_MACHDEP_H_ - -#include - -#define __NO_ISA_INTR_CHECK - -typedef struct mips_isa_chipset *isa_chipset_tag_t; - -struct mips_isa_chipset { - void *ic_v; - - void (*ic_attach_hook)(struct device *, struct device *, - struct isabus_attach_args *); - void *(*ic_intr_establish)(void *, int, int, int, int (*)(void *), - void *, char *); - void (*ic_intr_disestablish)(void *, void *); -}; - -#define isa_attach_hook(p, s, iba) \ - (*(iba)->iba_ic->ic_attach_hook)((p), (s), (iba)) -#define isa_intr_establish(c, i, t, l, f, a, n) \ - (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a), (n)) -#define isa_intr_disestablish(c, h) \ - (*(c)->ic_intr_disestablish)((c)->ic_v, (h)) - -void loongson_generic_isa_attach_hook(struct device *, struct device *, - struct isabus_attach_args *); -void loongson_isa_specific_eoi(int); -void loongson_set_isa_imr(uint); - -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/kcore.h b/lib/libc/include/mips64el-openbsd-none/loongson/kcore.h deleted file mode 100644 index c38fa9f7f6e0ddea59ac1f0ea7850a38a2d22eca..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/kcore.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: kcore.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/limits.h b/lib/libc/include/mips64el-openbsd-none/loongson/limits.h deleted file mode 100644 index 12007d997ad2c9432fc6ad13fabc963fed43c9f2..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/limits.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: limits.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/loadfile_machdep.h b/lib/libc/include/mips64el-openbsd-none/loongson/loadfile_machdep.h deleted file mode 100644 index 1486f8ce5c754fca11c37ce27e90e32eeb9a6f9c..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/loadfile_machdep.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $OpenBSD: loadfile_machdep.h,v 1.2 2015/07/17 20:44:39 miod Exp $ */ -/* $NetBSD: loadfile_machdep.h,v 1.2 2001/10/31 17:20:49 thorpej Exp $ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#define BOOT_ELF -#define ELFSIZE 64 - -#define LOAD_KERNEL LOAD_ALL -#define COUNT_KERNEL COUNT_ALL - -#define LOADADDR(a) (((u_long)(a)) + offset) -#define ALIGNENTRY(a) ((u_long)(a)) -#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c)) -#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c)) -#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c)) -#define WARN(a) (void)(printf a, \ - printf((errno ? ": %s\n" : "\n"), \ - strerror(errno))) -#define PROGRESS(a) (void) printf a -#define ALLOC(a) alloc(a) -#define FREE(a, b) free(a, b) \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/loongson2.h b/lib/libc/include/mips64el-openbsd-none/loongson/loongson2.h deleted file mode 100644 index 05688a8e0f9c45faa85f84be32d74c228bcbd3ab..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/loongson2.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: loongson2.h,v 1.1.1.1 2009/08/06 20:51:44 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/loongson3.h b/lib/libc/include/mips64el-openbsd-none/loongson/loongson3.h deleted file mode 100644 index bcbe6ca7018fb2277e222d0662241f22d4e253bf..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/loongson3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: loongson3.h,v 1.1 2016/11/06 10:20:33 visa Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/memconf.h b/lib/libc/include/mips64el-openbsd-none/loongson/memconf.h deleted file mode 100644 index c7782048ac7eb9086d64bc2dd8b4d77e3e9d67bb..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/memconf.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: memconf.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/mips_opcode.h b/lib/libc/include/mips64el-openbsd-none/loongson/mips_opcode.h deleted file mode 100644 index 5b5cbc3494fdd59ac6aacae953cf3619c6d1530d..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/mips_opcode.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mips_opcode.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/mplock.h b/lib/libc/include/mips64el-openbsd-none/loongson/mplock.h deleted file mode 100644 index dc963887f82cb06ab479ce94fdfddf76e44bb85e..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/mplock.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mplock.h,v 1.1 2017/01/19 14:51:02 visa Exp $ */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/mutex.h b/lib/libc/include/mips64el-openbsd-none/loongson/mutex.h deleted file mode 100644 index 8003e465f6b6905278f3da97386d911071f9056b..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/mutex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mutex.h,v 1.2 2015/07/08 13:37:31 dlg Exp $ */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/param.h b/lib/libc/include/mips64el-openbsd-none/loongson/param.h deleted file mode 100644 index 17092fa4a5a093ef5a4cd509b268b4fc28ef0bb5..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/param.h +++ /dev/null @@ -1,27 +0,0 @@ -/* $OpenBSD: param.h,v 1.4 2025/12/03 11:59:18 miod Exp $ */ - -/* Public Domain */ - -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - -#define MACHINE "loongson" -#define _MACHINE loongson -#define MACHINE_ARCH "mips64el" /* not the canonical endianness */ -#define _MACHINE_ARCH mips64el -#define MACHINE_CPU "mips64" -#define _MACHINE_CPU mips64 -#define MID_MACHINE MID_MIPS64 - -/* - * The Loongson level 1 cache expects software to prevent virtual - * aliases. Unfortunately, since this cache is physically tagged, - * this would require all virtual address to have the same bits 14 - * and 13 as their physical addresses, which is not something the - * kernel can guarantee unless the page size is at least 16KB. - */ -#define PAGE_SHIFT 14 - -#include - -#endif /* _MACHINE_PARAM_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/pcb.h b/lib/libc/include/mips64el-openbsd-none/loongson/pcb.h deleted file mode 100644 index e48bfc2f316c00e773efb610642791ad8d374be2..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/pcb.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: pcb.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/pci_machdep.h b/lib/libc/include/mips64el-openbsd-none/loongson/pci_machdep.h deleted file mode 100644 index ade283806c11d7029d43fe292cb48ad30d3cc5c7..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/pci_machdep.h +++ /dev/null @@ -1,101 +0,0 @@ -/* $OpenBSD: pci_machdep.h,v 1.10 2016/05/04 14:30:01 kettenis Exp $ */ - -/* - * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -typedef struct mips_pci_chipset *pci_chipset_tag_t; -typedef u_long pcitag_t; -typedef u_long pci_intr_handle_t; - -struct pci_attach_args; - -/* - * mips-specific PCI structure and type definitions. - * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. - */ -struct mips_pci_chipset { - void *pc_conf_v; - void (*pc_attach_hook)(struct device *, - struct device *, struct pcibus_attach_args *); - int (*pc_bus_maxdevs)(void *, int); - pcitag_t (*pc_make_tag)(void *, int, int, int); - void (*pc_decompose_tag)(void *, pcitag_t, int *, - int *, int *); - int (*pc_conf_size)(void *, pcitag_t); - pcireg_t (*pc_conf_read)(void *, pcitag_t, int); - void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); - - void *pc_intr_v; - int (*pc_intr_map)(struct pci_attach_args *, pci_intr_handle_t *); - const char *(*pc_intr_string)(void *, pci_intr_handle_t); - void *(*pc_intr_establish)(void *, pci_intr_handle_t, - int, int (*)(void *), void *, char *); - void (*pc_intr_disestablish)(void *, void *); -}; - -/* - * Functions provided to machine-independent PCI code. - */ -#define pci_attach_hook(p, s, pba) \ - (*(pba)->pba_pc->pc_attach_hook)((p), (s), (pba)) -#define pci_bus_maxdevs(c, b) \ - (*(c)->pc_bus_maxdevs)((c)->pc_conf_v, (b)) -#define pci_make_tag(c, b, d, f) \ - (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) -#define pci_decompose_tag(c, t, bp, dp, fp) \ - (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) -#define pci_conf_size(c, t) \ - (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) -#define pci_conf_read(c, t, r) \ - (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) -#define pci_conf_write(c, t, r, v) \ - (*(c)->pc_conf_write)((c)->pc_conf_v, (t), (r), (v)) -#define pci_intr_map(c, ihp) \ - (*(c)->pa_pc->pc_intr_map)((c), (ihp)) -#define pci_intr_map_msi(c, ihp) (-1) -#define pci_intr_map_msix(c, vec, ihp) (-1) -#define pci_intr_string(c, ih) \ - (*(c)->pc_intr_string)((c)->pc_intr_v, (ih)) -#define pci_intr_establish(c, ih, l, h, a, nm) \ - (*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a), (nm)) -#define pci_intr_disestablish(c, iv) \ - (*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv)) -#define pci_probe_device_hook(c, a) (0) - -#define pci_min_powerstate(c, t) (PCI_PMCSR_STATE_D3) -#define pci_set_powerstate_md(c, t, s, p) - -/* PCI view of CPU memory */ -extern paddr_t loongson_dma_base; - -/* - * Functions used during early system configuration. - */ - -extern pcitag_t (*pci_make_tag_early)(int, int, int); -extern pcireg_t (*pci_conf_read_early)(pcitag_t, int); - -#define pci_dev_postattach(a, b) \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/pmap.h b/lib/libc/include/mips64el-openbsd-none/loongson/pmap.h deleted file mode 100644 index eda0b11a3c63e3b7ab53d099b6ca595215ad5302..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/pmap.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: pmap.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/pmon.h b/lib/libc/include/mips64el-openbsd-none/loongson/pmon.h deleted file mode 100644 index 7729adb4680ab9e77a1c0d174631e57be336d579..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/pmon.h +++ /dev/null @@ -1,209 +0,0 @@ -/* $OpenBSD: pmon.h,v 1.5 2017/05/21 13:00:53 visa Exp $ */ - -/* - * Copyright (c) 2009, 2012 Miodrag Vallat. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _MACHINE_PMON_H_ -#define _MACHINE_PMON_H_ - -#if defined(_KERNEL) || defined(_STANDALONE) - -/* - * PMON2000 callvec definitions - */ - -/* 32-bit compatible types */ -typedef uint32_t pmon_size_t; -typedef int32_t pmon_ssize_t; -typedef int64_t pmon_off_t; - -int pmon_open(const char *, int, ...); -int pmon_close(int); -int pmon_read(int, void *, pmon_size_t); -pmon_ssize_t pmon_write(int, const void *, pmon_size_t); -pmon_off_t pmon_lseek(int, pmon_off_t, int); -int pmon_printf(const char *, ...); -void pmon_cacheflush(void); -char * pmon_gets(char *); - -#define PMON_MAXLN 256 /* internal gets() size limit */ - -extern int32_t pmon_callvec; - -const char *pmon_getarg(const int); -void pmon_init(int32_t, int32_t, int32_t, int32_t, uint32_t); - -#define PMON_ENVTYPE_ENVP 0 -#define PMON_ENVTYPE_EFI 1 -int pmon_getenvtype(void); - -/* - * The new environment interface is a /salmigondis/ of badly thought-out - * structs put together, pretending to be inspired by EFI but conveniently - * omitting key EFI structs because they are deemed non-applicable to - * MIPS systems. - * Of course, some fields are absolute addresses, while others are relative - * pointers, to add to the confusion. - */ - -struct pmon_env_reset { - void (*cold_boot)(void); /* not filled */ - void (*warm_boot)(void); - void (*boot)(unsigned int); /* not filled */ - void (*poweroff)(void); -}; - -/* all values are offsets relative to the beginning of the struct */ -struct pmon_env_ptr { - uint64_t offs_mem; - uint64_t offs_cpu; - uint64_t offs_sys; - uint64_t offs_irq; - uint64_t offs_iface; - uint64_t offs_special; - uint64_t offs_device; -}; - -struct pmon_env_smbios { - uint16_t version; - uint64_t vga_bios; - struct pmon_env_ptr ptrs; -}; - -struct pmon_env_efi { - uint64_t mps; /* not filled */ - uint64_t acpi; /* not filled */ - uint64_t acpi20; /* not filled */ - struct pmon_env_smbios bios; - uint64_t sal_systab; /* not filled */ - uint64_t bootinfo; /* not filled */ -}; - -struct pmon_env { - struct pmon_env_efi efi; - struct pmon_env_reset reset; -}; - -#define PMON_MEM_MAX 128 -struct pmon_env_mem_entry { - uint32_t node; - uint32_t type; -#define PMON_MEM_SYSTEM_LOW 1 /* physical memory <= 256 MB */ -#define PMON_MEM_SYSTEM_HIGH 2 /* physical memory > 256 MB */ -#define PMON_MEM_RESERVED 3 -#define PMON_MEM_PCI_IO 4 -#define PMON_MEM_PCI_MEM 5 -#define PMON_MEM_CPU_REGISTERS 6 -#define PMON_MEM_VIDEO_ROM 7 -#define PMON_MEM_OTHER_ROM 8 -#define PMON_MEM_ACPI_TABLE 9 - uint64_t address; - uint32_t size; -}; -struct pmon_env_mem { - uint16_t version; /* not filled */ - uint32_t nentries; - uint32_t mem_freq; - struct pmon_env_mem_entry mem_map[PMON_MEM_MAX]; -} __packed; - -struct pmon_env_cpu { - uint16_t version; /* not filled */ - uint32_t prid; /* cop0 PrID */ - uint32_t cputype; -/* 0 and 1 are supposedly intended for 2E and 2F, which do NOT provide this - interface; moreover Linux and PMON disagree on the values and have 2E and - 2F swapped. */ -#define PMON_CPUTYPE_LS3A 2 -#define PMON_CPUTYPE_LS3B 3 -#define PMON_CPUTYPE_LS1A 4 -#define PMON_CPUTYPE_LS1B 5 - uint32_t node; /* total number of NUMA nodes */ - uint16_t coreid; /* boot CPU core id */ - uint16_t reserved_cores; /* mask of reserved cores */ - uint32_t speed; - uint32_t ncpus; -} __packed; - -struct pmon_env_sys { - uint16_t version; /* not filled */ - uint32_t ccnuma_smp; - uint32_t double_channel; -} __packed; - -struct pmon_env_irq { - uint16_t version; /* not filled */ - uint16_t size; /* not filled */ - uint16_t rtr_bus; /* not filled */ - uint16_t rtr_devfn; /* not filled */ - uint32_t vendor; /* not filled */ - uint32_t device; /* not filled */ - uint32_t pic_type; -#define PMON_IRQ_PIC_HT 0 -#define PMON_IRQ_PIC_I8259 1 - uint64_t ht_interrupt_bit; - uint64_t ht_enable; - uint32_t node; - uint64_t pci_memory_space_start; - uint64_t pci_memory_space_end; - uint64_t pci_io_space_start; /* not filled */ - uint64_t pci_io_space_end; /* not filled */ - uint64_t pci_cfg_space; /* not filled */ -} __packed; - -struct pmon_env_iface { - uint16_t version; -#define PMON_IFACE_VERSION 0x0001 - uint16_t size; - uint8_t flag; - char description[64]; /* firmware version */ -} __packed; - -#define PMON_RESOURCE_MAX 128 -struct pmon_env_resource { - uint64_t start; - uint64_t end; - char name[64]; - uint32_t flags; -}; -struct pmon_env_special { - uint16_t version; - char name[64]; - uint32_t type; - struct pmon_env_resource resource[PMON_RESOURCE_MAX]; -}; - -struct pmon_env_device { - char name[64]; /* system description */ - uint32_t nentries; - struct pmon_env_resource resource[PMON_RESOURCE_MAX]; -}; - -const char *pmon_getenv(const char *); - -const struct pmon_env_reset *pmon_get_env_reset(void); -const struct pmon_env_smbios *pmon_get_env_smbios(void); -const struct pmon_env_mem *pmon_get_env_mem(void); -const struct pmon_env_cpu *pmon_get_env_cpu(void); -const struct pmon_env_sys *pmon_get_env_sys(void); -const struct pmon_env_irq *pmon_get_env_irq(void); -const struct pmon_env_iface *pmon_get_env_iface(void); -const struct pmon_env_special *pmon_get_env_special(void); -const struct pmon_env_device *pmon_get_env_device(void); - -#endif /* _KERNEL || _STANDALONE */ - -#endif /* _MACHINE_PMON_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/proc.h b/lib/libc/include/mips64el-openbsd-none/loongson/proc.h deleted file mode 100644 index 27b68200cf3e4a6bc41e3b0508c88a0cda1e8f8b..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/proc.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: proc.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/profile.h b/lib/libc/include/mips64el-openbsd-none/loongson/profile.h deleted file mode 100644 index d258d1147b2dde2184faa06acd8dd2dd3ff70da7..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/profile.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: profile.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/pte.h b/lib/libc/include/mips64el-openbsd-none/loongson/pte.h deleted file mode 100644 index 24c761d664776bcd5582463e73507b0dbc30b5e5..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/pte.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: pte.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/ptrace.h b/lib/libc/include/mips64el-openbsd-none/loongson/ptrace.h deleted file mode 100644 index bd8e886725336c5cb7c6446144b24abee4a70994..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/ptrace.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: ptrace.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/reg.h b/lib/libc/include/mips64el-openbsd-none/loongson/reg.h deleted file mode 100644 index aeecc496fedcc6c12355b089f99f5854affffcbb..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/reg.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: reg.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/regdef.h b/lib/libc/include/mips64el-openbsd-none/loongson/regdef.h deleted file mode 100644 index 03ae54124e7638aa5f2678b6628d38371ef2f010..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/regdef.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: regdef.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/regnum.h b/lib/libc/include/mips64el-openbsd-none/loongson/regnum.h deleted file mode 100644 index e371c1ed202ebcbbc576b98e86f6505550a93d89..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/regnum.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: regnum.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/reloc.h b/lib/libc/include/mips64el-openbsd-none/loongson/reloc.h deleted file mode 100644 index 4eb8c01cf15e7d068665c757f2cdb4ca3b1c79ec..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/reloc.h +++ /dev/null @@ -1,5 +0,0 @@ -/* $OpenBSD: reloc.h,v 1.1 2017/08/12 15:33:41 visa Exp $ */ - -/* public domain */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/setjmp.h b/lib/libc/include/mips64el-openbsd-none/loongson/setjmp.h deleted file mode 100644 index c834f0409a59c3a37ba2775a1f0b7f297645be29..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/setjmp.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: setjmp.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/signal.h b/lib/libc/include/mips64el-openbsd-none/loongson/signal.h deleted file mode 100644 index 7f4d38dee765615d064ae13976aa867a60ba9c91..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/signal.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: signal.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/spinlock.h b/lib/libc/include/mips64el-openbsd-none/loongson/spinlock.h deleted file mode 100644 index 63f58612b808d2e6af8cd6f0354ef2e7d22ef416..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/spinlock.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: spinlock.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/sysarch.h b/lib/libc/include/mips64el-openbsd-none/loongson/sysarch.h deleted file mode 100644 index 6dac08a77bf53343defb3088b3675f31e91bbdc0..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/sysarch.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: sysarch.h,v 1.1.1.1 2009/11/22 18:12:44 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/tcb.h b/lib/libc/include/mips64el-openbsd-none/loongson/tcb.h deleted file mode 100644 index 427e19101a005a0836cad7a09118435406234f8d..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/tcb.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: tcb.h,v 1.2 2013/06/01 21:20:54 jasper Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/timetc.h b/lib/libc/include/mips64el-openbsd-none/loongson/timetc.h deleted file mode 100644 index d3d291c815ca589d46f697b7f934e546a2490bcc..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/timetc.h +++ /dev/null @@ -1,23 +0,0 @@ -/* $OpenBSD: timetc.h,v 1.2 2020/07/18 08:37:43 visa Exp $ */ -/* - * Copyright (c) 2020 Paul Irofti - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _MACHINE_TIMETC_H_ -#define _MACHINE_TIMETC_H_ - -#include - -#endif /* _MACHINE_TIMETC_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/trap.h b/lib/libc/include/mips64el-openbsd-none/loongson/trap.h deleted file mode 100644 index c700eedba183ed4dd57238d231a5592197584571..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/trap.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: trap.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/loongson/vmparam.h b/lib/libc/include/mips64el-openbsd-none/loongson/vmparam.h deleted file mode 100644 index c6c4b75cfe65f59dda99fec28215085d0f4e6f77..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/loongson/vmparam.h +++ /dev/null @@ -1,11 +0,0 @@ -/* $OpenBSD: vmparam.h,v 1.5 2017/05/21 13:00:53 visa Exp $ */ -/* public domain */ -#ifndef _MACHINE_VMPARAM_H_ -#define _MACHINE_VMPARAM_H_ - -#define VM_PHYSSEG_MAX 8 /* Max number of physical memory segments */ -#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST - -#include - -#endif /* _MACHINE_VMPARAM_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/_types.h b/lib/libc/include/mips64el-openbsd-none/machine/_types.h deleted file mode 100644 index 327e3d3e38ff025d3e5bc0b211c50354c5887659..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/_types.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: _types.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/apmvar.h b/lib/libc/include/mips64el-openbsd-none/machine/apmvar.h deleted file mode 100644 index 6e12da5dc5156fdd65bd30db86544c07540d1233..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/apmvar.h +++ /dev/null @@ -1,127 +0,0 @@ -/* $OpenBSD: apmvar.h,v 1.8 2026/04/09 05:03:42 miod Exp $ */ - -/* - * Copyright (c) 2001 Alexander Guy - * Copyright (c) 1995 John T. Kohl - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef _MACHINE_APMVAR_H_ -#define _MACHINE_APMVAR_H_ - -#include - -/* Advanced Power Management (v1.0 and v1.1 specification) - * functions/defines/etc. - */ - -/* These definitions make up the heart of the user-land interface - * to the APM devices. - */ - -#define APM_AC_OFF 0x00 -#define APM_AC_ON 0x01 -#define APM_AC_BACKUP 0x02 -#define APM_AC_UNKNOWN 0xff -#define APM_BATT_HIGH 0x00 -#define APM_BATT_LOW 0x01 -#define APM_BATT_CRITICAL 0x02 -#define APM_BATT_CHARGING 0x03 -#define APM_BATT_UNKNOWN 0xff -#define APM_BATT_LIFE_UNKNOWN 0xff - -#define APM_NOEVENT 0x0000 -#define APM_STANDBY_REQ 0x0001 -#define APM_SUSPEND_REQ 0x0002 -#define APM_NORMAL_RESUME 0x0003 -#define APM_CRIT_RESUME 0x0004 /* suspend/resume happened - without us */ -#define APM_BATTERY_LOW 0x0005 -#define APM_POWER_CHANGE 0x0006 -#define APM_UPDATE_TIME 0x0007 -#define APM_CRIT_SUSPEND_REQ 0x0008 -#define APM_USER_STANDBY_REQ 0x0009 -#define APM_USER_SUSPEND_REQ 0x000A -#define APM_SYS_STANDBY_RESUME 0x000B -#define APM_CAPABILITY_CHANGE 0x000C /* apm v1.2 */ -#define APM_USER_HIBERNATE_REQ 0x000D -#define APM_EVENT_MASK 0xffff - -#define APM_EVENT_COMPOSE(t,i) ((((i) & 0x7fff) << 16)|((t) & APM_EVENT_MASK)) -#define APM_EVENT_TYPE(e) ((e) & APM_EVENT_MASK) -#define APM_EVENT_INDEX(e) ((e) >> 16) - -/* - * LP (Laptop Package) - * - * Copyright (C) 1994 by HOSOKAWA Tatsumi - * - * This software may be used, modified, copied, and distributed, in - * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its - * use. - * - * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) - */ - -#define APM_BATTERY_ABSENT 4 - -struct apm_power_info { - u_char battery_state; - u_char ac_state; - u_char battery_life; - u_char spare1; - u_int minutes_left; /* estimate */ - u_int spare2[6]; -}; - -struct apm_ctl { - u_int dev; - u_int mode; -}; - -#define APM_IOC_REJECT _IOW('A', 0, struct apm_event_info) /* reject request # */ -#define APM_IOC_STANDBY _IO('A', 1) /* put system into standby */ -#define APM_IOC_SUSPEND _IO('A', 2) /* put system into suspend */ -#define APM_IOC_GETPOWER _IOR('A', 3, struct apm_power_info) /* fetch battery state */ -#define APM_IOC_DEV_CTL _IOW('A', 5, struct apm_ctl) /* put device into mode */ -#define APM_IOC_PRN_CTL _IOW('A', 6, int ) /* driver power status msg */ -#define APM_PRINT_ON 0 /* driver power status displayed */ -#define APM_PRINT_OFF 1 /* driver power status not displayed */ -#define APM_PRINT_PCT 2 /* driver power status only displayed - if the percentage changes */ -#define APM_IOC_STANDBY_REQ _IO('A', 7) /* request standby */ -#define APM_IOC_SUSPEND_REQ _IO('A', 8) /* request suspend */ -#define APM_IOC_HIBERNATE _IO('A', 9) /* put system into hibernate */ - -#ifdef _KERNEL -void apm_setinfohook(int (*)(struct apm_power_info *)); -int apm_record_event(u_int, const char *, const char *); -#endif - -#endif /* _MACHINE_APMVAR_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/asm.h b/lib/libc/include/mips64el-openbsd-none/machine/asm.h deleted file mode 100644 index 63eab175139b6d2bd0759f45c617f72e4bbce5da..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/asm.h +++ /dev/null @@ -1,9 +0,0 @@ -/* $OpenBSD: asm.h,v 1.2 2016/11/18 15:38:14 visa Exp $ */ -/* public domain */ - -#ifdef MULTIPROCESSOR -#define HW_GET_CPU_INFO(ci, tmp) \ - dmfc0 ci, COP_0_ERROR_PC -#endif - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/atomic.h b/lib/libc/include/mips64el-openbsd-none/machine/atomic.h deleted file mode 100644 index 19aa2fd4f69b6d46c4242ab34787707f57884869..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/atomic.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: atomic.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/autoconf.h b/lib/libc/include/mips64el-openbsd-none/machine/autoconf.h deleted file mode 100644 index 7292105a5be85a5d60330b6b3dc1cbd65797fa34..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/autoconf.h +++ /dev/null @@ -1,124 +0,0 @@ -/* $OpenBSD: autoconf.h,v 1.17 2017/05/21 13:00:53 visa Exp $ */ - -/* - * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - * Definitions used by autoconfiguration. - */ - -#ifndef _MACHINE_AUTOCONF_H_ -#define _MACHINE_AUTOCONF_H_ - -#include - -struct bonito_config; -struct htb_config; -struct mips_isa_chipset; - -/* - * List of legacy I/O ranges. - */ -struct legacy_io_range { - bus_addr_t start; - bus_size_t end; /* inclusive */ -}; - -/* - * Per platform information. - */ -struct platform { - int system_type; -#define LOONGSON_2E 0x0000 /* Generic Loongson 2E system */ -#define LOONGSON_YEELOONG 0x0001 /* Lemote Yeeloong */ -#define LOONGSON_GDIUM 0x0002 /* EMTEC Gdium Liberty */ -#define LOONGSON_FULOONG 0x0003 /* Lemote Fuloong */ -#define LOONGSON_LYNLOONG 0x0004 /* Lemote Lynloong */ -#define LOONGSON_EBT700 0x0005 /* eBenton EBT700 */ -#define LOONGSON_3A 0x0066 /* Loongson 2Gq or 3A based system */ - - char *vendor; - char *product; - - const struct bonito_config *bonito_config; - const struct htb_config *htb_config; - struct mips_isa_chipset *isa_chipset; - const struct legacy_io_range *legacy_io_ranges; - - void (*setup)(void); - void (*device_register)(struct device *, - void *); - - void (*powerdown)(void); - void (*reset)(void); - int (*suspend)(void); - int (*resume)(void); - -#ifdef MULTIPROCESSOR - void (*config_secondary_cpus)( - struct device *, cfprint_t); - void (*boot_secondary_cpu)( - struct cpu_info *); - int (*ipi_establish)(int (*)(void *), - cpuid_t); - void (*ipi_set)(cpuid_t); - void (*ipi_clear)(cpuid_t); -#endif /* MULTIPROCESSOR */ -}; - -#define LOONGSON_MAXCPUS 16 - -extern const struct platform *sys_platform; -extern void *loongson_videobios; -extern uint loongson_cpumask; -extern uint loongson_ver; -extern int nnodes; - -#ifdef MULTIPROCESSOR -extern uint64_t cpu_spinup_a0; -extern uint64_t cpu_spinup_sp; -#endif - -struct mainbus_attach_args { - const char *maa_name; -}; - -extern struct device *bootdv; -extern char bootdev[]; -extern enum devclass bootdev_class; - -extern bus_space_tag_t early_mem_t; -extern bus_space_tag_t early_io_t; - -#define REGVAL8(x) *((volatile uint8_t *)PHYS_TO_XKPHYS((x), CCA_NC)) -#define REGVAL32(x) *((volatile uint32_t *)PHYS_TO_XKPHYS((x), CCA_NC)) -#define REGVAL64(x) *((volatile uint64_t *)PHYS_TO_XKPHYS((x), CCA_NC)) - -#define REGVAL(x) REGVAL32(x) - -#include - -#endif /* _MACHINE_AUTOCONF_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/bus.h b/lib/libc/include/mips64el-openbsd-none/machine/bus.h deleted file mode 100644 index 24430920dde3d01df663b8b0efaeecf2cf9e31e8..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/bus.h +++ /dev/null @@ -1,513 +0,0 @@ -/* $OpenBSD: bus.h,v 1.8 2020/04/14 17:35:28 kettenis Exp $ */ - -/* - * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _MACHINE_BUS_H_ -#define _MACHINE_BUS_H_ - -#ifdef __STDC__ -#define CAT(a,b) a##b -#define CAT3(a,b,c) a##b##c -#else -#define CAT(a,b) a/**/b -#define CAT3(a,b,c) a/**/b/**/c -#endif - -/* - * Bus access types. - */ -struct mips_bus_space; -typedef u_long bus_addr_t; -typedef u_long bus_size_t; -typedef u_long bus_space_handle_t; -typedef struct mips_bus_space *bus_space_tag_t; - -struct mips_bus_space { - bus_addr_t bus_base; - void *bus_private; - u_int8_t (*_space_read_1)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_1)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int8_t); - u_int16_t (*_space_read_2)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_2)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int16_t); - u_int32_t (*_space_read_4)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_4)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int32_t); - u_int64_t (*_space_read_8)(bus_space_tag_t , bus_space_handle_t, - bus_size_t); - void (*_space_write_8)(bus_space_tag_t , bus_space_handle_t, - bus_size_t, u_int64_t); - void (*_space_read_raw_2)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, u_int8_t *, bus_size_t); - void (*_space_write_raw_2)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const u_int8_t *, bus_size_t); - void (*_space_read_raw_4)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, u_int8_t *, bus_size_t); - void (*_space_write_raw_4)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const u_int8_t *, bus_size_t); - void (*_space_read_raw_8)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, u_int8_t *, bus_size_t); - void (*_space_write_raw_8)(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const u_int8_t *, bus_size_t); - int (*_space_map)(bus_space_tag_t , bus_addr_t, - bus_size_t, int, bus_space_handle_t *); - void (*_space_unmap)(bus_space_tag_t, bus_space_handle_t, - bus_size_t); - int (*_space_subregion)(bus_space_tag_t, bus_space_handle_t, - bus_size_t, bus_size_t, bus_space_handle_t *); - void * (*_space_vaddr)(bus_space_tag_t, bus_space_handle_t); - paddr_t (*_space_mmap)(bus_space_tag_t, bus_addr_t, off_t, - int, int); -}; - -#define bus_space_read_1(t, h, o) (*(t)->_space_read_1)((t), (h), (o)) -#define bus_space_read_2(t, h, o) (*(t)->_space_read_2)((t), (h), (o)) -#define bus_space_read_4(t, h, o) (*(t)->_space_read_4)((t), (h), (o)) -#define bus_space_read_8(t, h, o) (*(t)->_space_read_8)((t), (h), (o)) - -#define bus_space_write_1(t, h, o, v) (*(t)->_space_write_1)((t), (h), (o), (v)) -#define bus_space_write_2(t, h, o, v) (*(t)->_space_write_2)((t), (h), (o), (v)) -#define bus_space_write_4(t, h, o, v) (*(t)->_space_write_4)((t), (h), (o), (v)) -#define bus_space_write_8(t, h, o, v) (*(t)->_space_write_8)((t), (h), (o), (v)) - -#define bus_space_read_raw_multi_2(t, h, a, b, l) \ - (*(t)->_space_read_raw_2)((t), (h), (a), (b), (l)) -#define bus_space_read_raw_multi_4(t, h, a, b, l) \ - (*(t)->_space_read_raw_4)((t), (h), (a), (b), (l)) -#define bus_space_read_raw_multi_8(t, h, a, b, l) \ - (*(t)->_space_read_raw_8)((t), (h), (a), (b), (l)) - -#define bus_space_write_raw_multi_2(t, h, a, b, l) \ - (*(t)->_space_write_raw_2)((t), (h), (a), (b), (l)) -#define bus_space_write_raw_multi_4(t, h, a, b, l) \ - (*(t)->_space_write_raw_4)((t), (h), (a), (b), (l)) -#define bus_space_write_raw_multi_8(t, h, a, b, l) \ - (*(t)->_space_write_raw_8)((t), (h), (a), (b), (l)) - -#define bus_space_map(t, o, s, c, p) (*(t)->_space_map)((t), (o), (s), (c), (p)) -#define bus_space_unmap(t, h, s) (*(t)->_space_unmap)((t), (h), (s)) -#define bus_space_subregion(t, h, o, s, p) \ - (*(t)->_space_subregion)((t), (h), (o), (s), (p)) - -#define BUS_SPACE_MAP_CACHEABLE 0x01 -#define BUS_SPACE_MAP_LINEAR 0x02 -#define BUS_SPACE_MAP_PREFETCHABLE 0x04 - -#define bus_space_vaddr(t, h) (*(t)->_space_vaddr)((t), (h)) -#define bus_space_mmap(t, a, o, p, f) \ - (*(t)->_space_mmap)((t), (a), (o), (p), (f)) - -/*----------------------------------------------------------------------------*/ -#define bus_space_read_multi(n,m) \ -static __inline void \ -CAT(bus_space_read_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_size_t o, CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) \ - *x++ = CAT(bus_space_read_,n)(bst, bsh, o); \ -} - -bus_space_read_multi(1,8) -bus_space_read_multi(2,16) -bus_space_read_multi(4,32) -bus_space_read_multi(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_read_region(n,m) \ -static __inline void \ -CAT(bus_space_read_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_addr_t ba, CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) { \ - *x++ = CAT(bus_space_read_,n)(bst, bsh, ba); \ - ba += (n); \ - } \ -} - -bus_space_read_region(1,8) -bus_space_read_region(2,16) -bus_space_read_region(4,32) -bus_space_read_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_read_raw_region(n,m) \ -static __inline void \ -CAT(bus_space_read_raw_region_,n)(bus_space_tag_t bst, \ - bus_space_handle_t bsh, \ - bus_addr_t ba, u_int8_t *x, size_t cnt) \ -{ \ - cnt >>= ((n) >> 1); \ - while (cnt--) { \ - CAT(bus_space_read_raw_multi_,n)(bst, bsh, ba, x, (n)); \ - ba += (n); \ - x += (n); \ - } \ -} - -bus_space_read_raw_region(2,16) -bus_space_read_raw_region(4,32) -bus_space_read_raw_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_write_multi(n,m) \ -static __inline void \ -CAT(bus_space_write_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_size_t o, const CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) \ - CAT(bus_space_write_,n)(bst, bsh, o, *x++); \ -} - -bus_space_write_multi(1,8) -bus_space_write_multi(2,16) -bus_space_write_multi(4,32) -bus_space_write_multi(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_write_region(n,m) \ -static __inline void \ -CAT(bus_space_write_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_addr_t ba, const CAT3(u_int,m,_t) *x, size_t cnt) \ -{ \ - while (cnt--) { \ - CAT(bus_space_write_,n)(bst, bsh, ba, *x++); \ - ba += (n); \ - } \ -} - -bus_space_write_region(1,8) -bus_space_write_region(2,16) -bus_space_write_region(4,32) -bus_space_write_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_write_raw_region(n,m) \ -static __inline void \ -CAT(bus_space_write_raw_region_,n)(bus_space_tag_t bst, \ - bus_space_handle_t bsh, \ - bus_addr_t ba, const u_int8_t *x, size_t cnt) \ -{ \ - cnt >>= ((n) >> 1); \ - while (cnt--) { \ - CAT(bus_space_write_raw_multi_,n)(bst, bsh, ba, x, (n)); \ - ba += (n); \ - x += (n); \ - } \ -} - -bus_space_write_raw_region(2,16) -bus_space_write_raw_region(4,32) -bus_space_write_raw_region(8,64) - -/*----------------------------------------------------------------------------*/ -#define bus_space_set_region(n,m) \ -static __inline void \ -CAT(bus_space_set_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ - bus_addr_t ba, CAT3(u_int,m,_t) x, size_t cnt) \ -{ \ - while (cnt--) { \ - CAT(bus_space_write_,n)(bst, bsh, ba, x); \ - ba += (n); \ - } \ -} - -bus_space_set_region(1,8) -bus_space_set_region(2,16) -bus_space_set_region(4,32) -bus_space_set_region(8,64) - -/*----------------------------------------------------------------------------*/ -static __inline void -bus_space_copy_1(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - char *s = (char *)(h1 + o1); - char *d = (char *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - - -static __inline void -bus_space_copy_2(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - short *s = (short *)(h1 + o1); - short *d = (short *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - -static __inline void -bus_space_copy_4(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - int *s = (int *)(h1 + o1); - int *d = (int *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - -static __inline void -bus_space_copy_8(void *v, bus_space_handle_t h1, bus_size_t o1, - bus_space_handle_t h2, bus_size_t o2, bus_size_t c) -{ - int64_t *s = (int64_t *)(h1 + o1); - int64_t *d = (int64_t *)(h2 + o2); - - while (c--) - *d++ = *s++; -} - -int generic_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int, - bus_space_handle_t *); -void generic_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t); -int generic_space_region(bus_space_tag_t, bus_space_handle_t, bus_size_t, - bus_size_t, bus_space_handle_t *); -void *generic_space_vaddr(bus_space_tag_t, bus_space_handle_t); -uint8_t generic_space_read_1(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint16_t generic_space_read_2(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint32_t generic_space_read_4(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint64_t generic_space_read_8(bus_space_tag_t, bus_space_handle_t, bus_size_t); -void generic_space_read_raw_2(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void generic_space_write_1(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint8_t); -void generic_space_write_2(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint16_t); -void generic_space_write_4(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint32_t); -void generic_space_write_8(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint64_t); -void generic_space_write_raw_2(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -void generic_space_read_raw_4(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void generic_space_write_raw_4(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -void generic_space_read_raw_8(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void generic_space_write_raw_8(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -paddr_t generic_space_mmap(bus_space_tag_t, bus_addr_t, off_t, int, int); - -/*----------------------------------------------------------------------------*/ -/* - * Bus read/write barrier methods. - * - * void bus_space_barrier(bus_space_tag_t tag, - * bus_space_handle_t bsh, bus_size_t offset, - * bus_size_t len, int flags); - * - */ -static inline void -bus_space_barrier(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset, - bus_size_t length, int flags) -{ - __asm__ volatile ("sync" ::: "memory"); -} -#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ -#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ - -#define BUS_DMA_WAITOK 0x0000 -#define BUS_DMA_NOWAIT 0x0001 -#define BUS_DMA_ALLOCNOW 0x0002 -#define BUS_DMA_COHERENT 0x0008 -#define BUS_DMA_BUS1 0x0010 /* placeholders for bus functions... */ -#define BUS_DMA_BUS2 0x0020 -#define BUS_DMA_BUS3 0x0040 -#define BUS_DMA_BUS4 0x0080 -#define BUS_DMA_READ 0x0100 /* mapping is device -> memory only */ -#define BUS_DMA_WRITE 0x0200 /* mapping is memory -> device only */ -#define BUS_DMA_STREAMING 0x0400 /* hint: sequential, unidirectional */ -#define BUS_DMA_ZERO 0x0800 /* zero memory in dmamem_alloc */ -#define BUS_DMA_NOCACHE 0x1000 -#define BUS_DMA_64BIT 0x2000 /* device handles 64bit dva */ - -/* Forwards needed by prototypes below. */ -struct mbuf; -struct proc; -struct uio; - -#define BUS_DMASYNC_POSTREAD 0x0001 -#define BUS_DMASYNC_POSTWRITE 0x0002 -#define BUS_DMASYNC_PREREAD 0x0004 -#define BUS_DMASYNC_PREWRITE 0x0008 - -typedef struct machine_bus_dma_tag *bus_dma_tag_t; -typedef struct machine_bus_dmamap *bus_dmamap_t; - -/* - * bus_dma_segment_t - * - * Describes a single contiguous DMA transaction. Values - * are suitable for programming into DMA registers. - */ -struct machine_bus_dma_segment { - bus_addr_t ds_addr; /* DMA address */ - bus_size_t ds_len; /* length of transfer */ - - paddr_t _ds_paddr; /* CPU address */ - vaddr_t _ds_vaddr; /* CPU address */ -}; -typedef struct machine_bus_dma_segment bus_dma_segment_t; - -/* - * bus_dma_tag_t - * - * A machine-dependent opaque type describing the implementation of - * DMA for a given bus. - */ - -struct machine_bus_dma_tag { - void *_cookie; /* cookie used in the guts */ - - /* - * DMA mapping methods. - */ - int (*_dmamap_create)(bus_dma_tag_t , bus_size_t, int, - bus_size_t, bus_size_t, int, bus_dmamap_t *); - void (*_dmamap_destroy)(bus_dma_tag_t , bus_dmamap_t); - int (*_dmamap_load)(bus_dma_tag_t , bus_dmamap_t, void *, - bus_size_t, struct proc *, int); - int (*_dmamap_load_mbuf)(bus_dma_tag_t , bus_dmamap_t, - struct mbuf *, int); - int (*_dmamap_load_uio)(bus_dma_tag_t , bus_dmamap_t, - struct uio *, int); - int (*_dmamap_load_raw)(bus_dma_tag_t , bus_dmamap_t, - bus_dma_segment_t *, int, bus_size_t, int); - int (*_dmamap_load_buffer)(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); - void (*_dmamap_unload)(bus_dma_tag_t , bus_dmamap_t); - void (*_dmamap_sync)(bus_dma_tag_t , bus_dmamap_t, - bus_addr_t, bus_size_t, int); - - /* - * DMA memory utility functions. - */ - int (*_dmamem_alloc)(bus_dma_tag_t, bus_size_t, bus_size_t, - bus_size_t, bus_dma_segment_t *, int, int *, int); - void (*_dmamem_free)(bus_dma_tag_t, bus_dma_segment_t *, int); - int (*_dmamem_map)(bus_dma_tag_t, bus_dma_segment_t *, - int, size_t, caddr_t *, int); - void (*_dmamem_unmap)(bus_dma_tag_t, caddr_t, size_t); - paddr_t (*_dmamem_mmap)(bus_dma_tag_t, bus_dma_segment_t *, - int, off_t, int, int); - - /* - * internal memory address translation information. - */ - bus_addr_t (*_pa_to_device)(paddr_t); - paddr_t (*_device_to_pa)(bus_addr_t); - bus_addr_t _dma_mask; -}; - -#define bus_dmamap_create(t, s, n, m, b, f, p) \ - (*(t)->_dmamap_create)((t), (s), (n), (m), (b), (f), (p)) -#define bus_dmamap_destroy(t, p) \ - (*(t)->_dmamap_destroy)((t), (p)) -#define bus_dmamap_load(t, m, b, s, p, f) \ - (*(t)->_dmamap_load)((t), (m), (b), (s), (p), (f)) -#define bus_dmamap_load_mbuf(t, m, b, f) \ - (*(t)->_dmamap_load_mbuf)((t), (m), (b), (f)) -#define bus_dmamap_load_uio(t, m, u, f) \ - (*(t)->_dmamap_load_uio)((t), (m), (u), (f)) -#define bus_dmamap_load_raw(t, m, sg, n, s, f) \ - (*(t)->_dmamap_load_raw)((t), (m), (sg), (n), (s), (f)) -#define bus_dmamap_unload(t, p) \ - (*(t)->_dmamap_unload)((t), (p)) -#define bus_dmamap_sync(t, p, a, l, o) \ - (void)((t)->_dmamap_sync ? \ - (*(t)->_dmamap_sync)((t), (p), (a), (l), (o)) : (void)0) - -#define bus_dmamem_alloc(t, s, a, b, sg, n, r, f) \ - (*(t)->_dmamem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f)) -#define bus_dmamem_free(t, sg, n) \ - (*(t)->_dmamem_free)((t), (sg), (n)) -#define bus_dmamem_map(t, sg, n, s, k, f) \ - (*(t)->_dmamem_map)((t), (sg), (n), (s), (k), (f)) -#define bus_dmamem_unmap(t, k, s) \ - (*(t)->_dmamem_unmap)((t), (k), (s)) -#define bus_dmamem_mmap(t, sg, n, o, p, f) \ - (*(t)->_dmamem_mmap)((t), (sg), (n), (o), (p), (f)) - -int _dmamap_create(bus_dma_tag_t, bus_size_t, int, - bus_size_t, bus_size_t, int, bus_dmamap_t *); -void _dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); -int _dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int); -int _dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t, struct mbuf *, int); -int _dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); -int _dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, - bus_dma_segment_t *, int, bus_size_t, int); -int _dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); -void _dmamap_unload(bus_dma_tag_t, bus_dmamap_t); -void _dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, - bus_size_t, int); - -int _dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, - bus_size_t, bus_dma_segment_t *, int, int *, int); -void _dmamem_free(bus_dma_tag_t, bus_dma_segment_t *, int); -int _dmamem_map(bus_dma_tag_t, bus_dma_segment_t *, - int, size_t, caddr_t *, int); -void _dmamem_unmap(bus_dma_tag_t, caddr_t, size_t); -paddr_t _dmamem_mmap(bus_dma_tag_t, bus_dma_segment_t *, int, off_t, int, int); -int _dmamem_alloc_range(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, - bus_dma_segment_t *, int, int *, int, paddr_t, paddr_t); - -/* - * bus_dmamap_t - * - * Describes a DMA mapping. - */ -struct machine_bus_dmamap { - /* - * PRIVATE MEMBERS: not for use by machine-independent code. - */ - bus_size_t _dm_size; /* largest DMA transfer mappable */ - int _dm_segcnt; /* number of segs this map can map */ - bus_size_t _dm_maxsegsz; /* largest possible segment */ - bus_size_t _dm_boundary; /* don't cross this */ - int _dm_flags; /* misc. flags */ - - void *_dm_cookie; /* cookie for bus-specific functions */ - - /* - * PUBLIC MEMBERS: these are used by machine-independent code. - */ - bus_size_t dm_mapsize; /* size of the mapping */ - int dm_nsegs; /* # valid segments in mapping */ - bus_dma_segment_t dm_segs[1]; /* segments; variable length */ -}; - -#endif /* _MACHINE_BUS_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/conf.h b/lib/libc/include/mips64el-openbsd-none/machine/conf.h deleted file mode 100644 index 8eafed12d4280fe87a48ef344db8d720d17edd55..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/conf.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: conf.h,v 1.4 2022/06/28 14:43:50 visa Exp $ */ -/* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */ - -/* - * Copyright (c) 1996 Christos Zoulas. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Christos Zoulas. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include - -/* open, close, write, ioctl, kqueue */ -#define cdev_apm_init(c,n) { \ - dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ - (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ - (dev_type_stop((*))) enodev, 0, \ - (dev_type_mmap((*))) enodev, 0, 0, dev_init(c,n,kqfilter) } - -cdev_decl(apm); \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/cpu.h b/lib/libc/include/mips64el-openbsd-none/machine/cpu.h deleted file mode 100644 index d3d84bf3dbf9833456225af945c4fb8a2d57af25..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/cpu.h +++ /dev/null @@ -1,103 +0,0 @@ -/* $OpenBSD: cpu.h,v 1.8 2017/07/30 16:05:24 visa Exp $ */ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Copyright (C) 1989 Digital Equipment Corporation. - * Permission to use, copy, modify, and distribute this software and - * its documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appears in all copies. - * Digital Equipment Corporation makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * from: @(#)cpu.h 8.4 (Berkeley) 1/4/94 - */ - -#ifdef _KERNEL - -#if defined(MULTIPROCESSOR) && !defined(_LOCORE) -#define MAXCPUS 4 -struct cpu_info; -struct cpu_info *hw_getcurcpu(void); -void hw_setcurcpu(struct cpu_info *); -void hw_cpu_boot_secondary(struct cpu_info *); -void hw_cpu_hatch(struct cpu_info *); -void hw_cpu_spinup_trampoline(struct cpu_info *); -int hw_ipi_intr_establish(int (*)(void *), u_long); -void hw_ipi_intr_set(u_long); -void hw_ipi_intr_clear(u_long); -#endif /* MULTIPROCESSOR && !_LOCORE */ - -#if defined(CPU_LOONGSON2) && !defined(CPU_LOONGSON3) -#define Mips_SyncCache(ci) \ - Loongson2_SyncCache((ci)) -#define Mips_InvalidateICache(ci, va, l) \ - Loongson2_InvalidateICache((ci), (va), (l)) -#define Mips_InvalidateICachePage(ci, va) \ - Loongson2_InvalidateICachePage((ci), (va)) -#define Mips_SyncICache(ci) \ - Loongson2_SyncICache((ci)) -#define Mips_SyncDCachePage(ci, va, pa) \ - Loongson2_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCachePage(ci, va, pa) \ - Loongson2_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCache(ci, va, l) \ - Loongson2_HitSyncDCache((ci), (va), (l)) -#define Mips_IOSyncDCache(ci, va, l, h) \ - Loongson2_IOSyncDCache((ci), (va), (l), (h)) -#define Mips_HitInvalidateDCache(ci, va, l) \ - Loongson2_HitInvalidateDCache((ci), (va), (l)) -#endif - -#if defined(CPU_LOONGSON3) && !defined(CPU_LOONGSON2) -#define Mips_SyncCache(ci) \ - Loongson3_SyncCache((ci)) -#define Mips_InvalidateICache(ci, va, l) \ - Loongson3_InvalidateICache((ci), (va), (l)) -#define Mips_InvalidateICachePage(ci, va) \ - Loongson3_InvalidateICachePage((ci), (va)) -#define Mips_SyncICache(ci) \ - Loongson3_SyncICache((ci)) -#define Mips_SyncDCachePage(ci, va, pa) \ - Loongson3_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCachePage(ci, va, pa) \ - Loongson3_SyncDCachePage((ci), (va), (pa)) -#define Mips_HitSyncDCache(ci, va, l) \ - Loongson3_HitSyncDCache((ci), (va), (l)) -#define Mips_IOSyncDCache(ci, va, l, h) \ - Loongson3_IOSyncDCache((ci), (va), (l), (h)) -#define Mips_HitInvalidateDCache(ci, va, l) \ - Loongson3_HitInvalidateDCache((ci), (va), (l)) -#endif - -#endif /* _KERNEL */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/cpustate.h b/lib/libc/include/mips64el-openbsd-none/machine/cpustate.h deleted file mode 100644 index f5aff1a41b0821e4223149081bd09917bbd5ead5..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/cpustate.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: cpustate.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/db_machdep.h b/lib/libc/include/mips64el-openbsd-none/machine/db_machdep.h deleted file mode 100644 index 3759d833718e73d1721d3c9d4e719e76c39fe568..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/db_machdep.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: db_machdep.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/elf.h b/lib/libc/include/mips64el-openbsd-none/machine/elf.h deleted file mode 100644 index 5918df727bdaf3cd8ab2b3b7df5c61cdc0b8b8ef..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/elf.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: elf.h,v 1.1 2024/07/14 19:33:59 miod Exp $ */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/endian.h b/lib/libc/include/mips64el-openbsd-none/machine/endian.h deleted file mode 100644 index 2e7392a0828e58ea0353f15ea21bca2453d884eb..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/endian.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: endian.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/exec.h b/lib/libc/include/mips64el-openbsd-none/machine/exec.h deleted file mode 100644 index 53433783f0c0157fda10cb49ac0566fd0ae354c1..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/exec.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: exec.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/fpu.h b/lib/libc/include/mips64el-openbsd-none/machine/fpu.h deleted file mode 100644 index 19ee8af41438ceaa59169b2355572d0256f33272..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/fpu.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: fpu.h,v 1.1 2010/09/17 00:34:04 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/frame.h b/lib/libc/include/mips64el-openbsd-none/machine/frame.h deleted file mode 100644 index d14827e33c0e4797ab96d1648b847715e058d110..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/frame.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: frame.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/ieee.h b/lib/libc/include/mips64el-openbsd-none/machine/ieee.h deleted file mode 100644 index d390acb3c59f1631bcb889841e5f9d27e9520a2f..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/ieee.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: ieee.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/ieeefp.h b/lib/libc/include/mips64el-openbsd-none/machine/ieeefp.h deleted file mode 100644 index 17e880358e20378250fc45526d8c18fa0aef70a6..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/ieeefp.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: ieeefp.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/intr.h b/lib/libc/include/mips64el-openbsd-none/machine/intr.h deleted file mode 100644 index 64d103bc39aa71a0cb565ab4655c9d7eec4cbc21..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/intr.h +++ /dev/null @@ -1,193 +0,0 @@ -/* $OpenBSD: intr.h,v 1.19 2025/05/10 10:01:03 visa Exp $ */ - -/* - * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef _MACHINE_INTR_H_ -#define _MACHINE_INTR_H_ - -#define __USE_MI_SOFTINTR - -#include - -/* - * The interrupt level ipl is a logical level; per-platform interrupt - * code will turn it into the appropriate hardware interrupt masks - * values. - * - * Interrupt sources on the CPU are kept enabled regardless of the - * current ipl value; individual hardware sources interrupting while - * logically masked are masked on the fly, remembered as pending, and - * unmasked at the first splx() opportunity. - * - * An exception to this rule is the clock interrupt. Clock interrupts - * are always allowed to happen, but will (of course!) not be serviced - * if logically masked. The reason for this is that clocks usually sit on - * INT5 and cannot be easily masked if external hardware masking is used. - */ - -/* Interrupt priority `levels'; not mutually exclusive. */ -#define IPL_NONE 0 /* nothing */ -#define IPL_SOFTINT 1 /* soft interrupts */ -#define IPL_SOFTCLOCK 1 /* soft clock interrupts */ -#define IPL_SOFTNET 2 /* soft network interrupts */ -#define IPL_SOFTTTY 3 /* soft terminal interrupts */ -#define IPL_SOFTHIGH IPL_SOFTTTY /* highest level of soft interrupts */ -#define IPL_BIO 4 /* block I/O */ -#define IPL_AUDIO IPL_BIO -#define IPL_NET 5 /* network */ -#define IPL_TTY 6 /* terminal */ -#define IPL_VM 7 /* memory allocation */ -#define IPL_CLOCK 8 /* clock */ -#define IPL_STATCLOCK IPL_CLOCK -#define IPL_SCHED 9 /* everything */ -#define IPL_HIGH 9 /* everything */ -#define IPL_IPI 10 /* interprocessor interrupt */ -#define NIPLS 11 /* number of levels */ - -#define IPL_MPFLOOR IPL_TTY - -/* Interrupt priority 'flags'. */ -#define IPL_MPSAFE 0x100 - -/* Interrupt sharing types. */ -#define IST_NONE 0 /* none */ -#define IST_PULSE 1 /* pulsed */ -#define IST_EDGE 2 /* edge-triggered */ -#define IST_LEVEL 3 /* level-triggered */ - -#ifndef _LOCORE - -void softintr(int); - -#define splbio() splraise(IPL_BIO) -#define splnet() splraise(IPL_NET) -#define spltty() splraise(IPL_TTY) -#define splaudio() splraise(IPL_AUDIO) -#define splclock() splraise(IPL_CLOCK) -#define splvm() splraise(IPL_VM) -#define splhigh() splraise(IPL_HIGH) - -#define splsoftclock() splraise(IPL_SOFTCLOCK) -#define splsoftnet() splraise(IPL_SOFTNET) -#define splstatclock() splhigh() - -#define splsched() splhigh() -#define spl0() spllower(0) - -void splinit(void); - -#ifdef DIAGNOSTIC -/* - * Although this function is implemented in MI code, it must be in this MD - * header because we don't want this header to include MI includes. - */ -void splassert_fail(int, int, const char *); -extern int splassert_ctl; -void splassert_check(int, const char *); -#define splassert(__wantipl) do { \ - if (splassert_ctl > 0) { \ - splassert_check(__wantipl, __func__); \ - } \ -} while (0) -#define splsoftassert(wantipl) splassert(wantipl) -#else -#define splassert(X) -#define splsoftassert(X) -#endif - -void register_splx_handler(void (*)(int)); -int splraise(int); -void splx(int); -int spllower(int); - -/* - * Interrupt control struct used by interrupt dispatchers - * to hold interrupt handler info. - */ - -#include - -struct intrhand { - struct intrhand *ih_next; - int (*ih_fun)(void *); - void *ih_arg; - int ih_level; - int ih_irq; - int ih_flags; -#define IH_MPSAFE 0x01 - struct evcount ih_count; -}; - -void intr_barrier(void *); - -/* - * Low level interrupt dispatcher registration data. - */ - -/* Schedule priorities for base interrupts (CPU) */ -#define INTPRI_IPI 0 -#define INTPRI_CLOCK 1 -/* other values are system-specific */ - -#define NLOWINT 4 /* Number of low level registrations possible */ - -extern uint32_t idle_mask; - -struct trapframe; -void set_intr(int, uint32_t, uint32_t(*)(uint32_t, struct trapframe *)); - -uint32_t updateimask(uint32_t); -void dosoftint(void); - -#ifdef MULTIPROCESSOR -extern uint32_t ipi_mask; -#define ENABLEIPI() updateimask(~ipi_mask) -#endif - -struct pic { - void (*pic_eoi)(int); - void (*pic_mask)(int); - void (*pic_unmask)(int); -}; - -#ifdef CPU_LOONGSON3 - -void loongson3_intr_init(void); -void *loongson3_intr_establish(int, int, int (*)(void *), void*, - const char *); -void loongson3_intr_disestablish(void *); -void *loongson3_ht_intr_establish(int, int, int (*)(void *), void*, - const char *); -void loongson3_ht_intr_disestablish(void *); - -void loongson3_register_ht_pic(const struct pic *); - -#endif /* CPU_LOONGSON3 */ - -#endif /* _LOCORE */ - -#endif /* _MACHINE_INTR_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/isa_machdep.h b/lib/libc/include/mips64el-openbsd-none/machine/isa_machdep.h deleted file mode 100644 index 201c218bd3fb5231555a293b7d1d2c3625772613..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/isa_machdep.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: isa_machdep.h,v 1.2 2010/05/08 21:59:56 miod Exp $ */ - -/* - * Copyright (c) 2007 Miodrag Vallat. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice, this permission notice, and the disclaimer below - * appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _MACHINE_ISA_MACHDEP_H_ -#define _MACHINE_ISA_MACHDEP_H_ - -#include - -#define __NO_ISA_INTR_CHECK - -typedef struct mips_isa_chipset *isa_chipset_tag_t; - -struct mips_isa_chipset { - void *ic_v; - - void (*ic_attach_hook)(struct device *, struct device *, - struct isabus_attach_args *); - void *(*ic_intr_establish)(void *, int, int, int, int (*)(void *), - void *, char *); - void (*ic_intr_disestablish)(void *, void *); -}; - -#define isa_attach_hook(p, s, iba) \ - (*(iba)->iba_ic->ic_attach_hook)((p), (s), (iba)) -#define isa_intr_establish(c, i, t, l, f, a, n) \ - (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a), (n)) -#define isa_intr_disestablish(c, h) \ - (*(c)->ic_intr_disestablish)((c)->ic_v, (h)) - -void loongson_generic_isa_attach_hook(struct device *, struct device *, - struct isabus_attach_args *); -void loongson_isa_specific_eoi(int); -void loongson_set_isa_imr(uint); - -#endif \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/kcore.h b/lib/libc/include/mips64el-openbsd-none/machine/kcore.h deleted file mode 100644 index c38fa9f7f6e0ddea59ac1f0ea7850a38a2d22eca..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/kcore.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: kcore.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/limits.h b/lib/libc/include/mips64el-openbsd-none/machine/limits.h deleted file mode 100644 index 12007d997ad2c9432fc6ad13fabc963fed43c9f2..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/limits.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: limits.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/loongson2.h b/lib/libc/include/mips64el-openbsd-none/machine/loongson2.h deleted file mode 100644 index 05688a8e0f9c45faa85f84be32d74c228bcbd3ab..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/loongson2.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: loongson2.h,v 1.1.1.1 2009/08/06 20:51:44 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/loongson3.h b/lib/libc/include/mips64el-openbsd-none/machine/loongson3.h deleted file mode 100644 index bcbe6ca7018fb2277e222d0662241f22d4e253bf..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/loongson3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: loongson3.h,v 1.1 2016/11/06 10:20:33 visa Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/memconf.h b/lib/libc/include/mips64el-openbsd-none/machine/memconf.h deleted file mode 100644 index c7782048ac7eb9086d64bc2dd8b4d77e3e9d67bb..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/memconf.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: memconf.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/mips_opcode.h b/lib/libc/include/mips64el-openbsd-none/machine/mips_opcode.h deleted file mode 100644 index 5b5cbc3494fdd59ac6aacae953cf3619c6d1530d..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/mips_opcode.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mips_opcode.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/mplock.h b/lib/libc/include/mips64el-openbsd-none/machine/mplock.h deleted file mode 100644 index dc963887f82cb06ab479ce94fdfddf76e44bb85e..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/mplock.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mplock.h,v 1.1 2017/01/19 14:51:02 visa Exp $ */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/mutex.h b/lib/libc/include/mips64el-openbsd-none/machine/mutex.h deleted file mode 100644 index 8003e465f6b6905278f3da97386d911071f9056b..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/mutex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mutex.h,v 1.2 2015/07/08 13:37:31 dlg Exp $ */ - -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/param.h b/lib/libc/include/mips64el-openbsd-none/machine/param.h deleted file mode 100644 index 17092fa4a5a093ef5a4cd509b268b4fc28ef0bb5..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/param.h +++ /dev/null @@ -1,27 +0,0 @@ -/* $OpenBSD: param.h,v 1.4 2025/12/03 11:59:18 miod Exp $ */ - -/* Public Domain */ - -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - -#define MACHINE "loongson" -#define _MACHINE loongson -#define MACHINE_ARCH "mips64el" /* not the canonical endianness */ -#define _MACHINE_ARCH mips64el -#define MACHINE_CPU "mips64" -#define _MACHINE_CPU mips64 -#define MID_MACHINE MID_MIPS64 - -/* - * The Loongson level 1 cache expects software to prevent virtual - * aliases. Unfortunately, since this cache is physically tagged, - * this would require all virtual address to have the same bits 14 - * and 13 as their physical addresses, which is not something the - * kernel can guarantee unless the page size is at least 16KB. - */ -#define PAGE_SHIFT 14 - -#include - -#endif /* _MACHINE_PARAM_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/pcb.h b/lib/libc/include/mips64el-openbsd-none/machine/pcb.h deleted file mode 100644 index e48bfc2f316c00e773efb610642791ad8d374be2..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/pcb.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: pcb.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/pci_machdep.h b/lib/libc/include/mips64el-openbsd-none/machine/pci_machdep.h deleted file mode 100644 index ade283806c11d7029d43fe292cb48ad30d3cc5c7..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/pci_machdep.h +++ /dev/null @@ -1,101 +0,0 @@ -/* $OpenBSD: pci_machdep.h,v 1.10 2016/05/04 14:30:01 kettenis Exp $ */ - -/* - * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -typedef struct mips_pci_chipset *pci_chipset_tag_t; -typedef u_long pcitag_t; -typedef u_long pci_intr_handle_t; - -struct pci_attach_args; - -/* - * mips-specific PCI structure and type definitions. - * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. - */ -struct mips_pci_chipset { - void *pc_conf_v; - void (*pc_attach_hook)(struct device *, - struct device *, struct pcibus_attach_args *); - int (*pc_bus_maxdevs)(void *, int); - pcitag_t (*pc_make_tag)(void *, int, int, int); - void (*pc_decompose_tag)(void *, pcitag_t, int *, - int *, int *); - int (*pc_conf_size)(void *, pcitag_t); - pcireg_t (*pc_conf_read)(void *, pcitag_t, int); - void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t); - - void *pc_intr_v; - int (*pc_intr_map)(struct pci_attach_args *, pci_intr_handle_t *); - const char *(*pc_intr_string)(void *, pci_intr_handle_t); - void *(*pc_intr_establish)(void *, pci_intr_handle_t, - int, int (*)(void *), void *, char *); - void (*pc_intr_disestablish)(void *, void *); -}; - -/* - * Functions provided to machine-independent PCI code. - */ -#define pci_attach_hook(p, s, pba) \ - (*(pba)->pba_pc->pc_attach_hook)((p), (s), (pba)) -#define pci_bus_maxdevs(c, b) \ - (*(c)->pc_bus_maxdevs)((c)->pc_conf_v, (b)) -#define pci_make_tag(c, b, d, f) \ - (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) -#define pci_decompose_tag(c, t, bp, dp, fp) \ - (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) -#define pci_conf_size(c, t) \ - (*(c)->pc_conf_size)((c)->pc_conf_v, (t)) -#define pci_conf_read(c, t, r) \ - (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) -#define pci_conf_write(c, t, r, v) \ - (*(c)->pc_conf_write)((c)->pc_conf_v, (t), (r), (v)) -#define pci_intr_map(c, ihp) \ - (*(c)->pa_pc->pc_intr_map)((c), (ihp)) -#define pci_intr_map_msi(c, ihp) (-1) -#define pci_intr_map_msix(c, vec, ihp) (-1) -#define pci_intr_string(c, ih) \ - (*(c)->pc_intr_string)((c)->pc_intr_v, (ih)) -#define pci_intr_establish(c, ih, l, h, a, nm) \ - (*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a), (nm)) -#define pci_intr_disestablish(c, iv) \ - (*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv)) -#define pci_probe_device_hook(c, a) (0) - -#define pci_min_powerstate(c, t) (PCI_PMCSR_STATE_D3) -#define pci_set_powerstate_md(c, t, s, p) - -/* PCI view of CPU memory */ -extern paddr_t loongson_dma_base; - -/* - * Functions used during early system configuration. - */ - -extern pcitag_t (*pci_make_tag_early)(int, int, int); -extern pcireg_t (*pci_conf_read_early)(pcitag_t, int); - -#define pci_dev_postattach(a, b) \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/pmap.h b/lib/libc/include/mips64el-openbsd-none/machine/pmap.h deleted file mode 100644 index eda0b11a3c63e3b7ab53d099b6ca595215ad5302..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/pmap.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: pmap.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/pmon.h b/lib/libc/include/mips64el-openbsd-none/machine/pmon.h deleted file mode 100644 index 7729adb4680ab9e77a1c0d174631e57be336d579..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/pmon.h +++ /dev/null @@ -1,209 +0,0 @@ -/* $OpenBSD: pmon.h,v 1.5 2017/05/21 13:00:53 visa Exp $ */ - -/* - * Copyright (c) 2009, 2012 Miodrag Vallat. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _MACHINE_PMON_H_ -#define _MACHINE_PMON_H_ - -#if defined(_KERNEL) || defined(_STANDALONE) - -/* - * PMON2000 callvec definitions - */ - -/* 32-bit compatible types */ -typedef uint32_t pmon_size_t; -typedef int32_t pmon_ssize_t; -typedef int64_t pmon_off_t; - -int pmon_open(const char *, int, ...); -int pmon_close(int); -int pmon_read(int, void *, pmon_size_t); -pmon_ssize_t pmon_write(int, const void *, pmon_size_t); -pmon_off_t pmon_lseek(int, pmon_off_t, int); -int pmon_printf(const char *, ...); -void pmon_cacheflush(void); -char * pmon_gets(char *); - -#define PMON_MAXLN 256 /* internal gets() size limit */ - -extern int32_t pmon_callvec; - -const char *pmon_getarg(const int); -void pmon_init(int32_t, int32_t, int32_t, int32_t, uint32_t); - -#define PMON_ENVTYPE_ENVP 0 -#define PMON_ENVTYPE_EFI 1 -int pmon_getenvtype(void); - -/* - * The new environment interface is a /salmigondis/ of badly thought-out - * structs put together, pretending to be inspired by EFI but conveniently - * omitting key EFI structs because they are deemed non-applicable to - * MIPS systems. - * Of course, some fields are absolute addresses, while others are relative - * pointers, to add to the confusion. - */ - -struct pmon_env_reset { - void (*cold_boot)(void); /* not filled */ - void (*warm_boot)(void); - void (*boot)(unsigned int); /* not filled */ - void (*poweroff)(void); -}; - -/* all values are offsets relative to the beginning of the struct */ -struct pmon_env_ptr { - uint64_t offs_mem; - uint64_t offs_cpu; - uint64_t offs_sys; - uint64_t offs_irq; - uint64_t offs_iface; - uint64_t offs_special; - uint64_t offs_device; -}; - -struct pmon_env_smbios { - uint16_t version; - uint64_t vga_bios; - struct pmon_env_ptr ptrs; -}; - -struct pmon_env_efi { - uint64_t mps; /* not filled */ - uint64_t acpi; /* not filled */ - uint64_t acpi20; /* not filled */ - struct pmon_env_smbios bios; - uint64_t sal_systab; /* not filled */ - uint64_t bootinfo; /* not filled */ -}; - -struct pmon_env { - struct pmon_env_efi efi; - struct pmon_env_reset reset; -}; - -#define PMON_MEM_MAX 128 -struct pmon_env_mem_entry { - uint32_t node; - uint32_t type; -#define PMON_MEM_SYSTEM_LOW 1 /* physical memory <= 256 MB */ -#define PMON_MEM_SYSTEM_HIGH 2 /* physical memory > 256 MB */ -#define PMON_MEM_RESERVED 3 -#define PMON_MEM_PCI_IO 4 -#define PMON_MEM_PCI_MEM 5 -#define PMON_MEM_CPU_REGISTERS 6 -#define PMON_MEM_VIDEO_ROM 7 -#define PMON_MEM_OTHER_ROM 8 -#define PMON_MEM_ACPI_TABLE 9 - uint64_t address; - uint32_t size; -}; -struct pmon_env_mem { - uint16_t version; /* not filled */ - uint32_t nentries; - uint32_t mem_freq; - struct pmon_env_mem_entry mem_map[PMON_MEM_MAX]; -} __packed; - -struct pmon_env_cpu { - uint16_t version; /* not filled */ - uint32_t prid; /* cop0 PrID */ - uint32_t cputype; -/* 0 and 1 are supposedly intended for 2E and 2F, which do NOT provide this - interface; moreover Linux and PMON disagree on the values and have 2E and - 2F swapped. */ -#define PMON_CPUTYPE_LS3A 2 -#define PMON_CPUTYPE_LS3B 3 -#define PMON_CPUTYPE_LS1A 4 -#define PMON_CPUTYPE_LS1B 5 - uint32_t node; /* total number of NUMA nodes */ - uint16_t coreid; /* boot CPU core id */ - uint16_t reserved_cores; /* mask of reserved cores */ - uint32_t speed; - uint32_t ncpus; -} __packed; - -struct pmon_env_sys { - uint16_t version; /* not filled */ - uint32_t ccnuma_smp; - uint32_t double_channel; -} __packed; - -struct pmon_env_irq { - uint16_t version; /* not filled */ - uint16_t size; /* not filled */ - uint16_t rtr_bus; /* not filled */ - uint16_t rtr_devfn; /* not filled */ - uint32_t vendor; /* not filled */ - uint32_t device; /* not filled */ - uint32_t pic_type; -#define PMON_IRQ_PIC_HT 0 -#define PMON_IRQ_PIC_I8259 1 - uint64_t ht_interrupt_bit; - uint64_t ht_enable; - uint32_t node; - uint64_t pci_memory_space_start; - uint64_t pci_memory_space_end; - uint64_t pci_io_space_start; /* not filled */ - uint64_t pci_io_space_end; /* not filled */ - uint64_t pci_cfg_space; /* not filled */ -} __packed; - -struct pmon_env_iface { - uint16_t version; -#define PMON_IFACE_VERSION 0x0001 - uint16_t size; - uint8_t flag; - char description[64]; /* firmware version */ -} __packed; - -#define PMON_RESOURCE_MAX 128 -struct pmon_env_resource { - uint64_t start; - uint64_t end; - char name[64]; - uint32_t flags; -}; -struct pmon_env_special { - uint16_t version; - char name[64]; - uint32_t type; - struct pmon_env_resource resource[PMON_RESOURCE_MAX]; -}; - -struct pmon_env_device { - char name[64]; /* system description */ - uint32_t nentries; - struct pmon_env_resource resource[PMON_RESOURCE_MAX]; -}; - -const char *pmon_getenv(const char *); - -const struct pmon_env_reset *pmon_get_env_reset(void); -const struct pmon_env_smbios *pmon_get_env_smbios(void); -const struct pmon_env_mem *pmon_get_env_mem(void); -const struct pmon_env_cpu *pmon_get_env_cpu(void); -const struct pmon_env_sys *pmon_get_env_sys(void); -const struct pmon_env_irq *pmon_get_env_irq(void); -const struct pmon_env_iface *pmon_get_env_iface(void); -const struct pmon_env_special *pmon_get_env_special(void); -const struct pmon_env_device *pmon_get_env_device(void); - -#endif /* _KERNEL || _STANDALONE */ - -#endif /* _MACHINE_PMON_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/proc.h b/lib/libc/include/mips64el-openbsd-none/machine/proc.h deleted file mode 100644 index 27b68200cf3e4a6bc41e3b0508c88a0cda1e8f8b..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/proc.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: proc.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/profile.h b/lib/libc/include/mips64el-openbsd-none/machine/profile.h deleted file mode 100644 index d258d1147b2dde2184faa06acd8dd2dd3ff70da7..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/profile.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: profile.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/pte.h b/lib/libc/include/mips64el-openbsd-none/machine/pte.h deleted file mode 100644 index 24c761d664776bcd5582463e73507b0dbc30b5e5..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/pte.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: pte.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/ptrace.h b/lib/libc/include/mips64el-openbsd-none/machine/ptrace.h deleted file mode 100644 index bd8e886725336c5cb7c6446144b24abee4a70994..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/ptrace.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: ptrace.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/reg.h b/lib/libc/include/mips64el-openbsd-none/machine/reg.h deleted file mode 100644 index aeecc496fedcc6c12355b089f99f5854affffcbb..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/reg.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: reg.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/regdef.h b/lib/libc/include/mips64el-openbsd-none/machine/regdef.h deleted file mode 100644 index 03ae54124e7638aa5f2678b6628d38371ef2f010..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/regdef.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: regdef.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/regnum.h b/lib/libc/include/mips64el-openbsd-none/machine/regnum.h deleted file mode 100644 index e371c1ed202ebcbbc576b98e86f6505550a93d89..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/regnum.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: regnum.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/setjmp.h b/lib/libc/include/mips64el-openbsd-none/machine/setjmp.h deleted file mode 100644 index c834f0409a59c3a37ba2775a1f0b7f297645be29..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/setjmp.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: setjmp.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/signal.h b/lib/libc/include/mips64el-openbsd-none/machine/signal.h deleted file mode 100644 index 7f4d38dee765615d064ae13976aa867a60ba9c91..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/signal.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: signal.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/spinlock.h b/lib/libc/include/mips64el-openbsd-none/machine/spinlock.h deleted file mode 100644 index 63f58612b808d2e6af8cd6f0354ef2e7d22ef416..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/spinlock.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: spinlock.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/sysarch.h b/lib/libc/include/mips64el-openbsd-none/machine/sysarch.h deleted file mode 100644 index 6dac08a77bf53343defb3088b3675f31e91bbdc0..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/sysarch.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: sysarch.h,v 1.1.1.1 2009/11/22 18:12:44 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/timetc.h b/lib/libc/include/mips64el-openbsd-none/machine/timetc.h deleted file mode 100644 index d3d291c815ca589d46f697b7f934e546a2490bcc..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/timetc.h +++ /dev/null @@ -1,23 +0,0 @@ -/* $OpenBSD: timetc.h,v 1.2 2020/07/18 08:37:43 visa Exp $ */ -/* - * Copyright (c) 2020 Paul Irofti - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _MACHINE_TIMETC_H_ -#define _MACHINE_TIMETC_H_ - -#include - -#endif /* _MACHINE_TIMETC_H_ */ \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/trap.h b/lib/libc/include/mips64el-openbsd-none/machine/trap.h deleted file mode 100644 index c700eedba183ed4dd57238d231a5592197584571..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/trap.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: trap.h,v 1.1.1.1 2009/07/31 09:26:26 miod Exp $ */ -/* public domain */ -#include \ No newline at end of file diff --git a/lib/libc/include/mips64el-openbsd-none/machine/vmparam.h b/lib/libc/include/mips64el-openbsd-none/machine/vmparam.h deleted file mode 100644 index c6c4b75cfe65f59dda99fec28215085d0f4e6f77..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips64el-openbsd-none/machine/vmparam.h +++ /dev/null @@ -1,11 +0,0 @@ -/* $OpenBSD: vmparam.h,v 1.5 2017/05/21 13:00:53 visa Exp $ */ -/* public domain */ -#ifndef _MACHINE_VMPARAM_H_ -#define _MACHINE_VMPARAM_H_ - -#define VM_PHYSSEG_MAX 8 /* Max number of physical memory segments */ -#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST - -#include - -#endif /* _MACHINE_VMPARAM_H_ */ \ No newline at end of file diff --git a/lib/libc/include/powerpc-openbsd-eabihf/powerpc/_types.h b/lib/libc/include/powerpc-openbsd-eabihf/powerpc/_types.h index e3d855f9a0dbee945b8d523c47ee2affe8ba5580..d6d4ef442c04de36f6bb09c7206fc60a0b0dd0ea 100644 --- a/lib/libc/include/powerpc-openbsd-eabihf/powerpc/_types.h +++ b/lib/libc/include/powerpc-openbsd-eabihf/powerpc/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.25 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.26 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,12 +122,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -struct __va_list_tag; -typedef struct __va_list_tag * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/powerpc-openbsd-eabihf/powerpc/elf.h b/lib/libc/include/powerpc-openbsd-eabihf/powerpc/elf.h index d1a121fff937d23eb097ed8964b5fe495edccd89..3b2da29dc98ddc3e0e1530d2908ae9e3e414e365 100644 --- a/lib/libc/include/powerpc-openbsd-eabihf/powerpc/elf.h +++ b/lib/libc/include/powerpc-openbsd-eabihf/powerpc/elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.h,v 1.3 2025/02/19 18:25:03 jca Exp $ */ +/* $OpenBSD: elf.h,v 1.4 2026/07/21 19:37:06 gkoehler Exp $ */ /* * This file is in the public domain. @@ -54,6 +54,7 @@ extern unsigned long hwcap2; #define PPC_FEATURE2_ISEL 0x08000000 #define PPC_FEATURE2_TAR 0x04000000 #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 +#define PPC_FEATURE2_VEC_CRYPTO 0x02000000 #define PPC_FEATURE2_HTM_NOSC 0x01000000 #define PPC_FEATURE2_ARCH_3_00 0x00800000 #define PPC_FEATURE2_HAS_IEEE128 0x00400000 diff --git a/lib/libc/include/powerpc64-openbsd-none/machine/_types.h b/lib/libc/include/powerpc64-openbsd-none/machine/_types.h index c8b810163d813fdd1339779133064866bb5de929..4e331ed8a28849a74d596e6c0af855d917a0c315 100644 --- a/lib/libc/include/powerpc64-openbsd-none/machine/_types.h +++ b/lib/libc/include/powerpc64-openbsd-none/machine/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.4 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.5 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -123,11 +123,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/powerpc64-openbsd-none/machine/elf.h b/lib/libc/include/powerpc64-openbsd-none/machine/elf.h index d1a121fff937d23eb097ed8964b5fe495edccd89..3b2da29dc98ddc3e0e1530d2908ae9e3e414e365 100644 --- a/lib/libc/include/powerpc64-openbsd-none/machine/elf.h +++ b/lib/libc/include/powerpc64-openbsd-none/machine/elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.h,v 1.3 2025/02/19 18:25:03 jca Exp $ */ +/* $OpenBSD: elf.h,v 1.4 2026/07/21 19:37:06 gkoehler Exp $ */ /* * This file is in the public domain. @@ -54,6 +54,7 @@ extern unsigned long hwcap2; #define PPC_FEATURE2_ISEL 0x08000000 #define PPC_FEATURE2_TAR 0x04000000 #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 +#define PPC_FEATURE2_VEC_CRYPTO 0x02000000 #define PPC_FEATURE2_HTM_NOSC 0x01000000 #define PPC_FEATURE2_ARCH_3_00 0x00800000 #define PPC_FEATURE2_HAS_IEEE128 0x00400000 diff --git a/lib/libc/include/powerpc64-openbsd-none/powerpc64/_types.h b/lib/libc/include/powerpc64-openbsd-none/powerpc64/_types.h index c8b810163d813fdd1339779133064866bb5de929..4e331ed8a28849a74d596e6c0af855d917a0c315 100644 --- a/lib/libc/include/powerpc64-openbsd-none/powerpc64/_types.h +++ b/lib/libc/include/powerpc64-openbsd-none/powerpc64/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.4 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.5 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -123,11 +123,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/powerpc64-openbsd-none/powerpc64/elf.h b/lib/libc/include/powerpc64-openbsd-none/powerpc64/elf.h index d1a121fff937d23eb097ed8964b5fe495edccd89..3b2da29dc98ddc3e0e1530d2908ae9e3e414e365 100644 --- a/lib/libc/include/powerpc64-openbsd-none/powerpc64/elf.h +++ b/lib/libc/include/powerpc64-openbsd-none/powerpc64/elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.h,v 1.3 2025/02/19 18:25:03 jca Exp $ */ +/* $OpenBSD: elf.h,v 1.4 2026/07/21 19:37:06 gkoehler Exp $ */ /* * This file is in the public domain. @@ -54,6 +54,7 @@ extern unsigned long hwcap2; #define PPC_FEATURE2_ISEL 0x08000000 #define PPC_FEATURE2_TAR 0x04000000 #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 +#define PPC_FEATURE2_VEC_CRYPTO 0x02000000 #define PPC_FEATURE2_HTM_NOSC 0x01000000 #define PPC_FEATURE2_ARCH_3_00 0x00800000 #define PPC_FEATURE2_HAS_IEEE128 0x00400000 diff --git a/lib/libc/include/riscv64-openbsd-none/machine/_types.h b/lib/libc/include/riscv64-openbsd-none/machine/_types.h index b5c1227f1e6ee8bfb02e03c04c71c91269a1868c..36530ad8866789a76513ddc2a75e5fdcf578e459 100644 --- a/lib/libc/include/riscv64-openbsd-none/machine/_types.h +++ b/lib/libc/include/riscv64-openbsd-none/machine/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.5 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.6 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -124,11 +124,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/riscv64-openbsd-none/machine/bus.h b/lib/libc/include/riscv64-openbsd-none/machine/bus.h index 85999dfe9d44bf5a60520261340a4cc7232c9dc3..0efce8e152e17b031739fd13d96deb833a56ec57 100644 --- a/lib/libc/include/riscv64-openbsd-none/machine/bus.h +++ b/lib/libc/include/riscv64-openbsd-none/machine/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.8 2025/08/03 14:03:12 jca Exp $ */ +/* $OpenBSD: bus.h,v 1.10 2026/06/22 21:12:12 kettenis Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. @@ -371,6 +371,7 @@ struct machine_bus_dma_segment { paddr_t _ds_paddr; /* CPU address */ vaddr_t _ds_vaddr; /* CPU address */ + vaddr_t _ds_bounce_va; /* mapped bounced data */ int _ds_coherent; /* Coherently mapped */ }; typedef struct machine_bus_dma_segment bus_dma_segment_t; @@ -385,6 +386,8 @@ typedef struct machine_bus_dma_segment bus_dma_segment_t; struct machine_bus_dma_tag { void *_cookie; /* cookie used in the guts */ int _flags; /* misc. flags */ + paddr_t _low; /* lowest DMA-reachable address */ + paddr_t _high; /* highest DMA-reachable address */ /* * DMA mapping methods. @@ -401,7 +404,8 @@ struct machine_bus_dma_tag { int (*_dmamap_load_raw)(bus_dma_tag_t , bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int (*_dmamap_load_buffer)(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, + int *, int *, int); void (*_dmamap_unload)(bus_dma_tag_t , bus_dmamap_t); void (*_dmamap_sync)(bus_dma_tag_t , bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -459,6 +463,8 @@ struct machine_bus_dma_tag { #define bus_dmamem_mmap(t, sg, n, o, p, f) \ (*(t)->_dmamem_mmap)((t), (sg), (n), (o), (p), (f)) +void bus_dma_init(void); + int _dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); void _dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); @@ -469,7 +475,8 @@ int _dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); int _dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int _dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, int *, + int *, int); void _dmamap_unload(bus_dma_tag_t, bus_dmamap_t); void _dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -501,6 +508,13 @@ struct machine_bus_dmamap { void *_dm_cookie; /* cookie for bus-specific functions */ + struct vm_page **_dm_pages; /* replacement pages */ + vaddr_t _dm_pgva; /* those above -- mapped */ + int _dm_npages; /* number of pages allocated */ + int _dm_nused; /* number of pages replaced */ + paddr_t _dm_low; /* lowest DMA-reachable address */ + paddr_t _dm_high; /* highest DMA-reachable address */ + /* * PUBLIC MEMBERS: these are used by machine-independent code. */ diff --git a/lib/libc/include/riscv64-openbsd-none/machine/cpu.h b/lib/libc/include/riscv64-openbsd-none/machine/cpu.h index cb55a811b59437be0822b8c34eb498ebbc7b61ce..392bb13c4cee9af472d069e38774a72538813979 100644 --- a/lib/libc/include/riscv64-openbsd-none/machine/cpu.h +++ b/lib/libc/include/riscv64-openbsd-none/machine/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.25 2026/04/06 08:10:54 jca Exp $ */ +/* $OpenBSD: cpu.h,v 1.28 2026/07/07 12:12:44 kettenis Exp $ */ /* * Copyright (c) 2019 Mike Larkin @@ -26,11 +26,13 @@ /* CTL_MACHDEP definitions. */ #define CPU_COMPATIBLE 1 /* compatible property */ -#define CPU_MAXID 2 /* number of valid machdep ids */ +#define CPU_LED_BLINK 2 /* int: blink leds? */ +#define CPU_MAXID 3 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ { "compatible", CTLTYPE_STRING }, \ + { "led_blink", CTLTYPE_INT }, \ } #ifdef _KERNEL @@ -42,6 +44,8 @@ #include #include +void cpu_identify_cleanup(void); + /* All the CLKF_* macros take a struct clockframe * as an argument. */ #define clockframe trapframe @@ -263,14 +267,29 @@ void delay (unsigned); extern void (*cpu_startclock_fcn)(void); +extern unsigned long riscv_hwcap; +extern size_t riscv_vlenb; + void fpu_save(struct proc *, struct trapframe *); void fpu_load(struct proc *); +int vector_instruction(register_t stval); +void vector_save(struct proc *, struct trapframe *); +void vector_load(struct proc *); + extern int cpu_errata_sifive_cip_1200; #define cpu_idle_enter() do { /* nothing */ } while (0) #define cpu_idle_leave() do { /* nothing */ } while (0) +struct blink_led { + void (*bl_func)(void *, int); + void *bl_arg; + SLIST_ENTRY(blink_led) bl_next; +}; + +void blink_led_register(struct blink_led *); + #endif /* _KERNEL */ #ifdef MULTIPROCESSOR diff --git a/lib/libc/include/riscv64-openbsd-none/machine/elf.h b/lib/libc/include/riscv64-openbsd-none/machine/elf.h index 651c966fb81c5c0760003241863f039a16c6abbf..32cd29d7331f8a68b69563ff82368ae123f9fabd 100644 --- a/lib/libc/include/riscv64-openbsd-none/machine/elf.h +++ b/lib/libc/include/riscv64-openbsd-none/machine/elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.h,v 1.3 2024/07/14 09:48:49 jca Exp $ */ +/* $OpenBSD: elf.h,v 1.4 2026/05/02 14:09:17 jsing Exp $ */ /*- * Copyright (c) 1996-1997 John D. Polstra. @@ -27,7 +27,7 @@ */ #ifndef _MACHINE_ELF_H_ -#define _MACHINE_ELF_H_ +#define _MACHINE_ELF_H_ /* * ELF definitions for the RISC-V architecture. @@ -35,18 +35,62 @@ #ifdef _KERNEL # define __HAVE_CPU_HWCAP -extern unsigned long hwcap; +# define __HAVE_CPU_HWCAP2 +extern unsigned long hwcap; +extern unsigned long hwcap2; #endif /* _KERNEL */ /* Flags passed in AT_HWCAP */ -#define HWCAP_ISA_BIT(c) (1 << ((c) - 'a')) -#define HWCAP_ISA_I HWCAP_ISA_BIT('i') -#define HWCAP_ISA_M HWCAP_ISA_BIT('m') -#define HWCAP_ISA_A HWCAP_ISA_BIT('a') -#define HWCAP_ISA_F HWCAP_ISA_BIT('f') -#define HWCAP_ISA_D HWCAP_ISA_BIT('d') -#define HWCAP_ISA_C HWCAP_ISA_BIT('c') -#define HWCAP_ISA_G \ +#define HWCAP_ISA_BIT(c) (1 << ((c) - 'a')) +#define HWCAP_ISA_I HWCAP_ISA_BIT('i') +#define HWCAP_ISA_M HWCAP_ISA_BIT('m') +#define HWCAP_ISA_A HWCAP_ISA_BIT('a') +#define HWCAP_ISA_F HWCAP_ISA_BIT('f') +#define HWCAP_ISA_D HWCAP_ISA_BIT('d') +#define HWCAP_ISA_G \ (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) +#define HWCAP_ISA_B HWCAP_ISA_BIT('b') +#define HWCAP_ISA_C HWCAP_ISA_BIT('c') +#define HWCAP_ISA_H HWCAP_ISA_BIT('h') +#define HWCAP_ISA_V HWCAP_ISA_BIT('v') + +#ifdef _KERNEL +/* Kernel Used Extensions */ +#define HWCAP_ISA_K_OFFSET 32 +#define HWCAP_ISA_K_BIT(n) (1UL << (HWCAP_ISA_K_OFFSET + (n))) +#define HWCAP_ISA_K_MASK (0xffffUL << HWCAP_ISA_K_OFFSET) +#define HWCAP_ISA_ZICBOM HWCAP_ISA_K_BIT(0) /* Cache Block Management */ +#define HWCAP_ISA_ZICBOP HWCAP_ISA_K_BIT(1) /* Cache Block Prefetch */ +#define HWCAP_ISA_ZICBOZ HWCAP_ISA_K_BIT(2) /* Cache Block Zero */ + +/* Supervisor Extensions */ +#define HWCAP_ISA_S_OFFSET 48 +#define HWCAP_ISA_S_BIT(n) (1UL << (HWCAP_ISA_S_OFFSET + (n))) +#define HWCAP_ISA_S_MASK (0xffffUL << HWCAP_ISA_S_OFFSET) +#define HWCAP_ISA_SVNAPOT HWCAP_ISA_S_BIT(0) /* NAPOT Translation */ +#define HWCAP_ISA_SVPBMT HWCAP_ISA_S_BIT(1) /* Page-Based Memory Types */ +#define HWCAP_ISA_SVINVAL HWCAP_ISA_S_BIT(2) /* Cache Invalidation */ +#define HWCAP_ISA_SSTC HWCAP_ISA_S_BIT(3) /* Timer Interrupts */ +#define HWCAP_ISA_SCOFPMF HWCAP_ISA_S_BIT(4) /* Count Overflow */ +#define HWCAP_ISA_SSNPM HWCAP_ISA_S_BIT(5) /* Pointer Masking */ +#endif /* _KERNEL */ + +/* Flags passed in AT_HWCAP2 */ +#define HWCAP2_ISA_ZBA (1UL << 0) /* Address Generation */ +#define HWCAP2_ISA_ZBB (1UL << 1) /* Basic Bit Manipulation */ +#define HWCAP2_ISA_ZBC (1UL << 2) /* Carry-Less Multiplication */ +#define HWCAP2_ISA_ZBS (1UL << 3) /* Single-Bit */ +#define HWCAP2_ISA_ZFH (1UL << 4) /* Scalar Half Precision FP */ +#define HWCAP2_ISA_ZKT (1UL << 5) /* Data-Independent Execution */ +#define HWCAP2_ISA_ZVBB (1UL << 6) /* Vector Basic Bit Manipulation */ +#define HWCAP2_ISA_ZVBC (1UL << 7) /* Vector Carry-less Multiplication */ +#define HWCAP2_ISA_ZVFH (1UL << 8) /* Vector Half Precision FP */ +#define HWCAP2_ISA_ZVKG (1UL << 9) /* Vector GCM/GMAC */ +#define HWCAP2_ISA_ZVKNED (1UL << 10) /* Vector AES Block Cipher */ +#define HWCAP2_ISA_ZVKNHA (1UL << 11) /* Vector SHA-256 */ +#define HWCAP2_ISA_ZVKNHB (1UL << 12) /* Vector SHA-512 */ +#define HWCAP2_ISA_ZVKSED (1UL << 13) /* Vector ShangMi SM4 */ +#define HWCAP2_ISA_ZVKSH (1UL << 14) /* Vector ShangMi SM3 */ +#define HWCAP2_ISA_ZVKT (1UL << 15) /* Vector Data-Independent Execution */ #endif /* !_MACHINE_ELF_H_ */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-openbsd-none/machine/pcb.h b/lib/libc/include/riscv64-openbsd-none/machine/pcb.h index a1b6cb9e47409b0600a513384bc93ae95739feb6..af61df17626e012b234f9ac0d26696d0992c2fa6 100644 --- a/lib/libc/include/riscv64-openbsd-none/machine/pcb.h +++ b/lib/libc/include/riscv64-openbsd-none/machine/pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcb.h,v 1.4 2024/10/15 09:16:39 jsg Exp $ */ +/* $OpenBSD: pcb.h,v 1.5 2026/05/09 17:38:50 jsing Exp $ */ /* * Copyright (c) 2016 Dale Rahn @@ -31,11 +31,13 @@ struct pcb { u_int pcb_flags; #define PCB_FPU 0x00000001 /* Process had FPU initialized */ #define PCB_SINGLESTEP 0x00000002 /* Single step process */ +#define PCB_VECTOR 0x00000004 /* Process had vector initialized */ struct trapframe *pcb_tf; - register_t pcb_sp; // stack pointer of switchframe + register_t pcb_sp; /* stack pointer of switchframe */ - caddr_t pcb_onfault; // On fault handler - struct fpreg pcb_fpstate; // Floating Point state */ + caddr_t pcb_onfault; /* On fault handler */ + struct fpreg pcb_fpstate; /* Floating Point state */ + struct vreg *pcb_vstate; /* Vector state */ }; #endif /* _MACHINE_PCB_H_ */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-openbsd-none/machine/reg.h b/lib/libc/include/riscv64-openbsd-none/machine/reg.h index f80b13d4aa2fc703581d191d41eeced37f2330ca..c742bfd0629df9d1ad8e2df83e2ce672273b54b8 100644 --- a/lib/libc/include/riscv64-openbsd-none/machine/reg.h +++ b/lib/libc/include/riscv64-openbsd-none/machine/reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: reg.h,v 1.2 2021/05/12 01:20:52 jsg Exp $ */ +/* $OpenBSD: reg.h,v 1.3 2026/05/09 17:38:50 jsing Exp $ */ /*- * Copyright (c) 2019 Brian Bamsch @@ -57,4 +57,12 @@ struct fpreg { uint64_t fp_fcsr; /* floating-point control register */ }; +struct vreg { + uint64_t v_vtype; /* vector type control register */ + uint64_t v_vl; /* vector length control register */ + uint64_t v_vstart; /* vector start control register */ + uint64_t v_vcsr; /* vector control and status register */ + uint8_t v_vdata[]; /* vector register data (sized based on vlenb) */ +}; + #endif /* !_MACHINE_REG_H_ */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-openbsd-none/machine/riscvreg.h b/lib/libc/include/riscv64-openbsd-none/machine/riscvreg.h index cf19db3ca1d3e654c02b16034478097ac58e62b0..a009fe60b90d31b680d7ffc42f3d7b5b0a9b243e 100644 --- a/lib/libc/include/riscv64-openbsd-none/machine/riscvreg.h +++ b/lib/libc/include/riscv64-openbsd-none/machine/riscvreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: riscvreg.h,v 1.5 2022/08/29 02:01:18 jsg Exp $ */ +/* $OpenBSD: riscvreg.h,v 1.8 2026/07/24 10:51:00 kettenis Exp $ */ /*- * Copyright (c) 2019 Brian Bamsch @@ -67,6 +67,8 @@ #define MSTATUS_SPIE (1 << 5) #define MSTATUS_MPIE (1 << 7) #define MSTATUS_SPP (1 << 8) +#define MSTATUS_VS_SHIFT 9 +#define MSTATUS_VS_MASK (0x3 << MSTATUS_VS_SHIFT) #define MSTATUS_MPP_SHIFT 11 #define MSTATUS_MPP_MASK (0x3 << MSTATUS_MPP_SHIFT) #define MSTATUS_FS_SHIFT 13 @@ -90,6 +92,12 @@ #define SSTATUS_UPIE (1 << 4) #define SSTATUS_SPIE (1 << 5) #define SSTATUS_SPP (1 << 8) +#define SSTATUS_VS_SHIFT 9 +#define SSTATUS_VS_MASK (0x3 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_OFF (0x0 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_INITIAL (0x1 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_CLEAN (0x2 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_DIRTY (0x3 << SSTATUS_VS_SHIFT) #define SSTATUS_FS_SHIFT 13 #define SSTATUS_FS_MASK (0x3 << SSTATUS_FS_SHIFT) #define SSTATUS_FS_OFF (0x0 << SSTATUS_FS_SHIFT) @@ -154,6 +162,9 @@ #define UIP_UTIP (1 << 4) #define UIP_UEIP (1 << 8) +#define STOPEI_ID_MASK (0x7ff << STOPEI_ID_SHIFT) +#define STOPEI_ID_SHIFT 16 + #define PPN(pa) ((pa) >> PAGE_SHIFT) #define SATP_PPN_SHIFT 0 #define SATP_PPN_MASK (0xfffffffffffULL << SATP_PPN_SHIFT) @@ -191,18 +202,27 @@ #define INSN_SIZE 4 #define INSN_C_SIZE 2 +/* + * The maximum vector register length in bits (VLEN) is 65,536, as + * documented in section 31.2 of the The RISC-V Instruction Set Manual, + * Volume I: Unprivileged Architecture (Version 20260120). + */ +#define VLEN_MAX 65536 +#define VLEN_BYTES_MAX (VLEN_MAX / 8) + // Check if val can fit in the CSR immediate form #define CSR_ZIMM(val) \ (__builtin_constant_p(val) && ((u_long)(val) < 32)) #define csr_swap(csr, val) \ -({ if (CSR_ZIMM(val)) \ +({ u_long ret; \ + if (CSR_ZIMM(val)) \ __asm volatile("csrrwi %0, " #csr ", %1" \ - : "=r" (val) : "i" (val)); \ + : "=r" (ret) : "i" (val)); \ else \ - __asm volatile("csrrw %0, " #csr ", %1" \ - : "=r" (val) : "r" (val)); \ - val; \ + __asm volatile("csrrw %0, " #csr ", %1" \ + : "=r" (ret) : "r" (val)); \ + ret; \ }) #define csr_write(csr, val) \ diff --git a/lib/libc/include/riscv64-openbsd-none/riscv64/_types.h b/lib/libc/include/riscv64-openbsd-none/riscv64/_types.h index b5c1227f1e6ee8bfb02e03c04c71c91269a1868c..36530ad8866789a76513ddc2a75e5fdcf578e459 100644 --- a/lib/libc/include/riscv64-openbsd-none/riscv64/_types.h +++ b/lib/libc/include/riscv64-openbsd-none/riscv64/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.5 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.6 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -124,11 +124,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/riscv64-openbsd-none/riscv64/bus.h b/lib/libc/include/riscv64-openbsd-none/riscv64/bus.h index 85999dfe9d44bf5a60520261340a4cc7232c9dc3..0efce8e152e17b031739fd13d96deb833a56ec57 100644 --- a/lib/libc/include/riscv64-openbsd-none/riscv64/bus.h +++ b/lib/libc/include/riscv64-openbsd-none/riscv64/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.8 2025/08/03 14:03:12 jca Exp $ */ +/* $OpenBSD: bus.h,v 1.10 2026/06/22 21:12:12 kettenis Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. @@ -371,6 +371,7 @@ struct machine_bus_dma_segment { paddr_t _ds_paddr; /* CPU address */ vaddr_t _ds_vaddr; /* CPU address */ + vaddr_t _ds_bounce_va; /* mapped bounced data */ int _ds_coherent; /* Coherently mapped */ }; typedef struct machine_bus_dma_segment bus_dma_segment_t; @@ -385,6 +386,8 @@ typedef struct machine_bus_dma_segment bus_dma_segment_t; struct machine_bus_dma_tag { void *_cookie; /* cookie used in the guts */ int _flags; /* misc. flags */ + paddr_t _low; /* lowest DMA-reachable address */ + paddr_t _high; /* highest DMA-reachable address */ /* * DMA mapping methods. @@ -401,7 +404,8 @@ struct machine_bus_dma_tag { int (*_dmamap_load_raw)(bus_dma_tag_t , bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int (*_dmamap_load_buffer)(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, + int *, int *, int); void (*_dmamap_unload)(bus_dma_tag_t , bus_dmamap_t); void (*_dmamap_sync)(bus_dma_tag_t , bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -459,6 +463,8 @@ struct machine_bus_dma_tag { #define bus_dmamem_mmap(t, sg, n, o, p, f) \ (*(t)->_dmamem_mmap)((t), (sg), (n), (o), (p), (f)) +void bus_dma_init(void); + int _dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); void _dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); @@ -469,7 +475,8 @@ int _dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t, struct uio *, int); int _dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); int _dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, - bus_size_t, struct proc *, int, paddr_t *, int *, int); + bus_size_t, struct proc *, int, paddr_t *, int *, int *, + int *, int); void _dmamap_unload(bus_dma_tag_t, bus_dmamap_t); void _dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t, bus_size_t, int); @@ -501,6 +508,13 @@ struct machine_bus_dmamap { void *_dm_cookie; /* cookie for bus-specific functions */ + struct vm_page **_dm_pages; /* replacement pages */ + vaddr_t _dm_pgva; /* those above -- mapped */ + int _dm_npages; /* number of pages allocated */ + int _dm_nused; /* number of pages replaced */ + paddr_t _dm_low; /* lowest DMA-reachable address */ + paddr_t _dm_high; /* highest DMA-reachable address */ + /* * PUBLIC MEMBERS: these are used by machine-independent code. */ diff --git a/lib/libc/include/riscv64-openbsd-none/riscv64/cpu.h b/lib/libc/include/riscv64-openbsd-none/riscv64/cpu.h index cb55a811b59437be0822b8c34eb498ebbc7b61ce..392bb13c4cee9af472d069e38774a72538813979 100644 --- a/lib/libc/include/riscv64-openbsd-none/riscv64/cpu.h +++ b/lib/libc/include/riscv64-openbsd-none/riscv64/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.25 2026/04/06 08:10:54 jca Exp $ */ +/* $OpenBSD: cpu.h,v 1.28 2026/07/07 12:12:44 kettenis Exp $ */ /* * Copyright (c) 2019 Mike Larkin @@ -26,11 +26,13 @@ /* CTL_MACHDEP definitions. */ #define CPU_COMPATIBLE 1 /* compatible property */ -#define CPU_MAXID 2 /* number of valid machdep ids */ +#define CPU_LED_BLINK 2 /* int: blink leds? */ +#define CPU_MAXID 3 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ { "compatible", CTLTYPE_STRING }, \ + { "led_blink", CTLTYPE_INT }, \ } #ifdef _KERNEL @@ -42,6 +44,8 @@ #include #include +void cpu_identify_cleanup(void); + /* All the CLKF_* macros take a struct clockframe * as an argument. */ #define clockframe trapframe @@ -263,14 +267,29 @@ void delay (unsigned); extern void (*cpu_startclock_fcn)(void); +extern unsigned long riscv_hwcap; +extern size_t riscv_vlenb; + void fpu_save(struct proc *, struct trapframe *); void fpu_load(struct proc *); +int vector_instruction(register_t stval); +void vector_save(struct proc *, struct trapframe *); +void vector_load(struct proc *); + extern int cpu_errata_sifive_cip_1200; #define cpu_idle_enter() do { /* nothing */ } while (0) #define cpu_idle_leave() do { /* nothing */ } while (0) +struct blink_led { + void (*bl_func)(void *, int); + void *bl_arg; + SLIST_ENTRY(blink_led) bl_next; +}; + +void blink_led_register(struct blink_led *); + #endif /* _KERNEL */ #ifdef MULTIPROCESSOR diff --git a/lib/libc/include/riscv64-openbsd-none/riscv64/elf.h b/lib/libc/include/riscv64-openbsd-none/riscv64/elf.h index 651c966fb81c5c0760003241863f039a16c6abbf..32cd29d7331f8a68b69563ff82368ae123f9fabd 100644 --- a/lib/libc/include/riscv64-openbsd-none/riscv64/elf.h +++ b/lib/libc/include/riscv64-openbsd-none/riscv64/elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.h,v 1.3 2024/07/14 09:48:49 jca Exp $ */ +/* $OpenBSD: elf.h,v 1.4 2026/05/02 14:09:17 jsing Exp $ */ /*- * Copyright (c) 1996-1997 John D. Polstra. @@ -27,7 +27,7 @@ */ #ifndef _MACHINE_ELF_H_ -#define _MACHINE_ELF_H_ +#define _MACHINE_ELF_H_ /* * ELF definitions for the RISC-V architecture. @@ -35,18 +35,62 @@ #ifdef _KERNEL # define __HAVE_CPU_HWCAP -extern unsigned long hwcap; +# define __HAVE_CPU_HWCAP2 +extern unsigned long hwcap; +extern unsigned long hwcap2; #endif /* _KERNEL */ /* Flags passed in AT_HWCAP */ -#define HWCAP_ISA_BIT(c) (1 << ((c) - 'a')) -#define HWCAP_ISA_I HWCAP_ISA_BIT('i') -#define HWCAP_ISA_M HWCAP_ISA_BIT('m') -#define HWCAP_ISA_A HWCAP_ISA_BIT('a') -#define HWCAP_ISA_F HWCAP_ISA_BIT('f') -#define HWCAP_ISA_D HWCAP_ISA_BIT('d') -#define HWCAP_ISA_C HWCAP_ISA_BIT('c') -#define HWCAP_ISA_G \ +#define HWCAP_ISA_BIT(c) (1 << ((c) - 'a')) +#define HWCAP_ISA_I HWCAP_ISA_BIT('i') +#define HWCAP_ISA_M HWCAP_ISA_BIT('m') +#define HWCAP_ISA_A HWCAP_ISA_BIT('a') +#define HWCAP_ISA_F HWCAP_ISA_BIT('f') +#define HWCAP_ISA_D HWCAP_ISA_BIT('d') +#define HWCAP_ISA_G \ (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) +#define HWCAP_ISA_B HWCAP_ISA_BIT('b') +#define HWCAP_ISA_C HWCAP_ISA_BIT('c') +#define HWCAP_ISA_H HWCAP_ISA_BIT('h') +#define HWCAP_ISA_V HWCAP_ISA_BIT('v') + +#ifdef _KERNEL +/* Kernel Used Extensions */ +#define HWCAP_ISA_K_OFFSET 32 +#define HWCAP_ISA_K_BIT(n) (1UL << (HWCAP_ISA_K_OFFSET + (n))) +#define HWCAP_ISA_K_MASK (0xffffUL << HWCAP_ISA_K_OFFSET) +#define HWCAP_ISA_ZICBOM HWCAP_ISA_K_BIT(0) /* Cache Block Management */ +#define HWCAP_ISA_ZICBOP HWCAP_ISA_K_BIT(1) /* Cache Block Prefetch */ +#define HWCAP_ISA_ZICBOZ HWCAP_ISA_K_BIT(2) /* Cache Block Zero */ + +/* Supervisor Extensions */ +#define HWCAP_ISA_S_OFFSET 48 +#define HWCAP_ISA_S_BIT(n) (1UL << (HWCAP_ISA_S_OFFSET + (n))) +#define HWCAP_ISA_S_MASK (0xffffUL << HWCAP_ISA_S_OFFSET) +#define HWCAP_ISA_SVNAPOT HWCAP_ISA_S_BIT(0) /* NAPOT Translation */ +#define HWCAP_ISA_SVPBMT HWCAP_ISA_S_BIT(1) /* Page-Based Memory Types */ +#define HWCAP_ISA_SVINVAL HWCAP_ISA_S_BIT(2) /* Cache Invalidation */ +#define HWCAP_ISA_SSTC HWCAP_ISA_S_BIT(3) /* Timer Interrupts */ +#define HWCAP_ISA_SCOFPMF HWCAP_ISA_S_BIT(4) /* Count Overflow */ +#define HWCAP_ISA_SSNPM HWCAP_ISA_S_BIT(5) /* Pointer Masking */ +#endif /* _KERNEL */ + +/* Flags passed in AT_HWCAP2 */ +#define HWCAP2_ISA_ZBA (1UL << 0) /* Address Generation */ +#define HWCAP2_ISA_ZBB (1UL << 1) /* Basic Bit Manipulation */ +#define HWCAP2_ISA_ZBC (1UL << 2) /* Carry-Less Multiplication */ +#define HWCAP2_ISA_ZBS (1UL << 3) /* Single-Bit */ +#define HWCAP2_ISA_ZFH (1UL << 4) /* Scalar Half Precision FP */ +#define HWCAP2_ISA_ZKT (1UL << 5) /* Data-Independent Execution */ +#define HWCAP2_ISA_ZVBB (1UL << 6) /* Vector Basic Bit Manipulation */ +#define HWCAP2_ISA_ZVBC (1UL << 7) /* Vector Carry-less Multiplication */ +#define HWCAP2_ISA_ZVFH (1UL << 8) /* Vector Half Precision FP */ +#define HWCAP2_ISA_ZVKG (1UL << 9) /* Vector GCM/GMAC */ +#define HWCAP2_ISA_ZVKNED (1UL << 10) /* Vector AES Block Cipher */ +#define HWCAP2_ISA_ZVKNHA (1UL << 11) /* Vector SHA-256 */ +#define HWCAP2_ISA_ZVKNHB (1UL << 12) /* Vector SHA-512 */ +#define HWCAP2_ISA_ZVKSED (1UL << 13) /* Vector ShangMi SM4 */ +#define HWCAP2_ISA_ZVKSH (1UL << 14) /* Vector ShangMi SM3 */ +#define HWCAP2_ISA_ZVKT (1UL << 15) /* Vector Data-Independent Execution */ #endif /* !_MACHINE_ELF_H_ */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-openbsd-none/riscv64/pcb.h b/lib/libc/include/riscv64-openbsd-none/riscv64/pcb.h index a1b6cb9e47409b0600a513384bc93ae95739feb6..af61df17626e012b234f9ac0d26696d0992c2fa6 100644 --- a/lib/libc/include/riscv64-openbsd-none/riscv64/pcb.h +++ b/lib/libc/include/riscv64-openbsd-none/riscv64/pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcb.h,v 1.4 2024/10/15 09:16:39 jsg Exp $ */ +/* $OpenBSD: pcb.h,v 1.5 2026/05/09 17:38:50 jsing Exp $ */ /* * Copyright (c) 2016 Dale Rahn @@ -31,11 +31,13 @@ struct pcb { u_int pcb_flags; #define PCB_FPU 0x00000001 /* Process had FPU initialized */ #define PCB_SINGLESTEP 0x00000002 /* Single step process */ +#define PCB_VECTOR 0x00000004 /* Process had vector initialized */ struct trapframe *pcb_tf; - register_t pcb_sp; // stack pointer of switchframe + register_t pcb_sp; /* stack pointer of switchframe */ - caddr_t pcb_onfault; // On fault handler - struct fpreg pcb_fpstate; // Floating Point state */ + caddr_t pcb_onfault; /* On fault handler */ + struct fpreg pcb_fpstate; /* Floating Point state */ + struct vreg *pcb_vstate; /* Vector state */ }; #endif /* _MACHINE_PCB_H_ */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-openbsd-none/riscv64/reg.h b/lib/libc/include/riscv64-openbsd-none/riscv64/reg.h index f80b13d4aa2fc703581d191d41eeced37f2330ca..c742bfd0629df9d1ad8e2df83e2ce672273b54b8 100644 --- a/lib/libc/include/riscv64-openbsd-none/riscv64/reg.h +++ b/lib/libc/include/riscv64-openbsd-none/riscv64/reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: reg.h,v 1.2 2021/05/12 01:20:52 jsg Exp $ */ +/* $OpenBSD: reg.h,v 1.3 2026/05/09 17:38:50 jsing Exp $ */ /*- * Copyright (c) 2019 Brian Bamsch @@ -57,4 +57,12 @@ struct fpreg { uint64_t fp_fcsr; /* floating-point control register */ }; +struct vreg { + uint64_t v_vtype; /* vector type control register */ + uint64_t v_vl; /* vector length control register */ + uint64_t v_vstart; /* vector start control register */ + uint64_t v_vcsr; /* vector control and status register */ + uint8_t v_vdata[]; /* vector register data (sized based on vlenb) */ +}; + #endif /* !_MACHINE_REG_H_ */ \ No newline at end of file diff --git a/lib/libc/include/riscv64-openbsd-none/riscv64/riscvreg.h b/lib/libc/include/riscv64-openbsd-none/riscv64/riscvreg.h index cf19db3ca1d3e654c02b16034478097ac58e62b0..a009fe60b90d31b680d7ffc42f3d7b5b0a9b243e 100644 --- a/lib/libc/include/riscv64-openbsd-none/riscv64/riscvreg.h +++ b/lib/libc/include/riscv64-openbsd-none/riscv64/riscvreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: riscvreg.h,v 1.5 2022/08/29 02:01:18 jsg Exp $ */ +/* $OpenBSD: riscvreg.h,v 1.8 2026/07/24 10:51:00 kettenis Exp $ */ /*- * Copyright (c) 2019 Brian Bamsch @@ -67,6 +67,8 @@ #define MSTATUS_SPIE (1 << 5) #define MSTATUS_MPIE (1 << 7) #define MSTATUS_SPP (1 << 8) +#define MSTATUS_VS_SHIFT 9 +#define MSTATUS_VS_MASK (0x3 << MSTATUS_VS_SHIFT) #define MSTATUS_MPP_SHIFT 11 #define MSTATUS_MPP_MASK (0x3 << MSTATUS_MPP_SHIFT) #define MSTATUS_FS_SHIFT 13 @@ -90,6 +92,12 @@ #define SSTATUS_UPIE (1 << 4) #define SSTATUS_SPIE (1 << 5) #define SSTATUS_SPP (1 << 8) +#define SSTATUS_VS_SHIFT 9 +#define SSTATUS_VS_MASK (0x3 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_OFF (0x0 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_INITIAL (0x1 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_CLEAN (0x2 << SSTATUS_VS_SHIFT) +#define SSTATUS_VS_DIRTY (0x3 << SSTATUS_VS_SHIFT) #define SSTATUS_FS_SHIFT 13 #define SSTATUS_FS_MASK (0x3 << SSTATUS_FS_SHIFT) #define SSTATUS_FS_OFF (0x0 << SSTATUS_FS_SHIFT) @@ -154,6 +162,9 @@ #define UIP_UTIP (1 << 4) #define UIP_UEIP (1 << 8) +#define STOPEI_ID_MASK (0x7ff << STOPEI_ID_SHIFT) +#define STOPEI_ID_SHIFT 16 + #define PPN(pa) ((pa) >> PAGE_SHIFT) #define SATP_PPN_SHIFT 0 #define SATP_PPN_MASK (0xfffffffffffULL << SATP_PPN_SHIFT) @@ -191,18 +202,27 @@ #define INSN_SIZE 4 #define INSN_C_SIZE 2 +/* + * The maximum vector register length in bits (VLEN) is 65,536, as + * documented in section 31.2 of the The RISC-V Instruction Set Manual, + * Volume I: Unprivileged Architecture (Version 20260120). + */ +#define VLEN_MAX 65536 +#define VLEN_BYTES_MAX (VLEN_MAX / 8) + // Check if val can fit in the CSR immediate form #define CSR_ZIMM(val) \ (__builtin_constant_p(val) && ((u_long)(val) < 32)) #define csr_swap(csr, val) \ -({ if (CSR_ZIMM(val)) \ +({ u_long ret; \ + if (CSR_ZIMM(val)) \ __asm volatile("csrrwi %0, " #csr ", %1" \ - : "=r" (val) : "i" (val)); \ + : "=r" (ret) : "i" (val)); \ else \ - __asm volatile("csrrw %0, " #csr ", %1" \ - : "=r" (val) : "r" (val)); \ - val; \ + __asm volatile("csrrw %0, " #csr ", %1" \ + : "=r" (ret) : "r" (val)); \ + ret; \ }) #define csr_write(csr, val) \ diff --git a/lib/libc/include/sparc64-openbsd-none/machine/_types.h b/lib/libc/include/sparc64-openbsd-none/machine/_types.h index b0d11eb13a20cabcb551efe7c23783083043123d..6e5c37bce3e88a97577e57701f720e26bdfa9ea3 100644 --- a/lib/libc/include/sparc64-openbsd-none/machine/_types.h +++ b/lib/libc/include/sparc64-openbsd-none/machine/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.25 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.26 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,11 +122,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/sparc64-openbsd-none/sparc64/_types.h b/lib/libc/include/sparc64-openbsd-none/sparc64/_types.h index b0d11eb13a20cabcb551efe7c23783083043123d..6e5c37bce3e88a97577e57701f720e26bdfa9ea3 100644 --- a/lib/libc/include/sparc64-openbsd-none/sparc64/_types.h +++ b/lib/libc/include/sparc64-openbsd-none/sparc64/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.25 2023/07/02 19:02:28 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.26 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,11 +122,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/x86-openbsd-none/i386/_types.h b/lib/libc/include/x86-openbsd-none/i386/_types.h index b9c612f1bb4a8eadd97c7d4dd85b119e705c7d4a..b3bf0c94fc4c35e7a74f3026074ac3d4e36f7dbd 100644 --- a/lib/libc/include/x86-openbsd-none/i386/_types.h +++ b/lib/libc/include/x86-openbsd-none/i386/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.25 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.26 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,11 +122,7 @@ typedef long double __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/x86-openbsd-none/i386/i82489reg.h b/lib/libc/include/x86-openbsd-none/i386/i82489reg.h index bb3c256cfb899617a33cc972ae8a48a372df6d87..54bcde2a1457fb7f85c9c43490ac8ad18a90facc 100644 --- a/lib/libc/include/x86-openbsd-none/i386/i82489reg.h +++ b/lib/libc/include/x86-openbsd-none/i386/i82489reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82489reg.h,v 1.5 2019/07/26 04:35:38 kevlo Exp $ */ +/* $OpenBSD: i82489reg.h,v 1.6 2026/09/19 07:04:46 jsg Exp $ */ /* $NetBSD: i82489reg.h,v 1.1.2.1 2000/02/20 16:30:27 sommerfeld Exp $ */ /*- @@ -110,7 +110,7 @@ # define LAPIC_LVTT_VEC_MASK 0x000000ff # define LAPIC_LVTT_DS 0x00001000 # define LAPIC_LVTT_M 0x00010000 -# define LAPIC_LVTT_TM 0x00020000 +# define LAPIC_LVTT_TM 0x00060000 # define LAPIC_LVTT_TM_ONESHOT 0x00000000 # define LAPIC_LVTT_TM_PERIODIC 0x00020000 # define LAPIC_LVTT_TM_TSCDL 0x00040000 diff --git a/lib/libc/include/x86-openbsd-none/i386/specialreg.h b/lib/libc/include/x86-openbsd-none/i386/specialreg.h index d6872cec0b00679bbe9163bbdbb68360ca41767a..85104d1a842169fd5e91af6698be3d7534008f13 100644 --- a/lib/libc/include/x86-openbsd-none/i386/specialreg.h +++ b/lib/libc/include/x86-openbsd-none/i386/specialreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specialreg.h,v 1.86 2026/04/19 01:10:28 jsg Exp $ */ +/* $OpenBSD: specialreg.h,v 1.87 2026/05/14 01:39:38 jsg Exp $ */ /* $NetBSD: specialreg.h,v 1.7 1994/10/27 04:16:26 cgd Exp $ */ /*- @@ -535,6 +535,9 @@ #define DE_CFG_SERIALIZE_LFENCE (1 << 1) /* Enable serializing lfence */ #define DE_CFG_SERIALIZE_9 (1 << 9) /* Zenbleed chickenbit */ +#define MSR_BP_CFG 0xc001102e +#define BP_CFG_33 (1ULL << 33) /* op cache chickenbit, AMD-SB-7052 */ + #define IPM_C1E_CMP_HLT 0x10000000 #define IPM_SMI_CMP_HLT 0x08000000 diff --git a/lib/libc/include/x86-openbsd-none/machine/_types.h b/lib/libc/include/x86-openbsd-none/machine/_types.h index b9c612f1bb4a8eadd97c7d4dd85b119e705c7d4a..b3bf0c94fc4c35e7a74f3026074ac3d4e36f7dbd 100644 --- a/lib/libc/include/x86-openbsd-none/machine/_types.h +++ b/lib/libc/include/x86-openbsd-none/machine/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.25 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.26 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,11 +122,7 @@ typedef long double __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/x86-openbsd-none/machine/i82489reg.h b/lib/libc/include/x86-openbsd-none/machine/i82489reg.h index bb3c256cfb899617a33cc972ae8a48a372df6d87..54bcde2a1457fb7f85c9c43490ac8ad18a90facc 100644 --- a/lib/libc/include/x86-openbsd-none/machine/i82489reg.h +++ b/lib/libc/include/x86-openbsd-none/machine/i82489reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82489reg.h,v 1.5 2019/07/26 04:35:38 kevlo Exp $ */ +/* $OpenBSD: i82489reg.h,v 1.6 2026/09/19 07:04:46 jsg Exp $ */ /* $NetBSD: i82489reg.h,v 1.1.2.1 2000/02/20 16:30:27 sommerfeld Exp $ */ /*- @@ -110,7 +110,7 @@ # define LAPIC_LVTT_VEC_MASK 0x000000ff # define LAPIC_LVTT_DS 0x00001000 # define LAPIC_LVTT_M 0x00010000 -# define LAPIC_LVTT_TM 0x00020000 +# define LAPIC_LVTT_TM 0x00060000 # define LAPIC_LVTT_TM_ONESHOT 0x00000000 # define LAPIC_LVTT_TM_PERIODIC 0x00020000 # define LAPIC_LVTT_TM_TSCDL 0x00040000 diff --git a/lib/libc/include/x86-openbsd-none/machine/specialreg.h b/lib/libc/include/x86-openbsd-none/machine/specialreg.h index d6872cec0b00679bbe9163bbdbb68360ca41767a..85104d1a842169fd5e91af6698be3d7534008f13 100644 --- a/lib/libc/include/x86-openbsd-none/machine/specialreg.h +++ b/lib/libc/include/x86-openbsd-none/machine/specialreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specialreg.h,v 1.86 2026/04/19 01:10:28 jsg Exp $ */ +/* $OpenBSD: specialreg.h,v 1.87 2026/05/14 01:39:38 jsg Exp $ */ /* $NetBSD: specialreg.h,v 1.7 1994/10/27 04:16:26 cgd Exp $ */ /*- @@ -535,6 +535,9 @@ #define DE_CFG_SERIALIZE_LFENCE (1 << 1) /* Enable serializing lfence */ #define DE_CFG_SERIALIZE_9 (1 << 9) /* Zenbleed chickenbit */ +#define MSR_BP_CFG 0xc001102e +#define BP_CFG_33 (1ULL << 33) /* op cache chickenbit, AMD-SB-7052 */ + #define IPM_C1E_CMP_HLT 0x10000000 #define IPM_SMI_CMP_HLT 0x08000000 diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/_types.h b/lib/libc/include/x86_64-openbsd-none/amd64/_types.h index 6d48c5e0337ad2a3fcdc5497996ffd8d5efc6fce..e6976f252e0f7b5c9e59ffeaca724265a9fea0b1 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/_types.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.19 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.20 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,11 +122,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/bus.h b/lib/libc/include/x86_64-openbsd-none/amd64/bus.h index 140e3a73f3d476c60a61e8a599e10dfb145fc5e8..76b0193482ac26eb6aa348ce05f9d19b2bac2223 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/bus.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.37 2025/08/23 10:15:49 sf Exp $ */ +/* $OpenBSD: bus.h,v 1.38 2026/04/19 09:59:22 kettenis Exp $ */ /* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */ /*- @@ -671,6 +671,8 @@ struct bus_dmamap { bus_dma_segment_t dm_segs[1]; /* segments; variable length */ }; +void bus_dma_init(void); + int _bus_dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); void _bus_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/cpu.h b/lib/libc/include/x86_64-openbsd-none/amd64/cpu.h index cc0b57cdb6a47a06b9fc003db5310834e4a6e60c..28608fe42cc4c310aa44cab0e8c7f513e25394d3 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/cpu.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.185 2026/03/31 16:46:22 deraadt Exp $ */ +/* $OpenBSD: cpu.h,v 1.186 2026/09/08 21:01:59 daniel Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -170,6 +170,7 @@ struct cpu_info { u_int32_t ci_feature_sefflags_ebx;/* [I] */ u_int32_t ci_feature_sefflags_ecx;/* [I] */ u_int32_t ci_feature_sefflags_edx;/* [I] */ + u_int32_t ci_feature_sefflags_2_edx;/* [I] */ u_int32_t ci_feature_amdspec_ebx; /* [I] */ u_int32_t ci_feature_amdsev_eax; /* [I] */ u_int32_t ci_feature_amdsev_ebx; /* [I] */ diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/cpufunc.h b/lib/libc/include/x86_64-openbsd-none/amd64/cpufunc.h index 0f7b5cccf2295c7062a1346d70dca43b9124e157..787641ca870dee13f43a72f7fbcc97248394760b 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/cpufunc.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/cpufunc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpufunc.h,v 1.47 2025/12/30 03:19:15 jsg Exp $ */ +/* $OpenBSD: cpufunc.h,v 1.48 2026/07/28 15:08:06 hshoexer Exp $ */ /* $NetBSD: cpufunc.h,v 1.3 2003/05/08 10:27:43 fvdl Exp $ */ /*- @@ -311,13 +311,6 @@ wbinvd_on_all_cpus(void) wbinvd(); return 0; } - -static inline int -wbinvd_on_all_cpus_acked(void) -{ - wbinvd(); - return 0; -} #endif /* MULTIPROCESSOR */ static __inline void diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/ghcb.h b/lib/libc/include/x86_64-openbsd-none/amd64/ghcb.h index 159b8d57273af87d64158b70d1daf97f87ad11fa..589ef42e21689095303e6b2755c144548005dbab 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/ghcb.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/ghcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ghcb.h,v 1.7 2026/02/16 15:06:03 hshoexer Exp $ */ +/* $OpenBSD: ghcb.h,v 1.8 2026/08/19 08:56:28 hshoexer Exp $ */ /* * Copyright (c) 2024, 2025 Hans-Joerg Hoexer @@ -19,6 +19,8 @@ #ifndef _MACHINE_GHCB_H_ #define _MACHINE_GHCB_H_ +#ifdef AMDSEV + #ifndef _LOCORE #include @@ -42,6 +44,19 @@ #define GHCB_MAX 0xFFF +#endif /* !_LOCORE */ + +/* Definitions used with the MSR protocol */ +#define MSR_PROTO_CPUID_REQ 0x4 +#define MSR_PROTO_CPUID_RESP 0x5 +#define MSR_PROTO_PREFERRED_GHCB_PA_REQ 0x10 +#define MSR_PROTO_PREFERRED_GHCB_PA_RESP 0x11 +#define MSR_PROTO_REGISTER_GHCB_PA_REQ 0x12 +#define MSR_PROTO_REGISTER_GHCB_PA_RESP 0x13 +#define MSR_PROTO_TERMINATION_REQ 0x100 + +#ifndef _LOCORE + struct ghcb_sa { uint8_t v_pad0[0xcb]; /* 000h-0CAh */ uint8_t v_cpl; /* 0CBh */ @@ -102,14 +117,6 @@ struct ghcb_sync { int sz_c; int sz_d; }; -#endif /* !_LOCORE */ - -/* Definitions used with the MSR protocol */ -#define MSR_PROTO_CPUID_REQ 0x4 -#define MSR_PROTO_CPUID_RESP 0x5 -#define MSR_PROTO_TERMINATE 0x100 - -#ifndef _LOCORE extern vaddr_t ghcb_vaddr; extern paddr_t ghcb_paddr; @@ -249,4 +256,11 @@ ghcb_io_write_4(uint16_t port, uint32_t v) #endif /* !_LOCORE */ +#else /* !AMDSEV */ + +/* Definitions used with the MSR protocol */ +#define MSR_PROTO_TERMINATION_REQ 0x100 + +#endif /* AMDSEV */ + #endif /* !_MACHINE_GHCB_H_ */ \ No newline at end of file diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/i82489reg.h b/lib/libc/include/x86_64-openbsd-none/amd64/i82489reg.h index 788c516ac729c1fe16d917fec321c06c83b74172..0fa4bb70e18d682e2b5982d5204b9fe328d78357 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/i82489reg.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/i82489reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82489reg.h,v 1.5 2019/07/26 04:35:38 kevlo Exp $ */ +/* $OpenBSD: i82489reg.h,v 1.9 2026/09/19 16:11:07 mlarkin Exp $ */ /* $NetBSD: i82489reg.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */ /*- @@ -73,6 +73,8 @@ #define LAPIC_IRR 0x200 #define LAPIC_ESR 0x280 /* Err status. R */ +#define LAPIC_LVT_CMCI 0x2f0 /* Corrected machine chk LVT */ + #define LAPIC_ICRLO 0x300 /* Int. cmd. RW */ # define LAPIC_DLMODE_MASK 0x00000700 # define LAPIC_DLMODE_FIXED 0x00000000 @@ -82,6 +84,7 @@ # define LAPIC_DLMODE_NMI 0x00000400 # define LAPIC_DLMODE_INIT 0x00000500 # define LAPIC_DLMODE_STARTUP 0x00000600 +# define LAPIC_DLMODE_EXTINT 0x00000700 # define LAPIC_DSTMODE_LOG 0x00000800 @@ -110,11 +113,12 @@ # define LAPIC_LVTT_VEC_MASK 0x000000ff # define LAPIC_LVTT_DS 0x00001000 # define LAPIC_LVTT_M 0x00010000 -# define LAPIC_LVTT_TM 0x00020000 +# define LAPIC_LVTT_TM 0x00060000 # define LAPIC_LVTT_TM_ONESHOT 0x00000000 # define LAPIC_LVTT_TM_PERIODIC 0x00020000 # define LAPIC_LVTT_TM_TSCDL 0x00040000 +#define LAPIC_LVT_THERM 0x330 /* Thermal sensor LVT */ #define LAPIC_PCINT 0x340 #define LAPIC_LVINT0 0x350 /* Loc.vec (LINT0) RW */ # define LAPIC_LVT_PERIODIC 0x00020000 @@ -144,6 +148,31 @@ #define LAPIC_IRQ_MASK(i) (1 << ((i) + 1)) #define MSR_X2APIC_BASE 0x800 -#define MSR_X2APIC_EOI (MSR_X2APIC_BASE+0x0b) /* End Int. W */ -#define MSR_X2APIC_ID (MSR_X2APIC_BASE+0x02) /* ID. RW */ +#define MSR_X2APIC_END 0x83f +#define MSR_X2APIC_ID (MSR_X2APIC_BASE + 0x02) /* ID. R */ +#define MSR_X2APIC_VERSION (MSR_X2APIC_BASE + 0x03) /* Version. R */ +#define MSR_X2APIC_TPR (MSR_X2APIC_BASE + 0x08) /* Task prio. RW */ +#define MSR_X2APIC_PPR (MSR_X2APIC_BASE + 0x0a) /* Processor prio. R */ +#define MSR_X2APIC_EOI (MSR_X2APIC_BASE + 0x0b) /* End Int. W */ +#define MSR_X2APIC_LDR (MSR_X2APIC_BASE + 0x0d) /* Logical dest. R */ +#define MSR_X2APIC_SVR (MSR_X2APIC_BASE + 0x0f) /* Spurious intvec RW */ +#define MSR_X2APIC_ISR0 (MSR_X2APIC_BASE + 0x10) /* ISR 31:0. R */ +#define MSR_X2APIC_ISR7 (MSR_X2APIC_BASE + 0x17) /* ISR 255:224. R */ +#define MSR_X2APIC_TMR0 (MSR_X2APIC_BASE + 0x18) /* TMR 31:0. R */ +#define MSR_X2APIC_TMR7 (MSR_X2APIC_BASE + 0x1f) /* TMR 255:224. R */ +#define MSR_X2APIC_IRR0 (MSR_X2APIC_BASE + 0x20) /* IRR 31:0. R */ +#define MSR_X2APIC_IRR7 (MSR_X2APIC_BASE + 0x27) /* IRR 255:224. R */ +#define MSR_X2APIC_ESR (MSR_X2APIC_BASE + 0x28) /* Error status RW */ +#define MSR_X2APIC_LVT_CMCI (MSR_X2APIC_BASE + 0x2f) /* CMCI LVT. RW */ +#define MSR_X2APIC_ICR (MSR_X2APIC_BASE + 0x30) /* ICR. RW */ +#define MSR_X2APIC_LVT_TIMER (MSR_X2APIC_BASE + 0x32) /* Timer LVT. RW */ +#define MSR_X2APIC_LVT_THERM (MSR_X2APIC_BASE + 0x33) /* Thermal LVT. RW */ +#define MSR_X2APIC_LVT_PCINT (MSR_X2APIC_BASE + 0x34) /* Perf LVT. RW */ +#define MSR_X2APIC_LVT_LINT0 (MSR_X2APIC_BASE + 0x35) /* LINT0 LVT. RW */ +#define MSR_X2APIC_LVT_LINT1 (MSR_X2APIC_BASE + 0x36) /* LINT1 LVT. RW */ +#define MSR_X2APIC_LVT_ERROR (MSR_X2APIC_BASE + 0x37) /* Error LVT. RW */ +#define MSR_X2APIC_TIMER_ICR (MSR_X2APIC_BASE + 0x38) /* Initial count RW */ +#define MSR_X2APIC_TIMER_CCR (MSR_X2APIC_BASE + 0x39) /* Current count R */ +#define MSR_X2APIC_TIMER_DCR (MSR_X2APIC_BASE + 0x3e) /* Divisor config RW */ +#define MSR_X2APIC_SELF_IPI (MSR_X2APIC_BASE + 0x3f) /* Self IPI. W */ #define X2APIC_ID_MASK 0xff \ No newline at end of file diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/pci_machdep.h b/lib/libc/include/x86_64-openbsd-none/amd64/pci_machdep.h index 6804596ff5a3d7f98bb1fb113b33b696e359b595..c89d9146d5b5eaa3537184fdc82ceabcce250fa3 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/pci_machdep.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.32 2025/01/23 11:24:34 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.33 2026/07/25 22:57:22 chris Exp $ */ /* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */ /* @@ -104,6 +104,7 @@ void pci_set_powerstate_md(pci_chipset_tag_t, pcitag_t, int, int); void pci_mcfg_init(bus_space_tag_t, bus_addr_t, int, int, int); pci_chipset_tag_t pci_lookup_segment(int, int); +int acpipci_domain_to_seg(int); #define __HAVE_PCI_MSIX diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/pmap.h b/lib/libc/include/x86_64-openbsd-none/amd64/pmap.h index 1b1c88897834c1ed82a0fc7034762b3c6c28f2ff..635ce4f11da0215bd19b287605e92c95b937fcf9 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/pmap.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.94 2025/07/07 00:55:15 jsg Exp $ */ +/* $OpenBSD: pmap.h,v 1.95 2026/06/04 05:22:04 mlarkin Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -92,11 +92,8 @@ * The other levels are kept as physical pages in 3 UVM objects and are * temporarily mapped for virtual access when needed. * - * The other obvious difference from i386 is that it has a direct map of all - * physical memory in the VA range: - * - * 0xfffffd8000000000 - 0xffffff7fffffffff - * + * The other obvious difference from i386 is that it has a direct map of + * physical memory in a randomized VA subrange of the direct-map window. * The direct map is used in some cases to access PTEs of non-current pmaps. * * Note that address space is signed, so the layout for 48 bits is: @@ -104,8 +101,8 @@ * +---------------------------------+ 0xffffffffffffffff * | Kernel Image | * +---------------------------------+ 0xffffff8000000000 - * | Direct Map | - * +---------------------------------+ 0xfffffd8000000000 + * | Direct Map Window | + * +---------------------------------+ 0xffffee0000000000 * ~ ~ * | | * | Kernel Space | @@ -139,13 +136,23 @@ */ #define VA_SIGN_POS(va) ((va) & ~VA_SIGN_MASK) -#define L4_SLOT_PTE 255 -#define L4_SLOT_KERN 256 -#define L4_SLOT_KERNBASE 511 -#define NUM_L4_SLOT_DIRECT 4 -#define L4_SLOT_DIRECT (L4_SLOT_KERNBASE - NUM_L4_SLOT_DIRECT) +#define L4_SLOT_PTE 255 +#define L4_SLOT_KERN 256 +#define L4_SLOT_KERNBASE 511 +#define DIRECT_MAP_PML4_SLOTS 4 +#define DIRECT_MAP_START_CHOICES 32 +#define DIRECT_MAP_START_MASK (DIRECT_MAP_START_CHOICES - 1) +#define DIRECT_MAP_RESERVED_PML4_SLOTS (DIRECT_MAP_PML4_SLOTS + \ + DIRECT_MAP_START_CHOICES - 1) +#define DIRECT_MAP_SIZE ((vaddr_t)DIRECT_MAP_PML4_SLOTS * NBPD_L4) +#define L4_SLOT_DIRECT (L4_SLOT_KERNBASE - \ + DIRECT_MAP_RESERVED_PML4_SLOTS) #define L4_SLOT_EARLY (L4_SLOT_DIRECT - 1) +#if (DIRECT_MAP_START_CHOICES & DIRECT_MAP_START_MASK) != 0 +#error DIRECT_MAP_START_CHOICES must be a power of two +#endif + #define PDIR_SLOT_KERN L4_SLOT_KERN #define PDIR_SLOT_PTE L4_SLOT_PTE #define PDIR_SLOT_DIRECT L4_SLOT_DIRECT @@ -160,9 +167,7 @@ */ #define PTE_BASE ((pt_entry_t *) (L4_SLOT_PTE * NBPD_L4)) -#define PMAP_DIRECT_BASE (VA_SIGN_NEG((L4_SLOT_DIRECT * NBPD_L4))) -#define PMAP_DIRECT_END (VA_SIGN_NEG(((L4_SLOT_DIRECT + \ - NUM_L4_SLOT_DIRECT) * NBPD_L4))) +extern vaddr_t pmap_direct_base, pmap_direct_end; #define L1_BASE PTE_BASE @@ -498,8 +503,8 @@ kvtopte(vaddr_t va) return (PTE_BASE + pl1_i(va)); } -#define PMAP_DIRECT_MAP(pa) ((vaddr_t)PMAP_DIRECT_BASE + (pa)) -#define PMAP_DIRECT_UNMAP(va) ((paddr_t)(va) - PMAP_DIRECT_BASE) +#define PMAP_DIRECT_MAP(pa) ((vaddr_t)pmap_direct_base + (pa)) +#define PMAP_DIRECT_UNMAP(va) ((paddr_t)(va) - pmap_direct_base) #define pmap_map_direct(pg) PMAP_DIRECT_MAP(VM_PAGE_TO_PHYS(pg)) #define pmap_unmap_direct(va) PHYS_TO_VM_PAGE(PMAP_DIRECT_UNMAP(va)) diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/specialreg.h b/lib/libc/include/x86_64-openbsd-none/amd64/specialreg.h index 7f3b7d6c84a9213d9d4eaf4ee97dfa1349276fc9..eb8c05a04a718062a6b1b0f184eed509859790f7 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/specialreg.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/specialreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specialreg.h,v 1.122 2026/04/19 01:10:28 jsg Exp $ */ +/* $OpenBSD: specialreg.h,v 1.129 2026/09/19 16:11:07 mlarkin Exp $ */ /* $NetBSD: specialreg.h,v 1.1 2003/04/26 18:39:48 fvdl Exp $ */ /* $NetBSD: x86/specialreg.h,v 1.2 2003/04/25 21:54:30 fvdl Exp $ */ @@ -281,6 +281,11 @@ ("\20" "\03AVX512FNNIW" "\04AVX512FMAPS" "\012SRBDS_CTRL" "\013MD_CLEAR" \ "\016TSXFA" "\025IBT" "\033IBRS,IBPB" "\034STIBP" "\035L1DF" "\040SSBD" ) +/* SEFF subleaf 2 EDX bits */ +#define SEFF2EDX_BHI_CTRL 0x00000010 /* BHI_DIS_S supported */ +#define SEFF2_EDX_BITS \ + ("\20" "\05BHI_CTRL" ) + /* * Thermal and Power Management (CPUID function 0x6) EAX bits */ @@ -465,6 +470,7 @@ #define APICBASE_BSP 0x100 #define APICBASE_ENABLE_X2APIC 0x400 #define APICBASE_GLOBAL_ENABLE 0x800 +#define APICBASE_ADDRESS_MASK 0x000ffffffffff000ULL #define MSR_EBL_CR_POWERON 0x02a #define MSR_EBC_FREQUENCY_ID 0x02c /* Pentium 4 only */ #define MSR_TEST_CTL 0x033 @@ -474,6 +480,7 @@ #define SPEC_CTRL_IBRS (1ULL << 0) #define SPEC_CTRL_STIBP (1ULL << 1) #define SPEC_CTRL_SSBD (1ULL << 2) +#define SPEC_CTRL_BHI_DIS_S (1ULL << 10) #define MSR_PRED_CMD 0x049 /* Speculation Control IBPB */ #define PRED_CMD_IBPB (1ULL << 0) #define MSR_BIOS_UPDT_TRIG 0x079 @@ -710,6 +717,9 @@ #define DE_CFG_SERIALIZE_LFENCE (1 << 1) /* Enable serializing lfence */ #define DE_CFG_SERIALIZE_9 (1 << 9) /* Zenbleed chickenbit */ +#define MSR_BP_CFG 0xc001102e +#define BP_CFG_33 (1ULL << 33) /* op cache chickenbit, AMD-SB-7052 */ + #define IPM_C1E_CMP_HLT 0x10000000 #define IPM_SMI_CMP_HLT 0x08000000 @@ -734,6 +744,7 @@ #define MSR_SEV_STATUS 0xc0010131 #define SEV_STAT_ENABLED 0x00000001 #define SEV_STAT_ES_ENABLED 0x00000002 +#define SEV_STAT_SNP_ACTIVE 0x00000004 #define MSR_LS_CFG 0xc0011020 #define LS_CFG_DIS_LS2_SQUISH 0x02000000 @@ -1357,6 +1368,8 @@ #define VMCS_GUEST_IA32_LDTR_AR 0x4820 #define VMCS_GUEST_IA32_TR_AR 0x4822 #define VMCS_GUEST_INTERRUPTIBILITY_ST 0x4824 +#define VMX_INT_STATE_BLOCK_STI (1 << 0) +#define VMX_INT_STATE_BLOCK_MOVSS (1 << 1) #define VMCS_GUEST_ACTIVITY_STATE 0x4826 #define VMCS_GUEST_SMBASE 0x4828 #define VMCS_GUEST_IA32_SYSENTER_CS 0x482A @@ -1405,6 +1418,8 @@ #define VMCS_GUEST_IA32_SYSENTER_ESP 0x6824 #define VMCS_GUEST_IA32_SYSENTER_EIP 0x6826 #define VMCS_GUEST_IA32_S_CET 0x6828 +#define VMCS_GUEST_SSP 0x682A +#define VMCS_GUEST_IA32_INTR_SSP_TABLE 0x682C /* Natural-width host state fields */ #define VMCS_HOST_IA32_CR0 0x6C00 @@ -1420,6 +1435,8 @@ #define VMCS_HOST_IA32_RSP 0x6C14 #define VMCS_HOST_IA32_RIP 0x6C16 #define VMCS_HOST_IA32_S_CET 0x6C18 +#define VMCS_HOST_SSP 0x6C1A +#define VMCS_HOST_IA32_INTR_SSP_TABLE 0x6C1C #define IA32_VMX_INVVPID_INDIV_ADDR_CTX 0x0 #define IA32_VMX_INVVPID_SINGLE_CTX 0x1 @@ -1450,6 +1467,7 @@ #define MSR_AMD_VM_HSAVE_PA 0xc0010117 #define CPUID_AMD_SVM_CAP 0x8000000A #define AMD_SVM_NESTED_PAGING_CAP (1 << 0) +#define AMD_SVM_NRIP_SAVE_CAP (1 << 3) #define AMD_SVM_VMCB_CLEAN_CAP (1 << 5) #define AMD_SVM_FLUSH_BY_ASID_CAP (1 << 6) #define AMD_SVM_DECODE_ASSIST_CAP (1 << 7) diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/vmmvar.h b/lib/libc/include/x86_64-openbsd-none/amd64/vmmvar.h index 03006e307225ba4f611b604f3f1806b626047c52..4e6c82fac1c0aaaaa7b18ba8c67c07de9c401d46 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/vmmvar.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/vmmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmmvar.h,v 1.117 2025/09/17 18:37:44 sf Exp $ */ +/* $OpenBSD: vmmvar.h,v 1.123 2026/09/22 08:21:39 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -23,6 +23,8 @@ #ifndef _LOCORE +struct vm; + #define VMM_HV_SIGNATURE "OpenBSDVMM58" /* VMX: Basic Exit Reasons */ @@ -87,6 +89,8 @@ #define VMX_EXIT_XSAVES 63 #define VMX_EXIT_XRSTORS 64 +#define VM_EXIT_APICBASE 0xFFFC +#define VM_EXIT_X2APIC 0xFFFD #define VM_EXIT_TERMINATED 0xFFFE #define VM_EXIT_NONE 0xFFFF @@ -348,10 +352,25 @@ struct vm_exit_inout { struct vm_exit_eptviolation { uint8_t vee_fault_type; /* type of vm exit */ uint8_t vee_insn_info; /* bitfield */ -#define VEE_LEN_VALID 0x1 /* vee_insn_len is valid */ -#define VEE_BYTES_VALID 0x2 /* vee_insn_bytes is valid */ +#define VEE_LEN_VALID (1 << 0) /* vee_insn_len is valid */ +#define VEE_BYTES_VALID (1 << 1) /* vee_insn_bytes is valid */ +#define VEE_GPA_VALID (1 << 2) /* vee_gpa is valid */ uint8_t vee_insn_len; /* [VMX] instruction length */ uint8_t vee_insn_bytes[15]; /* [SVM] bytes at {R,E,}IP */ + uint64_t vee_gpa; /* GPA that caused the fault */ +}; + +/* Userspace-assisted x2APIC MSR access. */ +struct vm_exit_x2apic { + uint32_t vex_msr; + uint8_t vex_write; + uint8_t vex_pad[3]; + uint64_t vex_data; +}; + +/* Guest-visible IA32_APIC_BASE mode change. */ +struct vm_exit_apicbase { + uint64_t vea_value; }; /* @@ -469,6 +488,8 @@ struct vm_exit { union { struct vm_exit_inout vei; /* IN/OUT exit */ struct vm_exit_eptviolation vee; /* EPT VIOLATION exit*/ + struct vm_exit_apicbase vea; /* APICBASE mode exit */ + struct vm_exit_x2apic vex; /* x2APIC MSR exit */ }; struct vcpu_reg_state vrs; @@ -477,7 +498,6 @@ struct vm_exit { struct vm_intr_params { /* Input parameters to VMM_IOC_INTR */ - uint32_t vip_vm_id; uint32_t vip_vcpu_id; uint16_t vip_intr; }; @@ -495,7 +515,6 @@ struct vm_rwregs_params { * Input/output parameters to VMM_IOC_READREGS / * VMM_IOC_WRITEREGS */ - uint32_t vrwp_vm_id; uint32_t vrwp_vcpu_id; uint64_t vrwp_mask; struct vcpu_reg_state vrwp_regs; @@ -522,7 +541,6 @@ struct vm_rwregs_params { * direct cache access (CPUIDECX_DCA) * x2APIC (CPUIDECX_X2APIC) * apic deadline (CPUIDECX_DEADLINE) - * apic (CPUID_APIC) * psn (CPUID_PSN) * self snoop (CPUID_SS) * hyperthreading (CPUID_HTT) @@ -537,7 +555,7 @@ struct vm_rwregs_params { CPUIDECX_DCA | CPUIDECX_X2APIC | CPUIDECX_DEADLINE) #define VMM_ECPUIDECX_MASK ~(CPUIDECX_SVM | CPUIDECX_MWAITX) #define VMM_CPUIDEDX_MASK ~(CPUID_ACPI | CPUID_TM | \ - CPUID_HTT | CPUID_DS | CPUID_APIC | \ + CPUID_HTT | CPUID_DS | \ CPUID_PSN | CPUID_SS | CPUID_PBE | \ CPUID_MTRR | CPUID_MCE | CPUID_MCA) #define VMM_AMDSPEC_EBX_MASK ~(CPUIDEBX_IBPB | CPUIDEBX_IBRS | \ @@ -976,6 +994,7 @@ struct vcpu { struct vm_exit vc_exit; /* [v] */ uint16_t vc_intr; /* [v] */ + u_int vc_intr_latch; /* [a] */ uint8_t vc_irqready; /* [v] */ uint8_t vc_fpuinited; /* [v] */ @@ -991,6 +1010,7 @@ struct vcpu { /* Shadowed MSRs */ uint64_t vc_shadow_pat; /* [v] */ + uint64_t vc_apicbase; /* [v] */ /* Userland Protection Keys */ uint32_t vc_pkru; /* [v] */ @@ -1056,17 +1076,15 @@ void vmclear_on_cpu(struct cpu_info *); int vmm_probe_machdep(struct device *, void *, void *); void vmm_attach_machdep(struct device *, struct device *, void *); void vmm_activate_machdep(struct device *, int); -int vmmioctl_machdep(dev_t, u_long, caddr_t, int, struct proc *); -int pledge_ioctl_vmm_machdep(struct proc *, long); int vmm_start(void); int vmm_stop(void); int vm_impl_init(struct vm *, struct proc *); void vm_impl_deinit(struct vm *); int vcpu_init(struct vcpu *, struct vm_create_params *); void vcpu_deinit(struct vcpu *); -int vm_rwregs(struct vm_rwregs_params *, int); +int vm_rwregs(struct vm *, struct vm_rwregs_params *, int); int vcpu_reset_regs(struct vcpu *, struct vcpu_reg_state *); -int svm_get_vmsa_pa(uint32_t, uint32_t, uint64_t *); +int svm_get_vmsa_pa(struct proc *, struct file *, uint32_t, uint64_t *); #endif /* _KERNEL */ diff --git a/lib/libc/include/x86_64-openbsd-none/amd64/vmparam.h b/lib/libc/include/x86_64-openbsd-none/amd64/vmparam.h index dc577330a2478aa5516bf4de3591918142422568..463a650b1150c92d304aff1a0e88de66a5938f92 100644 --- a/lib/libc/include/x86_64-openbsd-none/amd64/vmparam.h +++ b/lib/libc/include/x86_64-openbsd-none/amd64/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.25 2024/11/08 01:44:52 jsg Exp $ */ +/* $OpenBSD: vmparam.h,v 1.26 2026/06/22 00:27:33 jsg Exp $ */ /* $NetBSD: vmparam.h,v 1.1 2003/04/26 18:39:49 fvdl Exp $ */ /*- @@ -98,7 +98,7 @@ #define VM_MIN_STACK_ADDRESS 0x0000600000000000 #endif #define VM_MIN_KERNEL_ADDRESS 0xffff800000000000 -#define VM_MAX_KERNEL_ADDRESS 0xffff800100000000 +#define VM_MAX_KERNEL_ADDRESS 0xffff808000000000 /* map PIE into approximately the first quarter of user va space */ #define VM_PIE_MIN_ADDR VM_MIN_ADDRESS diff --git a/lib/libc/include/x86_64-openbsd-none/machine/_types.h b/lib/libc/include/x86_64-openbsd-none/machine/_types.h index 6d48c5e0337ad2a3fcdc5497996ffd8d5efc6fce..e6976f252e0f7b5c9e59ffeaca724265a9fea0b1 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/_types.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.19 2023/07/02 19:02:27 cheloha Exp $ */ +/* $OpenBSD: _types.h,v 1.20 2026/08/31 10:58:08 tb Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -122,11 +122,7 @@ typedef float __float_t; typedef long __ptrdiff_t; typedef unsigned long __size_t; typedef long __ssize_t; -#if defined(__GNUC__) && __GNUC__ >= 3 typedef __builtin_va_list __va_list; -#else -typedef char * __va_list; -#endif /* Wide character support types */ #ifndef __cplusplus diff --git a/lib/libc/include/x86_64-openbsd-none/machine/bus.h b/lib/libc/include/x86_64-openbsd-none/machine/bus.h index 140e3a73f3d476c60a61e8a599e10dfb145fc5e8..76b0193482ac26eb6aa348ce05f9d19b2bac2223 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/bus.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.37 2025/08/23 10:15:49 sf Exp $ */ +/* $OpenBSD: bus.h,v 1.38 2026/04/19 09:59:22 kettenis Exp $ */ /* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */ /*- @@ -671,6 +671,8 @@ struct bus_dmamap { bus_dma_segment_t dm_segs[1]; /* segments; variable length */ }; +void bus_dma_init(void); + int _bus_dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); void _bus_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t); diff --git a/lib/libc/include/x86_64-openbsd-none/machine/cpu.h b/lib/libc/include/x86_64-openbsd-none/machine/cpu.h index cc0b57cdb6a47a06b9fc003db5310834e4a6e60c..28608fe42cc4c310aa44cab0e8c7f513e25394d3 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/cpu.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.185 2026/03/31 16:46:22 deraadt Exp $ */ +/* $OpenBSD: cpu.h,v 1.186 2026/09/08 21:01:59 daniel Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -170,6 +170,7 @@ struct cpu_info { u_int32_t ci_feature_sefflags_ebx;/* [I] */ u_int32_t ci_feature_sefflags_ecx;/* [I] */ u_int32_t ci_feature_sefflags_edx;/* [I] */ + u_int32_t ci_feature_sefflags_2_edx;/* [I] */ u_int32_t ci_feature_amdspec_ebx; /* [I] */ u_int32_t ci_feature_amdsev_eax; /* [I] */ u_int32_t ci_feature_amdsev_ebx; /* [I] */ diff --git a/lib/libc/include/x86_64-openbsd-none/machine/cpufunc.h b/lib/libc/include/x86_64-openbsd-none/machine/cpufunc.h index 0f7b5cccf2295c7062a1346d70dca43b9124e157..787641ca870dee13f43a72f7fbcc97248394760b 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/cpufunc.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/cpufunc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpufunc.h,v 1.47 2025/12/30 03:19:15 jsg Exp $ */ +/* $OpenBSD: cpufunc.h,v 1.48 2026/07/28 15:08:06 hshoexer Exp $ */ /* $NetBSD: cpufunc.h,v 1.3 2003/05/08 10:27:43 fvdl Exp $ */ /*- @@ -311,13 +311,6 @@ wbinvd_on_all_cpus(void) wbinvd(); return 0; } - -static inline int -wbinvd_on_all_cpus_acked(void) -{ - wbinvd(); - return 0; -} #endif /* MULTIPROCESSOR */ static __inline void diff --git a/lib/libc/include/x86_64-openbsd-none/machine/ghcb.h b/lib/libc/include/x86_64-openbsd-none/machine/ghcb.h index 159b8d57273af87d64158b70d1daf97f87ad11fa..589ef42e21689095303e6b2755c144548005dbab 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/ghcb.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/ghcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ghcb.h,v 1.7 2026/02/16 15:06:03 hshoexer Exp $ */ +/* $OpenBSD: ghcb.h,v 1.8 2026/08/19 08:56:28 hshoexer Exp $ */ /* * Copyright (c) 2024, 2025 Hans-Joerg Hoexer @@ -19,6 +19,8 @@ #ifndef _MACHINE_GHCB_H_ #define _MACHINE_GHCB_H_ +#ifdef AMDSEV + #ifndef _LOCORE #include @@ -42,6 +44,19 @@ #define GHCB_MAX 0xFFF +#endif /* !_LOCORE */ + +/* Definitions used with the MSR protocol */ +#define MSR_PROTO_CPUID_REQ 0x4 +#define MSR_PROTO_CPUID_RESP 0x5 +#define MSR_PROTO_PREFERRED_GHCB_PA_REQ 0x10 +#define MSR_PROTO_PREFERRED_GHCB_PA_RESP 0x11 +#define MSR_PROTO_REGISTER_GHCB_PA_REQ 0x12 +#define MSR_PROTO_REGISTER_GHCB_PA_RESP 0x13 +#define MSR_PROTO_TERMINATION_REQ 0x100 + +#ifndef _LOCORE + struct ghcb_sa { uint8_t v_pad0[0xcb]; /* 000h-0CAh */ uint8_t v_cpl; /* 0CBh */ @@ -102,14 +117,6 @@ struct ghcb_sync { int sz_c; int sz_d; }; -#endif /* !_LOCORE */ - -/* Definitions used with the MSR protocol */ -#define MSR_PROTO_CPUID_REQ 0x4 -#define MSR_PROTO_CPUID_RESP 0x5 -#define MSR_PROTO_TERMINATE 0x100 - -#ifndef _LOCORE extern vaddr_t ghcb_vaddr; extern paddr_t ghcb_paddr; @@ -249,4 +256,11 @@ ghcb_io_write_4(uint16_t port, uint32_t v) #endif /* !_LOCORE */ +#else /* !AMDSEV */ + +/* Definitions used with the MSR protocol */ +#define MSR_PROTO_TERMINATION_REQ 0x100 + +#endif /* AMDSEV */ + #endif /* !_MACHINE_GHCB_H_ */ \ No newline at end of file diff --git a/lib/libc/include/x86_64-openbsd-none/machine/i82489reg.h b/lib/libc/include/x86_64-openbsd-none/machine/i82489reg.h index 788c516ac729c1fe16d917fec321c06c83b74172..0fa4bb70e18d682e2b5982d5204b9fe328d78357 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/i82489reg.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/i82489reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82489reg.h,v 1.5 2019/07/26 04:35:38 kevlo Exp $ */ +/* $OpenBSD: i82489reg.h,v 1.9 2026/09/19 16:11:07 mlarkin Exp $ */ /* $NetBSD: i82489reg.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */ /*- @@ -73,6 +73,8 @@ #define LAPIC_IRR 0x200 #define LAPIC_ESR 0x280 /* Err status. R */ +#define LAPIC_LVT_CMCI 0x2f0 /* Corrected machine chk LVT */ + #define LAPIC_ICRLO 0x300 /* Int. cmd. RW */ # define LAPIC_DLMODE_MASK 0x00000700 # define LAPIC_DLMODE_FIXED 0x00000000 @@ -82,6 +84,7 @@ # define LAPIC_DLMODE_NMI 0x00000400 # define LAPIC_DLMODE_INIT 0x00000500 # define LAPIC_DLMODE_STARTUP 0x00000600 +# define LAPIC_DLMODE_EXTINT 0x00000700 # define LAPIC_DSTMODE_LOG 0x00000800 @@ -110,11 +113,12 @@ # define LAPIC_LVTT_VEC_MASK 0x000000ff # define LAPIC_LVTT_DS 0x00001000 # define LAPIC_LVTT_M 0x00010000 -# define LAPIC_LVTT_TM 0x00020000 +# define LAPIC_LVTT_TM 0x00060000 # define LAPIC_LVTT_TM_ONESHOT 0x00000000 # define LAPIC_LVTT_TM_PERIODIC 0x00020000 # define LAPIC_LVTT_TM_TSCDL 0x00040000 +#define LAPIC_LVT_THERM 0x330 /* Thermal sensor LVT */ #define LAPIC_PCINT 0x340 #define LAPIC_LVINT0 0x350 /* Loc.vec (LINT0) RW */ # define LAPIC_LVT_PERIODIC 0x00020000 @@ -144,6 +148,31 @@ #define LAPIC_IRQ_MASK(i) (1 << ((i) + 1)) #define MSR_X2APIC_BASE 0x800 -#define MSR_X2APIC_EOI (MSR_X2APIC_BASE+0x0b) /* End Int. W */ -#define MSR_X2APIC_ID (MSR_X2APIC_BASE+0x02) /* ID. RW */ +#define MSR_X2APIC_END 0x83f +#define MSR_X2APIC_ID (MSR_X2APIC_BASE + 0x02) /* ID. R */ +#define MSR_X2APIC_VERSION (MSR_X2APIC_BASE + 0x03) /* Version. R */ +#define MSR_X2APIC_TPR (MSR_X2APIC_BASE + 0x08) /* Task prio. RW */ +#define MSR_X2APIC_PPR (MSR_X2APIC_BASE + 0x0a) /* Processor prio. R */ +#define MSR_X2APIC_EOI (MSR_X2APIC_BASE + 0x0b) /* End Int. W */ +#define MSR_X2APIC_LDR (MSR_X2APIC_BASE + 0x0d) /* Logical dest. R */ +#define MSR_X2APIC_SVR (MSR_X2APIC_BASE + 0x0f) /* Spurious intvec RW */ +#define MSR_X2APIC_ISR0 (MSR_X2APIC_BASE + 0x10) /* ISR 31:0. R */ +#define MSR_X2APIC_ISR7 (MSR_X2APIC_BASE + 0x17) /* ISR 255:224. R */ +#define MSR_X2APIC_TMR0 (MSR_X2APIC_BASE + 0x18) /* TMR 31:0. R */ +#define MSR_X2APIC_TMR7 (MSR_X2APIC_BASE + 0x1f) /* TMR 255:224. R */ +#define MSR_X2APIC_IRR0 (MSR_X2APIC_BASE + 0x20) /* IRR 31:0. R */ +#define MSR_X2APIC_IRR7 (MSR_X2APIC_BASE + 0x27) /* IRR 255:224. R */ +#define MSR_X2APIC_ESR (MSR_X2APIC_BASE + 0x28) /* Error status RW */ +#define MSR_X2APIC_LVT_CMCI (MSR_X2APIC_BASE + 0x2f) /* CMCI LVT. RW */ +#define MSR_X2APIC_ICR (MSR_X2APIC_BASE + 0x30) /* ICR. RW */ +#define MSR_X2APIC_LVT_TIMER (MSR_X2APIC_BASE + 0x32) /* Timer LVT. RW */ +#define MSR_X2APIC_LVT_THERM (MSR_X2APIC_BASE + 0x33) /* Thermal LVT. RW */ +#define MSR_X2APIC_LVT_PCINT (MSR_X2APIC_BASE + 0x34) /* Perf LVT. RW */ +#define MSR_X2APIC_LVT_LINT0 (MSR_X2APIC_BASE + 0x35) /* LINT0 LVT. RW */ +#define MSR_X2APIC_LVT_LINT1 (MSR_X2APIC_BASE + 0x36) /* LINT1 LVT. RW */ +#define MSR_X2APIC_LVT_ERROR (MSR_X2APIC_BASE + 0x37) /* Error LVT. RW */ +#define MSR_X2APIC_TIMER_ICR (MSR_X2APIC_BASE + 0x38) /* Initial count RW */ +#define MSR_X2APIC_TIMER_CCR (MSR_X2APIC_BASE + 0x39) /* Current count R */ +#define MSR_X2APIC_TIMER_DCR (MSR_X2APIC_BASE + 0x3e) /* Divisor config RW */ +#define MSR_X2APIC_SELF_IPI (MSR_X2APIC_BASE + 0x3f) /* Self IPI. W */ #define X2APIC_ID_MASK 0xff \ No newline at end of file diff --git a/lib/libc/include/x86_64-openbsd-none/machine/pci_machdep.h b/lib/libc/include/x86_64-openbsd-none/machine/pci_machdep.h index 6804596ff5a3d7f98bb1fb113b33b696e359b595..c89d9146d5b5eaa3537184fdc82ceabcce250fa3 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/pci_machdep.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.32 2025/01/23 11:24:34 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.33 2026/07/25 22:57:22 chris Exp $ */ /* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */ /* @@ -104,6 +104,7 @@ void pci_set_powerstate_md(pci_chipset_tag_t, pcitag_t, int, int); void pci_mcfg_init(bus_space_tag_t, bus_addr_t, int, int, int); pci_chipset_tag_t pci_lookup_segment(int, int); +int acpipci_domain_to_seg(int); #define __HAVE_PCI_MSIX diff --git a/lib/libc/include/x86_64-openbsd-none/machine/pmap.h b/lib/libc/include/x86_64-openbsd-none/machine/pmap.h index 1b1c88897834c1ed82a0fc7034762b3c6c28f2ff..635ce4f11da0215bd19b287605e92c95b937fcf9 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/pmap.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.94 2025/07/07 00:55:15 jsg Exp $ */ +/* $OpenBSD: pmap.h,v 1.95 2026/06/04 05:22:04 mlarkin Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -92,11 +92,8 @@ * The other levels are kept as physical pages in 3 UVM objects and are * temporarily mapped for virtual access when needed. * - * The other obvious difference from i386 is that it has a direct map of all - * physical memory in the VA range: - * - * 0xfffffd8000000000 - 0xffffff7fffffffff - * + * The other obvious difference from i386 is that it has a direct map of + * physical memory in a randomized VA subrange of the direct-map window. * The direct map is used in some cases to access PTEs of non-current pmaps. * * Note that address space is signed, so the layout for 48 bits is: @@ -104,8 +101,8 @@ * +---------------------------------+ 0xffffffffffffffff * | Kernel Image | * +---------------------------------+ 0xffffff8000000000 - * | Direct Map | - * +---------------------------------+ 0xfffffd8000000000 + * | Direct Map Window | + * +---------------------------------+ 0xffffee0000000000 * ~ ~ * | | * | Kernel Space | @@ -139,13 +136,23 @@ */ #define VA_SIGN_POS(va) ((va) & ~VA_SIGN_MASK) -#define L4_SLOT_PTE 255 -#define L4_SLOT_KERN 256 -#define L4_SLOT_KERNBASE 511 -#define NUM_L4_SLOT_DIRECT 4 -#define L4_SLOT_DIRECT (L4_SLOT_KERNBASE - NUM_L4_SLOT_DIRECT) +#define L4_SLOT_PTE 255 +#define L4_SLOT_KERN 256 +#define L4_SLOT_KERNBASE 511 +#define DIRECT_MAP_PML4_SLOTS 4 +#define DIRECT_MAP_START_CHOICES 32 +#define DIRECT_MAP_START_MASK (DIRECT_MAP_START_CHOICES - 1) +#define DIRECT_MAP_RESERVED_PML4_SLOTS (DIRECT_MAP_PML4_SLOTS + \ + DIRECT_MAP_START_CHOICES - 1) +#define DIRECT_MAP_SIZE ((vaddr_t)DIRECT_MAP_PML4_SLOTS * NBPD_L4) +#define L4_SLOT_DIRECT (L4_SLOT_KERNBASE - \ + DIRECT_MAP_RESERVED_PML4_SLOTS) #define L4_SLOT_EARLY (L4_SLOT_DIRECT - 1) +#if (DIRECT_MAP_START_CHOICES & DIRECT_MAP_START_MASK) != 0 +#error DIRECT_MAP_START_CHOICES must be a power of two +#endif + #define PDIR_SLOT_KERN L4_SLOT_KERN #define PDIR_SLOT_PTE L4_SLOT_PTE #define PDIR_SLOT_DIRECT L4_SLOT_DIRECT @@ -160,9 +167,7 @@ */ #define PTE_BASE ((pt_entry_t *) (L4_SLOT_PTE * NBPD_L4)) -#define PMAP_DIRECT_BASE (VA_SIGN_NEG((L4_SLOT_DIRECT * NBPD_L4))) -#define PMAP_DIRECT_END (VA_SIGN_NEG(((L4_SLOT_DIRECT + \ - NUM_L4_SLOT_DIRECT) * NBPD_L4))) +extern vaddr_t pmap_direct_base, pmap_direct_end; #define L1_BASE PTE_BASE @@ -498,8 +503,8 @@ kvtopte(vaddr_t va) return (PTE_BASE + pl1_i(va)); } -#define PMAP_DIRECT_MAP(pa) ((vaddr_t)PMAP_DIRECT_BASE + (pa)) -#define PMAP_DIRECT_UNMAP(va) ((paddr_t)(va) - PMAP_DIRECT_BASE) +#define PMAP_DIRECT_MAP(pa) ((vaddr_t)pmap_direct_base + (pa)) +#define PMAP_DIRECT_UNMAP(va) ((paddr_t)(va) - pmap_direct_base) #define pmap_map_direct(pg) PMAP_DIRECT_MAP(VM_PAGE_TO_PHYS(pg)) #define pmap_unmap_direct(va) PHYS_TO_VM_PAGE(PMAP_DIRECT_UNMAP(va)) diff --git a/lib/libc/include/x86_64-openbsd-none/machine/specialreg.h b/lib/libc/include/x86_64-openbsd-none/machine/specialreg.h index 7f3b7d6c84a9213d9d4eaf4ee97dfa1349276fc9..eb8c05a04a718062a6b1b0f184eed509859790f7 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/specialreg.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/specialreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specialreg.h,v 1.122 2026/04/19 01:10:28 jsg Exp $ */ +/* $OpenBSD: specialreg.h,v 1.129 2026/09/19 16:11:07 mlarkin Exp $ */ /* $NetBSD: specialreg.h,v 1.1 2003/04/26 18:39:48 fvdl Exp $ */ /* $NetBSD: x86/specialreg.h,v 1.2 2003/04/25 21:54:30 fvdl Exp $ */ @@ -281,6 +281,11 @@ ("\20" "\03AVX512FNNIW" "\04AVX512FMAPS" "\012SRBDS_CTRL" "\013MD_CLEAR" \ "\016TSXFA" "\025IBT" "\033IBRS,IBPB" "\034STIBP" "\035L1DF" "\040SSBD" ) +/* SEFF subleaf 2 EDX bits */ +#define SEFF2EDX_BHI_CTRL 0x00000010 /* BHI_DIS_S supported */ +#define SEFF2_EDX_BITS \ + ("\20" "\05BHI_CTRL" ) + /* * Thermal and Power Management (CPUID function 0x6) EAX bits */ @@ -465,6 +470,7 @@ #define APICBASE_BSP 0x100 #define APICBASE_ENABLE_X2APIC 0x400 #define APICBASE_GLOBAL_ENABLE 0x800 +#define APICBASE_ADDRESS_MASK 0x000ffffffffff000ULL #define MSR_EBL_CR_POWERON 0x02a #define MSR_EBC_FREQUENCY_ID 0x02c /* Pentium 4 only */ #define MSR_TEST_CTL 0x033 @@ -474,6 +480,7 @@ #define SPEC_CTRL_IBRS (1ULL << 0) #define SPEC_CTRL_STIBP (1ULL << 1) #define SPEC_CTRL_SSBD (1ULL << 2) +#define SPEC_CTRL_BHI_DIS_S (1ULL << 10) #define MSR_PRED_CMD 0x049 /* Speculation Control IBPB */ #define PRED_CMD_IBPB (1ULL << 0) #define MSR_BIOS_UPDT_TRIG 0x079 @@ -710,6 +717,9 @@ #define DE_CFG_SERIALIZE_LFENCE (1 << 1) /* Enable serializing lfence */ #define DE_CFG_SERIALIZE_9 (1 << 9) /* Zenbleed chickenbit */ +#define MSR_BP_CFG 0xc001102e +#define BP_CFG_33 (1ULL << 33) /* op cache chickenbit, AMD-SB-7052 */ + #define IPM_C1E_CMP_HLT 0x10000000 #define IPM_SMI_CMP_HLT 0x08000000 @@ -734,6 +744,7 @@ #define MSR_SEV_STATUS 0xc0010131 #define SEV_STAT_ENABLED 0x00000001 #define SEV_STAT_ES_ENABLED 0x00000002 +#define SEV_STAT_SNP_ACTIVE 0x00000004 #define MSR_LS_CFG 0xc0011020 #define LS_CFG_DIS_LS2_SQUISH 0x02000000 @@ -1357,6 +1368,8 @@ #define VMCS_GUEST_IA32_LDTR_AR 0x4820 #define VMCS_GUEST_IA32_TR_AR 0x4822 #define VMCS_GUEST_INTERRUPTIBILITY_ST 0x4824 +#define VMX_INT_STATE_BLOCK_STI (1 << 0) +#define VMX_INT_STATE_BLOCK_MOVSS (1 << 1) #define VMCS_GUEST_ACTIVITY_STATE 0x4826 #define VMCS_GUEST_SMBASE 0x4828 #define VMCS_GUEST_IA32_SYSENTER_CS 0x482A @@ -1405,6 +1418,8 @@ #define VMCS_GUEST_IA32_SYSENTER_ESP 0x6824 #define VMCS_GUEST_IA32_SYSENTER_EIP 0x6826 #define VMCS_GUEST_IA32_S_CET 0x6828 +#define VMCS_GUEST_SSP 0x682A +#define VMCS_GUEST_IA32_INTR_SSP_TABLE 0x682C /* Natural-width host state fields */ #define VMCS_HOST_IA32_CR0 0x6C00 @@ -1420,6 +1435,8 @@ #define VMCS_HOST_IA32_RSP 0x6C14 #define VMCS_HOST_IA32_RIP 0x6C16 #define VMCS_HOST_IA32_S_CET 0x6C18 +#define VMCS_HOST_SSP 0x6C1A +#define VMCS_HOST_IA32_INTR_SSP_TABLE 0x6C1C #define IA32_VMX_INVVPID_INDIV_ADDR_CTX 0x0 #define IA32_VMX_INVVPID_SINGLE_CTX 0x1 @@ -1450,6 +1467,7 @@ #define MSR_AMD_VM_HSAVE_PA 0xc0010117 #define CPUID_AMD_SVM_CAP 0x8000000A #define AMD_SVM_NESTED_PAGING_CAP (1 << 0) +#define AMD_SVM_NRIP_SAVE_CAP (1 << 3) #define AMD_SVM_VMCB_CLEAN_CAP (1 << 5) #define AMD_SVM_FLUSH_BY_ASID_CAP (1 << 6) #define AMD_SVM_DECODE_ASSIST_CAP (1 << 7) diff --git a/lib/libc/include/x86_64-openbsd-none/machine/vmmvar.h b/lib/libc/include/x86_64-openbsd-none/machine/vmmvar.h index 03006e307225ba4f611b604f3f1806b626047c52..4e6c82fac1c0aaaaa7b18ba8c67c07de9c401d46 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/vmmvar.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/vmmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmmvar.h,v 1.117 2025/09/17 18:37:44 sf Exp $ */ +/* $OpenBSD: vmmvar.h,v 1.123 2026/09/22 08:21:39 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -23,6 +23,8 @@ #ifndef _LOCORE +struct vm; + #define VMM_HV_SIGNATURE "OpenBSDVMM58" /* VMX: Basic Exit Reasons */ @@ -87,6 +89,8 @@ #define VMX_EXIT_XSAVES 63 #define VMX_EXIT_XRSTORS 64 +#define VM_EXIT_APICBASE 0xFFFC +#define VM_EXIT_X2APIC 0xFFFD #define VM_EXIT_TERMINATED 0xFFFE #define VM_EXIT_NONE 0xFFFF @@ -348,10 +352,25 @@ struct vm_exit_inout { struct vm_exit_eptviolation { uint8_t vee_fault_type; /* type of vm exit */ uint8_t vee_insn_info; /* bitfield */ -#define VEE_LEN_VALID 0x1 /* vee_insn_len is valid */ -#define VEE_BYTES_VALID 0x2 /* vee_insn_bytes is valid */ +#define VEE_LEN_VALID (1 << 0) /* vee_insn_len is valid */ +#define VEE_BYTES_VALID (1 << 1) /* vee_insn_bytes is valid */ +#define VEE_GPA_VALID (1 << 2) /* vee_gpa is valid */ uint8_t vee_insn_len; /* [VMX] instruction length */ uint8_t vee_insn_bytes[15]; /* [SVM] bytes at {R,E,}IP */ + uint64_t vee_gpa; /* GPA that caused the fault */ +}; + +/* Userspace-assisted x2APIC MSR access. */ +struct vm_exit_x2apic { + uint32_t vex_msr; + uint8_t vex_write; + uint8_t vex_pad[3]; + uint64_t vex_data; +}; + +/* Guest-visible IA32_APIC_BASE mode change. */ +struct vm_exit_apicbase { + uint64_t vea_value; }; /* @@ -469,6 +488,8 @@ struct vm_exit { union { struct vm_exit_inout vei; /* IN/OUT exit */ struct vm_exit_eptviolation vee; /* EPT VIOLATION exit*/ + struct vm_exit_apicbase vea; /* APICBASE mode exit */ + struct vm_exit_x2apic vex; /* x2APIC MSR exit */ }; struct vcpu_reg_state vrs; @@ -477,7 +498,6 @@ struct vm_exit { struct vm_intr_params { /* Input parameters to VMM_IOC_INTR */ - uint32_t vip_vm_id; uint32_t vip_vcpu_id; uint16_t vip_intr; }; @@ -495,7 +515,6 @@ struct vm_rwregs_params { * Input/output parameters to VMM_IOC_READREGS / * VMM_IOC_WRITEREGS */ - uint32_t vrwp_vm_id; uint32_t vrwp_vcpu_id; uint64_t vrwp_mask; struct vcpu_reg_state vrwp_regs; @@ -522,7 +541,6 @@ struct vm_rwregs_params { * direct cache access (CPUIDECX_DCA) * x2APIC (CPUIDECX_X2APIC) * apic deadline (CPUIDECX_DEADLINE) - * apic (CPUID_APIC) * psn (CPUID_PSN) * self snoop (CPUID_SS) * hyperthreading (CPUID_HTT) @@ -537,7 +555,7 @@ struct vm_rwregs_params { CPUIDECX_DCA | CPUIDECX_X2APIC | CPUIDECX_DEADLINE) #define VMM_ECPUIDECX_MASK ~(CPUIDECX_SVM | CPUIDECX_MWAITX) #define VMM_CPUIDEDX_MASK ~(CPUID_ACPI | CPUID_TM | \ - CPUID_HTT | CPUID_DS | CPUID_APIC | \ + CPUID_HTT | CPUID_DS | \ CPUID_PSN | CPUID_SS | CPUID_PBE | \ CPUID_MTRR | CPUID_MCE | CPUID_MCA) #define VMM_AMDSPEC_EBX_MASK ~(CPUIDEBX_IBPB | CPUIDEBX_IBRS | \ @@ -976,6 +994,7 @@ struct vcpu { struct vm_exit vc_exit; /* [v] */ uint16_t vc_intr; /* [v] */ + u_int vc_intr_latch; /* [a] */ uint8_t vc_irqready; /* [v] */ uint8_t vc_fpuinited; /* [v] */ @@ -991,6 +1010,7 @@ struct vcpu { /* Shadowed MSRs */ uint64_t vc_shadow_pat; /* [v] */ + uint64_t vc_apicbase; /* [v] */ /* Userland Protection Keys */ uint32_t vc_pkru; /* [v] */ @@ -1056,17 +1076,15 @@ void vmclear_on_cpu(struct cpu_info *); int vmm_probe_machdep(struct device *, void *, void *); void vmm_attach_machdep(struct device *, struct device *, void *); void vmm_activate_machdep(struct device *, int); -int vmmioctl_machdep(dev_t, u_long, caddr_t, int, struct proc *); -int pledge_ioctl_vmm_machdep(struct proc *, long); int vmm_start(void); int vmm_stop(void); int vm_impl_init(struct vm *, struct proc *); void vm_impl_deinit(struct vm *); int vcpu_init(struct vcpu *, struct vm_create_params *); void vcpu_deinit(struct vcpu *); -int vm_rwregs(struct vm_rwregs_params *, int); +int vm_rwregs(struct vm *, struct vm_rwregs_params *, int); int vcpu_reset_regs(struct vcpu *, struct vcpu_reg_state *); -int svm_get_vmsa_pa(uint32_t, uint32_t, uint64_t *); +int svm_get_vmsa_pa(struct proc *, struct file *, uint32_t, uint64_t *); #endif /* _KERNEL */ diff --git a/lib/libc/include/x86_64-openbsd-none/machine/vmparam.h b/lib/libc/include/x86_64-openbsd-none/machine/vmparam.h index dc577330a2478aa5516bf4de3591918142422568..463a650b1150c92d304aff1a0e88de66a5938f92 100644 --- a/lib/libc/include/x86_64-openbsd-none/machine/vmparam.h +++ b/lib/libc/include/x86_64-openbsd-none/machine/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.25 2024/11/08 01:44:52 jsg Exp $ */ +/* $OpenBSD: vmparam.h,v 1.26 2026/06/22 00:27:33 jsg Exp $ */ /* $NetBSD: vmparam.h,v 1.1 2003/04/26 18:39:49 fvdl Exp $ */ /*- @@ -98,7 +98,7 @@ #define VM_MIN_STACK_ADDRESS 0x0000600000000000 #endif #define VM_MIN_KERNEL_ADDRESS 0xffff800000000000 -#define VM_MAX_KERNEL_ADDRESS 0xffff800100000000 +#define VM_MAX_KERNEL_ADDRESS 0xffff808000000000 /* map PIE into approximately the first quarter of user va space */ #define VM_PIE_MIN_ADDR VM_MIN_ADDRESS diff --git a/tools/process_headers.zig b/tools/process_headers.zig index 976f17b18207bd12bd915a64b4318d9543e63399..5859eebd22fa04cadeaa62f8fb0842e2287d8f8a 100644 --- a/tools/process_headers.zig +++ b/tools/process_headers.zig @@ -108,7 +108,6 @@ const openbsd_targets = [_]LibCTarget{ .{ .arch = .arm, .abi = .eabi }, .{ .arch = .aarch64, .abi = .none }, .{ .arch = .mips64, .abi = .none }, - .{ .arch = .mips64el, .abi = .none }, .{ .arch = .powerpc, .abi = .eabihf }, .{ .arch = .powerpc64, .abi = .none }, .{ .arch = .riscv64, .abi = .none }, @@ -238,7 +237,6 @@ pub fn main(init: std.process.Init) !void { .arm => "armv7", .aarch64 => "arm64", .mips64 => "octeon", - .mips64el => "loongson", .powerpc => "macppc", .x86 => "i386", .x86_64 => "amd64", -- 2.54.0