mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
um: Add an internal header shared among the user code
Move relevant declarations to this header. This will address below -Wmissing-prototypes warnings: arch/um/os-Linux/elf_aux.c:26:13: warning: no previous prototype for ‘scan_elf_aux’ [-Wmissing-prototypes] arch/um/os-Linux/mem.c:213:13: warning: no previous prototype for ‘check_tmpexec’ [-Wmissing-prototypes] arch/um/os-Linux/skas/process.c:107:6: warning: no previous prototype for ‘wait_stub_done’ [-Wmissing-prototypes] Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
6a85e34c4d
commit
847d3abc6a
@ -13,6 +13,7 @@
|
|||||||
#include <init.h>
|
#include <init.h>
|
||||||
#include <elf_user.h>
|
#include <elf_user.h>
|
||||||
#include <mem_user.h>
|
#include <mem_user.h>
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
typedef Elf32_auxv_t elf_auxv_t;
|
typedef Elf32_auxv_t elf_auxv_t;
|
||||||
|
|
||||||
|
20
arch/um/os-Linux/internal.h
Normal file
20
arch/um/os-Linux/internal.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
#ifndef __UM_OS_LINUX_INTERNAL_H
|
||||||
|
#define __UM_OS_LINUX_INTERNAL_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* elf_aux.c
|
||||||
|
*/
|
||||||
|
void scan_elf_aux(char **envp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* mem.c
|
||||||
|
*/
|
||||||
|
void check_tmpexec(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* skas/process.c
|
||||||
|
*/
|
||||||
|
void wait_stub_done(int pid);
|
||||||
|
|
||||||
|
#endif /* __UM_OS_LINUX_INTERNAL_H */
|
@ -16,6 +16,7 @@
|
|||||||
#include <kern_util.h>
|
#include <kern_util.h>
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
#include <um_malloc.h>
|
#include <um_malloc.h>
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
#define PGD_BOUND (4 * 1024 * 1024)
|
#define PGD_BOUND (4 * 1024 * 1024)
|
||||||
#define STACKSIZE (8 * 1024 * 1024)
|
#define STACKSIZE (8 * 1024 * 1024)
|
||||||
@ -102,8 +103,6 @@ static void setup_env_path(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void scan_elf_aux( char **envp);
|
|
||||||
|
|
||||||
int __init main(int argc, char **argv, char **envp)
|
int __init main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
char **new_argv;
|
char **new_argv;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <init.h>
|
#include <init.h>
|
||||||
#include <kern_util.h>
|
#include <kern_util.h>
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* kasan_map_memory - maps memory from @start with a size of @len.
|
* kasan_map_memory - maps memory from @start with a size of @len.
|
||||||
|
@ -17,11 +17,10 @@
|
|||||||
#include <skas.h>
|
#include <skas.h>
|
||||||
#include <sysdep/ptrace.h>
|
#include <sysdep/ptrace.h>
|
||||||
#include <sysdep/stub.h>
|
#include <sysdep/stub.h>
|
||||||
|
#include "../internal.h"
|
||||||
|
|
||||||
extern char batch_syscall_stub[], __syscall_stub_start[];
|
extern char batch_syscall_stub[], __syscall_stub_start[];
|
||||||
|
|
||||||
extern void wait_stub_done(int pid);
|
|
||||||
|
|
||||||
static inline unsigned long *check_init_stack(struct mm_id * mm_idp,
|
static inline unsigned long *check_init_stack(struct mm_id * mm_idp,
|
||||||
unsigned long *stack)
|
unsigned long *stack)
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <skas.h>
|
#include <skas.h>
|
||||||
#include <sysdep/stub.h>
|
#include <sysdep/stub.h>
|
||||||
#include <linux/threads.h>
|
#include <linux/threads.h>
|
||||||
|
#include "../internal.h"
|
||||||
|
|
||||||
int is_skas_winch(int pid, int fd, void *data)
|
int is_skas_winch(int pid, int fd, void *data)
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <ptrace_user.h>
|
#include <ptrace_user.h>
|
||||||
#include <registers.h>
|
#include <registers.h>
|
||||||
#include <skas.h>
|
#include <skas.h>
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
static void ptrace_child(void)
|
static void ptrace_child(void)
|
||||||
{
|
{
|
||||||
@ -222,8 +223,6 @@ static void __init check_ptrace(void)
|
|||||||
check_sysemu();
|
check_sysemu();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void check_tmpexec(void);
|
|
||||||
|
|
||||||
static void __init check_coredump_limit(void)
|
static void __init check_coredump_limit(void)
|
||||||
{
|
{
|
||||||
struct rlimit lim;
|
struct rlimit lim;
|
||||||
|
Loading…
Reference in New Issue
Block a user