svn commit: r330866 - in head/sys: amd64/linux amd64/linux32 i386/linux kern sys

Ed Maste emaste at FreeBSD.org
Tue Mar 13 16:40:30 UTC 2018


Author: emaste
Date: Tue Mar 13 16:40:29 2018
New Revision: 330866
URL: https://svnweb.freebsd.org/changeset/base/330866

Log:
  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

Modified:
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/kern/imgact_elf.c
  head/sys/sys/imgact_elf.h

Modified: head/sys/amd64/linux/linux_sysvec.c
==============================================================================
--- head/sys/amd64/linux/linux_sysvec.c	Tue Mar 13 16:33:41 2018	(r330865)
+++ head/sys/amd64/linux/linux_sysvec.c	Tue Mar 13 16:40:29 2018	(r330866)
@@ -121,7 +121,7 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioct
 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
 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 = {

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 13 16:33:41 2018	(r330865)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 13 16:40:29 2018	(r330866)
@@ -127,7 +127,7 @@ static void     linux_sendsig(sig_t catcher, ksiginfo_
 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
 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 *osr
 
 	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 *osr
 	 */
 	*osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3];
 
-	return (TRUE);
+	return (true);
 }
 
 static Elf_Brandnote linux32_brandnote = {

Modified: head/sys/i386/linux/linux_sysvec.c
==============================================================================
--- head/sys/i386/linux/linux_sysvec.c	Tue Mar 13 16:33:41 2018	(r330865)
+++ head/sys/i386/linux/linux_sysvec.c	Tue Mar 13 16:40:29 2018	(r330866)
@@ -115,7 +115,7 @@ static void     linux_sendsig(sig_t catcher, ksiginfo_
 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
 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 = {

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Tue Mar 13 16:33:41 2018	(r330865)
+++ head/sys/kern/imgact_elf.c	Tue Mar 13 16:40:29 2018	(r330866)
@@ -96,9 +96,9 @@ static int __elfN(load_section)(struct image_params *i
     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, int3
 	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 *os
 
 	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 *os
 	 */
 	*osrel = desc[1] * 100000 + desc[2] * 1000 + desc[3];
 
-	return (TRUE);
+	return (true);
 }
 
 int

Modified: head/sys/sys/imgact_elf.h
==============================================================================
--- head/sys/sys/imgact_elf.h	Tue Mar 13 16:33:41 2018	(r330865)
+++ head/sys/sys/imgact_elf.h	Tue Mar 13 16:40:29 2018	(r330866)
@@ -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. */


More information about the svn-src-all mailing list