Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
664cd341
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
664cd341
编写于
1月 07, 2014
作者:
R
rofl0r
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
x32 port (diff against vanilla x86_64)
上级
323272db
变更
39
展开全部
隐藏空白更改
内联
并排
Showing
39 changed file
with
882 addition
and
793 deletion
+882
-793
arch/x32/bits/alltypes.h.in
arch/x32/bits/alltypes.h.in
+6
-6
arch/x32/bits/ipc.h
arch/x32/bits/ipc.h
+2
-2
arch/x32/bits/limits.h
arch/x32/bits/limits.h
+2
-2
arch/x32/bits/msg.h
arch/x32/bits/msg.h
+4
-1
arch/x32/bits/reg.h
arch/x32/bits/reg.h
+1
-1
arch/x32/bits/setjmp.h
arch/x32/bits/setjmp.h
+1
-1
arch/x32/bits/shm.h
arch/x32/bits/shm.h
+14
-6
arch/x32/bits/signal.h
arch/x32/bits/signal.h
+6
-6
arch/x32/bits/stat.h
arch/x32/bits/stat.h
+1
-1
arch/x32/bits/stdint.h
arch/x32/bits/stdint.h
+6
-6
arch/x32/bits/syscall.h
arch/x32/bits/syscall.h
+609
-630
arch/x32/src/syscall_cp_fixup.c
arch/x32/src/syscall_cp_fixup.c
+34
-0
arch/x32/syscall_arch.h
arch/x32/syscall_arch.h
+76
-17
src/fenv/x32/fenv.s
src/fenv/x32/fenv.s
+26
-26
src/ldso/x32/start.s
src/ldso/x32/start.s
+15
-7
src/math/x32/acosl.s
src/math/x32/acosl.s
+1
-1
src/math/x32/asinl.s
src/math/x32/asinl.s
+1
-1
src/math/x32/atan2l.s
src/math/x32/atan2l.s
+2
-2
src/math/x32/atanl.s
src/math/x32/atanl.s
+1
-1
src/math/x32/exp2l.s
src/math/x32/exp2l.s
+21
-21
src/math/x32/expl.s
src/math/x32/expl.s
+16
-16
src/math/x32/fabsl.s
src/math/x32/fabsl.s
+1
-1
src/math/x32/floorl.s
src/math/x32/floorl.s
+9
-9
src/math/x32/fmodl.s
src/math/x32/fmodl.s
+2
-2
src/math/x32/llrintl.s
src/math/x32/llrintl.s
+3
-3
src/math/x32/log10l.s
src/math/x32/log10l.s
+1
-1
src/math/x32/log1pl.s
src/math/x32/log1pl.s
+2
-2
src/math/x32/log2l.s
src/math/x32/log2l.s
+1
-1
src/math/x32/logl.s
src/math/x32/logl.s
+1
-1
src/math/x32/lrintl.s
src/math/x32/lrintl.s
+3
-3
src/math/x32/remainderl.s
src/math/x32/remainderl.s
+2
-2
src/math/x32/rintl.s
src/math/x32/rintl.s
+1
-1
src/math/x32/sqrtl.s
src/math/x32/sqrtl.s
+1
-1
src/process/x32/vfork.s
src/process/x32/vfork.s
+1
-1
src/signal/x32/restore.s
src/signal/x32/restore.s
+1
-1
src/thread/x32/__set_thread_area.s
src/thread/x32/__set_thread_area.s
+1
-1
src/thread/x32/__unmapself.s
src/thread/x32/__unmapself.s
+2
-2
src/thread/x32/clone.s
src/thread/x32/clone.s
+2
-4
src/thread/x32/syscall_cp.s
src/thread/x32/syscall_cp.s
+3
-3
未找到文件。
arch/x32/bits/alltypes.h.in
浏览文件 @
664cd341
#define _Addr
long
#define _Int64 long
#define _Reg long
#define _Addr
int
#define _Int64 long
long
#define _Reg long
long
TYPEDEF __builtin_va_list va_list;
TYPEDEF __builtin_va_list __isoc_va_list;
#ifndef __cplusplus
TYPEDEF
int
wchar_t;
TYPEDEF
long
wchar_t;
#endif
TYPEDEF unsigned wint_t;
...
...
@@ -18,8 +18,8 @@ TYPEDEF float float_t;
TYPEDEF double double_t;
#endif
TYPEDEF long time_t;
TYPEDEF long suseconds_t;
TYPEDEF long
long
time_t;
TYPEDEF long
long
suseconds_t;
TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t;
...
...
arch/x32/bits/ipc.h
浏览文件 @
664cd341
...
...
@@ -7,8 +7,8 @@ struct ipc_perm
gid_t
cgid
;
mode_t
mode
;
int
__ipc_perm_seq
;
long
__pad1
;
long
__pad2
;
long
long
__pad1
;
long
long
__pad2
;
};
#define IPC_64 0
arch/x32/bits/limits.h
浏览文件 @
664cd341
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGE_SIZE 4096
#define LONG_BIT
64
#define LONG_BIT
32
#endif
#define LONG_MAX 0x7fffffff
ffffffff
L
#define LONG_MAX 0x7fffffffL
#define LLONG_MAX 0x7fffffffffffffffLL
arch/x32/bits/msg.h
浏览文件 @
664cd341
...
...
@@ -5,9 +5,12 @@ struct msqid_ds
time_t
msg_rtime
;
time_t
msg_ctime
;
unsigned
long
msg_cbytes
;
long
__unused1
;
msgqnum_t
msg_qnum
;
long
__unused2
;
msglen_t
msg_qbytes
;
long
__unused3
;
pid_t
msg_lspid
;
pid_t
msg_lrpid
;
unsigned
long
__unused
[
2
];
unsigned
long
long
__unused
[
2
];
};
arch/x32/bits/reg.h
浏览文件 @
664cd341
#undef __WORDSIZE
#define __WORDSIZE
64
#define __WORDSIZE
32
#define R15 0
#define R14 1
#define R13 2
...
...
arch/x32/bits/setjmp.h
浏览文件 @
664cd341
typedef
unsigned
long
__jmp_buf
[
8
];
typedef
unsigned
long
long
__jmp_buf
[
8
];
arch/x32/bits/shm.h
浏览文件 @
664cd341
...
...
@@ -10,16 +10,24 @@ struct shmid_ds
pid_t
shm_cpid
;
pid_t
shm_lpid
;
unsigned
long
shm_nattch
;
unsigned
long
__pad1
;
unsigned
long
__pad2
;
unsigned
long
__pad0
;
unsigned
long
long
__pad1
;
unsigned
long
long
__pad2
;
};
struct
shminfo
{
unsigned
long
shmmax
,
shmmin
,
shmmni
,
shmseg
,
shmall
,
__unused
[
4
];
unsigned
long
shmmax
,
__pad0
,
shmmin
,
__pad1
,
shmmni
,
__pad2
,
shmseg
,
__pad3
,
shmall
,
__pad4
;
unsigned
long
long
__unused
[
4
];
};
struct
shm_info
{
int
__used_ids
;
unsigned
long
shm_tot
,
shm_rss
,
shm_swp
;
unsigned
long
__swap_attempts
,
__swap_successes
;
};
int
__pad_ids
;
unsigned
long
shm_tot
,
__pad0
,
shm_rss
,
__pad1
,
shm_swp
,
__pad2
;
unsigned
long
__swap_attempts
,
__pad3
,
__swap_successes
,
__pad4
;
}
#ifdef __GNUC__
__attribute__
((
__aligned__
(
8
)))
#endif
;
arch/x32/bits/signal.h
浏览文件 @
664cd341
...
...
@@ -42,12 +42,12 @@ typedef struct _fpstate {
unsigned
padding
[
24
];
}
*
fpregset_t
;
struct
sigcontext
{
unsigned
long
r8
,
r9
,
r10
,
r11
,
r12
,
r13
,
r14
,
r15
;
unsigned
long
rdi
,
rsi
,
rbp
,
rbx
,
rdx
,
rax
,
rcx
,
rsp
,
rip
,
eflags
;
unsigned
long
long
r8
,
r9
,
r10
,
r11
,
r12
,
r13
,
r14
,
r15
;
unsigned
long
long
rdi
,
rsi
,
rbp
,
rbx
,
rdx
,
rax
,
rcx
,
rsp
,
rip
,
eflags
;
unsigned
short
cs
,
gs
,
fs
,
__pad0
;
unsigned
long
err
,
trapno
,
oldmask
,
cr2
;
unsigned
long
long
err
,
trapno
,
oldmask
,
cr2
;
struct
_fpstate
*
fpstate
;
unsigned
long
__reserved1
[
8
];
unsigned
long
long
__reserved1
[
8
];
};
typedef
struct
{
gregset_t
gregs
;
...
...
@@ -56,7 +56,7 @@ typedef struct {
}
mcontext_t
;
#else
typedef
struct
{
unsigned
long
__space
[
32
];
unsigned
long
long
__space
[
32
];
}
mcontext_t
;
#endif
...
...
@@ -66,7 +66,7 @@ typedef struct __ucontext {
stack_t
uc_stack
;
mcontext_t
uc_mcontext
;
sigset_t
uc_sigmask
;
unsigned
long
__fpregs_mem
[
64
];
unsigned
long
long
__fpregs_mem
[
64
];
}
ucontext_t
;
#define SA_NOCLDSTOP 1
...
...
arch/x32/bits/stat.h
浏览文件 @
664cd341
...
...
@@ -18,5 +18,5 @@ struct stat {
struct
timespec
st_atim
;
struct
timespec
st_mtim
;
struct
timespec
st_ctim
;
long
__unused
[
3
];
long
long
__unused
[
3
];
};
arch/x32/bits/stdint.h
浏览文件 @
664cd341
...
...
@@ -12,9 +12,9 @@ typedef uint32_t uint_fast32_t;
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define INTPTR_MIN INT
64
_MIN
#define INTPTR_MAX INT
64
_MAX
#define UINTPTR_MAX UINT
64
_MAX
#define PTRDIFF_MIN INT
64
_MIN
#define PTRDIFF_MAX INT
64
_MAX
#define SIZE_MAX UINT
64
_MAX
#define INTPTR_MIN INT
32
_MIN
#define INTPTR_MAX INT
32
_MAX
#define UINTPTR_MAX UINT
32
_MAX
#define PTRDIFF_MIN INT
32
_MIN
#define PTRDIFF_MAX INT
32
_MAX
#define SIZE_MAX UINT
32
_MAX
arch/x32/bits/syscall.h
浏览文件 @
664cd341
此差异已折叠。
点击以展开。
arch/x32/src/syscall_cp_fixup.c
0 → 100644
浏览文件 @
664cd341
#include <sys/syscall.h>
long
__syscall_cp_internal
(
volatile
void
*
,
long
long
,
long
long
,
long
long
,
long
long
,
long
long
,
long
long
,
long
long
);
struct
__timespec
{
long
long
tv_sec
;
long
tv_nsec
;
};
struct
__timespec_kernel
{
long
long
tv_sec
;
long
long
tv_nsec
;
};
#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
long
__syscall_cp_asm
(
volatile
void
*
foo
,
long
long
n
,
long
long
a1
,
long
long
a2
,
long
long
a3
,
long
long
a4
,
long
long
a5
,
long
long
a6
)
{
switch
(
n
)
{
case
SYS_mq_timedsend
:
case
SYS_mq_timedreceive
:
case
SYS_pselect6
:
if
(
a5
)
a5
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a5
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a5
)
->
tv_nsec
});
break
;
case
SYS_futex
:
if
(
a4
)
a4
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a4
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a4
)
->
tv_nsec
});
if
(
n
==
SYS_futex
)
break
;
case
SYS_clock_nanosleep
:
case
SYS_rt_sigtimedwait
:
case
SYS_ppoll
:
if
(
a3
)
a3
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a3
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a3
)
->
tv_nsec
});
break
;
case
SYS_nanosleep
:
if
(
a1
)
a1
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a1
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a1
)
->
tv_nsec
});
if
(
a2
)
a2
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a2
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a2
)
->
tv_nsec
});
break
;
}
return
__syscall_cp_internal
(
foo
,
n
,
a1
,
a2
,
a3
,
a4
,
a5
,
a6
);
}
arch/x32/syscall_arch.h
浏览文件 @
664cd341
#define __SYSCALL_LL_E(x) (x)
#define __SYSCALL_LL_O(x) (x)
static
__inline
long
__syscall0
(
long
n
)
#define __scc(X) sizeof(1?(X):0ULL) < 8 ? (unsigned long) (X) : (long long) (X)
#define syscall_arg_t long long
struct
__timespec
{
long
long
tv_sec
;
long
tv_nsec
;
};
struct
__timespec_kernel
{
long
long
tv_sec
;
long
long
tv_nsec
;
};
#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
static
__inline
long
__syscall0
(
long
long
n
)
{
unsigned
long
ret
;
__asm__
__volatile__
(
"syscall"
:
"=a"
(
ret
)
:
"a"
(
n
)
:
"rcx"
,
"r11"
,
"memory"
);
return
ret
;
}
static
__inline
long
__syscall1
(
long
n
,
long
a1
)
static
__inline
long
__syscall1
(
long
long
n
,
long
long
a1
)
{
unsigned
long
ret
;
__asm__
__volatile__
(
"syscall"
:
"=a"
(
ret
)
:
"a"
(
n
),
"D"
(
a1
)
:
"rcx"
,
"r11"
,
"memory"
);
return
ret
;
}
static
__inline
long
__syscall2
(
long
n
,
long
a1
,
long
a2
)
static
__inline
long
__syscall2
(
long
long
n
,
long
long
a1
,
long
long
a2
)
{
unsigned
long
ret
;
struct
__timespec
*
ts2
=
0
;
switch
(
n
)
{
case
SYS_nanosleep
:
if
(
a1
)
a1
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a1
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a1
)
->
tv_nsec
});
break
;
case
SYS_clock_settime
:
if
(
a2
)
a2
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a2
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a2
)
->
tv_nsec
});
}
__asm__
__volatile__
(
"syscall"
:
"=a"
(
ret
)
:
"a"
(
n
),
"D"
(
a1
),
"S"
(
a2
)
:
"rcx"
,
"r11"
,
"memory"
);
:
"rcx"
,
"r11"
,
"memory"
);
return
ret
;
}
static
__inline
long
__syscall3
(
long
n
,
long
a1
,
long
a2
,
long
a3
)
static
__inline
long
__syscall3
(
long
long
n
,
long
long
a1
,
long
long
a2
,
long
long
a3
)
{
unsigned
long
ret
;
__asm__
__volatile__
(
"syscall"
:
"=a"
(
ret
)
:
"a"
(
n
),
"D"
(
a1
),
"S"
(
a2
),
...
...
@@ -31,32 +47,75 @@ static __inline long __syscall3(long n, long a1, long a2, long a3)
return
ret
;
}
static
__inline
long
__syscall4
(
long
n
,
long
a1
,
long
a2
,
long
a3
,
long
a4
)
static
__inline
long
__syscall4
(
long
long
n
,
long
long
a1
,
long
long
a2
,
long
long
a3
,
long
long
a4
)
{
unsigned
long
ret
;
register
long
r10
__asm__
(
"r10"
)
=
a4
;
register
long
long
r10
__asm__
(
"r10"
)
=
a4
;
switch
(
n
)
{
case
SYS_futex
:
if
((
a2
&
(
~
128
/* FUTEX_PRIVATE_FLAG */
))
==
0
/* FUTEX_WAIT */
)
{
if
(
r10
)
r10
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
r10
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
r10
)
->
tv_nsec
});
}
break
;
case
SYS_utimensat
:
if
(
a3
)
a3
=
(
unsigned
long
)
((
struct
__timespec_kernel
[
2
])
{
[
0
]
=
{.
tv_sec
=
__tsc
(
a3
)[
0
].
tv_sec
,
.
tv_nsec
=
__tsc
(
a3
)[
0
].
tv_nsec
},
[
1
]
=
{.
tv_sec
=
__tsc
(
a3
)[
1
].
tv_sec
,
.
tv_nsec
=
__tsc
(
a3
)[
1
].
tv_nsec
},
});
break
;
case
SYS_clock_nanosleep
:
case
SYS_rt_sigtimedwait
:
case
SYS_ppoll
:
if
(
a3
)
a3
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
a3
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
a3
)
->
tv_nsec
});
}
__asm__
__volatile__
(
"syscall"
:
"=a"
(
ret
)
:
"a"
(
n
),
"D"
(
a1
),
"S"
(
a2
),
"d"
(
a3
),
"r"
(
r10
)
:
"rcx"
,
"r11"
,
"memory"
);
"d"
(
a3
),
"r"
(
r10
)
:
"rcx"
,
"r11"
,
"memory"
);
return
ret
;
}
static
__inline
long
__syscall5
(
long
n
,
long
a1
,
long
a2
,
long
a3
,
long
a4
,
long
a5
)
static
__inline
long
__syscall5
(
long
long
n
,
long
long
a1
,
long
long
a2
,
long
long
a3
,
long
long
a4
,
long
long
a5
)
{
unsigned
long
ret
;
register
long
r10
__asm__
(
"r10"
)
=
a4
;
register
long
r8
__asm__
(
"r8"
)
=
a5
;
register
long
long
r10
__asm__
(
"r10"
)
=
a4
;
register
long
long
r8
__asm__
(
"r8"
)
=
a5
;
switch
(
n
)
{
case
SYS_futex
:
if
((
a2
&
(
~
128
/* FUTEX_PRIVATE_FLAG */
))
==
0
/* FUTEX_WAIT */
)
{
if
(
r10
)
r10
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
r10
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
r10
)
->
tv_nsec
});
}
break
;
case
SYS_mq_timedsend
:
case
SYS_mq_timedreceive
:
if
(
r8
)
r8
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
r8
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
r8
)
->
tv_nsec
});
}
__asm__
__volatile__
(
"syscall"
:
"=a"
(
ret
)
:
"a"
(
n
),
"D"
(
a1
),
"S"
(
a2
),
"d"
(
a3
),
"r"
(
r10
),
"r"
(
r8
)
:
"rcx"
,
"r11"
,
"memory"
);
"d"
(
a3
),
"r"
(
r10
),
"r"
(
r8
)
:
"rcx"
,
"r11"
,
"memory"
);
return
ret
;
}
static
__inline
long
__syscall6
(
long
n
,
long
a1
,
long
a2
,
long
a3
,
long
a4
,
long
a5
,
long
a6
)
static
__inline
long
__syscall6
(
long
long
n
,
long
long
a1
,
long
long
a2
,
long
long
a3
,
long
long
a4
,
long
long
a5
,
long
long
a6
)
{
unsigned
long
ret
;
register
long
r10
__asm__
(
"r10"
)
=
a4
;
register
long
r8
__asm__
(
"r8"
)
=
a5
;
register
long
r9
__asm__
(
"r9"
)
=
a6
;
register
long
long
r10
__asm__
(
"r10"
)
=
a4
;
register
long
long
r8
__asm__
(
"r8"
)
=
a5
;
register
long
long
r9
__asm__
(
"r9"
)
=
a6
;
switch
(
n
)
{
case
SYS_futex
:
if
((
a2
&
(
~
128
/* FUTEX_PRIVATE_FLAG */
))
==
0
/* FUTEX_WAIT */
)
{
if
(
r10
)
r10
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
r10
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
r10
)
->
tv_nsec
});
}
break
;
case
SYS_pselect6
:
if
(
r8
)
r8
=
(
unsigned
long
)
(
&
(
struct
__timespec_kernel
)
{
.
tv_sec
=
__tsc
(
r8
)
->
tv_sec
,
.
tv_nsec
=
__tsc
(
r8
)
->
tv_nsec
});
}
__asm__
__volatile__
(
"syscall"
:
"=a"
(
ret
)
:
"a"
(
n
),
"D"
(
a1
),
"S"
(
a2
),
"d"
(
a3
),
"r"
(
r10
),
"r"
(
r8
),
"r"
(
r9
)
:
"rcx"
,
"r11"
,
"memory"
);
"d"
(
a3
),
"r"
(
r10
),
"r"
(
r8
),
"r"
(
r9
)
:
"rcx"
,
"r11"
,
"memory"
);
return
ret
;
}
src/fenv/x32/fenv.s
浏览文件 @
664cd341
...
...
@@ -8,14 +8,14 @@ feclearexcept:
test
%
eax
,%
ecx
jz
1
f
fnclex
1
:
stmxcsr
-
8
(%
r
sp
)
1
:
stmxcsr
-
8
(%
e
sp
)
and
$
0x3f
,%
eax
or
%
eax
,-
8
(%
r
sp
)
test
%
ecx
,-
8
(%
r
sp
)
or
%
eax
,-
8
(%
e
sp
)
test
%
ecx
,-
8
(%
e
sp
)
jz
1
f
not
%
ecx
and
%
ecx
,-
8
(%
r
sp
)
ldmxcsr
-
8
(%
r
sp
)
and
%
ecx
,-
8
(%
e
sp
)
ldmxcsr
-
8
(%
e
sp
)
1
:
xor
%
eax
,%
eax
ret
...
...
@@ -23,9 +23,9 @@ feclearexcept:
.
type
feraiseexcept
,@
function
feraiseexcept
:
and
$
0x3f
,%
edi
stmxcsr
-
8
(%
r
sp
)
or
%
edi
,-
8
(%
r
sp
)
ldmxcsr
-
8
(%
r
sp
)
stmxcsr
-
8
(%
e
sp
)
or
%
edi
,-
8
(%
e
sp
)
ldmxcsr
-
8
(%
e
sp
)
xor
%
eax
,%
eax
ret
...
...
@@ -35,15 +35,15 @@ __fesetround:
push
%
rax
xor
%
eax
,%
eax
mov
%
edi
,%
ecx
fnstcw
(%
r
sp
)
andb
$
0xf3
,
1
(%
r
sp
)
or
%
ch
,
1
(%
r
sp
)
fldcw
(%
r
sp
)
stmxcsr
(%
r
sp
)
fnstcw
(%
e
sp
)
andb
$
0xf3
,
1
(%
e
sp
)
or
%
ch
,
1
(%
e
sp
)
fldcw
(%
e
sp
)
stmxcsr
(%
e
sp
)
shl
$
3
,%
ch
andb
$
0x9f
,
1
(%
r
sp
)
or
%
ch
,
1
(%
r
sp
)
ldmxcsr
(%
r
sp
)
andb
$
0x9f
,
1
(%
e
sp
)
or
%
ch
,
1
(%
e
sp
)
ldmxcsr
(%
e
sp
)
pop
%
rcx
ret
...
...
@@ -51,7 +51,7 @@ __fesetround:
.
type
fegetround
,@
function
fegetround
:
push
%
rax
stmxcsr
(%
r
sp
)
stmxcsr
(%
e
sp
)
pop
%
rax
shr
$
3
,%
eax
and
$
0xc00
,%
eax
...
...
@@ -61,27 +61,27 @@ fegetround:
.
type
fegetenv
,@
function
fegetenv
:
xor
%
eax
,%
eax
fnstenv
(%
r
di
)
stmxcsr
28
(%
r
di
)
fnstenv
(%
e
di
)
stmxcsr
28
(%
e
di
)
ret
.
global
fesetenv
.
type
fesetenv
,@
function
fesetenv
:
xor
%
eax
,%
eax
inc
%
r
di
inc
%
e
di
jz
1
f
fldenv
-
1
(%
r
di
)
ldmxcsr
27
(%
r
di
)
fldenv
-
1
(%
e
di
)
ldmxcsr
27
(%
e
di
)
ret
1
:
push
%
rax
push
%
rax
pushq
$
0xffff
pushq
$
0x37f
fldenv
(%
r
sp
)
fldenv
(%
e
sp
)
pushq
$
0x1f80
ldmxcsr
(%
r
sp
)
add
$
40
,%
r
sp
ldmxcsr
(%
e
sp
)
add
$
40
,%
e
sp
ret
.
global
fetestexcept
...
...
@@ -89,7 +89,7 @@ fesetenv:
fetestexcept
:
and
$
0x3f
,%
edi
push
%
rax
stmxcsr
(%
r
sp
)
stmxcsr
(%
e
sp
)
pop
%
rsi
fnstsw
%
ax
or
%
esi
,%
eax
...
...
src/ldso/x32/start.s
浏览文件 @
664cd341
.
text
.
global
_start
_start
:
mov
(%
rsp
),%
rdi
lea
8
(%
rsp
),%
rsi
mov
(%
rsp
),%
rdi
/*
move
argc
into
1
st
argument
slot
*/
lea
4
(%
rsp
),%
rsi
/*
move
argv
into
2
nd
argument
slot
*/
call
__dynlink
pop
%
rdi
/
*
in
case
the
dynlinker
was
called
directly
,
it
sets
the
"consumed"
argv
values
to
-
1
.
so
we
must
loop
over
the
array
as
long
as
-
1
is
in
the
top
argv
slot
,
decrement
argc
,
and
then
set
the
stackpointer
to
the
new
argc
as
well
as
argc
's new value.
as
the
x32
abi
has
longs
in
the
argv
array
,
we
cannot
use
push
/
pop
.
*/
movl
(%
rsp
),%
edi
/*
copy
argc
into
edi
*/
xor
%
rdx
,%
rdx
/*
we
use
rdx
as
an
offset
to
the
current
argv
member
*/
1
:
dec
%
edi
pop
%
rsi
cmp
$
-
1
,%
rsi
addl
$
4
,
%
edx
movl
(%
rsp
,
%
rdx
),
%
esi
cmp
$
-
1
,%
esi
jz
1
b
inc
%
edi
push
%
rsi
push
%
rdi
subl
$
4
,
%
edx
lea
(%
rsp
,
%
rdx
),
%
rsp
/*
set
rsp
to
new
argv
[-
1
]
*/
movl
%
edi
,
(%
rsp
)
/*
write
new
argc
there
*/
xor
%
edx
,%
edx
jmp
*%
rax
src/math/x32/acosl.s
浏览文件 @
664cd341
...
...
@@ -3,7 +3,7 @@
.
global
acosl
.
type
acosl
,@
function
acosl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
1
:
fld
%
st
(
0
)
fld1
fsub
%
st
(
0
),%
st
(
1
)
...
...
src/math/x32/asinl.s
浏览文件 @
664cd341
.
global
asinl
.
type
asinl
,@
function
asinl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
1
:
fld
%
st
(
0
)
fld1
fsub
%
st
(
0
),%
st
(
1
)
...
...
src/math/x32/atan2l.s
浏览文件 @
664cd341
.
global
atan2l
.
type
atan2l
,@
function
atan2l
:
fldt
8
(%
r
sp
)
fldt
24
(%
r
sp
)
fldt
8
(%
e
sp
)
fldt
24
(%
e
sp
)
fpatan
ret
src/math/x32/atanl.s
浏览文件 @
664cd341
.
global
atanl
.
type
atanl
,@
function
atanl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
fld1
fpatan
ret
src/math/x32/exp2l.s
浏览文件 @
664cd341
.
global
expm1l
.
type
expm1l
,@
function
expm1l
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
fldl2e
fmulp
movl
$
0xc2820000
,-
4
(%
r
sp
)
flds
-
4
(%
r
sp
)
movl
$
0xc2820000
,-
4
(%
e
sp
)
flds
-
4
(%
e
sp
)
fucomp
%
st
(
1
)
fnstsw
%
ax
sahf
...
...
@@ -35,21 +35,21 @@ expm1l:
.
global
exp2l
.
type
exp2l
,@
function
exp2l
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
1
:
fld
%
st
(
0
)
sub
$
16
,%
r
sp
fstpt
(%
r
sp
)
mov
8
(%
r
sp
),%
ax
sub
$
16
,%
e
sp
fstpt
(%
e
sp
)
mov
8
(%
e
sp
),%
ax
and
$
0x7fff
,%
ax
cmp
$
0x3fff
+
13
,%
ax
jb
4
f
#
|x|
<
8192
cmp
$
0x3fff
+
15
,%
ax
jae
3
f
#
|x|
>=
32768
fsts
(%
r
sp
)
cmpl
$
0xc67ff800
,(%
r
sp
)
fsts
(%
e
sp
)
cmpl
$
0xc67ff800
,(%
e
sp
)
jb
2
f
#
x
>
-
16382
movl
$
0x5f000000
,(%
r
sp
)
flds
(%
r
sp
)
#
0x1p63
movl
$
0x5f000000
,(%
e
sp
)
flds
(%
e
sp
)
#
0x1p63
fld
%
st
(
1
)
fsub
%
st
(
1
)
faddp
...
...
@@ -57,10 +57,10 @@ exp2l:
fnstsw
sahf
je
2
f
#
x
-
0x1p63
+
0x1p63
==
x
movl
$
1
,(%
r
sp
)
flds
(%
r
sp
)
#
0x1p-149
movl
$
1
,(%
e
sp
)
flds
(%
e
sp
)
#
0x1p-149
fdiv
%
st
(
1
)
fstps
(%
r
sp
)
#
raise
underflow
fstps
(%
e
sp
)
#
raise
underflow
2
:
fld1
fld
%
st
(
1
)
frndint
...
...
@@ -70,21 +70,21 @@ exp2l:
faddp
#
2
^(
x
-
rint
(
x
))
1
:
fscale
fstp
%
st
(
1
)
add
$
16
,%
r
sp
add
$
16
,%
e
sp
ret
3
:
xor
%
eax
,%
eax
4
:
cmp
$
0x3fff
-
64
,%
ax
fld1
jb
1
b
#
|x|
<
0x1p-64
fstpt
(%
r
sp
)
fistl
8
(%
r
sp
)
fildl
8
(%
r
sp
)
fstpt
(%
e
sp
)
fistl
8
(%
e
sp
)
fildl
8
(%
e
sp
)
fsubrp
%
st
(
1
)
addl
$
0x3fff
,
8
(%
r
sp
)
addl
$
0x3fff
,
8
(%
e
sp
)
f2xm1
fld1
faddp
#
2
^(
x
-
rint
(
x
))
fldt
(%
r
sp
)
#
2
^
rint
(
x
)
fldt
(%
e
sp
)
#
2
^
rint
(
x
)
fmulp
add
$
16
,%
r
sp
add
$
16
,%
e
sp
ret
src/math/x32/expl.s
浏览文件 @
664cd341
...
...
@@ -6,11 +6,11 @@
.
global
expl
.
type
expl
,@
function
expl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
#
interesting
case
:
0x1p-32
<=
|x|
<
16384
#
check
if
(
exponent
|
0x8000
)
is
in
[
0xbfff
-
32
,
0xbfff
+
13
]
mov
16
(%
r
sp
),
%
ax
mov
16
(%
e
sp
),
%
ax
or
$
0x8000
,
%
ax
sub
$
0xbfdf
,
%
ax
cmp
$
45
,
%
ax
...
...
@@ -29,29 +29,29 @@ expl:
#
should
be
0x1
.71547652
b82fe178p0L
==
0x3fff
b8aa3b29
5
c17f0bc
#
it
will
be
wrong
on
non
-
nearest
rounding
mode
2
:
fldl2e
sub
q
$
48
,
%
r
sp
sub
$
48
,
%
e
sp
#
hi
=
log2e_hi
*
x
#
2
^
hi
=
exp2l
(
hi
)
fmul
%
st
(
1
),%
st
fld
%
st
(
0
)
fstpt
(%
r
sp
)
fstpt
16
(%
r
sp
)
fstpt
32
(%
r
sp
)
fstpt
(%
e
sp
)
fstpt
16
(%
e
sp
)
fstpt
32
(%
e
sp
)
call
exp2l
# if 2^hi == inf return 2^hi
fld
%
st
(
0
)
fstpt
(%
r
sp
)
cmpw
$
0x7fff
,
8
(%
r
sp
)
fstpt
(%
e
sp
)
cmpw
$
0x7fff
,
8
(%
e
sp
)
je
1
f
fldt
32
(%
r
sp
)
fldt
16
(%
r
sp
)
fldt
32
(%
e
sp
)
fldt
16
(%
e
sp
)
#
fpu
stack
:
2
^
hi
x
hi
#
exact
mult
:
x
*
log2e
fld
%
st
(
1
)
#
c
=
0x1p32
+
1
movq
$
0x41f0000000100000
,%
rax
pushq
%
rax
fldl
(%
r
sp
)
fldl
(%
e
sp
)
#
xh
=
x
-
c
*
x
+
c
*
x
#
xl
=
x
-
xh
fmulp
...
...
@@ -63,7 +63,7 @@ expl:
#
yh
=
log2e_hi
-
c
*
log2e_hi
+
c
*
log2e_hi
movq
$
0x3ff7154765200000
,%
rax
pushq
%
rax
fldl
(%
r
sp
)
fldl
(%
e
sp
)
#
fpu
stack
:
2
^
hi
x
hi
xh
xl
yh
#
lo
=
hi
-
xh
*
yh
+
xl
*
yh
fld
%
st
(
2
)
...
...
@@ -74,7 +74,7 @@ expl:
#
yl
=
log2e_hi
-
yh
movq
$
0x3de705fc2f000000
,%
rax
pushq
%
rax
fldl
(%
r
sp
)
fldl
(%
e
sp
)
#
fpu
stack
:
2
^
hi
x
lo
xh
xl
yl
#
lo
+=
xh
*
yl
+
xl
*
yl
fmul
%
st
,
%
st
(
2
)
...
...
@@ -87,8 +87,8 @@ expl:
pushq
%
rax
movq
$
0x82f0025f2dc582ee
,%
rax
pushq
%
rax
fldt
(%
r
sp
)
add
q
$
40
,%
r
sp
fldt
(%
e
sp
)
add
$
40
,%
e
sp
#
fpu
stack
:
2
^
hi
x
lo
log2e_lo
#
lo
+=
log2e_lo
*
x
#
return
2
^
hi
+
2
^
hi
(
2
^
lo
-
1
)
...
...
@@ -97,5 +97,5 @@ expl:
f2xm1
fmul
%
st
(
1
),
%
st
faddp
1
:
add
q
$
48
,
%
r
sp
1
:
add
$
48
,
%
e
sp
ret
src/math/x32/fabsl.s
浏览文件 @
664cd341
.
global
fabsl
.
type
fabsl
,@
function
fabsl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
fabs
ret
src/math/x32/floorl.s
浏览文件 @
664cd341
.
global
floorl
.
type
floorl
,@
function
floorl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
1
:
mov
$
0x7
,%
al
1
:
fstcw
8
(%
r
sp
)
mov
9
(%
r
sp
),%
ah
mov
%
al
,
9
(%
r
sp
)
fldcw
8
(%
r
sp
)
1
:
fstcw
8
(%
e
sp
)
mov
9
(%
e
sp
),%
ah
mov
%
al
,
9
(%
e
sp
)
fldcw
8
(%
e
sp
)
frndint
mov
%
ah
,
9
(%
r
sp
)
fldcw
8
(%
r
sp
)
mov
%
ah
,
9
(%
e
sp
)
fldcw
8
(%
e
sp
)
ret
.
global
ceill
.
type
ceill
,@
function
ceill
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
mov
$
0xb
,%
al
jmp
1
b
.
global
truncl
.
type
truncl
,@
function
truncl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
mov
$
0xf
,%
al
jmp
1
b
src/math/x32/fmodl.s
浏览文件 @
664cd341
.
global
fmodl
.
type
fmodl
,@
function
fmodl
:
fldt
24
(%
r
sp
)
fldt
8
(%
r
sp
)
fldt
24
(%
e
sp
)
fldt
8
(%
e
sp
)
1
:
fprem
fstsw
%
ax
sahf
...
...
src/math/x32/llrintl.s
浏览文件 @
664cd341
.
global
llrintl
.
type
llrintl
,@
function
llrintl
:
fldt
8
(%
r
sp
)
fistpll
8
(%
r
sp
)
mov
8
(%
r
sp
),%
rax
fldt
8
(%
e
sp
)
fistpll
8
(%
e
sp
)
mov
8
(%
e
sp
),%
rax
ret
src/math/x32/log10l.s
浏览文件 @
664cd341
...
...
@@ -2,6 +2,6 @@
.
type
log10l
,@
function
log10l
:
fldlg2
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
fyl2x
ret
src/math/x32/log1pl.s
浏览文件 @
664cd341
.
global
log1pl
.
type
log1pl
,@
function
log1pl
:
mov
14
(%
r
sp
),%
eax
mov
14
(%
e
sp
),%
eax
fldln2
and
$
0x7fffffff
,%
eax
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
cmp
$
0x3ffd9400
,%
eax
ja
1
f
fyl2xp1
...
...
src/math/x32/log2l.s
浏览文件 @
664cd341
...
...
@@ -2,6 +2,6 @@
.
type
log2l
,@
function
log2l
:
fld1
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
fyl2x
ret
src/math/x32/logl.s
浏览文件 @
664cd341
...
...
@@ -2,6 +2,6 @@
.
type
logl
,@
function
logl
:
fldln2
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
fyl2x
ret
src/math/x32/lrintl.s
浏览文件 @
664cd341
.
global
lrintl
.
type
lrintl
,@
function
lrintl
:
fldt
8
(%
r
sp
)
fistpll
8
(%
r
sp
)
mov
8
(%
r
sp
),%
rax
fldt
8
(%
e
sp
)
fistpll
8
(%
e
sp
)
mov
8
(%
e
sp
),%
rax
ret
src/math/x32/remainderl.s
浏览文件 @
664cd341
.
global
remainderl
.
type
remainderl
,@
function
remainderl
:
fldt
24
(%
r
sp
)
fldt
8
(%
r
sp
)
fldt
24
(%
e
sp
)
fldt
8
(%
e
sp
)
1
:
fprem1
fstsw
%
ax
sahf
...
...
src/math/x32/rintl.s
浏览文件 @
664cd341
.
global
rintl
.
type
rintl
,@
function
rintl
:
fldt
8
(%
r
sp
)
fldt
8
(%
e
sp
)
frndint
ret
src/math/x32/sqrtl.s
浏览文件 @
664cd341
.
global
sqrtl
.
type
sqrtl
,@
function
sqrtl
:
fldt
8
(%
r
sp
)
sqrtl
:
fldt
8
(%
e
sp
)
fsqrt
ret
src/process/x32/vfork.s
浏览文件 @
664cd341
...
...
@@ -5,7 +5,7 @@
__vfork
:
vfork
:
pop
%
rdx
mov
$
58
,%
eax
mov
$
0x4000003a
,%
eax
/*
SYS_vfork
*/
syscall
push
%
rdx
mov
%
rax
,%
rdi
...
...
src/signal/x32/restore.s
浏览文件 @
664cd341
...
...
@@ -4,5 +4,5 @@
.
type
__restore
,@
function
__restore_rt
:
__restore
:
movl
$
15
,
%
eax
movl
$
0x40000201
,
%
eax
/*
SYS_rt_sigreturn
*/
syscall
src/thread/x32/__set_thread_area.s
浏览文件 @
664cd341
...
...
@@ -5,6 +5,6 @@
__set_thread_area
:
mov
%
rdi
,%
rsi
/*
shift
for
syscall
*/
movl
$
0x1002
,%
edi
/*
SET_FS
register
*/
movl
$
158
,%
eax
/*
set
fs
segment
to
*/
movl
$
0x4000009e
,%
eax
/*
set
fs
segment
to
*/
syscall
/*
arch_prctl
(
SET_FS
,
arg
)*/
ret
src/thread/x32/__unmapself.s
浏览文件 @
664cd341
...
...
@@ -3,8 +3,8 @@
.
global
__unmapself
.
type
__unmapself
,@
function
__unmapself
:
movl
$
11
,%
eax
/*
SYS_munmap
*/
movl
$
0x4000000b
,%
eax
/*
SYS_munmap
*/
syscall
/*
munmap
(
arg2
,
arg3
)
*/
xor
%
rdi
,%
rdi
/*
exit
()
args
:
always
return
success
*/
movl
$
60
,%
eax
/*
SYS_exit
*/
movl
$
0x4000003c
,%
eax
/*
SYS_exit
*/
syscall
/*
exit
(
0
)
*/
src/thread/x32/clone.s
浏览文件 @
664cd341
...
...
@@ -2,8 +2,7 @@
.
global
__clone
.
type
__clone
,@
function
__clone
:
xor
%
eax
,%
eax
mov
$
56
,%
al
movl
$
0x40000038
,%
eax
/*
SYS_clone
*/
mov
%
rdi
,%
r11
mov
%
rdx
,%
rdi
mov
%
r8
,%
rdx
...
...
@@ -20,8 +19,7 @@ __clone:
pop
%
rdi
call
*%
r9
mov
%
eax
,%
edi
xor
%
eax
,%
eax
mov
$
60
,%
al
movl
$
0x4000003c
,%
eax
/*
SYS_exit
*/
syscall
hlt
1
:
ret
src/thread/x32/syscall_cp.s
浏览文件 @
664cd341
.
text
.
global
__syscall_cp_
asm
.
type
__syscall_cp_
asm
,@
function
__syscall_cp_
asm
:
.
global
__syscall_cp_
internal
.
type
__syscall_cp_
internal
,@
function
__syscall_cp_
internal
:
.
global
__cp_begin
__cp_begin
:
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
760f5d7e
·
3月 11, 2023
mentioned in commit
760f5d7e
mentioned in commit 760f5d7efed4d4761875334f8c4e6398be308cc9
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录