mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions.
Suggested by: jmallett Reviewed by: bdrewery, jmallett Differential Revision: https://reviews.freebsd.org/D5123
This commit is contained in:
parent
4088e74393
commit
5842bd683f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295056
|
@ -70,30 +70,30 @@ sysdecode_syscallname(enum sysdecode_abi abi, unsigned int code)
|
|||
{
|
||||
|
||||
switch (abi) {
|
||||
case FREEBSD:
|
||||
case SYSDECODE_ABI_FREEBSD:
|
||||
if (code < nitems(syscallnames))
|
||||
return (syscallnames[code]);
|
||||
break;
|
||||
#if defined(__amd64__) || defined(__powerpc64__)
|
||||
case FREEBSD32:
|
||||
case SYSDECODE_ABI_FREEBSD32:
|
||||
if (code < nitems(freebsd32_syscallnames))
|
||||
return (freebsd32_syscallnames[code]);
|
||||
break;
|
||||
#endif
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
case LINUX:
|
||||
case SYSDECODE_ABI_LINUX:
|
||||
if (code < nitems(linux_syscallnames))
|
||||
return (linux_syscallnames[code]);
|
||||
break;
|
||||
#endif
|
||||
#ifdef __amd64__
|
||||
case LINUX32:
|
||||
case SYSDECODE_ABI_LINUX32:
|
||||
if (code < nitems(linux32_syscallnames))
|
||||
return (linux32_syscallnames[code]);
|
||||
break;
|
||||
#endif
|
||||
#if defined(__amd64__) || defined(__aarch64__)
|
||||
case CLOUDABI64:
|
||||
case SYSDECODE_ABI_CLOUDABI64:
|
||||
if (code < nitems(cloudabi64_syscallnames))
|
||||
return (cloudabi64_syscallnames[code]);
|
||||
break;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 24, 2016
|
||||
.Dd January 29, 2016
|
||||
.Dt SYSDECODE 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -44,23 +44,23 @@ The supported ABIs are named by the
|
|||
.Vt enum sysdecode_abi
|
||||
enumeration.
|
||||
.Pp
|
||||
.Bl -tag -width "Li UNKNOWN_ABI" -compact
|
||||
.It Li FREEBSD
|
||||
.Bl -tag -width "Li SYSDECODE_ABI_CLOUDABI64" -compact
|
||||
.It Li SYSDECODE_ABI_FREEBSD
|
||||
Native FreeBSD binaries.
|
||||
Supported on all platforms.
|
||||
.It Li FREEBSD32
|
||||
.It Li SYSDECODE_ABI_FREEBSD32
|
||||
32-bit FreeBSD binaries.
|
||||
Supported on amd64 and powerpc64.
|
||||
.It Li LINUX
|
||||
.It Li SYSDECODE_ABI_LINUX
|
||||
Linux binaries of the same platform.
|
||||
Supported on amd64 and i386.
|
||||
.It Li LINUX32
|
||||
.It Li SYSDECODE_ABI_LINUX32
|
||||
32-bit Linux binaries.
|
||||
Supported on amd64.
|
||||
.It Li CLOUDABI64
|
||||
.It Li SYSDECODE_ABI_CLOUDABI64
|
||||
64-bit CloudABI binaries.
|
||||
Supported on aarch64 and amd64.
|
||||
.It Li UNKNOWN_ABI
|
||||
.It Li SYSDECODE_ABI_UNKNOWN
|
||||
A placeholder for use when the ABI is not known.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
|
|
|
@ -30,12 +30,12 @@
|
|||
#define __SYSDECODE_H__
|
||||
|
||||
enum sysdecode_abi {
|
||||
UNKNOWN_ABI = 0,
|
||||
FREEBSD,
|
||||
FREEBSD32,
|
||||
LINUX,
|
||||
LINUX32,
|
||||
CLOUDABI64
|
||||
SYSDECODE_ABI_UNKNOWN = 0,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD32,
|
||||
SYSDECODE_ABI_LINUX,
|
||||
SYSDECODE_ABI_LINUX32,
|
||||
SYSDECODE_ABI_CLOUDABI64
|
||||
};
|
||||
|
||||
const char *sysdecode_ioctlname(unsigned long _val);
|
||||
|
|
|
@ -690,20 +690,20 @@ syscallabi(u_int sv_flags)
|
|||
{
|
||||
|
||||
if (sv_flags == 0)
|
||||
return (FREEBSD);
|
||||
return (SYSDECODE_ABI_FREEBSD);
|
||||
switch (sv_flags & SV_ABI_MASK) {
|
||||
case SV_ABI_FREEBSD:
|
||||
return (FREEBSD);
|
||||
return (SYSDECODE_ABI_FREEBSD);
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
case SV_ABI_LINUX:
|
||||
#ifdef __amd64__
|
||||
if (sv_flags & SV_ILP32)
|
||||
return (LINUX32);
|
||||
return (SYSDECODE_ABI_LINUX32);
|
||||
#endif
|
||||
return (LINUX);
|
||||
return (SYSDECODE_ABI_LINUX);
|
||||
#endif
|
||||
default:
|
||||
return (UNKNOWN_ABI);
|
||||
return (SYSDECODE_ABI_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ aarch64_cloudabi64_fetch_retval(struct trussinfo *trussinfo, long *retval,
|
|||
|
||||
static struct procabi aarch64_cloudabi64 = {
|
||||
"CloudABI ELF64",
|
||||
CLOUDABI64,
|
||||
SYSDECODE_ABI_CLOUDABI64,
|
||||
aarch64_cloudabi64_fetch_args,
|
||||
aarch64_cloudabi64_fetch_retval
|
||||
};
|
||||
|
|
|
@ -99,7 +99,7 @@ aarch64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi aarch64_freebsd = {
|
||||
"FreeBSD ELF64",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
aarch64_fetch_args,
|
||||
aarch64_fetch_retval
|
||||
};
|
||||
|
|
|
@ -90,7 +90,7 @@ amd64_cloudabi64_fetch_retval(struct trussinfo *trussinfo, long *retval,
|
|||
|
||||
static struct procabi amd64_cloudabi64 = {
|
||||
"CloudABI ELF64",
|
||||
CLOUDABI64,
|
||||
SYSDECODE_ABI_CLOUDABI64,
|
||||
amd64_cloudabi64_fetch_args,
|
||||
amd64_cloudabi64_fetch_retval
|
||||
};
|
||||
|
|
|
@ -121,7 +121,7 @@ amd64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi amd64_freebsd = {
|
||||
"FreeBSD ELF64",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
amd64_fetch_args,
|
||||
amd64_fetch_retval
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ amd64_freebsd32_fetch_retval(struct trussinfo *trussinfo, long *retval,
|
|||
|
||||
static struct procabi amd64_freebsd32 = {
|
||||
"FreeBSD ELF32",
|
||||
FREEBSD32,
|
||||
SYSDECODE_ABI_FREEBSD32,
|
||||
amd64_freebsd32_fetch_args,
|
||||
amd64_freebsd32_fetch_retval
|
||||
};
|
||||
|
@ -126,7 +126,7 @@ PROCABI(amd64_freebsd32);
|
|||
|
||||
static struct procabi amd64_freebsd32_aout = {
|
||||
"FreeBSD a.out",
|
||||
FREEBSD32,
|
||||
SYSDECODE_ABI_FREEBSD32,
|
||||
amd64_freebsd32_fetch_args,
|
||||
amd64_freebsd32_fetch_retval
|
||||
};
|
||||
|
|
|
@ -131,7 +131,7 @@ amd64_linux32_fetch_retval(struct trussinfo *trussinfo, long *retval,
|
|||
|
||||
static struct procabi amd64_linux32 = {
|
||||
"Linux ELF32",
|
||||
LINUX32,
|
||||
SYSDECODE_ABI_LINUX32,
|
||||
amd64_linux32_fetch_args,
|
||||
amd64_linux32_fetch_retval
|
||||
};
|
||||
|
|
|
@ -128,7 +128,7 @@ arm_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi arm_freebsd = {
|
||||
"FreeBSD ELF32",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
arm_fetch_args,
|
||||
arm_fetch_retval
|
||||
};
|
||||
|
|
|
@ -110,7 +110,7 @@ i386_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi i386_freebsd = {
|
||||
"FreeBSD ELF32",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
i386_fetch_args,
|
||||
i386_fetch_retval
|
||||
};
|
||||
|
@ -119,7 +119,7 @@ PROCABI(i386_freebsd);
|
|||
|
||||
static struct procabi i386_freebsd_aout = {
|
||||
"FreeBSD a.out",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
i386_fetch_args,
|
||||
i386_fetch_retval
|
||||
};
|
||||
|
|
|
@ -130,7 +130,7 @@ i386_linux_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi i386_linux = {
|
||||
"Linux ELF32",
|
||||
LINUX,
|
||||
SYSDECODE_ABI_LINUX,
|
||||
i386_linux_fetch_args,
|
||||
i386_linux_fetch_retval
|
||||
};
|
||||
|
|
|
@ -131,7 +131,7 @@ static struct procabi mips_freebsd = {
|
|||
#else
|
||||
"FreeBSD ELF32",
|
||||
#endif
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
mips_fetch_args,
|
||||
mips_fetch_retval
|
||||
};
|
||||
|
|
|
@ -112,7 +112,7 @@ powerpc_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi powerpc_freebsd = {
|
||||
"FreeBSD ELF32",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
powerpc_fetch_args,
|
||||
powerpc_fetch_retval
|
||||
};
|
||||
|
|
|
@ -108,7 +108,7 @@ powerpc64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi powerpc64_freebsd = {
|
||||
"FreeBSD ELF64",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
powerpc64_fetch_args,
|
||||
powerpc64_fetch_retval
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ powerpc64_freebsd32_fetch_retval(struct trussinfo *trussinfo, long *retval, int
|
|||
|
||||
static struct procabi powerpc64_freebsd32 = {
|
||||
"FreeBSD ELF32",
|
||||
FREEBSD32,
|
||||
SYSDECODE_ABI_FREEBSD32,
|
||||
powerpc64_freebsd32_fetch_args,
|
||||
powerpc64_freebsd32_fetch_retval
|
||||
};
|
||||
|
|
|
@ -115,7 +115,7 @@ sparc64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
|
|||
|
||||
static struct procabi sparc64_freebsd = {
|
||||
"FreeBSD ELF64",
|
||||
FREEBSD,
|
||||
SYSDECODE_ABI_FREEBSD,
|
||||
sparc64_fetch_args,
|
||||
sparc64_fetch_retval
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue