Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
48c946a4
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
48c946a4
编写于
2月 08, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC64]: Make use of the new fs/compat_binfmt_elf.c
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
2ba85f3a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
52 addition
and
152 deletion
+52
-152
arch/sparc64/Kconfig
arch/sparc64/Kconfig
+1
-7
arch/sparc64/kernel/Makefile
arch/sparc64/kernel/Makefile
+0
-1
arch/sparc64/kernel/binfmt_elf32.c
arch/sparc64/kernel/binfmt_elf32.c
+0
-136
include/asm-sparc64/elf.h
include/asm-sparc64/elf.h
+51
-8
未找到文件。
arch/sparc64/Kconfig
浏览文件 @
48c946a4
...
...
@@ -380,13 +380,7 @@ config COMPAT
bool
depends on SPARC32_COMPAT
default y
config BINFMT_ELF32
bool "Kernel support for 32-bit ELF binaries"
depends on SPARC32_COMPAT
help
This allows you to run 32-bit Linux/ELF binaries on your Ultra.
Everybody wants this; say Y.
select COMPAT_BINFMT_ELF
config BINFMT_AOUT32
bool "Kernel support for 32-bit (ie. SunOS) a.out binaries"
...
...
arch/sparc64/kernel/Makefile
浏览文件 @
48c946a4
...
...
@@ -21,7 +21,6 @@ obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o \
obj-$(CONFIG_PCI_MSI)
+=
pci_msi.o
obj-$(CONFIG_SMP)
+=
smp.o trampoline.o hvtramp.o
obj-$(CONFIG_SPARC32_COMPAT)
+=
sys32.o sys_sparc32.o signal32.o
obj-$(CONFIG_BINFMT_ELF32)
+=
binfmt_elf32.o
obj-$(CONFIG_BINFMT_AOUT32)
+=
binfmt_aout32.o
obj-$(CONFIG_MODULES)
+=
module.o
obj-$(CONFIG_US3_FREQ)
+=
us3_cpufreq.o
...
...
arch/sparc64/kernel/binfmt_elf32.c
已删除
100644 → 0
浏览文件 @
2ba85f3a
/*
* binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra.
*
* Copyright (C) 1995, 1996, 1997, 1998, 2008 David S. Miller (davem@davemloft.net)
* Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz)
*/
#define ELF_ARCH EM_SPARC
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB;
/* Format is:
* G0 --> G7
* O0 --> O7
* L0 --> L7
* I0 --> I7
* PSR, PC, nPC, Y, WIM, TBR
*/
typedef
unsigned
int
elf_greg_t
;
#define ELF_NGREG 38
typedef
elf_greg_t
elf_gregset_t
[
ELF_NGREG
];
typedef
struct
{
union
{
unsigned
int
pr_regs
[
32
];
unsigned
long
pr_dregs
[
16
];
}
pr_fr
;
unsigned
int
__unused
;
unsigned
int
pr_fsr
;
unsigned
char
pr_qcnt
;
unsigned
char
pr_q_entrysize
;
unsigned
char
pr_en
;
unsigned
int
pr_q
[
64
];
}
elf_fpregset_t
;
/* UltraSparc extensions. Still unused, but will be eventually. */
typedef
struct
{
unsigned
int
pr_type
;
unsigned
int
pr_align
;
union
{
struct
{
union
{
unsigned
int
pr_regs
[
32
];
unsigned
long
pr_dregs
[
16
];
long
double
pr_qregs
[
8
];
}
pr_xfr
;
}
pr_v8p
;
unsigned
int
pr_xfsr
;
unsigned
int
pr_fprs
;
unsigned
int
pr_xg
[
8
];
unsigned
int
pr_xo
[
8
];
unsigned
long
pr_tstate
;
unsigned
int
pr_filler
[
8
];
}
pr_un
;
}
elf_xregset_t
;
#define elf_check_arch(x) (((x)->e_machine == EM_SPARC) || ((x)->e_machine == EM_SPARC32PLUS))
#define ELF_ET_DYN_BASE 0x70000000
#include <asm/processor.h>
#include <linux/module.h>
#include <linux/elfcore.h>
#include <linux/compat.h>
#define elf_prstatus elf_prstatus32
struct
elf_prstatus32
{
struct
elf_siginfo
pr_info
;
/* Info associated with signal */
short
pr_cursig
;
/* Current signal */
unsigned
int
pr_sigpend
;
/* Set of pending signals */
unsigned
int
pr_sighold
;
/* Set of held signals */
pid_t
pr_pid
;
pid_t
pr_ppid
;
pid_t
pr_pgrp
;
pid_t
pr_sid
;
struct
compat_timeval
pr_utime
;
/* User time */
struct
compat_timeval
pr_stime
;
/* System time */
struct
compat_timeval
pr_cutime
;
/* Cumulative user time */
struct
compat_timeval
pr_cstime
;
/* Cumulative system time */
elf_gregset_t
pr_reg
;
/* GP registers */
int
pr_fpvalid
;
/* True if math co-processor being used. */
};
#define elf_prpsinfo elf_prpsinfo32
struct
elf_prpsinfo32
{
char
pr_state
;
/* numeric process state */
char
pr_sname
;
/* char for pr_state */
char
pr_zomb
;
/* zombie */
char
pr_nice
;
/* nice val */
unsigned
int
pr_flag
;
/* flags */
u16
pr_uid
;
u16
pr_gid
;
pid_t
pr_pid
,
pr_ppid
,
pr_pgrp
,
pr_sid
;
/* Lots missing */
char
pr_fname
[
16
];
/* filename of executable */
char
pr_psargs
[
ELF_PRARGSZ
];
/* initial part of arg list */
};
#include <linux/highuid.h>
#undef NEW_TO_OLD_UID
#undef NEW_TO_OLD_GID
#define NEW_TO_OLD_UID(uid) ((uid) > 65535) ? (u16)overflowuid : (u16)(uid)
#define NEW_TO_OLD_GID(gid) ((gid) > 65535) ? (u16)overflowgid : (u16)(gid)
#include <linux/time.h>
#undef cputime_to_timeval
#define cputime_to_timeval cputime_to_compat_timeval
static
inline
void
cputime_to_compat_timeval
(
const
cputime_t
cputime
,
struct
compat_timeval
*
value
)
{
unsigned
long
jiffies
=
cputime_to_jiffies
(
cputime
);
value
->
tv_usec
=
(
jiffies
%
HZ
)
*
(
1000000L
/
HZ
);
value
->
tv_sec
=
jiffies
/
HZ
;
}
#undef start_thread
#define start_thread start_thread32
#define init_elf_binfmt init_elf32_binfmt
MODULE_DESCRIPTION
(
"Binary format loader for compatibility with 32bit SparcLinux binaries on the Ultra"
);
MODULE_AUTHOR
(
"Eric Youngdale, David S. Miller, Jakub Jelinek"
);
#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR
#include <asm/a.out.h>
#undef TASK_SIZE
#define TASK_SIZE STACK_TOP32
#include "../../../fs/binfmt_elf.c"
include/asm-sparc64/elf.h
浏览文件 @
48c946a4
...
...
@@ -75,7 +75,6 @@
/*
* These are used to set parameters in the core dumps.
*/
#ifndef ELF_ARCH
#define ELF_ARCH EM_SPARCV9
#define ELF_CLASS ELFCLASS64
#define ELF_DATA ELFDATA2MSB
...
...
@@ -100,14 +99,59 @@ typedef struct {
unsigned
long
pr_gsr
;
unsigned
long
pr_fprs
;
}
elf_fpregset_t
;
#endif
/* Format of 32-bit elf_gregset_t is:
* G0 --> G7
* O0 --> O7
* L0 --> L7
* I0 --> I7
* PSR, PC, nPC, Y, WIM, TBR
*/
typedef
unsigned
int
compat_elf_greg_t
;
#define COMPAT_ELF_NGREG 38
typedef
compat_elf_greg_t
compat_elf_gregset_t
[
COMPAT_ELF_NGREG
];
typedef
struct
{
union
{
unsigned
int
pr_regs
[
32
];
unsigned
long
pr_dregs
[
16
];
}
pr_fr
;
unsigned
int
__unused
;
unsigned
int
pr_fsr
;
unsigned
char
pr_qcnt
;
unsigned
char
pr_q_entrysize
;
unsigned
char
pr_en
;
unsigned
int
pr_q
[
64
];
}
compat_elf_fpregset_t
;
/* UltraSparc extensions. Still unused, but will be eventually. */
typedef
struct
{
unsigned
int
pr_type
;
unsigned
int
pr_align
;
union
{
struct
{
union
{
unsigned
int
pr_regs
[
32
];
unsigned
long
pr_dregs
[
16
];
long
double
pr_qregs
[
8
];
}
pr_xfr
;
}
pr_v8p
;
unsigned
int
pr_xfsr
;
unsigned
int
pr_fprs
;
unsigned
int
pr_xg
[
8
];
unsigned
int
pr_xo
[
8
];
unsigned
long
pr_tstate
;
unsigned
int
pr_filler
[
8
];
}
pr_un
;
}
elf_xregset_t
;
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#ifndef elf_check_arch
#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH)
/* Might be EM_SPARCV9 or EM_SPARC */
#endif
#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH)
#define compat_elf_check_arch(x) ((x)->e_machine == EM_SPARC || \
(x)->e_machine == EM_SPARC32PLUS)
#define compat_start_thread start_thread32
#define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE PAGE_SIZE
...
...
@@ -117,9 +161,8 @@ typedef struct {
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
#ifndef ELF_ET_DYN_BASE
#define ELF_ET_DYN_BASE 0x0000010000000000UL
#endif
#define ELF_ET_DYN_BASE 0x0000010000000000UL
#define COMPAT_ELF_ET_DYN_BASE 0x0000000070000000UL
/* This yields a mask that user programs can use to figure out what
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录