@zigc/lib 0.17.0-dev.332 → 0.17.0-dev.340

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/libc/include/aarch64-openbsd-none/arm64/cpu.h +7 -1
  2. package/libc/include/aarch64-openbsd-none/arm64/intr.h +9 -1
  3. package/libc/include/aarch64-openbsd-none/machine/cpu.h +7 -1
  4. package/libc/include/aarch64-openbsd-none/machine/intr.h +9 -1
  5. package/libc/include/generic-openbsd/db.h +1 -7
  6. package/libc/include/generic-openbsd/ddb/db_interface.h +2 -1
  7. package/libc/include/generic-openbsd/fnmatch.h +6 -2
  8. package/libc/include/generic-openbsd/login_cap.h +3 -1
  9. package/libc/include/generic-openbsd/miscfs/fuse/fusefs_node.h +2 -1
  10. package/libc/include/generic-openbsd/net/bpf.h +3 -1
  11. package/libc/include/generic-openbsd/net/hfsc.h +4 -4
  12. package/libc/include/generic-openbsd/net/if.h +5 -1
  13. package/libc/include/generic-openbsd/net/if_bridge.h +48 -1
  14. package/libc/include/generic-openbsd/net/if_etherbridge.h +20 -7
  15. package/libc/include/generic-openbsd/net/if_media.h +26 -1
  16. package/libc/include/generic-openbsd/net/if_pflow.h +71 -20
  17. package/libc/include/generic-openbsd/net/if_pfsync.h +2 -2
  18. package/libc/include/generic-openbsd/net/if_sppp.h +2 -1
  19. package/libc/include/generic-openbsd/net/if_trunk.h +3 -2
  20. package/libc/include/generic-openbsd/net/if_types.h +2 -2
  21. package/libc/include/generic-openbsd/net/if_var.h +34 -12
  22. package/libc/include/generic-openbsd/net/netisr.h +1 -3
  23. package/libc/include/generic-openbsd/net/pfvar.h +154 -1
  24. package/libc/include/generic-openbsd/net/pfvar_priv.h +256 -1
  25. package/libc/include/generic-openbsd/net80211/ieee80211.h +76 -4
  26. package/libc/include/generic-openbsd/net80211/ieee80211_ioctl.h +3 -2
  27. package/libc/include/generic-openbsd/net80211/ieee80211_node.h +48 -2
  28. package/libc/include/generic-openbsd/net80211/ieee80211_proto.h +4 -1
  29. package/libc/include/generic-openbsd/net80211/ieee80211_var.h +18 -2
  30. package/libc/include/generic-openbsd/netinet/if_ether.h +12 -11
  31. package/libc/include/generic-openbsd/netinet/igmp_var.h +17 -3
  32. package/libc/include/generic-openbsd/netinet/in_pcb.h +2 -1
  33. package/libc/include/generic-openbsd/netinet/in_var.h +17 -59
  34. package/libc/include/generic-openbsd/netinet/ip.h +3 -2
  35. package/libc/include/generic-openbsd/netinet/tcp_timer.h +1 -2
  36. package/libc/include/generic-openbsd/netinet6/in6_var.h +15 -29
  37. package/libc/include/generic-openbsd/netinet6/ip6_var.h +1 -2
  38. package/libc/include/generic-openbsd/netinet6/mld6_var.h +17 -4
  39. package/libc/include/generic-openbsd/netinet6/nd6.h +2 -2
  40. package/libc/include/generic-openbsd/pthread.h +2 -2
  41. package/libc/include/generic-openbsd/signal.h +2 -2
  42. package/libc/include/generic-openbsd/sndio.h +6 -12
  43. package/libc/include/generic-openbsd/strings.h +5 -1
  44. package/libc/include/generic-openbsd/sys/device.h +4 -3
  45. package/libc/include/generic-openbsd/sys/disklabel.h +17 -5
  46. package/libc/include/generic-openbsd/sys/dkio.h +3 -5
  47. package/libc/include/generic-openbsd/sys/filedesc.h +3 -2
  48. package/libc/include/generic-openbsd/sys/mbuf.h +1 -1
  49. package/libc/include/generic-openbsd/sys/mman.h +7 -2
  50. package/libc/include/generic-openbsd/sys/mutex.h +10 -7
  51. package/libc/include/generic-openbsd/sys/namei.h +8 -7
  52. package/libc/include/generic-openbsd/sys/param.h +1 -1
  53. package/libc/include/generic-openbsd/sys/pledge.h +1 -3
  54. package/libc/include/generic-openbsd/sys/protosw.h +8 -1
  55. package/libc/include/generic-openbsd/sys/ptrace.h +4 -1
  56. package/libc/include/generic-openbsd/sys/sched.h +8 -1
  57. package/libc/include/generic-openbsd/sys/signal.h +4 -2
  58. package/libc/include/generic-openbsd/sys/socketvar.h +2 -1
  59. package/libc/include/generic-openbsd/sys/sockio.h +11 -1
  60. package/libc/include/generic-openbsd/sys/syscall.h +5 -3
  61. package/libc/include/generic-openbsd/sys/syscallargs.h +9 -2
  62. package/libc/include/generic-openbsd/sys/sysctl.h +7 -4
  63. package/libc/include/generic-openbsd/sys/types.h +6 -2
  64. package/libc/include/generic-openbsd/sys/videoio.h +143 -68
  65. package/libc/include/generic-openbsd/sys/xcall.h +2 -2
  66. package/libc/include/generic-openbsd/time.h +2 -2
  67. package/libc/include/generic-openbsd/unistd.h +2 -2
  68. package/libc/include/generic-openbsd/uvm/uvm_anon.h +2 -3
  69. package/libc/include/generic-openbsd/uvm/uvm_extern.h +1 -19
  70. package/libc/include/generic-openbsd/uvm/uvm_pager.h +3 -4
  71. package/libc/include/generic-openbsd/uvm/uvm_pmemrange.h +1 -2
  72. package/libc/include/generic-openbsd/uvm/uvm_swap.h +4 -1
  73. package/libc/include/generic-openbsd/uvm/uvm_vnode.h +3 -4
  74. package/libc/include/generic-openbsd/uvm/uvmexp.h +41 -35
  75. package/libc/include/mips64-openbsd-none/machine/octeonvar.h +1 -27
  76. package/libc/include/mips64-openbsd-none/octeon/octeonvar.h +1 -27
  77. package/libc/include/mips64el-openbsd-none/loongson/apmvar.h +1 -1
  78. package/libc/include/mips64el-openbsd-none/loongson/param.h +1 -5
  79. package/libc/include/mips64el-openbsd-none/machine/apmvar.h +1 -1
  80. package/libc/include/mips64el-openbsd-none/machine/param.h +1 -5
  81. package/libc/include/powerpc-openbsd-eabihf/powerpc/intr.h +1 -4
  82. package/libc/include/powerpc64-openbsd-none/machine/atomic.h +3 -3
  83. package/libc/include/powerpc64-openbsd-none/powerpc64/atomic.h +3 -3
  84. package/libc/include/riscv64-openbsd-none/machine/cpu.h +4 -8
  85. package/libc/include/riscv64-openbsd-none/machine/cpufunc.h +4 -4
  86. package/libc/include/riscv64-openbsd-none/machine/pmap.h +5 -1
  87. package/libc/include/riscv64-openbsd-none/machine/pte.h +9 -1
  88. package/libc/include/riscv64-openbsd-none/riscv64/cpu.h +4 -8
  89. package/libc/include/riscv64-openbsd-none/riscv64/cpufunc.h +4 -4
  90. package/libc/include/riscv64-openbsd-none/riscv64/pmap.h +5 -1
  91. package/libc/include/riscv64-openbsd-none/riscv64/pte.h +9 -1
  92. package/libc/include/x86-openbsd-none/i386/specialreg.h +3 -1
  93. package/libc/include/x86-openbsd-none/machine/specialreg.h +3 -1
  94. package/libc/include/x86_64-openbsd-none/amd64/conf.h +11 -2
  95. package/libc/include/x86_64-openbsd-none/amd64/cpu.h +14 -4
  96. package/libc/include/x86_64-openbsd-none/amd64/cpufunc.h +2 -3
  97. package/libc/include/x86_64-openbsd-none/amd64/ghcb.h +2 -1
  98. package/libc/include/x86_64-openbsd-none/amd64/i82489var.h +2 -4
  99. package/libc/include/x86_64-openbsd-none/amd64/i8259.h +1 -53
  100. package/libc/include/x86_64-openbsd-none/amd64/intr.h +5 -2
  101. package/libc/include/x86_64-openbsd-none/amd64/intrdefs.h +9 -7
  102. package/libc/include/x86_64-openbsd-none/amd64/kexec.h +48 -0
  103. package/libc/include/x86_64-openbsd-none/amd64/specialreg.h +4 -1
  104. package/libc/include/x86_64-openbsd-none/machine/conf.h +11 -2
  105. package/libc/include/x86_64-openbsd-none/machine/cpu.h +14 -4
  106. package/libc/include/x86_64-openbsd-none/machine/cpufunc.h +2 -3
  107. package/libc/include/x86_64-openbsd-none/machine/ghcb.h +2 -1
  108. package/libc/include/x86_64-openbsd-none/machine/i82489var.h +2 -4
  109. package/libc/include/x86_64-openbsd-none/machine/i8259.h +1 -53
  110. package/libc/include/x86_64-openbsd-none/machine/intr.h +5 -2
  111. package/libc/include/x86_64-openbsd-none/machine/intrdefs.h +9 -7
  112. package/libc/include/x86_64-openbsd-none/machine/kexec.h +48 -0
  113. package/libc/include/x86_64-openbsd-none/machine/specialreg.h +4 -1
  114. package/libc/openbsd/abilists +0 -0
  115. package/package.json +1 -1
  116. package/std/Io/File.zig +6 -0
  117. package/std/Target.zig +2 -7
  118. package/std/bit_set.zig +0 -1
  119. package/std/crypto/ascon.zig +0 -2
  120. package/std/crypto/salsa20.zig +0 -6
  121. package/std/crypto/sha3.zig +0 -2
  122. package/std/debug/cpu_context.zig +0 -21
  123. package/libc/include/mips64el-openbsd-none/loongson/hibernate.h +0 -33
  124. package/libc/include/mips64el-openbsd-none/loongson/hibernate_var.h +0 -39
  125. package/libc/include/mips64el-openbsd-none/machine/hibernate.h +0 -33
  126. package/libc/include/mips64el-openbsd-none/machine/hibernate_var.h +0 -39
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: uvmexp.h,v 1.19 2025/03/10 19:52:57 miod Exp $ */
1
+ /* $OpenBSD: uvmexp.h,v 1.27 2026/03/08 17:06:10 deraadt Exp $ */
2
2
 
3
3
  #ifndef _UVM_UVMEXP_
4
4
  #define _UVM_UVMEXP_
@@ -41,13 +41,14 @@
41
41
  * other than the vm system.
42
42
  *
43
43
  * Locks used to protect struct members in this file:
44
- * a atomic operations
44
+ * a atomic operations (signed int, so use atomic_load_sint)
45
45
  * I immutable after creation
46
46
  * K kernel lock
47
47
  * F uvm_lock_fpageq
48
48
  * L uvm_lock_pageq
49
49
  * S uvm_swap_data_lock
50
50
  * p copy of per-CPU counters, used only by userland.
51
+ * o updated only by the page daemon
51
52
  */
52
53
  struct uvmexp {
53
54
  /* vm_page constants */
@@ -57,13 +58,13 @@ struct uvmexp {
57
58
 
58
59
  /* vm_page counters */
59
60
  int npages; /* [I] number of pages we manage */
60
- int free; /* [F] number of free pages */
61
- int active; /* [L] # of active pages */
62
- int inactive; /* [L] # of pages that we free'd but may want back */
63
- int paging; /* [a] # of pages in the process of being paged out */
64
- int wired; /* [a] number of wired pages */
61
+ int free; /* [aF] number of free pages */
62
+ int active; /* [aL] # of active pages */
63
+ int inactive; /* [aL] # of pages that we free'd but may want back */
64
+ int paging; /* [a] # number of pages in the process of being paged out */
65
+ int wired; /* [a] # number of wired pages */
65
66
 
66
- int zeropages; /* [F] number of zero'd pages */
67
+ int zeropages; /* [aF] number of zero'd pages */
67
68
  int reserve_pagedaemon; /* [I] # of pages reserved for pagedaemon */
68
69
  int reserve_kernel; /* [I] # of pages reserved for kernel */
69
70
  int percpucaches; /* [a] # of pages in per-CPU caches */
@@ -83,9 +84,9 @@ struct uvmexp {
83
84
  int vnodeminpct;/* min percent vnode pages */
84
85
 
85
86
  /* swap */
86
- int nswapdev; /* [S] number of configured swap devices in system */
87
- int swpages; /* [S] number of PAGE_SIZE'ed swap pages */
88
- int swpginuse; /* [S] number of swap pages in use */
87
+ int nswapdev; /* [aS] number of configured swap devices in system */
88
+ int swpages; /* [aS] number of PAGE_SIZE'ed swap pages */
89
+ int swpginuse; /* [aS] number of swap pages in use */
89
90
  int swpgonly; /* [a] number of swap pages in use, not also in RAM */
90
91
  int nswget; /* [a] number of swap pages moved from disk to RAM */
91
92
  int nanon; /* XXX number total of anon's in system */
@@ -94,23 +95,23 @@ struct uvmexp {
94
95
 
95
96
  /* stat counters */
96
97
  int faults; /* [p] page fault count */
97
- int traps; /* trap count */
98
- int intrs; /* interrupt count */
98
+ int traps; /* [a] trap count */
99
+ int intrs; /* [a] interrupt count */
99
100
  int swtch; /* context switch count */
100
- int softs; /* software interrupt count */
101
- int syscalls; /* system calls */
101
+ int softs; /* [a] software interrupt count */
102
+ int syscalls; /* [a] system calls */
102
103
  int pageins; /* [p] pagein operation count */
103
104
  /* pageouts are in pdpageouts below */
104
105
  int pcphit; /* [a] # of pagealloc from per-CPU cache */
105
106
  int pcpmiss; /* [a] # of times a per-CPU cache was empty */
106
107
  int pgswapin; /* pages swapped in */
107
- int pgswapout; /* pages swapped out */
108
+ int pgswapout; /* [a] pages swapped out */
108
109
  int forks; /* forks */
109
110
  int forks_ppwait; /* forks where parent waits */
110
111
  int forks_sharevm; /* forks where vmspace is shared */
111
- int pga_zerohit; /* pagealloc where zero wanted and zero
112
+ int pga_zerohit; /* [a] pagealloc where zero wanted and zero
112
113
  was available */
113
- int pga_zeromiss; /* pagealloc where zero wanted and zero
114
+ int pga_zeromiss; /* [a] pagealloc where zero wanted and zero
114
115
  not available */
115
116
  int unused09; /* formerly zeroaborts */
116
117
 
@@ -138,23 +139,22 @@ struct uvmexp {
138
139
  int fltnoup; /* [p] # of times fault upgrade failed */
139
140
 
140
141
  /* daemon counters */
141
- int pdwoke; /* [F] # of times daemon woke up */
142
- int pdrevs; /* number of times daemon scanned for free pages */
143
- int pdswout; /* number of times daemon called for swapout */
144
- int pdfreed; /* number of pages daemon freed since boot */
145
- int pdscans; /* number of pages daemon scanned since boot */
146
- int pdanscan; /* number of anonymous pages scanned by daemon */
147
- int pdobscan; /* number of object pages scanned by daemon */
148
- int pdreact; /* number of pages daemon reactivated since boot */
149
- int pdbusy; /* number of times daemon found a busy page */
150
- int pdpageouts; /* number of times daemon started a pageout */
151
- int pdpending; /* number of times daemon got a pending pagout */
152
- int pddeact; /* number of pages daemon deactivates */
153
-
154
- int unused13; /* formerly pdrevtext */
155
-
156
- int fpswtch; /* FPU context switches */
157
- int kmapent; /* number of kernel map entries */
142
+ int pdwoke; /* [ao] # of times daemon woke up */
143
+ int pdrevs; /* [ao] # of times daemon scanned for free pages */
144
+ int pdswout; /* [o] # of times daemon called for swapout */
145
+ int pdfreed; /* [ao] # of pages daemon freed since boot */
146
+ int pdscans; /* [ao] # of pages daemon scanned since boot */
147
+ int pdanscan; /* [ao] # of anonymous pages scanned by daemon */
148
+ int pdobscan; /* [ao] # of object pages scanned by daemon */
149
+ int pdreact; /* [ao] # of pages daemon reactivated since boot */
150
+ int pdbusy; /* [ao] # of times daemon found a busy page */
151
+ int pdpageouts; /* [ao] # of times daemon started a pageout */
152
+ int pdpending; /* [ao] # of times daemon got a pending pagout */
153
+ int pddeact; /* [ao] # of pages daemon deactivates */
154
+ int swpskip; /* [ao] # of pages delayed because swap crypt busy */
155
+
156
+ int fpswtch; /* [a] FPU context switches */
157
+ int kmapent; /* [a] number of kernel map entries */
158
158
  };
159
159
 
160
160
  struct _ps_strings {
@@ -163,6 +163,12 @@ struct _ps_strings {
163
163
 
164
164
  #ifdef _KERNEL
165
165
 
166
+ static inline int
167
+ atomic_load_sint(volatile const int *p)
168
+ {
169
+ return *p;
170
+ }
171
+
166
172
  /*
167
173
  * Per-cpu UVM counters.
168
174
  */
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: octeonvar.h,v 1.54 2022/08/29 02:01:18 jsg Exp $ */
1
+ /* $OpenBSD: octeonvar.h,v 1.55 2025/12/30 22:55:07 jsg Exp $ */
2
2
  /* $NetBSD: maltavar.h,v 1.3 2002/03/18 10:10:16 simonb Exp $ */
3
3
 
4
4
  /*-
@@ -335,32 +335,6 @@ int octeon_ioclock_speed(void);
335
335
  #endif /* _KERNEL */
336
336
  #endif /* _KERNEL || _STANDALONE */
337
337
 
338
- static inline int
339
- ffs64(uint64_t val)
340
- {
341
- int ret;
342
-
343
- __asm volatile ( \
344
- _ASM_PROLOGUE_MIPS64
345
- " dclz %0, %1 \n"
346
- _ASM_EPILOGUE
347
- : "=r"(ret) : "r"(val));
348
- return 64 - ret;
349
- }
350
-
351
- static inline int
352
- ffs32(uint32_t val)
353
- {
354
- int ret;
355
-
356
- __asm volatile ( \
357
- _ASM_PROLOGUE_MIPS64
358
- " clz %0, %1 \n"
359
- _ASM_EPILOGUE
360
- : "=r"(ret) : "r"(val));
361
- return 32 - ret;
362
- }
363
-
364
338
  static inline uint64_t
365
339
  octeon_xkphys_read_8(paddr_t address)
366
340
  {
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: octeonvar.h,v 1.54 2022/08/29 02:01:18 jsg Exp $ */
1
+ /* $OpenBSD: octeonvar.h,v 1.55 2025/12/30 22:55:07 jsg Exp $ */
2
2
  /* $NetBSD: maltavar.h,v 1.3 2002/03/18 10:10:16 simonb Exp $ */
3
3
 
4
4
  /*-
@@ -335,32 +335,6 @@ int octeon_ioclock_speed(void);
335
335
  #endif /* _KERNEL */
336
336
  #endif /* _KERNEL || _STANDALONE */
337
337
 
338
- static inline int
339
- ffs64(uint64_t val)
340
- {
341
- int ret;
342
-
343
- __asm volatile ( \
344
- _ASM_PROLOGUE_MIPS64
345
- " dclz %0, %1 \n"
346
- _ASM_EPILOGUE
347
- : "=r"(ret) : "r"(val));
348
- return 64 - ret;
349
- }
350
-
351
- static inline int
352
- ffs32(uint32_t val)
353
- {
354
- int ret;
355
-
356
- __asm volatile ( \
357
- _ASM_PROLOGUE_MIPS64
358
- " clz %0, %1 \n"
359
- _ASM_EPILOGUE
360
- : "=r"(ret) : "r"(val));
361
- return 32 - ret;
362
- }
363
-
364
338
  static inline uint64_t
365
339
  octeon_xkphys_read_8(paddr_t address)
366
340
  {
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: apmvar.h,v 1.6 2019/01/22 02:36:30 phessler Exp $ */
1
+ /* $OpenBSD: apmvar.h,v 1.8 2026/04/09 05:03:42 miod Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2001 Alexander Guy
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: param.h,v 1.3 2013/03/23 16:12:23 deraadt Exp $ */
1
+ /* $OpenBSD: param.h,v 1.4 2025/12/03 11:59:18 miod Exp $ */
2
2
 
3
3
  /* Public Domain */
4
4
 
@@ -13,8 +13,6 @@
13
13
  #define _MACHINE_CPU mips64
14
14
  #define MID_MACHINE MID_MIPS64
15
15
 
16
- #ifdef _KERNEL
17
-
18
16
  /*
19
17
  * The Loongson level 1 cache expects software to prevent virtual
20
18
  * aliases. Unfortunately, since this cache is physically tagged,
@@ -24,8 +22,6 @@
24
22
  */
25
23
  #define PAGE_SHIFT 14
26
24
 
27
- #endif /* _KERNEL */
28
-
29
25
  #include <mips64/param.h>
30
26
 
31
27
  #endif /* _MACHINE_PARAM_H_ */
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: apmvar.h,v 1.6 2019/01/22 02:36:30 phessler Exp $ */
1
+ /* $OpenBSD: apmvar.h,v 1.8 2026/04/09 05:03:42 miod Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2001 Alexander Guy
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: param.h,v 1.3 2013/03/23 16:12:23 deraadt Exp $ */
1
+ /* $OpenBSD: param.h,v 1.4 2025/12/03 11:59:18 miod Exp $ */
2
2
 
3
3
  /* Public Domain */
4
4
 
@@ -13,8 +13,6 @@
13
13
  #define _MACHINE_CPU mips64
14
14
  #define MID_MACHINE MID_MIPS64
15
15
 
16
- #ifdef _KERNEL
17
-
18
16
  /*
19
17
  * The Loongson level 1 cache expects software to prevent virtual
20
18
  * aliases. Unfortunately, since this cache is physically tagged,
@@ -24,8 +22,6 @@
24
22
  */
25
23
  #define PAGE_SHIFT 14
26
24
 
27
- #endif /* _KERNEL */
28
-
29
25
  #include <mips64/param.h>
30
26
 
31
27
  #endif /* _MACHINE_PARAM_H_ */
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: intr.h,v 1.57 2025/05/10 09:54:17 visa Exp $ */
1
+ /* $OpenBSD: intr.h,v 1.58 2026/01/04 23:51:12 jsg Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA.
@@ -64,7 +64,6 @@
64
64
  #if defined(_KERNEL) && !defined(_LOCORE)
65
65
 
66
66
  #include <sys/evcount.h>
67
- #include <machine/atomic.h>
68
67
 
69
68
  #define PPC_NIRQ 66
70
69
  #define PPC_CLK_IRQ 64
@@ -111,8 +110,6 @@ void splassert_check(int, const char *);
111
110
  #define splsoftassert(wantipl) do { /* nada */ } while (0)
112
111
  #endif
113
112
 
114
- #define set_sint(p) atomic_setbits_int(&curcpu()->ci_ipending, p)
115
-
116
113
  #define splbio() splraise(IPL_BIO)
117
114
  #define splnet() splraise(IPL_NET)
118
115
  #define spltty() splraise(IPL_TTY)
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: atomic.h,v 1.3 2022/08/29 02:01:18 jsg Exp $ */
1
+ /* $OpenBSD: atomic.h,v 1.4 2025/11/18 05:24:38 gkoehler Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2015 Martin Pieuchot
@@ -276,10 +276,10 @@ _atomic_addic_long_nv(volatile unsigned long *p, unsigned long v)
276
276
  #define __membar(_f) do { __asm volatile(_f ::: "memory"); } while (0)
277
277
 
278
278
  #if defined(MULTIPROCESSOR) || !defined(_KERNEL)
279
- #define membar_enter() __membar("isync")
279
+ #define membar_enter() __membar("sync")
280
280
  #define membar_exit() __membar("sync")
281
281
  #define membar_producer() __membar("sync")
282
- #define membar_consumer() __membar("isync")
282
+ #define membar_consumer() __membar("sync")
283
283
  #define membar_sync() __membar("sync")
284
284
  #else
285
285
  #define membar_enter() __membar("")
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: atomic.h,v 1.3 2022/08/29 02:01:18 jsg Exp $ */
1
+ /* $OpenBSD: atomic.h,v 1.4 2025/11/18 05:24:38 gkoehler Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2015 Martin Pieuchot
@@ -276,10 +276,10 @@ _atomic_addic_long_nv(volatile unsigned long *p, unsigned long v)
276
276
  #define __membar(_f) do { __asm volatile(_f ::: "memory"); } while (0)
277
277
 
278
278
  #if defined(MULTIPROCESSOR) || !defined(_KERNEL)
279
- #define membar_enter() __membar("isync")
279
+ #define membar_enter() __membar("sync")
280
280
  #define membar_exit() __membar("sync")
281
281
  #define membar_producer() __membar("sync")
282
- #define membar_consumer() __membar("isync")
282
+ #define membar_consumer() __membar("sync")
283
283
  #define membar_sync() __membar("sync")
284
284
  #else
285
285
  #define membar_enter() __membar("")
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: cpu.h,v 1.24 2024/06/11 16:02:35 jca Exp $ */
1
+ /* $OpenBSD: cpu.h,v 1.25 2026/04/06 08:10:54 jca Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2019 Mike Larkin <mlarkin@openbsd.org>
@@ -141,13 +141,9 @@ struct cpu_info {
141
141
  #define CPUF_GO (1<<5)
142
142
  #define CPUF_RUNNING (1<<6)
143
143
 
144
- static inline struct cpu_info *
145
- curcpu(void)
146
- {
147
- struct cpu_info *__ci = NULL;
148
- __asm volatile("mv %0, tp" : "=&r"(__ci));
149
- return (__ci);
150
- }
144
+ register struct cpu_info *__curcpu asm ("tp");
145
+
146
+ #define curcpu() (__curcpu)
151
147
 
152
148
  extern uint32_t boot_hart; /* The hart we booted on. */
153
149
  extern struct cpu_info cpu_info_primary;
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: cpufunc.h,v 1.6 2023/08/21 20:17:30 miod Exp $ */
1
+ /* $OpenBSD: cpufunc.h,v 1.7 2026/04/05 11:48:17 kettenis Exp $ */
2
2
 
3
3
  /*-
4
4
  * Copyright (c) 2014 Andrew Turner
@@ -89,9 +89,9 @@ sfence_vma_page_asid(uintptr_t addr, uint64_t asid)
89
89
  extern int64_t dcache_line_size;
90
90
  extern int64_t icache_line_size;
91
91
 
92
- extern void (*cpu_dcache_wbinv_range)(paddr_t, psize_t);
93
- extern void (*cpu_dcache_inv_range)(paddr_t, psize_t);
94
- extern void (*cpu_dcache_wb_range)(paddr_t, psize_t);
92
+ extern void (*cpu_dcache_wbinv_range)(vaddr_t, vsize_t);
93
+ extern void (*cpu_dcache_inv_range)(vaddr_t, vsize_t);
94
+ extern void (*cpu_dcache_wb_range)(vaddr_t, vsize_t);
95
95
 
96
96
  static __inline void
97
97
  load_satp(uint64_t val)
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: pmap.h,v 1.14 2025/02/03 17:59:40 jca Exp $ */
1
+ /* $OpenBSD: pmap.h,v 1.15 2026/04/05 11:48:17 kettenis Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2019-2020 Brian Bamsch <bbamsch@google.com>
@@ -75,6 +75,10 @@ struct pmap {
75
75
  #define PMAP_NOCACHE 0x1 /* non-cacheable memory */
76
76
  #define PMAP_DEVICE 0x2 /* device memory */
77
77
 
78
+ extern uint64_t pmap_pma;
79
+ extern uint64_t pmap_nc;
80
+ extern uint64_t pmap_io;
81
+
78
82
  #define PG_PMAP_MOD PG_PMAP0
79
83
  #define PG_PMAP_REF PG_PMAP1
80
84
  #define PG_PMAP_EXE PG_PMAP2
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: pte.h,v 1.4 2024/10/14 12:02:16 jsg Exp $ */
1
+ /* $OpenBSD: pte.h,v 1.5 2026/04/05 11:48:17 kettenis Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2019 Brian Bamsch <bbamsch@google.com>
@@ -38,6 +38,14 @@
38
38
  #define PTE_RX (PTE_R | PTE_X)
39
39
  #define PTE_KERN (PTE_V | PTE_R | PTE_W | PTE_A | PTE_D)
40
40
 
41
+ /* Svpmbt extension */
42
+ #define PTE_PMA (0ULL << 61)
43
+ #define PTE_NC (1ULL << 61)
44
+ #define PTE_IO (2ULL << 61)
45
+
46
+ /* Svnapot extension */
47
+ #define PTE_N (1ULL << 63)
48
+
41
49
  /* T-Head extended page attributes */
42
50
  #define PTE_THEAD_SO (1ULL << 63)
43
51
  #define PTE_THEAD_C (1ULL << 62)
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: cpu.h,v 1.24 2024/06/11 16:02:35 jca Exp $ */
1
+ /* $OpenBSD: cpu.h,v 1.25 2026/04/06 08:10:54 jca Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2019 Mike Larkin <mlarkin@openbsd.org>
@@ -141,13 +141,9 @@ struct cpu_info {
141
141
  #define CPUF_GO (1<<5)
142
142
  #define CPUF_RUNNING (1<<6)
143
143
 
144
- static inline struct cpu_info *
145
- curcpu(void)
146
- {
147
- struct cpu_info *__ci = NULL;
148
- __asm volatile("mv %0, tp" : "=&r"(__ci));
149
- return (__ci);
150
- }
144
+ register struct cpu_info *__curcpu asm ("tp");
145
+
146
+ #define curcpu() (__curcpu)
151
147
 
152
148
  extern uint32_t boot_hart; /* The hart we booted on. */
153
149
  extern struct cpu_info cpu_info_primary;
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: cpufunc.h,v 1.6 2023/08/21 20:17:30 miod Exp $ */
1
+ /* $OpenBSD: cpufunc.h,v 1.7 2026/04/05 11:48:17 kettenis Exp $ */
2
2
 
3
3
  /*-
4
4
  * Copyright (c) 2014 Andrew Turner
@@ -89,9 +89,9 @@ sfence_vma_page_asid(uintptr_t addr, uint64_t asid)
89
89
  extern int64_t dcache_line_size;
90
90
  extern int64_t icache_line_size;
91
91
 
92
- extern void (*cpu_dcache_wbinv_range)(paddr_t, psize_t);
93
- extern void (*cpu_dcache_inv_range)(paddr_t, psize_t);
94
- extern void (*cpu_dcache_wb_range)(paddr_t, psize_t);
92
+ extern void (*cpu_dcache_wbinv_range)(vaddr_t, vsize_t);
93
+ extern void (*cpu_dcache_inv_range)(vaddr_t, vsize_t);
94
+ extern void (*cpu_dcache_wb_range)(vaddr_t, vsize_t);
95
95
 
96
96
  static __inline void
97
97
  load_satp(uint64_t val)
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: pmap.h,v 1.14 2025/02/03 17:59:40 jca Exp $ */
1
+ /* $OpenBSD: pmap.h,v 1.15 2026/04/05 11:48:17 kettenis Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2019-2020 Brian Bamsch <bbamsch@google.com>
@@ -75,6 +75,10 @@ struct pmap {
75
75
  #define PMAP_NOCACHE 0x1 /* non-cacheable memory */
76
76
  #define PMAP_DEVICE 0x2 /* device memory */
77
77
 
78
+ extern uint64_t pmap_pma;
79
+ extern uint64_t pmap_nc;
80
+ extern uint64_t pmap_io;
81
+
78
82
  #define PG_PMAP_MOD PG_PMAP0
79
83
  #define PG_PMAP_REF PG_PMAP1
80
84
  #define PG_PMAP_EXE PG_PMAP2
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: pte.h,v 1.4 2024/10/14 12:02:16 jsg Exp $ */
1
+ /* $OpenBSD: pte.h,v 1.5 2026/04/05 11:48:17 kettenis Exp $ */
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2019 Brian Bamsch <bbamsch@google.com>
@@ -38,6 +38,14 @@
38
38
  #define PTE_RX (PTE_R | PTE_X)
39
39
  #define PTE_KERN (PTE_V | PTE_R | PTE_W | PTE_A | PTE_D)
40
40
 
41
+ /* Svpmbt extension */
42
+ #define PTE_PMA (0ULL << 61)
43
+ #define PTE_NC (1ULL << 61)
44
+ #define PTE_IO (2ULL << 61)
45
+
46
+ /* Svnapot extension */
47
+ #define PTE_N (1ULL << 63)
48
+
41
49
  /* T-Head extended page attributes */
42
50
  #define PTE_THEAD_SO (1ULL << 63)
43
51
  #define PTE_THEAD_C (1ULL << 62)
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: specialreg.h,v 1.85 2023/08/16 04:07:38 jsg Exp $ */
1
+ /* $OpenBSD: specialreg.h,v 1.86 2026/04/19 01:10:28 jsg Exp $ */
2
2
  /* $NetBSD: specialreg.h,v 1.7 1994/10/27 04:16:26 cgd Exp $ */
3
3
 
4
4
  /*-
@@ -528,6 +528,8 @@
528
528
  #define MSR_PATCH_LOADER 0xc0010020
529
529
  #define MSR_INT_PEN_MSG 0xc0010055 /* Interrupt pending message */
530
530
 
531
+ #define MSR_FP_CFG 0xc0011028 /* Floating Point Configuration */
532
+ #define FP_CFG_9 (1 << 9) /* FP-DSS chickenbit */
531
533
  #define MSR_DE_CFG 0xc0011029 /* Decode Configuration */
532
534
  #define DE_CFG_721 0x00000001 /* errata 721 */
533
535
  #define DE_CFG_SERIALIZE_LFENCE (1 << 1) /* Enable serializing lfence */
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: specialreg.h,v 1.85 2023/08/16 04:07:38 jsg Exp $ */
1
+ /* $OpenBSD: specialreg.h,v 1.86 2026/04/19 01:10:28 jsg Exp $ */
2
2
  /* $NetBSD: specialreg.h,v 1.7 1994/10/27 04:16:26 cgd Exp $ */
3
3
 
4
4
  /*-
@@ -528,6 +528,8 @@
528
528
  #define MSR_PATCH_LOADER 0xc0010020
529
529
  #define MSR_INT_PEN_MSG 0xc0010055 /* Interrupt pending message */
530
530
 
531
+ #define MSR_FP_CFG 0xc0011028 /* Floating Point Configuration */
532
+ #define FP_CFG_9 (1 << 9) /* FP-DSS chickenbit */
531
533
  #define MSR_DE_CFG 0xc0011029 /* Decode Configuration */
532
534
  #define DE_CFG_721 0x00000001 /* errata 721 */
533
535
  #define DE_CFG_SERIALIZE_LFENCE (1 << 1) /* Enable serializing lfence */
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: conf.h,v 1.11 2024/09/04 07:45:08 jsg Exp $ */
1
+ /* $OpenBSD: conf.h,v 1.12 2025/11/12 11:34:36 hshoexer Exp $ */
2
2
  /* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */
3
3
 
4
4
  /*
@@ -56,4 +56,13 @@ cdev_decl(pctr);
56
56
  cdev_decl(vmm);
57
57
 
58
58
  #include "psp.h"
59
- cdev_decl(psp);
59
+ cdev_decl(psp);
60
+
61
+ #include "kexec.h"
62
+ #define cdev_kexec_init(c,n) { \
63
+ dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
64
+ (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
65
+ (dev_type_stop((*))) nullop, 0, \
66
+ (dev_type_mmap((*))) enodev }
67
+
68
+ cdev_decl(kexec);
@@ -1,4 +1,4 @@
1
- /* $OpenBSD: cpu.h,v 1.180 2025/04/28 16:18:25 bluhm Exp $ */
1
+ /* $OpenBSD: cpu.h,v 1.185 2026/03/31 16:46:22 deraadt Exp $ */
2
2
  /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
3
3
 
4
4
  /*-
@@ -53,6 +53,7 @@
53
53
  #include <sys/sched.h>
54
54
  #include <sys/sensors.h>
55
55
  #include <sys/srp.h>
56
+ #include <sys/xcall.h>
56
57
  #include <uvm/uvm_percpu.h>
57
58
 
58
59
  #ifdef _KERNEL
@@ -187,6 +188,7 @@ struct cpu_info {
187
188
  int ci_inatomic; /* [o] */
188
189
 
189
190
  #define __HAVE_CPU_TOPOLOGY
191
+ u_int32_t ci_cputype; /* [I] */
190
192
  u_int32_t ci_smt_id; /* [I] */
191
193
  u_int32_t ci_core_id; /* [I] */
192
194
  u_int32_t ci_pkg_id; /* [I] */
@@ -215,6 +217,7 @@ struct cpu_info {
215
217
 
216
218
  #ifdef MULTIPROCESSOR
217
219
  struct srp_hazard ci_srp_hazards[SRP_HAZARD_NUM];
220
+ struct xcall_cpu ci_xcall;
218
221
  #define __HAVE_UVM_PERCPU
219
222
  struct uvm_pmr_cache ci_uvm; /* [o] page cache */
220
223
  #endif
@@ -289,7 +292,7 @@ extern void need_resched(struct cpu_info *);
289
292
 
290
293
  #if defined(MULTIPROCESSOR)
291
294
 
292
- #define MAXCPUS 64 /* bitmask */
295
+ #define MAXCPUS 255
293
296
 
294
297
  #define CPU_STARTUP(_ci) ((_ci)->ci_func->start(_ci))
295
298
  #define CPU_STOP(_ci) ((_ci)->ci_func->stop(_ci))
@@ -431,6 +434,7 @@ extern void (*cpu_suspend_cycle_fcn)(void);
431
434
  #define cpu_idle_leave() do { /* nothing */ } while (0)
432
435
  extern void (*initclock_func)(void);
433
436
  extern void (*startclock_func)(void);
437
+ extern int hibernate_delay;
434
438
 
435
439
  struct region_descriptor;
436
440
  void lgdt(struct region_descriptor *);
@@ -444,6 +448,9 @@ void startclocks(void);
444
448
  void rtcinit(void);
445
449
  void rtcstart(void);
446
450
  void rtcstop(void);
451
+ int rtcalarm_suspend(struct timeval *tv);
452
+ void rtcalarm_resume(void);
453
+ int rtcalarm_fired(void);
447
454
  void i8254_delay(int);
448
455
  void i8254_initclocks(void);
449
456
  void i8254_startclock(void);
@@ -496,13 +503,15 @@ void mp_setperf_init(void);
496
503
  #define CPU_CPUFEATURE 8 /* cpuid features */
497
504
  #define CPU_KBDRESET 10 /* keyboard reset under pcvt */
498
505
  #define CPU_XCRYPT 12 /* supports VIA xcrypt in userland */
506
+ #define CPU_HIBERNATEDELAY 13 /* hibernate delay after suspend */
499
507
  #define CPU_LIDACTION 14 /* action caused by lid close */
500
508
  #define CPU_FORCEUKBD 15 /* Force ukbd(4) as console keyboard */
501
509
  #define CPU_TSCFREQ 16 /* TSC frequency */
502
510
  #define CPU_INVARIANTTSC 17 /* has invariant TSC */
503
511
  #define CPU_PWRACTION 18 /* action caused by power button */
504
512
  #define CPU_RETPOLINE 19 /* cpu requires retpoline pattern */
505
- #define CPU_MAXID 20 /* number of valid machdep ids */
513
+ #define CPU_VMMODE 20 /* virtualization mode */
514
+ #define CPU_MAXID 21 /* number of valid machdep ids */
506
515
 
507
516
  #define CTL_MACHDEP_NAMES { \
508
517
  { 0, 0 }, \
@@ -518,13 +527,14 @@ void mp_setperf_init(void);
518
527
  { "kbdreset", CTLTYPE_INT }, \
519
528
  { 0, 0 }, \
520
529
  { "xcrypt", CTLTYPE_INT }, \
521
- { 0, 0 }, \
530
+ { "hibernatedelay", CTLTYPE_INT }, \
522
531
  { "lidaction", CTLTYPE_INT }, \
523
532
  { "forceukbd", CTLTYPE_INT }, \
524
533
  { "tscfreq", CTLTYPE_QUAD }, \
525
534
  { "invarianttsc", CTLTYPE_INT }, \
526
535
  { "pwraction", CTLTYPE_INT }, \
527
536
  { "retpoline", CTLTYPE_INT }, \
537
+ { "vmmode", CTLTYPE_STRING }, \
528
538
  }
529
539
 
530
540
  #endif /* !_MACHINE_CPU_H_ */