diff --git a/sys/sys/_uexterror.h b/sys/sys/_uexterror.h index 2bbeb3e4186f..7951b2c5b26d 100644 --- a/sys/sys/_uexterror.h +++ b/sys/sys/_uexterror.h @@ -1,27 +1,29 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2025 The FreeBSD Foundation * All rights reserved. * * This software were developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. */ #ifndef _SYS__UEXTERROR_H_ #define _SYS__UEXTERROR_H_ #include struct uexterror { __uint32_t ver; __uint32_t error; __uint32_t cat; __uint32_t src_line; + __uint32_t flags; + __uint32_t rsrv0; __uint64_t p1; __uint64_t p2; __uint64_t rsrv1[4]; char msg[128]; }; #endif diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 2fb4c494d158..7e842f553866 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -1,66 +1,66 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2025 The FreeBSD Foundation * All rights reserved. * * This software were developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. */ #ifndef _SYS_EXTERRVAR_H_ #define _SYS_EXTERRVAR_H_ #include #include #include #define UEXTERROR_MAXLEN 256 -#define UEXTERROR_VER 0x10010001 +#define UEXTERROR_VER 0x10010002 #define EXTERRCTL_ENABLE 1 #define EXTERRCTL_DISABLE 2 #define EXTERRCTLF_FORCE 0x00000001 #ifdef _KERNEL #ifndef EXTERR_CATEGORY #error "Specify error category before including sys/exterrvar.h" #endif #ifdef BLOAT_KERNEL_WITH_EXTERR #define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = mmsg #else #define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = NULL #endif #define SET_ERROR2(eerror, mmsg, pp1, pp2) do { \ struct thread *_Td = curthread; \ if ((_Td->td_pflags2 & TDP2_UEXTERR) != 0) { \ _Td->td_pflags2 |= TDP2_EXTERR; \ _Td->td_kexterr.error = eerror; \ _Td->td_kexterr.cat = EXTERR_CATEGORY; \ SET_ERROR_MSG(mmsg); \ _Td->td_kexterr.p1 = (uintptr_t)pp1; \ _Td->td_kexterr.p2 = (uintptr_t)pp2; \ _Td->td_kexterr.src_line = __LINE__; \ } \ } while (0) #define SET_ERROR0(eerror, mmsg) SET_ERROR2(eerror, mmsg, 0, 0) #define SET_ERROR1(eerror, mmsg, pp1) SET_ERROR2(eerror, mmsg, pp1, 0) int exterr_to_ue(struct thread *td, struct uexterror *ue); #else /* _KERNEL */ #include __BEGIN_DECLS int exterrctl(u_int op, u_int flags, void *ptr); __END_DECLS #endif /* _KERNEL */ #endif