From a95659f75fe71725e02a066786852b3bc02a1cc6 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 13 Mar 2018 16:40:29 +0000 Subject: [PATCH] Use C99 boolean type for translate_osrel Migrate to modern types before creating MD Linuxolator bits for new architectures. Reviewed by: cem Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14676 --- sys/amd64/linux/linux_sysvec.c | 8 ++++---- sys/amd64/linux32/linux32_sysvec.c | 8 ++++---- sys/i386/linux/linux_sysvec.c | 8 ++++---- sys/kern/imgact_elf.c | 14 +++++++------- sys/sys/imgact_elf.h | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 7a467958359c..7266010f046c 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -121,7 +121,7 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); static register_t * linux_copyout_strings(struct image_params *imgp); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); -static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); static void linux_set_syscall_retval(struct thread *td, int error); @@ -846,7 +846,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, static char GNULINUX_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -857,7 +857,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel) desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -865,7 +865,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel) */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux64_brandnote = { diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index f7ed37e553b3..bb04490da2a3 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -127,7 +127,7 @@ static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); -static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); @@ -1043,7 +1043,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -1054,7 +1054,7 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osrel) desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -1062,7 +1062,7 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osrel) */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux32_brandnote = { diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 354ca1ca546b..7773dea60ee2 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -115,7 +115,7 @@ static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static register_t *linux_copyout_strings(struct image_params *imgp); -static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); @@ -1017,7 +1017,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -1028,7 +1028,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel) desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -1036,7 +1036,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel) */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux_brandnote = { diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 98e7cd445b18..ce07aaab2092 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -96,9 +96,9 @@ static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, size_t pagesize); static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); -static boolean_t __elfN(freebsd_trans_osrel)(const Elf_Note *note, +static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel); -static boolean_t kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); static boolean_t __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, int32_t *osrel); static vm_prot_t __elfN(trans_prot)(Elf_Word); @@ -155,7 +155,7 @@ Elf_Brandnote __elfN(freebsd_brandnote) = { .trans_osrel = __elfN(freebsd_trans_osrel) }; -static boolean_t +static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel) { uintptr_t p; @@ -164,7 +164,7 @@ __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel) p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); *osrel = *(const int32_t *)(p); - return (TRUE); + return (true); } static const char GNU_ABI_VENDOR[] = "GNU"; @@ -179,7 +179,7 @@ Elf_Brandnote __elfN(kfreebsd_brandnote) = { .trans_osrel = kfreebsd_trans_osrel }; -static boolean_t +static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -190,7 +190,7 @@ kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel) desc = (const Elf32_Word *)p; if (desc[0] != GNU_KFREEBSD_ABI_DESC) - return (FALSE); + return (false); /* * Debian GNU/kFreeBSD embed the earliest compatible kernel version @@ -198,7 +198,7 @@ kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel) */ *osrel = desc[1] * 100000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } int diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index 0ce5b08845d3..e0e50954248e 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -63,7 +63,7 @@ typedef struct { Elf_Note hdr; const char * vendor; int flags; - boolean_t (*trans_osrel)(const Elf_Note *, int32_t *); + bool (*trans_osrel)(const Elf_Note *, int32_t *); #define BN_CAN_FETCH_OSREL 0x0001 /* Deprecated. */ #define BN_TRANSLATE_OSREL 0x0002 /* Use trans_osrel to fetch osrel */ /* after checking the image ABI specification, if needed. */