From: Paul Floyd Date: Wed, 1 May 2024 14:06:53 +0000 (+0200) Subject: FreeBSD cleanup: mostly using VKI prefix in vki-freebsd.h X-Git-Tag: VALGRIND_3_24_0~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cf0a741495d87af10b92450c34693eef4ce59a2;p=thirdparty%2Fvalgrind.git FreeBSD cleanup: mostly using VKI prefix in vki-freebsd.h --- diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 11cd4d6fc..51c562346 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -994,7 +994,8 @@ PRE(sys_ioctl) buffers */ case VKI_BIOCSETF: // #define BIOCSETF _IOW('B', 103, struct bpf_program) - // test with "usbdump" (as root) + // "usbconfig" to get a list of devices then + // test with "usbdump -i usbus0" (as root) if (ARG3 && ML_(safe_to_deref)((const void*)ARG3, sizeof(struct vki_bpf_program))) { struct vki_bpf_program* fp = (struct vki_bpf_program*)ARG3; PRE_FIELD_READ("ioctl(BIOCSETF).bf_len", fp->bf_len); diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h index 46d00dd97..1b51e939f 100644 --- a/include/vki/vki-freebsd.h +++ b/include/vki/vki-freebsd.h @@ -59,8 +59,8 @@ # error Unknown platform #endif -#include -#include +#include // O_RDONLY +#include // MAXPATHLEN //---------------------------------------------------------------------- @@ -717,11 +717,11 @@ static __inline struct vki_cmsghdr * vki_cmsg_nxthdr (struct vki_msghdr *__msg, #define VKI_SOCK_STREAM 1 -#include +#include // TCP_NODELAY #define VKI_TCP_NODELAY TCP_NODELAY -#include +#include // IPPROTO_TCP #define VKI_IPPROTO_TCP IPPROTO_TCP @@ -2019,14 +2019,14 @@ struct vki_uuid { #define VKI__SS_PAD1SIZE (VKI__SS_ALIGNSIZE - sizeof(unsigned char) - \ sizeof(vki_sa_family_t)) #define VKI__SS_PAD2SIZE (VKI__SS_MAXSIZE - sizeof(unsigned char) - \ - sizeof(sa_family_t) - VKI__SS_PAD1SIZE - VKI__SS_ALIGNSIZE) + sizeof(vki_sa_family_t) - VKI__SS_PAD1SIZE - VKI__SS_ALIGNSIZE) struct vki_sockaddr_storage { unsigned char vki_ss_len; /* address length */ vki_sa_family_t vki_ss_family; /* address family */ char vki___ss_pad1[VKI__SS_PAD1SIZE]; __int64_t vki___ss_align; /* force desired struct alignment */ - char vki___ss_pad2VKI_[_SS_PAD2SIZE]; + char vki___ss_pad2VKI_[VKI__SS_PAD2SIZE]; }; //---------------------------------------------------------------------- @@ -2222,7 +2222,6 @@ struct vki_kinfo_file { // From sys/sysctl.h (and related) //---------------------------------------------------------------------- -#include #include #define VKI_CTL_KERN CTL_KERN @@ -2471,7 +2470,7 @@ struct vki_ps_strings { * registers. * * I can't just change mode_t to be 32bit. that will mess up - * the 'stat' structures in thie file. + * the 'stat' structures in this file. * * Instead I'll just do what the compiler does, and promote * it to 32bits. @@ -2492,8 +2491,6 @@ struct vki_ps_strings { #define vki_mode_t vki_int32_t #endif -// See syswrap-freebsd.c PRE/POST(sys_ioctl) - //---------------------------------------------------------------------- // From sys/pciio.h //---------------------------------------------------------------------- @@ -2777,18 +2774,18 @@ struct vki_scsi_inquiry_data { // From sys/queue.h //---------------------------------------------------------------------- -#define SLIST_ENTRY(type) \ +#define VKI_SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } -#define LIST_ENTRY(type) \ +#define VKI_LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } -#define STAILQ_ENTRY(type) \ +#define VKI_STAILQ_ENTRY(type) \ struct { \ struct type *stqe_next; /* next element */ \ } @@ -2806,7 +2803,7 @@ struct vki_qm_trace { #define VKI_TRACEBUF #endif -#define TAILQ_ENTRY(type) \ +#define VKI_TAILQ_ENTRY(type) \ struct { \ struct type *tqe_next; /* next element */ \ struct type **tqe_prev; /* address of previous next element */ \ @@ -2821,10 +2818,10 @@ struct { \ #define VKI_CAM_VERSION 0x1a /* Hex value for current version */ typedef union { - LIST_ENTRY(vki_ccb_hdr) le; - SLIST_ENTRY(vki_ccb_hdr) sle; - TAILQ_ENTRY(vki_ccb_hdr) tqe; - STAILQ_ENTRY(vki_ccb_hdr) stqe; + VKI_LIST_ENTRY(vki_ccb_hdr) le; + VKI_SLIST_ENTRY(vki_ccb_hdr) sle; + VKI_TAILQ_ENTRY(vki_ccb_hdr) tqe; + VKI_STAILQ_ENTRY(vki_ccb_hdr) stqe; } vki_camq_entry; typedef enum {