| author | |
| committer | |
| log | 846aa04a07161e865d0b28f653e1ff0a99b25840 |
| tree | d3be86bcf68a42a99810d9b3dfb7801b8dec2a56 |
| parent | 086f8d7b225df5ea15ef578411c94181fc53c464 |
| signature |
22 files changed, 339 insertions(+), 87 deletions(-)
lib/libc/include/generic-netbsd/fcntl.h+4-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: fcntl.h,v 1.57 2025/07/25 23:24:46 kre Exp $	*/ | |
| 1 | /*	$NetBSD: fcntl.h,v 1.57.2.1 2026/06/16 09:06:50 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1983, 1990, 1993 |
| ... | ... | @@ -121,6 +121,9 @@ |
| 121 | 121 | #if defined(_NETBSD_SOURCE) |
| 122 | 122 | #define	O_NOSIGPIPE	0x01000000	/* don't deliver sigpipe */ |
| 123 | 123 | #define	O_REGULAR	0x02000000	/* fail if not a regular file */ |
| 124 | #endif | |
| 125 | #if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0 >= 700) || \ | |
| 126 | defined(_NETBSD_SOURCE) | |
| 124 | 127 | #define	O_EXEC		0x04000000	/* open for executing only */ |
| 125 | 128 | #endif |
| 126 | 129 | #if (_POSIX_C_SOURCE - 0) >= 202405L || (_XOPEN_SOURCE - 0 >= 800) || \ |
lib/libc/include/generic-netbsd/i386/mcontext.h+23-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: mcontext.h,v 1.19 2024/11/30 01:04:10 christos Exp $	*/ | |
| 1 | /*	$NetBSD: mcontext.h,v 1.19.2.1 2026/07/19 15:57:27 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. |
| ... | ... | @@ -40,6 +40,7 @@ |
| 40 | 40 | #define	_UC_CLRSTACK	_UC_MD_BIT17 |
| 41 | 41 | #define	_UC_VM		_UC_MD_BIT18 |
| 42 | 42 | #define	_UC_TLSBASE	_UC_MD_BIT19 |
| 43 | #define	_UC_XSAVE	_UC_MD_BIT20 | |
| 43 | 44 | |
| 44 | 45 | /* |
| 45 | 46 | * Layout of mcontext_t according to the System V Application Binary Interface, |
| ... | ... | @@ -85,6 +86,27 @@ typedef struct { |
| 85 | 86 | 			char	__fp_xmm[512]; |
| 86 | 87 | 		} __fp_xmm_state;	/* x87 and xmm regs in fxsave format */ |
| 87 | 88 | 		int	__fp_fpregs[128]; |
| 89 | 		struct { | |
| 90 | 			/* | |
| 91 | 			 * `The XSAVE feature set does not use bytes | |
| 92 | 			 * 511:416; bytes 463:416 are reserved.' | |
| 93 | 			 * | |
| 94 | 			 * We take a part out of this to form a pointer | |
| 95 | 			 * to an external XSAVE area. This way, we can | |
| 96 | 			 * replicate the FXSAVE parts for the benefit | |
| 97 | 			 * of userland programs that aren't aware of | |
| 98 | 			 * the XSAVE pointer, have used the extended | |
| 99 | 			 * CPU registers (ymmN/zmmN/&c.), and want to | |
| 100 | 			 * examine the x87/SSE register state in a | |
| 101 | 			 * signal handler. The kernel does not use | |
| 102 | 			 * this part. | |
| 103 | 			 */ | |
| 104 | 			char		__fxsave[416]; | |
| 105 | 			char		__rsvd[48]; | |
| 106 | 			__greg_t	__xsaveptr; | |
| 107 | 			__greg_t	__xsavelen; | |
| 108 | 			char		__pad[40]; | |
| 109 | 		} __xsave; | |
| 88 | 110 | 	} __fp_reg_set; |
| 89 | 111 | 	int 	__fp_pad[33];			/* Historic padding */ |
| 90 | 112 | } __fpregset_t; |
lib/libc/include/generic-netbsd/i386/wchar_limits.h+1-1| ... | ... | @@ -44,4 +44,4 @@ |
| 44 | 44 | #define	WINT_MIN	(-0x7fffffff-1)			/* wint_t	 */ |
| 45 | 45 | #define	WINT_MAX	0x7fffffff			/* wint_t	 */ |
| 46 | 46 | |
| 47 | #endif /* !_I386_WCHAR_LIMITS_H_ */ | |
| 47 | #endif /* !_I386_WCHAR_LIMITS_H_ */ | |
| \ No newline at end of file |
lib/libc/include/generic-netbsd/machine/pte.h+32-19| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* $NetBSD: pte.h,v 1.14.2.2 2025/10/26 12:28:36 martin Exp $ */ | |
| 1 | /* $NetBSD: pte.h,v 1.14.2.3 2026/06/03 18:17:02 martin Exp $ */ | |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc. |
| ... | ... | @@ -139,6 +139,12 @@ pte_modified_p(pt_entry_t pte) |
| 139 | 139 | 	return (pte & PTE_D) != 0; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | static inline bool | |
| 143 | pte_referenced_p(pt_entry_t pte) | |
| 144 | { | |
| 145 | 	return (pte & PTE_A) != 0; | |
| 146 | } | |
| 147 | ||
| 142 | 148 | static inline bool |
| 143 | 149 | pte_cached_p(pt_entry_t pte) |
| 144 | 150 | { |
| ... | ... | @@ -177,9 +183,15 @@ pte_nv_entry(bool kernel_p) |
| 177 | 183 | } |
| 178 | 184 | |
| 179 | 185 | static inline pt_entry_t |
| 180 | pte_prot_nowrite(pt_entry_t pte) | |
| 186 | pte_clear_modify(pt_entry_t pte) | |
| 187 | { | |
| 188 | 	return pte & ~PTE_D; | |
| 189 | } | |
| 190 | ||
| 191 | static inline pt_entry_t | |
| 192 | pte_clear_reference(pt_entry_t pte) | |
| 181 | 193 | { |
| 182 | 	return pte & ~PTE_W; | |
| 194 | 	return pte & ~PTE_A; | |
| 183 | 195 | } |
| 184 | 196 | |
| 185 | 197 | static inline pt_entry_t |
| ... | ... | @@ -237,28 +249,29 @@ pte_make_enter(paddr_t pa, struct vm_page_md *mdpg, vm_prot_t prot, |
| 237 | 249 | 	pte |= pte_prot_bits(mdpg, prot, kernel_p); |
| 238 | 250 | 	pte |= pte_enter_flags_to_pbmt(flags); |
| 239 | 251 | |
| 240 | 	if (mdpg != NULL) { | |
| 252 | 	/* | |
| 253 | 	 * pmap_enter should have checked flags and updated | |
| 254 | 	 * VM_PAGEMD_{REFERENCED,MODIFIED}_P, so there is no | |
| 255 | 	 * need here. | |
| 256 | 	 */ | |
| 257 | 	KASSERT(((flags & VM_PROT_ALL) == 0) || VM_PAGEMD_REFERENCED_P(mdpg)); | |
| 258 | 	KASSERT(((flags & VM_PROT_WRITE) == 0) || VM_PAGEMD_MODIFIED_P(mdpg)); | |
| 241 | 259 | |
| 242 | 		if ((prot & VM_PROT_WRITE) != 0 && | |
| 243 | 		 ((flags & VM_PROT_WRITE) != 0 || VM_PAGEMD_MODIFIED_P(mdpg))) { | |
| 260 | 	if (mdpg != NULL) { | |
| 261 | 		if ((prot & VM_PROT_WRITE) != 0 && VM_PAGEMD_MODIFIED_P(mdpg)) { | |
| 244 | 262 | 			/* |
| 245 | 			* This is a writable mapping, and the page's mod state | |
| 246 | 			* indicates it has already been modified. No need for | |
| 247 | 			* modified emulation. | |
| 248 | 			*/ | |
| 263 | 			 * This is a writable mapping, and the page's mod state | |
| 264 | 			 * indicates it has already been modified. No need for | |
| 265 | 			 * reference or modified emulation. | |
| 266 | 			 */ | |
| 249 | 267 | 			pte |= PTE_A | PTE_D; |
| 250 | 		} else if ((flags & VM_PROT_ALL) || VM_PAGEMD_REFERENCED_P(mdpg)) { | |
| 268 | 		} else if (VM_PAGEMD_REFERENCED_P(mdpg)) { | |
| 251 | 269 | 			/* |
| 252 | 			* - The access type indicates that we don't need to do | |
| 253 | 			* referenced emulation. | |
| 254 | 			* OR | |
| 255 | 			* - The physical page has already been referenced so no need | |
| 256 | 			* to re-do referenced emulation here. | |
| 257 | 			*/ | |
| 270 | 			 * The physical page has already been referenced so no need | |
| 271 | 			 * to re-do referenced emulation here. | |
| 272 | 			 */ | |
| 258 | 273 | 			pte |= PTE_A; |
| 259 | 274 | 		} |
| 260 | 	} else { | |
| 261 | 		pte |= PTE_A | PTE_D; | |
| 262 | 275 | 	} |
| 263 | 276 | |
| 264 | 277 | 	return pte; |
lib/libc/include/generic-netbsd/machine/vmparam.h+21-9| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: vmparam.h,v 1.14 2023/05/07 12:41:48 skrll Exp $	*/ | |
| 1 | /*	$NetBSD: vmparam.h,v 1.14.8.2 2026/06/03 18:17:02 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc. |
| ... | ... | @@ -50,6 +50,25 @@ |
| 50 | 50 | #define	PAGE_SIZE	(1 << PAGE_SHIFT) |
| 51 | 51 | #define	PAGE_MASK	(PAGE_SIZE - 1) |
| 52 | 52 | |
| 53 | #ifdef _LP64 | |
| 54 | /* | |
| 55 | * Default pager_map of 16MB is awfully small. There is plenty | |
| 56 | * of VA so use it. | |
| 57 | */ | |
| 58 | #define	PAGER_MAP_DEFAULT_SIZE (512 * 1024 * 1024) | |
| 59 | ||
| 60 | /* | |
| 61 | * Defaults for Unified Buffer Cache parameters. | |
| 62 | */ | |
| 63 | ||
| 64 | #ifndef UBC_WINSHIFT | |
| 65 | #define	UBC_WINSHIFT	16	/* 64kB */ | |
| 66 | #endif | |
| 67 | #ifndef UBC_NWINS | |
| 68 | #define	UBC_NWINS	4096	/* 256MB */ | |
| 69 | #endif | |
| 70 | #endif | |
| 71 | ||
| 53 | 72 | /* |
| 54 | 73 | * USRSTACK is the top (end) of the user stack. |
| 55 | 74 | * |
| ... | ... | @@ -125,12 +144,6 @@ |
| 125 | 144 | #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xffffffd000000000) |
| 126 | 145 | |
| 127 | 146 | #else		/* Sv32 */ |
| 128 | /* | |
| 129 | * kernel virtual space layout: | |
| 130 | * 0x8000_0000 - 64GiB KERNEL VM Space (inc. text/data/bss) | |
| 131 | * (0x4000_0000 +1GiB) KERNEL VM start of KVA | |
| 132 | * (0x0000_0000 64GiB) reserved | |
| 133 | */ | |
| 134 | 147 | |
| 135 | 148 | /* |
| 136 | 149 | * kernel virtual space layout without direct map (common case) |
| ... | ... | @@ -154,13 +167,12 @@ |
| 154 | 167 | * |
| 155 | 168 | */ |
| 156 | 169 | |
| 157 | ||
| 158 | ||
| 159 | 170 | #define VM_MAXUSER_ADDRESS	((vaddr_t)-0x7fffffff-1)/* 0xffff_ffff_8000_0000 */ |
| 160 | 171 | #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)-0x7fffffff-1)/* 0xffff_ffff_8000_0000 */ |
| 161 | 172 | #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)-0x10000000)	/* 0xffff_ffff_f000_0000 */ |
| 162 | 173 | |
| 163 | 174 | #endif |
| 175 | ||
| 164 | 176 | #define VM_KERNEL_BASE		VM_MIN_KERNEL_ADDRESS |
| 165 | 177 | #define VM_KERNEL_SIZE		0x2000000	/* 32 MiB (8 / 16 megapages) */ |
| 166 | 178 | #define VM_KERNEL_DTB_BASE	(VM_KERNEL_BASE + VM_KERNEL_SIZE) |
lib/libc/include/generic-netbsd/mips/pte.h+14-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: pte.h,v 1.27 2020/08/22 15:34:51 skrll Exp $	*/ | |
| 1 | /*	$NetBSD: pte.h,v 1.27.28.1 2026/06/03 18:17:03 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1997 The NetBSD Foundation, Inc. |
| ... | ... | @@ -269,6 +269,12 @@ pte_modified_p(pt_entry_t pte) |
| 269 | 269 | 	return (pte & MIPS_MMU(PG_D)) != 0; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | static inline bool | |
| 273 | pte_referenced_p(pt_entry_t pte) | |
| 274 | { | |
| 275 | 	return false; | |
| 276 | } | |
| 277 | ||
| 272 | 278 | static inline bool |
| 273 | 279 | pte_global_p(pt_entry_t pte) |
| 274 | 280 | { |
| ... | ... | @@ -340,11 +346,17 @@ pte_prot_downgrade(pt_entry_t pte, vm_prot_t prot) |
| 340 | 346 | } |
| 341 | 347 | |
| 342 | 348 | static inline pt_entry_t |
| 343 | pte_prot_nowrite(pt_entry_t pte) | |
| 349 | pte_clear_modify(pt_entry_t pte) | |
| 344 | 350 | { |
| 345 | 351 | 	return pte & ~MIPS_MMU(PG_D); |
| 346 | 352 | } |
| 347 | 353 | |
| 354 | static inline pt_entry_t | |
| 355 | pte_clear_reference(pt_entry_t pte) | |
| 356 | { | |
| 357 | 	return pte; | |
| 358 | } | |
| 359 | ||
| 348 | 360 | static inline pt_entry_t |
| 349 | 361 | pte_cached_change(pt_entry_t pte, bool cached) |
| 350 | 362 | { |
lib/libc/include/generic-netbsd/netinet/tcp_timer.h+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: tcp_timer.h,v 1.30 2019/08/06 15:48:18 riastradh Exp $	*/ | |
| 1 | /*	$NetBSD: tcp_timer.h,v 1.30.34.1 2026/07/19 15:51:03 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 2001, 2005 The NetBSD Foundation, Inc. |
| ... | ... | @@ -119,7 +119,7 @@ |
| 119 | 119 | #define	TCPTV_MSL	( 30*PR_SLOWHZ)		/* max seg lifetime (hah!) */ |
| 120 | 120 | #define	TCPTV_SRTTBASE	0			/* base roundtrip time; |
| 121 | 121 | 						 if 0, no idea yet */ |
| 122 | #define	TCPTV_SRTTDFLT	( 3*PR_SLOWHZ)		/* assumed RTT if no info */ | |
| 122 | #define	TCPTV_SRTTDFLT	( 1*PR_SLOWHZ)		/* initial RTO; RFC 6298 (2.1) */ | |
| 123 | 123 | |
| 124 | 124 | #define	TCPTV_PERSMIN	( 5*PR_SLOWHZ)		/* retransmit persistance */ |
| 125 | 125 | #define	TCPTV_PERSMAX	( 60*PR_SLOWHZ)		/* maximum persist interval */ |
lib/libc/include/generic-netbsd/nfs/nfs.h+3-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: nfs.h,v 1.81 2024/12/07 02:05:55 riastradh Exp $	*/ | |
| 1 | /*	$NetBSD: nfs.h,v 1.81.2.1 2026/06/27 09:46:05 martin Exp $	*/ | |
| 2 | 2 | /* |
| 3 | 3 | * Copyright (c) 1989, 1993, 1995 |
| 4 | 4 | *	The Regents of the University of California. All rights reserved. |
| ... | ... | @@ -451,6 +451,8 @@ struct nfssvc_sock { |
| 451 | 451 | 	int		ns_sflags;		/* b: */ |
| 452 | 452 | 	int		ns_cc;			/* b: */ |
| 453 | 453 | 	int		ns_reclen;		/* b: */ |
| 454 | 	int		ns_frag_count;		/* b: */ | |
| 455 | 	int		ns_streamlen;		/* b: */ | |
| 454 | 456 | 	int		ns_numuids; |
| 455 | 457 | 	u_int32_t	ns_sref;		/* g: */ |
| 456 | 458 | 	SIMPLEQ_HEAD(, nfsrv_descript) ns_sendq; /* s: send reply list */ |
lib/libc/include/generic-netbsd/nfs/nfsmount.h+4-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: nfsmount.h,v 1.54 2024/12/07 02:05:55 riastradh Exp $	*/ | |
| 1 | /*	$NetBSD: nfsmount.h,v 1.54.2.1 2026/06/03 18:46:36 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * Copyright (c) 1989, 1993 |
| ... | ... | @@ -92,13 +92,15 @@ struct nfs_args { |
| 92 | 92 | #define	NFSMNT_READDIRSIZE	0x00020000 /* Set readdir size */ |
| 93 | 93 | #define NFSMNT_XLATECOOKIE	0x00040000 /* 32<->64 dir cookie xlation */ |
| 94 | 94 | #define	NFSMNT_NOAC		0x00080000 /* Turn off attribute cache */ |
| 95 | #define	NFSMNT_NOWCCMSG		0x00100000 /* Turn off attribute wcc messages */ | |
| 95 | 96 | |
| 96 | 97 | #define NFSMNT_BITS	"\177\20" \ |
| 97 | 98 | "b\00soft\0b\01wsize\0b\02rsize\0b\03timeo\0" \ |
| 98 | 99 | "b\04retrans\0b\05maxgrps\0b\06intr\0b\07noconn\0" \ |
| 99 | 100 | "b\10nqnfs\0b\11nfsv3\0b\12kerb\0b\13dumbtimr\0" \ |
| 100 | 101 | "b\14leaseterm\0b\15readahead\0b\16deadthresh\0b\17resvport\0" \ |
| 101 | "b\20rdirplus\0b\21readdirsize\0b\22xlatecookie\0b\23noac\0" | |
| 102 | "b\20rdirplus\0b\21readdirsize\0b\22xlatecookie\0b\23noac\0" \ | |
| 103 | "b\24nowccmsg\0" | |
| 102 | 104 | |
| 103 | 105 | /* |
| 104 | 106 | * NFS internal flags (nm_iflag) */ |
lib/libc/include/generic-netbsd/pthread.h+1-1| ... | ... | @@ -461,4 +461,4 @@ __END_DECLS |
| 461 | 461 | |
| 462 | 462 | #endif /* __LIBPTHREAD_SOURCE__ */ |
| 463 | 463 | |
| 464 | #endif /* _LIB_PTHREAD_H */ | |
| 464 | #endif /* _LIB_PTHREAD_H */ | |
| \ No newline at end of file |
lib/libc/include/generic-netbsd/riscv/pte.h+32-19| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /* $NetBSD: pte.h,v 1.14.2.2 2025/10/26 12:28:36 martin Exp $ */ | |
| 1 | /* $NetBSD: pte.h,v 1.14.2.3 2026/06/03 18:17:02 martin Exp $ */ | |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc. |
| ... | ... | @@ -139,6 +139,12 @@ pte_modified_p(pt_entry_t pte) |
| 139 | 139 | 	return (pte & PTE_D) != 0; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | static inline bool | |
| 143 | pte_referenced_p(pt_entry_t pte) | |
| 144 | { | |
| 145 | 	return (pte & PTE_A) != 0; | |
| 146 | } | |
| 147 | ||
| 142 | 148 | static inline bool |
| 143 | 149 | pte_cached_p(pt_entry_t pte) |
| 144 | 150 | { |
| ... | ... | @@ -177,9 +183,15 @@ pte_nv_entry(bool kernel_p) |
| 177 | 183 | } |
| 178 | 184 | |
| 179 | 185 | static inline pt_entry_t |
| 180 | pte_prot_nowrite(pt_entry_t pte) | |
| 186 | pte_clear_modify(pt_entry_t pte) | |
| 187 | { | |
| 188 | 	return pte & ~PTE_D; | |
| 189 | } | |
| 190 | ||
| 191 | static inline pt_entry_t | |
| 192 | pte_clear_reference(pt_entry_t pte) | |
| 181 | 193 | { |
| 182 | 	return pte & ~PTE_W; | |
| 194 | 	return pte & ~PTE_A; | |
| 183 | 195 | } |
| 184 | 196 | |
| 185 | 197 | static inline pt_entry_t |
| ... | ... | @@ -237,28 +249,29 @@ pte_make_enter(paddr_t pa, struct vm_page_md *mdpg, vm_prot_t prot, |
| 237 | 249 | 	pte |= pte_prot_bits(mdpg, prot, kernel_p); |
| 238 | 250 | 	pte |= pte_enter_flags_to_pbmt(flags); |
| 239 | 251 | |
| 240 | 	if (mdpg != NULL) { | |
| 252 | 	/* | |
| 253 | 	 * pmap_enter should have checked flags and updated | |
| 254 | 	 * VM_PAGEMD_{REFERENCED,MODIFIED}_P, so there is no | |
| 255 | 	 * need here. | |
| 256 | 	 */ | |
| 257 | 	KASSERT(((flags & VM_PROT_ALL) == 0) || VM_PAGEMD_REFERENCED_P(mdpg)); | |
| 258 | 	KASSERT(((flags & VM_PROT_WRITE) == 0) || VM_PAGEMD_MODIFIED_P(mdpg)); | |
| 241 | 259 | |
| 242 | 		if ((prot & VM_PROT_WRITE) != 0 && | |
| 243 | 		 ((flags & VM_PROT_WRITE) != 0 || VM_PAGEMD_MODIFIED_P(mdpg))) { | |
| 260 | 	if (mdpg != NULL) { | |
| 261 | 		if ((prot & VM_PROT_WRITE) != 0 && VM_PAGEMD_MODIFIED_P(mdpg)) { | |
| 244 | 262 | 			/* |
| 245 | 			* This is a writable mapping, and the page's mod state | |
| 246 | 			* indicates it has already been modified. No need for | |
| 247 | 			* modified emulation. | |
| 248 | 			*/ | |
| 263 | 			 * This is a writable mapping, and the page's mod state | |
| 264 | 			 * indicates it has already been modified. No need for | |
| 265 | 			 * reference or modified emulation. | |
| 266 | 			 */ | |
| 249 | 267 | 			pte |= PTE_A | PTE_D; |
| 250 | 		} else if ((flags & VM_PROT_ALL) || VM_PAGEMD_REFERENCED_P(mdpg)) { | |
| 268 | 		} else if (VM_PAGEMD_REFERENCED_P(mdpg)) { | |
| 251 | 269 | 			/* |
| 252 | 			* - The access type indicates that we don't need to do | |
| 253 | 			* referenced emulation. | |
| 254 | 			* OR | |
| 255 | 			* - The physical page has already been referenced so no need | |
| 256 | 			* to re-do referenced emulation here. | |
| 257 | 			*/ | |
| 270 | 			 * The physical page has already been referenced so no need | |
| 271 | 			 * to re-do referenced emulation here. | |
| 272 | 			 */ | |
| 258 | 273 | 			pte |= PTE_A; |
| 259 | 274 | 		} |
| 260 | 	} else { | |
| 261 | 		pte |= PTE_A | PTE_D; | |
| 262 | 275 | 	} |
| 263 | 276 | |
| 264 | 277 | 	return pte; |
lib/libc/include/generic-netbsd/riscv/vmparam.h+21-9| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: vmparam.h,v 1.14 2023/05/07 12:41:48 skrll Exp $	*/ | |
| 1 | /*	$NetBSD: vmparam.h,v 1.14.8.2 2026/06/03 18:17:02 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc. |
| ... | ... | @@ -50,6 +50,25 @@ |
| 50 | 50 | #define	PAGE_SIZE	(1 << PAGE_SHIFT) |
| 51 | 51 | #define	PAGE_MASK	(PAGE_SIZE - 1) |
| 52 | 52 | |
| 53 | #ifdef _LP64 | |
| 54 | /* | |
| 55 | * Default pager_map of 16MB is awfully small. There is plenty | |
| 56 | * of VA so use it. | |
| 57 | */ | |
| 58 | #define	PAGER_MAP_DEFAULT_SIZE (512 * 1024 * 1024) | |
| 59 | ||
| 60 | /* | |
| 61 | * Defaults for Unified Buffer Cache parameters. | |
| 62 | */ | |
| 63 | ||
| 64 | #ifndef UBC_WINSHIFT | |
| 65 | #define	UBC_WINSHIFT	16	/* 64kB */ | |
| 66 | #endif | |
| 67 | #ifndef UBC_NWINS | |
| 68 | #define	UBC_NWINS	4096	/* 256MB */ | |
| 69 | #endif | |
| 70 | #endif | |
| 71 | ||
| 53 | 72 | /* |
| 54 | 73 | * USRSTACK is the top (end) of the user stack. |
| 55 | 74 | * |
| ... | ... | @@ -125,12 +144,6 @@ |
| 125 | 144 | #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xffffffd000000000) |
| 126 | 145 | |
| 127 | 146 | #else		/* Sv32 */ |
| 128 | /* | |
| 129 | * kernel virtual space layout: | |
| 130 | * 0x8000_0000 - 64GiB KERNEL VM Space (inc. text/data/bss) | |
| 131 | * (0x4000_0000 +1GiB) KERNEL VM start of KVA | |
| 132 | * (0x0000_0000 64GiB) reserved | |
| 133 | */ | |
| 134 | 147 | |
| 135 | 148 | /* |
| 136 | 149 | * kernel virtual space layout without direct map (common case) |
| ... | ... | @@ -154,13 +167,12 @@ |
| 154 | 167 | * |
| 155 | 168 | */ |
| 156 | 169 | |
| 157 | ||
| 158 | ||
| 159 | 170 | #define VM_MAXUSER_ADDRESS	((vaddr_t)-0x7fffffff-1)/* 0xffff_ffff_8000_0000 */ |
| 160 | 171 | #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)-0x7fffffff-1)/* 0xffff_ffff_8000_0000 */ |
| 161 | 172 | #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)-0x10000000)	/* 0xffff_ffff_f000_0000 */ |
| 162 | 173 | |
| 163 | 174 | #endif |
| 175 | ||
| 164 | 176 | #define VM_KERNEL_BASE		VM_MIN_KERNEL_ADDRESS |
| 165 | 177 | #define VM_KERNEL_SIZE		0x2000000	/* 32 MiB (8 / 16 megapages) */ |
| 166 | 178 | #define VM_KERNEL_DTB_BASE	(VM_KERNEL_BASE + VM_KERNEL_SIZE) |
lib/libc/include/generic-netbsd/sys/fcntl.h+4-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: fcntl.h,v 1.57 2025/07/25 23:24:46 kre Exp $	*/ | |
| 1 | /*	$NetBSD: fcntl.h,v 1.57.2.1 2026/06/16 09:06:50 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1983, 1990, 1993 |
| ... | ... | @@ -121,6 +121,9 @@ |
| 121 | 121 | #if defined(_NETBSD_SOURCE) |
| 122 | 122 | #define	O_NOSIGPIPE	0x01000000	/* don't deliver sigpipe */ |
| 123 | 123 | #define	O_REGULAR	0x02000000	/* fail if not a regular file */ |
| 124 | #endif | |
| 125 | #if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0 >= 700) || \ | |
| 126 | defined(_NETBSD_SOURCE) | |
| 124 | 127 | #define	O_EXEC		0x04000000	/* open for executing only */ |
| 125 | 128 | #endif |
| 126 | 129 | #if (_POSIX_C_SOURCE - 0) >= 202405L || (_XOPEN_SOURCE - 0 >= 800) || \ |
lib/libc/include/generic-netbsd/sys/lua.h+3-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: lua.h,v 1.9 2023/07/11 14:57:21 martin Exp $ */ | |
| 1 | /*	$NetBSD: lua.h,v 1.9.8.1 2026/06/29 19:52:23 martin Exp $ */ | |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * Copyright (c) 2014 by Lourival Vieira Neto <lneto@NetBSD.org>. |
| ... | ... | @@ -33,7 +33,9 @@ |
| 33 | 33 | #define _SYS_LUA_H_ |
| 34 | 34 | |
| 35 | 35 | #include <sys/param.h> |
| 36 | ||
| 36 | 37 | #include <sys/ioccom.h> |
| 38 | #include <sys/stdbool.h> | |
| 37 | 39 | |
| 38 | 40 | #include <lua.h>		/* for lua_State */ |
| 39 | 41 |
lib/libc/include/generic-netbsd/sys/param.h+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: param.h,v 1.738.2.5 2026/05/12 04:23:51 martin Exp $	*/ | |
| 1 | /*	$NetBSD: param.h,v 1.738.2.9 2026/07/30 15:23:12 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1982, 1986, 1989, 1993 |
| ... | ... | @@ -566,4 +566,4 @@ extern size_t coherency_unit; |
| 566 | 566 | #endif |
| 567 | 567 | #endif /* !__ASSEMBLER__ */ |
| 568 | 568 | |
| 569 | #endif /* !_SYS_PARAM_H_ */ | |
| 569 | #endif /* !_SYS_PARAM_H_ */ | |
| \ No newline at end of file |
lib/libc/include/generic-netbsd/x86/cpu_extended_state.h+3-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: cpu_extended_state.h,v 1.19 2025/04/24 01:50:39 riastradh Exp $	*/ | |
| 1 | /*	$NetBSD: cpu_extended_state.h,v 1.19.2.1 2026/07/19 15:57:27 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | #ifndef _X86_CPU_EXTENDED_STATE_H_ |
| 4 | 4 | #define _X86_CPU_EXTENDED_STATE_H_ |
| ... | ... | @@ -142,6 +142,8 @@ struct xsave_header { |
| 142 | 142 | }; |
| 143 | 143 | __CTASSERT(sizeof(struct xsave_header) == 512 + 64); |
| 144 | 144 | |
| 145 | #define	XSAVE_ALIGN	64 | |
| 146 | ||
| 145 | 147 | /* |
| 146 | 148 | * The ymm save area actually follows the xsave_header. |
| 147 | 149 | */ |
lib/libc/include/generic-netbsd/x86/fpu.h+7-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: fpu.h,v 1.23 2020/10/24 07:14:29 mgorny Exp $	*/ | |
| 1 | /*	$NetBSD: fpu.h,v 1.23.28.1 2026/07/19 15:57:27 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | #ifndef	_X86_FPU_H_ |
| 4 | 4 | #define	_X86_FPU_H_ |
| ... | ... | @@ -46,6 +46,12 @@ int process_read_xstate(struct lwp *, struct xstate *); |
| 46 | 46 | int process_verify_xstate(const struct xstate *); |
| 47 | 47 | int process_write_xstate(struct lwp *, const struct xstate *); |
| 48 | 48 | |
| 49 | bool process_xsave_needed_p(struct lwp *); | |
| 50 | void process_read_xsave(struct lwp *, const struct xsave_header **, size_t *); | |
| 51 | int process_verify_xsavelen(struct lwp *, size_t); | |
| 52 | int process_verify_xsave(struct lwp *, const struct xsave_header *, size_t); | |
| 53 | void process_write_xsave(struct lwp *, const struct xsave_header *, size_t); | |
| 54 | ||
| 49 | 55 | #endif |
| 50 | 56 | |
| 51 | 57 | #endif /* _X86_FPU_H_ */ |
| \ No newline at end of file |
lib/libc/include/generic-netbsd/x86/specialreg.h+71-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: specialreg.h,v 1.219 2025/04/28 13:01:27 riastradh Exp $	*/ | |
| 1 | /*	$NetBSD: specialreg.h,v 1.219.2.1 2026/07/19 15:57:27 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * Copyright (c) 2014-2020 The NetBSD Foundation, Inc. |
| ... | ... | @@ -183,16 +183,82 @@ |
| 183 | 183 | 	"\0" |
| 184 | 184 | |
| 185 | 185 | /* |
| 186 | * Known FPU bits, only these get enabled. The save area is sized for all the | |
| 187 | * fields below. | |
| 186 | * XCR0_FPU: Known FPU bits, only these get enabled. The save area is | |
| 187 | * sized for all the fields below. | |
| 188 | * | |
| 189 | * Any bits added to this will expand the extended CPU state that we | |
| 190 | * may have to save and restore with XSAVE for userland processes, | |
| 191 | * either in the kernel when preempting threads, or on the user's stack | |
| 192 | * when delivering a signal. | |
| 193 | * | |
| 194 | * The kernel can dyanmically allocate larger sizes (on amd64, anyway, | |
| 195 | * though not currently on i386 or Xen PV). But if the XSAVE area is | |
| 196 | * expanded so much that it and mcontext_t exceed MINSIGSTKSZ | |
| 197 | * (currently 8192), a userland ABI change and compatibility layer is | |
| 198 | * required to accommodate that, because existing programs may use | |
| 199 | * sigaltstack(2) with stacks sized for the old MINSIGSTKSZ. | |
| 200 | * | |
| 201 | * The current stack requirement is 3160 bytes of space plus up to | |
| 202 | * 63+15+8=86 bytes of padding for alignment (could be reduced by | |
| 203 | * around 512 bytes by having mcontext_t overlap with the XSAVE area a | |
| 204 | * little in machdep.c cpu_getmcontext_xsave, but we don't do that | |
| 205 | * right now): | |
| 206 | * | |
| 207 | * - mcontext_t (728 bytes: general registers and 512-byte FXSAVE area) | |
| 208 | * - XSAVE header (576 bytes: 512 bytes of FXSAVE, 64 bytes of metadata) | |
| 209 | * - AVX state: ymm0..ymm15 high 128-bit halves (256 bytes) | |
| 210 | * - AVX-512 state: | |
| 211 | * . k0..k7 opmask registers (64 bytes) | |
| 212 | * . zmm0..zmm15 high 256-bit halves (512 bytes) | |
| 213 | * . zmm16..zmm31 registers (1024 bytes) | |
| 214 | * | |
| 215 | * Likely future extensions that would expand the state beyond | |
| 216 | * MINSIGSTKSZ: | |
| 217 | * | |
| 218 | * - AMX (Advanced Matrix Extensions) and ACE (AI Compute Extensions) | |
| 219 | * state: | |
| 220 | * . [AMX/ACE] TILECFG (64 bytes) | |
| 221 | * . [AMX/ACE] TILEDATA (8192 bytes) | |
| 222 | * . [ACE] SCALEDATA (128 bytes) | |
| 223 | * | |
| 224 | * As a precaution against ABI breakage, x86/identcpu.c will panic at | |
| 225 | * boot if the XSAVE state size enabled in XCR0 exceeds MINSIGSTKSZ. | |
| 226 | * | |
| 227 | * References: | |
| 228 | * | |
| 229 | * - Intel 64 and IA-32 Architectures Software Developer's Manual, | |
| 230 | * Volume 1: Basic Architecture, Intel, Order Number: 253665-092US, | |
| 231 | * June 2026, Sec. 13.1 `XSAVE-Supported Features and State-Component | |
| 232 | * Bitmaps', pp. 13-1 -- 13-2. | |
| 233 | * https://web.archive.org/web/20260709150417/https://cdrdv2-public.intel.com/922477/253665-092-sdm-vol-1.pdf | |
| 234 | * | |
| 235 | * - AI Compute Extensions (ACE) Specification, x86 Ecosystem Advisory | |
| 236 | * Group, Version 1.15, 2026-05-15, Sec 15.4.1 `XSAVE State | |
| 237 | * Components', p. 86. | |
| 238 | * https://web.archive.org/web/20260619062626/https://x86ecosystem.org/wp-content/uploads/2026/06/ACE_v1_Specification_public_1_15.pdf | |
| 188 | 239 | */ |
| 189 | 240 | #if defined __i386__ || defined XENPV /* XXX XENPV PR kern/59371 */ |
| 190 | 241 | #define XCR0_FPU	(XCR0_X87 | XCR0_SSE | XCR0_YMM_Hi128 | \ |
| 191 | 242 | 			 XCR0_Opmask | XCR0_ZMM_Hi256 | XCR0_Hi16_ZMM) |
| 192 | 243 | #else |
| 193 | 244 | #define XCR0_FPU	(XCR0_X87 | XCR0_SSE | XCR0_YMM_Hi128 | \ |
| 194 | 			 XCR0_Opmask | XCR0_ZMM_Hi256 | XCR0_Hi16_ZMM | \ | |
| 195 | 			 XCR0_TILECFG | XCR0_TILEDATA) | |
| 245 | 			 XCR0_Opmask | XCR0_ZMM_Hi256 | XCR0_Hi16_ZMM) | |
| 246 | #endif | |
| 247 | ||
| 248 | /* | |
| 249 | * Maximum size of XSAVE state that we can handle without ABI changes | |
| 250 | * to userland. Must match usage in cpu_getmcontext. Extra 8 is neeed | |
| 251 | * on amd64 to have space for return address in 16-byte-aligned stack | |
| 252 | * frame. | |
| 253 | */ | |
| 254 | #ifdef __x86_64__ | |
| 255 | #define	XSAVE_MAX_BYTES							 \ | |
| 256 | 	(MINSIGSTKSZ - (8 + STACK_ALIGNBYTES +				 \ | |
| 257 | 	 sizeof(struct sigframe_siginfo) + (XSAVE_ALIGN - 1))) | |
| 258 | #else | |
| 259 | #define	XSAVE_MAX_BYTES							 \ | |
| 260 | 	(MINSIGSTKSZ - (STACK_ALIGNBYTES +				 \ | |
| 261 | 	 sizeof(struct sigframe_siginfo) + (XSAVE_ALIGN - 1))) | |
| 196 | 262 | #endif |
| 197 | 263 | |
| 198 | 264 | /* |
lib/libc/include/powerpc-netbsd-eabi/powerpc/oea/pmap.h+6-4| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: pmap.h,v 1.39 2023/12/15 09:42:33 rin Exp $	*/ | |
| 1 | /*	$NetBSD: pmap.h,v 1.39.4.1 2026/07/03 17:51:59 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (C) 1995, 1996 Wolfgang Solfrank. |
| ... | ... | @@ -122,11 +122,13 @@ __BEGIN_DECLS |
| 122 | 122 | #include <sys/systm.h> |
| 123 | 123 | |
| 124 | 124 | /* |
| 125 | * For OEA and OEA64_BRIDGE, we guarantee that pa below USER_ADDR | |
| 126 | * (== 3GB < VM_MIN_KERNEL_ADDRESS) is direct-mapped. | |
| 125 | * Physical memory below PMAP_DIRECT_MAPPED_LEN is direct-mapped | |
| 126 | * (pa == va). Direct region covers the segments below BOTH | |
| 127 | * the user copyin window (USER_SR) and the kernel HTAB window | |
| 128 | * (KERNEL_SR), so it can never overlap. | |
| 127 | 129 | */ |
| 128 | 130 | #if defined(PPC_OEA) || defined(PPC_OEA64_BRIDGE) |
| 129 | #define	PMAP_DIRECT_MAPPED_SR	(USER_SR - 1) | |
| 131 | #define	PMAP_DIRECT_MAPPED_SR	(MIN(USER_SR, KERNEL_SR) - 1) | |
| 130 | 132 | #define	PMAP_DIRECT_MAPPED_LEN \ |
| 131 | 133 | ((vaddr_t)SEGMENT_LENGTH * (PMAP_DIRECT_MAPPED_SR + 1)) |
| 132 | 134 | #endif |
lib/libc/include/x86-netbsd-none/machine/mcontext.h+23-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: mcontext.h,v 1.19 2024/11/30 01:04:10 christos Exp $	*/ | |
| 1 | /*	$NetBSD: mcontext.h,v 1.19.2.1 2026/07/19 15:57:27 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. |
| ... | ... | @@ -40,6 +40,7 @@ |
| 40 | 40 | #define	_UC_CLRSTACK	_UC_MD_BIT17 |
| 41 | 41 | #define	_UC_VM		_UC_MD_BIT18 |
| 42 | 42 | #define	_UC_TLSBASE	_UC_MD_BIT19 |
| 43 | #define	_UC_XSAVE	_UC_MD_BIT20 | |
| 43 | 44 | |
| 44 | 45 | /* |
| 45 | 46 | * Layout of mcontext_t according to the System V Application Binary Interface, |
| ... | ... | @@ -85,6 +86,27 @@ typedef struct { |
| 85 | 86 | 			char	__fp_xmm[512]; |
| 86 | 87 | 		} __fp_xmm_state;	/* x87 and xmm regs in fxsave format */ |
| 87 | 88 | 		int	__fp_fpregs[128]; |
| 89 | 		struct { | |
| 90 | 			/* | |
| 91 | 			 * `The XSAVE feature set does not use bytes | |
| 92 | 			 * 511:416; bytes 463:416 are reserved.' | |
| 93 | 			 * | |
| 94 | 			 * We take a part out of this to form a pointer | |
| 95 | 			 * to an external XSAVE area. This way, we can | |
| 96 | 			 * replicate the FXSAVE parts for the benefit | |
| 97 | 			 * of userland programs that aren't aware of | |
| 98 | 			 * the XSAVE pointer, have used the extended | |
| 99 | 			 * CPU registers (ymmN/zmmN/&c.), and want to | |
| 100 | 			 * examine the x87/SSE register state in a | |
| 101 | 			 * signal handler. The kernel does not use | |
| 102 | 			 * this part. | |
| 103 | 			 */ | |
| 104 | 			char		__fxsave[416]; | |
| 105 | 			char		__rsvd[48]; | |
| 106 | 			__greg_t	__xsaveptr; | |
| 107 | 			__greg_t	__xsavelen; | |
| 108 | 			char		__pad[40]; | |
| 109 | 		} __xsave; | |
| 88 | 110 | 	} __fp_reg_set; |
| 89 | 111 | 	int 	__fp_pad[33];			/* Historic padding */ |
| 90 | 112 | } __fpregset_t; |
lib/libc/include/x86_64-netbsd-none/amd64/mcontext.h+31-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: mcontext.h,v 1.24 2024/11/30 01:04:06 christos Exp $	*/ | |
| 1 | /*	$NetBSD: mcontext.h,v 1.24.2.1 2026/07/19 15:57:26 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. |
| ... | ... | @@ -56,7 +56,28 @@ typedef	__greg_t	__gregset_t[_NGREG]; |
| 56 | 56 | * which requires 16 byte alignment. However the mcontext version |
| 57 | 57 | * is never directly accessed. |
| 58 | 58 | */ |
| 59 | typedef char __fpregset_t[512] __aligned(8); | |
| 59 | typedef union { | |
| 60 | 	char	__fxsave[512] __aligned(8); | |
| 61 | 	struct { | |
| 62 | 		/* | |
| 63 | 		 * `The XSAVE feature set does not use bytes 511:416; | |
| 64 | 		 * bytes 463:416 are reserved.' | |
| 65 | 		 * | |
| 66 | 		 * We take a part out of this to form a pointer to an | |
| 67 | 		 * external XSAVE area. This way, we can replicate the | |
| 68 | 		 * FXSAVE parts for the benefit of userland programs | |
| 69 | 		 * that aren't aware of the XSAVE pointer, have used | |
| 70 | 		 * the extended CPU registers (ymmN/zmmN/&c.), and want | |
| 71 | 		 * to examine the x87/SSE register state in a signal | |
| 72 | 		 * handler. The kernel does not use this part. | |
| 73 | 		 */ | |
| 74 | 		char		__fxsave[416]; | |
| 75 | 		char		__rsvd[48]; | |
| 76 | 		__greg_t	__xsaveptr; | |
| 77 | 		__greg_t	__xsavelen; | |
| 78 | 		char		__pad[32]; | |
| 79 | 	}	__xsave; | |
| 80 | } __fpregset_t; | |
| 60 | 81 | |
| 61 | 82 | typedef struct { |
| 62 | 83 | 	__gregset_t	__gregs; |
| ... | ... | @@ -75,6 +96,7 @@ typedef struct { |
| 75 | 96 | #define	_UC_MACHINE_SET_PC(uc, pc)	_UC_MACHINE_PC(uc) = (pc) |
| 76 | 97 | |
| 77 | 98 | #define	_UC_TLSBASE	_UC_MD_BIT19 |
| 99 | #define	_UC_XSAVE	_UC_MD_BIT20 | |
| 78 | 100 | |
| 79 | 101 | /* |
| 80 | 102 | * mcontext extensions to handle signal delivery. |
| ... | ... | @@ -127,6 +149,13 @@ typedef struct { |
| 127 | 149 | 		struct { |
| 128 | 150 | 			char	__fp_xmm[512]; |
| 129 | 151 | 		} __fp_xmm_state; |
| 152 | 		struct { | |
| 153 | 			char		__fxsave[416]; | |
| 154 | 			char		__rsvd[48]; | |
| 155 | 			__greg32_t	__xsaveptr; | |
| 156 | 			__greg32_t	__xsavelen; | |
| 157 | 			char		__pad[40]; | |
| 158 | 		} __xsave; | |
| 130 | 159 | 	} __fp_reg_set; |
| 131 | 160 | 	int	__fp_pad[33];			/* Historic padding */ |
| 132 | 161 | } __fpregset32_t; |
lib/libc/include/x86_64-netbsd-none/machine/mcontext.h+31-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | /*	$NetBSD: mcontext.h,v 1.24 2024/11/30 01:04:06 christos Exp $	*/ | |
| 1 | /*	$NetBSD: mcontext.h,v 1.24.2.1 2026/07/19 15:57:26 martin Exp $	*/ | |
| 2 | 2 | |
| 3 | 3 | /*- |
| 4 | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. |
| ... | ... | @@ -56,7 +56,28 @@ typedef	__greg_t	__gregset_t[_NGREG]; |
| 56 | 56 | * which requires 16 byte alignment. However the mcontext version |
| 57 | 57 | * is never directly accessed. |
| 58 | 58 | */ |
| 59 | typedef char __fpregset_t[512] __aligned(8); | |
| 59 | typedef union { | |
| 60 | 	char	__fxsave[512] __aligned(8); | |
| 61 | 	struct { | |
| 62 | 		/* | |
| 63 | 		 * `The XSAVE feature set does not use bytes 511:416; | |
| 64 | 		 * bytes 463:416 are reserved.' | |
| 65 | 		 * | |
| 66 | 		 * We take a part out of this to form a pointer to an | |
| 67 | 		 * external XSAVE area. This way, we can replicate the | |
| 68 | 		 * FXSAVE parts for the benefit of userland programs | |
| 69 | 		 * that aren't aware of the XSAVE pointer, have used | |
| 70 | 		 * the extended CPU registers (ymmN/zmmN/&c.), and want | |
| 71 | 		 * to examine the x87/SSE register state in a signal | |
| 72 | 		 * handler. The kernel does not use this part. | |
| 73 | 		 */ | |
| 74 | 		char		__fxsave[416]; | |
| 75 | 		char		__rsvd[48]; | |
| 76 | 		__greg_t	__xsaveptr; | |
| 77 | 		__greg_t	__xsavelen; | |
| 78 | 		char		__pad[32]; | |
| 79 | 	}	__xsave; | |
| 80 | } __fpregset_t; | |
| 60 | 81 | |
| 61 | 82 | typedef struct { |
| 62 | 83 | 	__gregset_t	__gregs; |
| ... | ... | @@ -75,6 +96,7 @@ typedef struct { |
| 75 | 96 | #define	_UC_MACHINE_SET_PC(uc, pc)	_UC_MACHINE_PC(uc) = (pc) |
| 76 | 97 | |
| 77 | 98 | #define	_UC_TLSBASE	_UC_MD_BIT19 |
| 99 | #define	_UC_XSAVE	_UC_MD_BIT20 | |
| 78 | 100 | |
| 79 | 101 | /* |
| 80 | 102 | * mcontext extensions to handle signal delivery. |
| ... | ... | @@ -127,6 +149,13 @@ typedef struct { |
| 127 | 149 | 		struct { |
| 128 | 150 | 			char	__fp_xmm[512]; |
| 129 | 151 | 		} __fp_xmm_state; |
| 152 | 		struct { | |
| 153 | 			char		__fxsave[416]; | |
| 154 | 			char		__rsvd[48]; | |
| 155 | 			__greg32_t	__xsaveptr; | |
| 156 | 			__greg32_t	__xsavelen; | |
| 157 | 			char		__pad[40]; | |
| 158 | 		} __xsave; | |
| 130 | 159 | 	} __fp_reg_set; |
| 131 | 160 | 	int	__fp_pad[33];			/* Historic padding */ |
| 132 | 161 | } __fpregset32_t; |