sys/compat: Use C99 fixed-width integer types.

No functional change.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D33632
This commit is contained in:
John Baldwin 2021-12-28 09:41:33 -08:00
parent 326d578232
commit cc5aa0a496
6 changed files with 139 additions and 139 deletions

View File

@ -193,16 +193,16 @@ struct nstat32 {
};
struct iovec32 {
u_int32_t iov_base;
uint32_t iov_base;
int iov_len;
};
struct msghdr32 {
u_int32_t msg_name;
uint32_t msg_name;
socklen_t msg_namelen;
u_int32_t msg_iov;
uint32_t msg_iov;
int msg_iovlen;
u_int32_t msg_control;
uint32_t msg_control;
socklen_t msg_controllen;
int msg_flags;
};
@ -216,10 +216,10 @@ struct stat32 {
ino_t st_ino;
nlink_t st_nlink;
mode_t st_mode;
u_int16_t st_padding0;
uint16_t st_padding0;
uid_t st_uid;
gid_t st_gid;
u_int32_t st_padding1;
uint32_t st_padding1;
dev_t st_rdev;
#ifdef __STAT32_TIME_T_EXT
__int32_t st_atim_ext;
@ -239,27 +239,27 @@ struct stat32 {
struct timespec32 st_birthtim;
off_t st_size;
int64_t st_blocks;
u_int32_t st_blksize;
u_int32_t st_flags;
u_int64_t st_gen;
u_int64_t st_spare[10];
uint32_t st_blksize;
uint32_t st_flags;
uint64_t st_gen;
uint64_t st_spare[10];
};
struct freebsd11_stat32 {
u_int32_t st_dev;
u_int32_t st_ino;
uint32_t st_dev;
uint32_t st_ino;
mode_t st_mode;
u_int16_t st_nlink;
uint16_t st_nlink;
uid_t st_uid;
gid_t st_gid;
u_int32_t st_rdev;
uint32_t st_rdev;
struct timespec32 st_atim;
struct timespec32 st_mtim;
struct timespec32 st_ctim;
off_t st_size;
int64_t st_blocks;
u_int32_t st_blksize;
u_int32_t st_flags;
u_int32_t st_gen;
uint32_t st_blksize;
uint32_t st_flags;
uint32_t st_gen;
int32_t st_lspare;
struct timespec32 st_birthtim;
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
@ -280,15 +280,15 @@ struct ostat32 {
struct timespec32 st_ctim;
__int32_t st_blksize;
__int32_t st_blocks;
u_int32_t st_flags;
uint32_t st_flags;
__uint32_t st_gen;
};
struct jail32_v0 {
u_int32_t version;
uint32_t version;
uint32_t path;
uint32_t hostname;
u_int32_t ip_number;
uint32_t ip_number;
};
struct jail32 {
@ -303,7 +303,7 @@ struct jail32 {
};
struct sigaction32 {
u_int32_t sa_u;
uint32_t sa_u;
int sa_flags;
sigset_t sa_mask;
};
@ -381,7 +381,7 @@ struct kinfo_proc32 {
u_int ki_slptime;
u_int ki_swtime;
u_int ki_cow;
u_int64_t ki_runtime;
uint64_t ki_runtime;
struct timeval32 ki_start;
struct timeval32 ki_childtime;
int ki_flag;

View File

@ -382,10 +382,10 @@ freebsd32_sigaltstack(struct thread *td,
*/
int
freebsd32_exec_copyin_args(struct image_args *args, const char *fname,
enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv)
enum uio_seg segflg, uint32_t *argv, uint32_t *envv)
{
char *argp, *envp;
u_int32_t *p32, arg;
uint32_t *p32, arg;
int error;
bzero(args, sizeof(*args));
@ -2782,7 +2782,7 @@ freebsd4_freebsd32_sigaction(struct thread *td,
#ifdef COMPAT_43
struct osigaction32 {
u_int32_t sa_u;
uint32_t sa_u;
osigset_t sa_mask;
int sa_flags;
};
@ -2821,7 +2821,7 @@ ofreebsd32_sigaction(struct thread *td,
}
struct sigvec32 {
u_int32_t sv_handler;
uint32_t sv_handler;
int sv_mask;
int sv_flags;
};
@ -2861,7 +2861,7 @@ ofreebsd32_sigvec(struct thread *td,
}
struct sigstack32 {
u_int32_t ss_sp;
uint32_t ss_sp;
int ss_onstack;
};
@ -3392,7 +3392,7 @@ int
freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base)
{
int argc, envc, i;
u_int32_t *vectp;
uint32_t *vectp;
char *stringp;
uintptr_t destp, ustringp;
struct freebsd32_ps_strings *arginfo;
@ -3511,7 +3511,7 @@ freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base)
* Fill in "ps_strings" struct for ps, w, etc.
*/
imgp->argv = vectp;
if (suword32(&arginfo->ps_argvstr, (u_int32_t)(intptr_t)vectp) != 0 ||
if (suword32(&arginfo->ps_argvstr, (uint32_t)(intptr_t)vectp) != 0 ||
suword32(&arginfo->ps_nargvstr, argc) != 0)
return (EFAULT);
@ -3531,7 +3531,7 @@ freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base)
return (EFAULT);
imgp->envv = vectp;
if (suword32(&arginfo->ps_envstr, (u_int32_t)(intptr_t)vectp) != 0 ||
if (suword32(&arginfo->ps_envstr, (uint32_t)(intptr_t)vectp) != 0 ||
suword32(&arginfo->ps_nenvstr, envc) != 0)
return (EFAULT);

View File

@ -32,8 +32,8 @@
#define _COMPAT_FREEBSD32_SIGNAL_H_
struct sigaltstack32 {
u_int32_t ss_sp; /* signal stack base */
u_int32_t ss_size; /* signal stack length */
uint32_t ss_sp; /* signal stack base */
uint32_t ss_size; /* signal stack length */
int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
};

View File

@ -43,9 +43,9 @@
#include <vm/pmap.h>
struct freebsd32_ps_strings {
u_int32_t ps_argvstr; /* first of 0 or more argument strings */
uint32_t ps_argvstr; /* first of 0 or more argument strings */
int ps_nargvstr; /* the number of argument strings */
u_int32_t ps_envstr; /* first of 0 or more environment strings */
uint32_t ps_envstr; /* first of 0 or more environment strings */
int ps_nenvstr; /* the number of environment strings */
};
@ -122,6 +122,6 @@ void freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32);
struct image_args;
int freebsd32_exec_copyin_args(struct image_args *args, const char *fname,
enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv);
enum uio_seg segflg, uint32_t *argv, uint32_t *envv);
#endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */

View File

@ -43,109 +43,109 @@
(_MC_IA32_HASSEGS | _MC_IA32_HASBASES | _MC_IA32_HASFPXSTATE)
struct ia32_mcontext {
u_int32_t mc_onstack; /* XXX - sigcontext compat. */
u_int32_t mc_gs; /* machine state (struct trapframe) */
u_int32_t mc_fs;
u_int32_t mc_es;
u_int32_t mc_ds;
u_int32_t mc_edi;
u_int32_t mc_esi;
u_int32_t mc_ebp;
u_int32_t mc_isp;
u_int32_t mc_ebx;
u_int32_t mc_edx;
u_int32_t mc_ecx;
u_int32_t mc_eax;
u_int32_t mc_trapno;
u_int32_t mc_err;
u_int32_t mc_eip;
u_int32_t mc_cs;
u_int32_t mc_eflags;
u_int32_t mc_esp;
u_int32_t mc_ss;
u_int32_t mc_len; /* sizeof(struct ia32_mcontext) */
uint32_t mc_onstack; /* XXX - sigcontext compat. */
uint32_t mc_gs; /* machine state (struct trapframe) */
uint32_t mc_fs;
uint32_t mc_es;
uint32_t mc_ds;
uint32_t mc_edi;
uint32_t mc_esi;
uint32_t mc_ebp;
uint32_t mc_isp;
uint32_t mc_ebx;
uint32_t mc_edx;
uint32_t mc_ecx;
uint32_t mc_eax;
uint32_t mc_trapno;
uint32_t mc_err;
uint32_t mc_eip;
uint32_t mc_cs;
uint32_t mc_eflags;
uint32_t mc_esp;
uint32_t mc_ss;
uint32_t mc_len; /* sizeof(struct ia32_mcontext) */
/* We use the same values for fpformat and ownedfp */
u_int32_t mc_fpformat;
u_int32_t mc_ownedfp;
u_int32_t mc_flags;
uint32_t mc_fpformat;
uint32_t mc_ownedfp;
uint32_t mc_flags;
/*
* See <i386/include/npx.h> for the internals of mc_fpstate[].
*/
u_int32_t mc_fpstate[128] __aligned(16);
u_int32_t mc_fsbase;
u_int32_t mc_gsbase;
u_int32_t mc_xfpustate;
u_int32_t mc_xfpustate_len;
u_int32_t mc_spare2[4];
uint32_t mc_fpstate[128] __aligned(16);
uint32_t mc_fsbase;
uint32_t mc_gsbase;
uint32_t mc_xfpustate;
uint32_t mc_xfpustate_len;
uint32_t mc_spare2[4];
};
struct ia32_ucontext {
sigset_t uc_sigmask;
struct ia32_mcontext uc_mcontext;
u_int32_t uc_link;
uint32_t uc_link;
struct sigaltstack32 uc_stack;
u_int32_t uc_flags;
u_int32_t __spare__[4];
uint32_t uc_flags;
uint32_t __spare__[4];
};
#if defined(COMPAT_FREEBSD4)
struct ia32_mcontext4 {
u_int32_t mc_onstack; /* XXX - sigcontext compat. */
u_int32_t mc_gs; /* machine state (struct trapframe) */
u_int32_t mc_fs;
u_int32_t mc_es;
u_int32_t mc_ds;
u_int32_t mc_edi;
u_int32_t mc_esi;
u_int32_t mc_ebp;
u_int32_t mc_isp;
u_int32_t mc_ebx;
u_int32_t mc_edx;
u_int32_t mc_ecx;
u_int32_t mc_eax;
u_int32_t mc_trapno;
u_int32_t mc_err;
u_int32_t mc_eip;
u_int32_t mc_cs;
u_int32_t mc_eflags;
u_int32_t mc_esp;
u_int32_t mc_ss;
u_int32_t mc_fpregs[28];
u_int32_t __spare__[17];
uint32_t mc_onstack; /* XXX - sigcontext compat. */
uint32_t mc_gs; /* machine state (struct trapframe) */
uint32_t mc_fs;
uint32_t mc_es;
uint32_t mc_ds;
uint32_t mc_edi;
uint32_t mc_esi;
uint32_t mc_ebp;
uint32_t mc_isp;
uint32_t mc_ebx;
uint32_t mc_edx;
uint32_t mc_ecx;
uint32_t mc_eax;
uint32_t mc_trapno;
uint32_t mc_err;
uint32_t mc_eip;
uint32_t mc_cs;
uint32_t mc_eflags;
uint32_t mc_esp;
uint32_t mc_ss;
uint32_t mc_fpregs[28];
uint32_t __spare__[17];
};
struct ia32_ucontext4 {
sigset_t uc_sigmask;
struct ia32_mcontext4 uc_mcontext;
u_int32_t uc_link;
uint32_t uc_link;
struct sigaltstack32 uc_stack;
u_int32_t __spare__[8];
uint32_t __spare__[8];
};
#endif
#ifdef COMPAT_43
struct ia32_sigcontext3 {
u_int32_t sc_onstack;
u_int32_t sc_mask;
u_int32_t sc_esp;
u_int32_t sc_ebp;
u_int32_t sc_isp;
u_int32_t sc_eip;
u_int32_t sc_eflags;
u_int32_t sc_es;
u_int32_t sc_ds;
u_int32_t sc_cs;
u_int32_t sc_ss;
u_int32_t sc_edi;
u_int32_t sc_esi;
u_int32_t sc_ebx;
u_int32_t sc_edx;
u_int32_t sc_ecx;
u_int32_t sc_eax;
u_int32_t sc_gs;
u_int32_t sc_fs;
u_int32_t sc_trapno;
u_int32_t sc_err;
uint32_t sc_onstack;
uint32_t sc_mask;
uint32_t sc_esp;
uint32_t sc_ebp;
uint32_t sc_isp;
uint32_t sc_eip;
uint32_t sc_eflags;
uint32_t sc_es;
uint32_t sc_ds;
uint32_t sc_cs;
uint32_t sc_ss;
uint32_t sc_edi;
uint32_t sc_esi;
uint32_t sc_ebx;
uint32_t sc_edx;
uint32_t sc_ecx;
uint32_t sc_eax;
uint32_t sc_gs;
uint32_t sc_fs;
uint32_t sc_trapno;
uint32_t sc_err;
};
#endif
@ -155,22 +155,22 @@ struct ia32_sigcontext3 {
#ifdef COMPAT_FREEBSD4
struct ia32_sigframe4 {
u_int32_t sf_signum;
u_int32_t sf_siginfo; /* code or pointer to sf_si */
u_int32_t sf_ucontext; /* points to sf_uc */
u_int32_t sf_addr; /* undocumented 4th arg */
u_int32_t sf_ah; /* action/handler pointer */
uint32_t sf_signum;
uint32_t sf_siginfo; /* code or pointer to sf_si */
uint32_t sf_ucontext; /* points to sf_uc */
uint32_t sf_addr; /* undocumented 4th arg */
uint32_t sf_ah; /* action/handler pointer */
struct ia32_ucontext4 sf_uc; /* = *sf_ucontext */
struct siginfo32 sf_si; /* = *sf_siginfo (SA_SIGINFO case) */
};
#endif
struct ia32_sigframe {
u_int32_t sf_signum;
u_int32_t sf_siginfo; /* code or pointer to sf_si */
u_int32_t sf_ucontext; /* points to sf_uc */
u_int32_t sf_addr; /* undocumented 4th arg */
u_int32_t sf_ah; /* action/handler pointer */
uint32_t sf_signum;
uint32_t sf_siginfo; /* code or pointer to sf_si */
uint32_t sf_ucontext; /* points to sf_uc */
uint32_t sf_addr; /* undocumented 4th arg */
uint32_t sf_ah; /* action/handler pointer */
/* Beware, hole due to ucontext being 16 byte aligned! */
struct ia32_ucontext sf_uc; /* = *sf_ucontext */
struct siginfo32 sf_si; /* = *sf_siginfo (SA_SIGINFO case) */
@ -185,10 +185,10 @@ struct ia32_siginfo3 {
};
struct ia32_sigframe3 {
int sf_signum;
u_int32_t sf_arg2; /* int or siginfo_t */
u_int32_t sf_scp;
u_int32_t sf_addr;
u_int32_t sf_ah; /* action/handler pointer */
uint32_t sf_arg2; /* int or siginfo_t */
uint32_t sf_scp;
uint32_t sf_addr;
uint32_t sf_ah; /* action/handler pointer */
struct ia32_siginfo3 sf_siginfo;
};
#endif

View File

@ -159,17 +159,17 @@ static TAILQ_HEAD(, linux_ioctl_handler_element) linux32_ioctl_handlers =
*/
struct linux_hd_geometry {
u_int8_t heads;
u_int8_t sectors;
u_int16_t cylinders;
u_int32_t start;
uint8_t heads;
uint8_t sectors;
uint16_t cylinders;
uint32_t start;
};
struct linux_hd_big_geometry {
u_int8_t heads;
u_int8_t sectors;
u_int32_t cylinders;
u_int32_t start;
uint8_t heads;
uint8_t sectors;
uint32_t cylinders;
uint32_t start;
};
static int
@ -1103,9 +1103,9 @@ struct l_dvd_layer {
u_char track_density:4;
u_char linear_density:4;
u_char bca:1;
u_int32_t start_sector;
u_int32_t end_sector;
u_int32_t end_sector_l0;
uint32_t start_sector;
uint32_t end_sector;
uint32_t end_sector_l0;
};
struct l_dvd_physical {
@ -1690,7 +1690,7 @@ struct linux_old_mixer_info {
char name[32];
};
static u_int32_t dirbits[4] = { IOC_VOID, IOC_IN, IOC_OUT, IOC_INOUT };
static uint32_t dirbits[4] = { IOC_VOID, IOC_IN, IOC_OUT, IOC_INOUT };
#define SETDIR(c) (((c) & ~IOC_DIRMASK) | dirbits[args->cmd >> 30])