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
This commit is contained in:
parent
56e53cb8ef
commit
a95659f75f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330866
@ -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 = {
|
||||
|
@ -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 = {
|
||||
|
@ -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 = {
|
||||
|
@ -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
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user