Make shuffle_scno globally available

* syscall.c (shuffle_scno): Move the declaration...
* defs.h (shuffle_scno): ...here. Remove static qualifier.
* linux/aarch64/shuffle_scno.c (shuffle_scno): Remove static qualifier.
* linux/arm/shuffle_scno.c: Likewise.
* linux/shuffle_scno.c: Likewise.
* linux/x32/shuffle_scno.c: Likewise.
* linux/x86_64/shuffle_scno.c: Likewise.
This commit is contained in:
Eugene Syromyatnikov 2018-02-01 12:48:44 +01:00 committed by Dmitry V. Levin
parent c3e8a9ebb4
commit f729ab68dd
7 changed files with 13 additions and 11 deletions

8
defs.h
View File

@ -407,6 +407,14 @@ extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
* is valid; NULL otherwise.
*/
extern const char *syscall_name(kernel_ulong_t scno);
/**
* Shuffle syscall numbers so that we don't have huge gaps in syscall table.
* The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n.
*
* @param scno Raw or shuffled syscall number.
* @return Shuffled or raw syscall number, respectively.
*/
extern kernel_ulong_t shuffle_scno(kernel_ulong_t scno);
extern const char *err_name(unsigned long err);
extern bool is_erestart(struct tcb *);

View File

@ -2,7 +2,7 @@
#include "../arm/shuffle_scno.c"
#undef shuffle_scno
static kernel_ulong_t
kernel_ulong_t
shuffle_scno(kernel_ulong_t scno)
{
if (current_personality == 1)

View File

@ -1,4 +1,4 @@
static kernel_ulong_t
kernel_ulong_t
shuffle_scno(kernel_ulong_t scno)
{
if (scno < ARM_FIRST_SHUFFLED_SYSCALL)

View File

@ -1,4 +1,4 @@
static kernel_ulong_t
kernel_ulong_t
shuffle_scno(kernel_ulong_t scno)
{
return scno;

View File

@ -1,4 +1,4 @@
static kernel_ulong_t
kernel_ulong_t
shuffle_scno(kernel_ulong_t scno)
{
if (current_personality == 0 && scno != (kernel_ulong_t) -1)

View File

@ -1,4 +1,4 @@
static kernel_ulong_t
kernel_ulong_t
shuffle_scno(kernel_ulong_t scno)
{
if (current_personality == 2)

View File

@ -486,12 +486,6 @@ dumpio(struct tcb *tcp)
}
}
/*
* Shuffle syscall numbers so that we don't have huge gaps in syscall table.
* The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n.
*/
static kernel_ulong_t shuffle_scno(kernel_ulong_t scno);
const char *
err_name(unsigned long err)
{